Chiosa
AI & Agents

CanonQ trains language models to use one shared low-bit codec

Few Bits, One Law: Toward W2A4KV2 · arXiv:2610.09202

3 min
Updated
Schematic overview of CanonQ. Fixed source-specific transforms and normalization map tensor blocks to canonical coordinates. Frozen Gaussian-reference codebooks are reused across layers and models…
Schematic overview of CanonQ. Fixed source-specific transforms and normalization map tensor blocks to canonical coordinates. Frozen Gaussian-reference codebooks are reused across layers and models for matching (b,d). Joint QAT adapts the model to coupled quantization errors at…Figure 1 · Few Bits, One Law: Toward W2A4KV2 · Kai Yi et al. · CC BY 4.0

In plain words

Language models store numbers for their weights, working activations, and attention cache. Compressing all three to very few bits is difficult because their numbers differ and compression errors can interact.

CanonQ transforms these values into shared coordinates, uses fixed sets of representative values, and trains the model while compression is active. In one LLaMA3-1B test with 2-bit weights, 4-bit activations, and a 2-bit cache, it had higher average accuracy than ParetoQ across eight question-answering and related tests. That result applies to the tested configurations.

The research

When a model compresses its weights, working activations, and attention cache at once, errors in one part can affect the others. It remains unclear whether one reusable quantization design can support all three while the model learns to operate through their combined errors.

CanonQ transforms model tensors into canonical coordinates, then trains the model through fixed quantizers to adapt to their interacting errors.

For LLaMA3-1B at 2-bit weights, 4-bit activations, and a 2-bit KV cache, the authors compared trained CanonQ and ParetoQ configurations using different quantization paths. On WikiText-2, a text corpus scored by next-token prediction error, perplexity was 15.42 for CanonQ and 90.57 for ParetoQ.

Across eight zero-shot question-answering and related tests, mean accuracy, the share of correct answers without examples in the prompt, was 53.56% for CanonQ and 40.47% for ParetoQ. Both measures favor CanonQ in this tested comparison.

The headline comparison is between complete trained configurations, so it does not isolate the quantization method as the only difference. Each configuration uses one training seed, and the findings cover the models and settings tested in the paper.

What the evidence shows

  • A shared compression interface

    CanonQ is a quantization-aware training framework for compressing language-model weights, activations, and key/value (KV) cache states. The challenge is that these sources have different value distributions, and errors can interact when they are compressed together.

    CanonQ uses fixed transformations and a shared quantization interface, then trains the model through the enabled compression steps.

  • Checking the reference fit

    The authors checked whether rotation moved activations closer to the Gaussian reference used to design the codebooks. With groups and energy normalization held constant, the mean layer-by-layer scalar W1 distance fell from 0.101 without rotation to 0.010 with rotation.

    This diagnostic measures scalar alignment before codeword assignment; it does not establish alignment of full groups or improved model quality.

  • Adaptation changes the result

    A zero-update comparison tested whether the model needed to adapt to the fixed canonical weight-and-activation codec. On LLaMA3-1B with 2-bit weights and 4-bit activations, training reduced WikiText-2 perplexity from 7043.43 to 13.84.

    Perplexity summarizes next-token prediction error, so the result indicates much better prediction on this text corpus after training with that codec.

  • Joint compression results

    For LLaMA3-1B with 2-bit weights, 4-bit activations, and a 2-bit cache, CanonQ-Omni-d1 had lower WikiText-2 perplexity than ParetoQ: 15.42 versus 90.57. Across eight zero-shot tests of question answering and related tasks, where accuracy is the share of correct answers without examples in the prompt, mean accuracy was 53.56% versus 40.47%. These are results for complete trained configurations.

  • The cache path also matters

    A cache-path comparison kept the canonical weight and activation paths fixed and changed the complete KV-cache path. At the same compression setting, the canonical path had lower WikiText-2 perplexity and higher mean accuracy across eight zero-shot tests than the uniform path.

    Since the change covered the full cache path, the comparison does not identify which of its components explains the difference.

  • Code generation, reasoning, and theory

    On GSM8K, a grade-school math test scored by final-answer correctness, CanonQ-d1 answered 630 of 1,319 problems correctly (47.8%), compared with 453 (34.3%) for ParetoQ. On two code-generation tests, it scored 32.2% on MBPP and 62.2% on HumanEval, versus 28.0% and 43.9% for ParetoQ.

    These coding scores are greedy pass@1, the share of tasks solved by one generated solution. GSM8K guided learning-rate selection; the coding tests did not.

    Separately, the paper derives bounds linking source mismatch and quantization distortion to transfer error, local loss, and gradient bias, under assumptions that do not directly match the experiments’ AdamW training.

Deep

Next paperOne robot model learns to predict scenes and control varied robots