Open source 2-bit compression for local LLMs

We compressed LLMs by 85%. Same size as llama.cpp's 2-bit, much smarter.

Pingala-8 stores Qwen3-4B in 1.24 GB instead of 8.05 GB. That is the same file size as llama.cpp's smallest common 2-bit format, IQ2_XXS, and it scores 21% higher on five standard quizzes. No retraining: it compresses the model you already have. Code, logs and a one-click Windows build are open.

Real time, not sped up. Text and timing come from a real run of Pingala-8 Qwen3-4B (1.24 GB) on an RTX 5070 Ti Laptop GPU; the chat window is recreated.

Results

Smaller, smarter at the same size, fast at writing

Qwen3-4B unless noted. Measured on one GPU (RTX 5070 Ti Laptop). Every number is in the paper and the logs in the repository.

85%
smaller than the original

Qwen3-4B goes from 8.05 GB (fp16) to 1.24 GB, 6.5x less. Llama-3.1-8B goes from 16.08 GB to 2.39 GB.

+21%
quiz score vs llama.cpp's 2-bit at the same size

Average of five tasks: 50.8 against 41.9 for IQ2_XXS. That keeps 90% of the 8-bit model's 56.3.

39%
faster than Q4_K_M at half its size

About 216 tokens per second when writing a reply (batch 1), 1.10x IQ2_XXS. Reading long prompts is slower: 0.74x.

Quality at equal size

Same bytes, lower perplexity

Perplexity measures how well a model predicts real text; lower is better. On WikiText-2 the original Qwen3-4B scores 12.46. At the IQ2_XXS file size, Pingala-8 scores 16.64, against 28.61 for IQ2_XXS (42% lower) and 18.15 for the strongest IQ2_KT file of this size we built.

Two scatter plots of WikiText-2 perplexity against file size. Qwen3-4B near 1.24 GB: Pingala-8 B4 16.64, several IQ2_KT files (best 18.15), IQ2_XXS 28.61, fp16 12.46. Llama-3.1-8B near 2.39 GB: Pingala-8 B4 9.14, IQ2_KT 10.04, IQ2_XXS 12.35.
Swipe the chart sideways to see both panels.
WikiText-2 perplexity against file size, context 4096 (B4 is the released Pingala-8 file). (a) Qwen3-4B, 73 windows; this B4 file is the last of a chain of builds, so treat it as tuned (post hoc). (b) Llama-3.1-8B base, 70 strided windows, prediction written down before the run: 9.14 against 10.04 for IQ2_KT and 12.35 for IQ2_XXS. With a start token at every window the Llama result is 8.44 against 9.36 for IQ2_KT.

Quiz scores, Qwen3-4B

Zero-shot accuracy (%). All three 2-bit files are about 1.24 GB. The original is the 8-bit Q8_0 file.

TaskOriginal (8-bit)IQ2_XXSIQ2_KTPingala-8vs IQ2_XXS
ARC-Easy66.143.953.360.9+39%
ARC-Challenge45.229.135.137.8+30%
HellaSwag65.847.853.357.7+21%
WinoGrande65.557.557.963.8+11%
MMLU38.731.132.934.0+9%
Average56.341.946.550.8+21%
How it compares

Where Pingala-8 wins, and where others do

Qwen3-4B, WikiText-2 perplexity at context 4096, the same test for every file. Lower is better.

FormatSizePerplexityOur honest note
Pingala-8 (B4)Genrius AI 1.24 GB 16.64 Compresses the original model, no retraining. Needs our patched llama.cpp and an NVIDIA GPU (CUDA).
IQ2_XXSllama.cpp 1.25 GB 28.61 Same size. Runs in stock llama.cpp, Ollama and LM Studio, on CPU and Mac too. Reads prompts faster (we run at 0.74x). We score 21% higher on the quizzes and write 1.10x as fast.
IQ2_KTik_llama.cpp 1.25 GB 18.15 Same size, and the strongest same-size rival we built. Reads prompts about 1.3x faster than ours. It beats us on Qwen3-14B (9.40 against our 9.57).
Q4_K_Mllama.cpp about 2x ours not compared A bigger 4-bit file; pick it if memory is not your limit. We compared speed only: at batch 1 we write 39% faster at half its size.
GSQ Q2_KISTA-DASLab 1.67 GB 14.37 Better perplexity than ours, with a file 34% bigger.
Ternary Bonsai 4Bprism-ml 1.07 GB 11.59 Better and smaller. It is a retrained model, not a compression of Qwen3-4B (it even beats the original), and needs a training run and their fork.
Qwen3-4B fp16original 8.05 GB 12.46 The uncompressed model, for reference.

Our reading: among the formats we tested, Pingala-8 gives the lowest perplexity for compressing the original Qwen3-4B to about 1.24 GB without retraining. If you only want a strong small model in this class, a retrained model like Ternary Bonsai is the better choice. Pingala-8 is for compressing models nobody has retrained for you. On Llama-3.1-8B (2.39 GB) it also beats both same-size formats: 8.44 against 9.36 for IQ2_KT.

Try it

Try it in 3 steps

Windows or Linux with an NVIDIA RTX GPU (30, 40 or 50 series) and a recent driver. No Python, no build.

  1. Download

    Get pingala8-windows-cuda12.zip (1.6 GB) from the v2.4-oneclick release.

    Linux: pingala8-linux-cuda13.tar.gz on the same page.

  2. Unzip and double-click

    Run run_qwen3_4b.bat (or run_llama31_8b.bat). The model downloads once from Hugging Face.

    Linux: ./run.sh qwen or ./run.sh llama.

  3. Chat

    On Windows a chat page opens in your browser at http://127.0.0.1:8080 (on Linux, open that address yourself). Everything runs on your machine.

    Close the black window to stop.

Will it fit your GPU? Normal vs Pingala-8 calculator

Building from source, running the paper's perplexity test, or using the CPU patch: see the quick start in the README. Models: Qwen3-4B and Llama-3.1-8B.

How it works

A trellis code over groups of 4 weights

Most 2-bit formats round each small group of weights on its own. Pingala-8 codes the groups in sequence with Ungerboeck's 8-state trellis code: a small state carries over from one group of 4 weights to the next and decides which set of values the next group may use, so the same bits land closer to the true weights.

Before coding, a random Hadamard rotation spreads out the few very large weights, and LDLQ rounding passes each column's error on to the columns not yet coded. These ideas come from QuIP, QuIP# and QTIP, and the format sits next to ikawrakow's IQ2_KT. A CUDA patch to llama.cpp (commit 7ac59a6) reads the file.

Read the full article for the plain-language and technical story.

Why the name

Pingala's Chandahsutra, an ancient Sanskrit work on poetic metre, lists the 8 patterns of three long or short syllables, the ganas. Our code has 8 states over short patterns, so we named it after him. The name is credit; the trellis labels are Ungerboeck's.

Limitations

What we lose

Please read this before you choose Pingala-8.

  • It loses on Qwen3-14B.We predicted a win before the run and did not get one: 9.57 against 9.40 for IQ2_KT on WikiText-2, a tie on C4.
  • Prompts are slower.Reading a prompt runs at 0.74x IQ2_XXS. Long documents take longer before the first word.
  • Batched decoding is slower.Serving 2 to 8 chats at once runs at 0.18x to 0.34x IQ2_XXS. It suits one person on one GPU, not a server.
  • Needs our runtime.Patched llama.cpp with CUDA only. Stock llama.cpp, Ollama and LM Studio cannot load it yet. No Metal or Vulkan; CPU generation is 0.56x to 0.62x IQ2_XXS.
  • The Qwen3-4B number is tuned.That file is the last of many builds tested on WikiText-2. C4 was held out; the Llama-3.1-8B and Qwen3-14B runs were pre-registered.
  • One GPU, no safety evaluation.Speed was measured on one RTX 5070 Ti Laptop. We have not evaluated the safety behaviour of the compressed models.
Paper

Read and cite the paper

Small-State Coset Trellis Coding at IQ2_XXS Size: An Equal-Bytes Study in llama.cpp

Harshit Goyal, Genrius AI. Preprint, version 2.4, October 2026. DOI: 10.5281/zenodo.23481757

@misc{goyal2026pingala8,
  title     = {Small-State Coset Trellis Coding at {IQ2\_XXS} Size:
               An Equal-Bytes Study in {llama.cpp}},
  author    = {Goyal, Harshit},
  year      = {2026},
  month     = oct,
  publisher = {Zenodo},
  doi       = {10.5281/zenodo.23481757},
  url       = {https://doi.org/10.5281/zenodo.23481757},
  note      = {Preprint, version 2.4.
               Code: https://github.com/Genrius-AI/pingala8-llm}
}