ThinkBit: Search Codewords, Recalibrate Scales, Select by Reasoning
Organizations: Microsoft Applied Sciences Group
Abstract
Reasoning language models generate thousands of tokens per answer, and generation speed is limited by memory bandwidth, so storing weights in two bits instead of bfloat16 can potentially make inference 8 cheaper. Two-bit methods are usually judged by perplexity and multiple-choice question-answering accuracy, both of which say little about whether a model can still reason through more difficult problems. We present ThinkBit, a strictly scalar two-bit framework built to preserve reasoning, in which every weight is an integer codeword times a bfloat16 scale shared by a group of weights. We first use a sensitivity metric to assign each layer a ternary, 2-bit, or 3-bit tier to allocate bitwidths optimally among layers. This is followed by a layerwise Gumbel-softmax-based scalar quantization algorithm that searches for optimal codewords block by block. Since a layerwise scheme does not capture how quantized layers interact with each other, we recalibrate scales, with the codewords frozen, using a knowledge-distillation-based loss against the teacher model. We then perform a short quantization-aware training (QAT) stage that lets the model mimic the base model's distribution by reassigning codewords. Finally, a paired reasoning test on training problems selects the final checkpoint between the recalibration stage and the QAT stage. On Qwen3-1.7B at matched size, our recalibrated checkpoint scores 46.7 on MATH-500 against 30.0 for EfficientQAT trained on the same data, and 73.0 after QAT on reasoning traces; at 0.52 GB it is smaller than every published 2-bit GGUF of the model yet more accurate on MATH-500. We show that this framework scales and up to 14B, a 3.74 GB model scores 94.8 on MATH-500, against 97.5 for the 29.5 GB bfloat16 model.
Figures & tables
| Gumbel-softmax ( eqs. 11 and 12 ) | ReinMax ( eq. 13 ) | |
|---|---|---|
| Forward weight | soft blend of grid values, | hard grid value, |
| Gradient | exact gradient of the soft weight | second-order estimate for the hard weight |
| Temperature | annealed toward 0 | kept |
| Train–test gap | vanishes only as becomes one-hot | none: training uses grid weights |
| Used for | ternary and 3-bit layers | 2-bit layers |
| Name | Checkpoint |
|---|---|
| GSQ | Stages 1–2: tiers allocated and codewords searched; no training |
| Rec | GSQ + Stage 3: scales and RMSNorm gains recalibrated, codewords frozen |
| QAT | Rec + Stage 4: QAT reassigns codewords (the full framework) |
| QAT-noRec | GSQ + Stage 4, without recalibration |
| LW-Rec , LW-QAT | as Rec and QAT , but starting from the layer-wise PTQ solution instead of codeword search |
| QAT-only | layer-wise start + Stage 4 only: no codeword search, no recalibration |
| Stage | Data | Amount |
|---|---|---|
| 1: KronQ sensitivity | subset of the Stage-2 calibration data | 2M tokens |
| 2: Codeword search (GSQ) | own replies, tool conversations, code and FineWeb-Edu | 57M tokens |
| 3: Scale recalibration | all sources (i)–(iii) presented in Section 3 | 268M tokens |
| 4: QAT | all sources (i)–(iii) presented in Section 3 | 537M tokens |
| 4 ∗ : QAT, reasoning data ( +R ) | (i)–(iii) plus complete long reasoning traces ( section 3 ) | 1.1–2.1B tokens |
| 5: Checkpoint selection | level-3–5 MATH training problems, disjoint from MATH-500 | 313 problems |
| Qwen3-1.7B | WikiText-2 | 7-task | MMLU | GSM8K | HumanEval | MATH-500 |
|---|---|---|---|---|---|---|
| bf16 | 16.67 | 58.9 | 55.5 | 68.6 | 41.5 | 91.2 |
| Stage 2: GSQ-hbf16 | 46.91 | 43.8 | 36.4 | 27.5 | 8.5 | 14.8 |
| Stage 3: Rec-hbf16 | 19.46 | 51.5 | 44.4 | 51.6 | 22.6 | 47.5 |
| Stage 4: QAT-hbf16 | 16.54 | 54.6 | 49.9 | 50.2 | 17.7 | 43.0 |
| Model | Checkpoint | Strict acc. | Closed (%) | Acc. on closed |
|---|---|---|---|---|
| Qwen3-1.7B | bf16 | 91.2 | 99.2 | 91.9 |
| Rec-hbf16 | 47.5 | 88.0 | 53.9 | |
| QAT-hbf16 | 43.0 | 69.6 | 61.7 | |
| QAT-noRec-hbf16 | 37.0 | 57.2 | 64.5 | |
| LW-QAT-hbf16 | 35.0 | 68.2 | 51.3 | |
| QAT-only-hbf16 | 32.1 | 55.4 | 58.0 |
| Model | Checkpoint | GB | bits/param | 7-task | MMLU | GSM8K | HumanEval | MATH-500 | AIME@16 |
|---|---|---|---|---|---|---|---|---|---|
| Qwen3-1.7B | bf16 | 3.44 | 16 | 58.9 | 55.5 | 68.6 | 41.5 | 91.2 | 41.4 |
| 2.6 bits per parameter | |||||||||
| QAT+R-h2 (selected) § | 0.52 | 2.42 | 53.8 | 47.0 | 58.7 | 25.6 | 73.0 | 12.3 | |
| Rec+R-h2 § | 0.52 | 2.42 | 50.6 | 43.5 | 51.7 | 22.0 | 55.6 | 3.0 | |
| Rec-h2 | 0.52 | 2.42 | 51.1 | 45.2 | 51.8 | 22.6 | 46.7 | 1.0 | |
| 1-bit Bonsai | 0.25 | 1.15 | 49.7 | 41.7 | 43.9 | 37.2 | 28.7 | 0.7 | |
| MATH-500 (think) | |||||||||
| Qwen3-1.7B | GB | bits/param | 7-task | MMLU | GSM8K | HumanEval | BFCL NL | greedy | sampled |
| bf16 | 3.44 | 16 | 58.9 | 55.5 | 68.6 | 41.5 | 81.7 | 90.2 | 91.2 |
| 2.6 bits per parameter | |||||||||
| PrismML 1-bit Bonsai ∘ | 0.25 | 1.15 | 49.7 | 41.7 | 43.9 | 37.2 | 74.3 | 25.4 | 28.7 |
| PrismML Ternary Bonsai ∘ | 0.46 | 2.15 | 55.0 | 48.6 | 60.0 | 48.2 | 74.7 | 42.8 | 46.4 |
| Ours: QAT+R-h2 (selected) § | 0.52 | 2.42 | 53.8 | 47.0 | 58.7 | 25.6 | 73.0 | 68.6 | 73.0 |
| MATH-500 (thinking) | |||||||
| Qwen3-1.7B variant | WikiText-2 | 7-task | MMLU | GSM8K | HumanEval | greedy | sampled |
| bf16 | 16.67 | 58.9 | 55.5 | 68.6 | 41.5 | 90.2 | 91.2 |
| GSQ-hbf16 | 46.91 | 43.8 | 36.4 | 27.5 | 8.5 | 15.0 | 14.8 |
| Scale recalibration (codewords frozen) | |||||||
| RMSNorm gains only | 25.29 | 48.0 | 38.2 | 38.8 | 16.5 | 27.8 | 34.0 |
| scales only | 19.49 | 51.4 | 44.1 | 51.3 | 23.2 | 39.2 | 48.5 |
| Model | Contrast (A vs. B) | A | B | [95% CI] | status | |
| Qwen3-1.7B | codeword search ( QAT vs. LW-QAT ) | 43.0 | 35.0 | +8.0 [5.6, 10.2] | abl | |
| vs. tuned GPTQ start (all tiers, clipped scales) | 43.0 | 32.6 | +10.3 [8.0, 12.8] | check | ||
| vs. GPTQ start + Hessian-weighted rounding | 43.0 | 37.8 | +5.2 [3.1, 7.5] | check | ||
| recalibration before QAT ( QAT vs. QAT-noRec ) | 43.0 | 37.0 | +6.0 [3.6, 8.3] | abl | ||
| recalibration on layer-wise-start codewords ( LW-QAT vs. QAT-only ) | 35.0 | 32.1 | +2.85 [0.85, 4.90] | 0.009 | abl | |
| both ( QAT vs. QAT-only ) | 43.0 | 32.1 | +10.8 [8.5, 13.0] | abl |
Appendix figures & tables23 assets
Supplementary material from the paper’s appendix.
Appendix
| Symbol | Meaning |
|---|---|
| Algorithm 2 | |
| , , , | model; calibration and training sequences; selection problems |
| , | number of transformer blocks; calibration activations entering the current block |
| Format ( section 2.1 ) | |
| , , | bf16 and quantized weight of linear layer ( ); number of weights |
| , | group size (128); group of input column |
| Suite | Tasks | Shots / format | Decoding |
|---|---|---|---|
| 7-task core | ARC-e/c, WinoGrande, HellaSwag, PIQA, LAMBADA, MMLU | lm-eval defaults (0-shot), log-likelihood | – |
| Generative | GSM8K (strict match) | 5-shot, no chat template | greedy |
| HumanEval | 0-shot, pass@1 | greedy | |
| Tool use | BFCL v4: non-live (syntax-tree match), live, multi-turn, irrelevance | official harness, native tool format | greedy, vLLM server |
| Broad suite | MMLU-Pro, TriviaQA, TruthfulQA, SciQ, OpenBookQA, CommonsenseQA, BoolQ, RACE, ARC-C, BBH-CoT, MATH-500, GSM8K-CoT, IFEval, MBPP, HumanEval+ | task defaults; ARC-C 25-shot; BBH 3-shot CoT; GSM8K-CoT 8-shot | greedy |
| Thinking mode | AIME24, AIME25 (30 problems each), MATH-500 | chat template, thinking on, 0-shot | greedy, 1 sample; and sampled (temperature 0.6, top- 0.95, top- 20, 4 samples, strict scoring); 32k new tokens |
| Qwen3-1.7B | ARC-e | ARC-c | Wino | HSwag | PIQA | LAMB | MMLU | Mean |
|---|---|---|---|---|---|---|---|---|
| bf16 | 69.7 | 43.0 | 60.9 | 60.4 | 72.2 | 50.5 | 55.5 | 58.9 |
| GSQ-hbf16 | 51.4 | 29.9 | 54.3 | 41.5 | 64.9 | 28.4 | 36.4 | 43.8 |
| Rec-hbf16 | 62.4 | 36.6 | 57.1 | 49.2 | 68.2 | 42.7 | 44.4 | 51.5 |
| QAT-hbf16 | 66.4 | 38.2 | 59.2 | 52.6 | 69.0 | 47.1 | 49.9 | 54.6 |
| QAT-h2 | 65.1 | 37.5 | 61.0 | 51.4 | 69.2 | 45.5 | 48.0 | 54.0 |
| QAT+R-h2 (selected) | 66.3 | 38.6 | 58.3 | 51.2 | 70.4 | 44.7 | 47.0 | 53.8 |
| Qwen3-1.7B | query/key at 2 bits ( ThinkBit ) | not forced |
|---|---|---|
| ternary query / key projections (of 28) | 0 / 0 | 15 / 3 |
| KronQ objective (relative) | 1.000 | 0.997 |
| WikiText-2 after codeword search | 46.91 | 46.35 |
| held-out KL after recalibration | 0.282 | 0.279 |
| WikiText-2 after recalibration | 19.46 | 19.56 |
| sampled MATH-500 after recalibration | 47.5 | 49.3 |
| WikiText-2 | held-out | MATH-500 | after QAT | ||||||
|---|---|---|---|---|---|---|---|---|---|
| Qwen3-1.7B start | before rec. | after rec. | KL | after rec. | after QAT | 7-task | GSM8K | HumanEval | BFCL NL |
| GSQ (framework) | 46.91 | 19.46 | 0.282 | 47.5 | 43.0 | 54.6 | 50.2 | 17.7 | 75.5 |
| GPTQ, all tiers, clipped scales | 1,379 | 22.02 | 0.402 | 18.5 | 32.6 | 53.8 | 49.4 | 17.7 | 70.0 |
| GPTQ + Hessian-weighted rounding | 10,352 | 21.06 | 0.367 | 24.1 | 37.8 | 53.8 | 51.9 | 17.7 | 71.9 |
| sampled MATH-500 | selector | ||||||
| Model | Contrast (A vs. B) | A | B | [95% CI] | [95% CI] | ||
| Qwen3-1.7B | Rec-h2 : two recalibration passes vs. one | 46.7 | 44.4 | +2.3 [0.3, 4.2] | 0.027 | +0.6 | 0.71 |
| Rec-h2 (1 pass) vs. QAT-h2 | 44.4 | 42.0 | – | – | +5.1 [2.4, 8.0] | ||
| Rec-hbf16 : two passes vs. one pass | 46.6 | 47.5 | 0.9 | 0.38 | 2.3 | 0.052 | |
| two passes: Rec-h2 vs. Rec-hbf16 | 46.7 | 46.6 | +0.1 | 0.96 | – | – | |
| QAT-h2 vs. QAT-noRec-h2 | 42.0 | 38.2 | +3.8 [1.7, 6.0] | +3.2 [1.0, 5.6] | 0.009 | ||
| QAT vs. | 7-task [90% CI] | equiv. | MMLU [90% CI] | equiv. |
|---|---|---|---|---|
| LW-QAT : layer-wise start instead of GSQ | +0.91 [0.37, 1.44] | yes | +1.22 [0.61, 1.84] | no |
| without the scale recalibration | +0.18 [-0.29, 0.63] | yes | +1.03 [0.47, 1.59] | no |
| QAT-only (neither) | -0.15 [-0.64, 0.34] | yes | -0.02 [-0.69, 0.65] | yes |
| uniform 2-bit, GPTQ, recalibration | +0.20 [-0.35, 0.73] | yes | +0.72 [0.08, 1.39] | yes |
| tuned GPTQ start | +0.79 [0.32, 1.28] | yes | +2.07 [1.47, 2.68] | no |
| GPTQ + Hessian-weighted rounding | +0.80 [0.31, 1.32] | yes | +1.62 [0.98, 2.29] | no |
| Model | Contrast (A vs. B) | A | B | [95% CI] | status | |
| Qwen3-1.7B | QAT-h2 vs. Rec-h2 (0.52 GB) | 42.0 | 46.7 | 4.7 [ 7.1, 2.2] | post hoc | |
| Rec-h2 vs. GGUF Q2_K [ 62 ] (0.78 GB) | 46.7 | 41.9 | +4.8 [2.0, 7.7] | 0.001 | post hoc | |
| Rec-h2 vs. Rec-hbf16 (0.52 vs. 0.98 GB) | 46.7 | 47.5 | 0.8 [ 2.7, 1.0] | 0.44 | post hoc | |
| Qwen3-14B | Rec-hbf16 (6.4 GB) vs. QAT-h2 (3.74 GB) | 92.8 | 90.5 | +2.3 [0.9, 3.7] | 0.002 | post hoc |
| QAT-h2 vs. Rec-h2 (3.74 GB) | 90.5 | 92.7 | 2.2 [ 3.8, 0.6] | 0.011 | post hoc | |
| codeword search at the recalibrated checkpoint ( Rec-hbf16 vs. LW-Rec-hbf16 ; exploratory) | 92.8 | 89.7 | +3.2 [1.8, 4.7] | post hoc |
| Model | A vs. B | A | B | kept | |
|---|---|---|---|---|---|
| Qwen3-1.7B | QAT-hbf16 vs. Rec-hbf16 | 22.5 | 28.8 | Rec-hbf16 | |
| Qwen3-1.7B | QAT-h2 vs. Rec-h2 | 21.9 | 27.6 | Rec-h2 | |
| Qwen3-1.7B | Rec-hbf16 vs. Rec-h2 | 28.8 | 27.6 | 0.37 | Rec-h2 |
| Qwen3-14B | QAT-h2 vs. Rec-hbf16 | 83.3 | 87.9 | Rec-hbf16 | |
| Qwen3-14B | QAT-h2 vs. Rec-h2 | 83.3 | 87.5 | Rec-h2 | |
| Qwen3-14B | Rec-hbf16 vs. Rec-h2 | 87.9 | 87.5 | 0.73 | Rec-h2 |
| Qwen3-1.7B, codewords frozen | Held-out KL | WikiText-2 |
|---|---|---|
| GSQ-hbf16 | 0.641 | 46.91 |
| + RMSNorm gains only | 0.418 | 25.29 |
| + scales only | 0.282 | 19.49 |
| + scales and RMSNorm gains ( Rec-hbf16 ) | 0.282 | 19.46 |
| median | same sign | relative weight error | ||||
|---|---|---|---|---|---|---|
| Tier | as (%) | corr. | GSQ | recalibrated | least-squares | |
| ternary | 0.064 | 51.6 | 0.08 | 0.425 | 0.431 | 0.325 |
| 2-bit | 0.054 | 49.8 | 0.00 | 0.198 | 0.207 | 0.192 |
| 3-bit | 0.058 | 50.8 | 0.05 | 0.287 | 0.296 | 0.109 |
| all | 0.062 | 51.4 | 0.07 | 0.386 | 0.393 | 0.277 |
| Qwen3-1.7B | local block error | propagated error | next-token KL |
|---|---|---|---|
| GSQ-hbf16 | 0.079 | 0.214 | 1.300 |
| Rec-hbf16 | 0.094 | 0.282 | 0.571 |
| QAT-hbf16 | 0.122 | 0.373 | 0.371 |
| Thinking budget (tokens) | 1k | 2k | 4k | 8k | 16k | 32k, unforced |
|---|---|---|---|---|---|---|
| bf16 | 74.2 | 77.0 | 82.4 | 86.0 | 90.0 | 90.2 |
| Rec-hbf16 | 40.4 | 43.2 | 44.4 | 44.6 | 45.2 | 40.6 |
| QAT-hbf16 | 42.2 | 43.6 | 44.4 | 43.4 | 39.2 | 39.0 |
| QAT-only-hbf16 | 33.6 | 34.6 | 36.6 | 31.0 | 28.8 | 26.6 |
| 0.52 GB checkpoints (2-bit head and embedding) and Q2_K | ||||||
| Rec-h2 , 0.52 GB | 40.6 | 42.0 | 43.4 | 42.6 | 41.0 | 39.0 |
| Model | Contrast | closing rate | accuracy on closed | problems |
|---|---|---|---|---|
| Qwen3-1.7B | codeword search | +1.4 [ 1.0, 3.8] | +10.4 [7.1, 13.6] | 414 |
| scale recalibration | +12.3 [9.8, 14.9] | +2.1 [ 1.4, 5.8] | 379 | |
| QAT vs. Rec | 18.4 [ 21.1, 15.6] | 0.5 [ 3.5, 2.5] | 440 |
| quantized | bits per quantized weight | ||||
| Model | Checkpoint | weights | measured | computed | file (GB) |
| Qwen3-1.7B | QAT-hbf16 | 1.41B | 2.011 | 2.000 | 0.977 |
| QAT-h2 | 2.03B | 2.046 | 2.038 | 0.520 | |
| Rec-h2 | 2.03B | 2.046 | 2.038 | 0.520 | |
| Qwen3-14B | QAT-only-h2 | 14.77B | 2.023 | 2.013 | 3.736 |
| Rec-h2 | 14.77B | 2.023 | 2.013 | 3.736 | |
| weight memory | decode (tokens/s) | prefill, 1,024 | top-1 agreement | ||
|---|---|---|---|---|---|
| Qwen3 | (GiB) | batch 1 | batch 16 | tokens (ms) | (%) |
| 1.7B | 3.22 1.85 | 424 408 | 6,232 5,998 | 12.8 15.7 | 98.7 |
| 8B | 15.27 5.68 | 146 212 | 2,225 3,184 | 27.0 28.4 | 99.1 |
| 14B | 27.52 9.31 | 86 150 | 1,341 2,302 | 48.0 45.0 | 98.3 |
| Model | Checkpoint | GB | strict | lenient | closed (%) | strict if closed |
|---|---|---|---|---|---|---|
| 2.6 bits per parameter | ||||||
| Qwen3-1.7B | QAT+R-h2 (selected) | 0.52 | 73.0 | 74.6 | 87.1 | 83.8 |
| Qwen3-1.7B | Rec-h2 | 0.52 | 46.7 | 47.3 | 86.0 | 54.2 |
| Qwen3-1.7B | QAT-h2 | 0.52 | 42.0 | 44.9 | 70.0 | 60.0 |
| 2.6–4 bits per parameter | ||||||
| Qwen3-1.7B | GGUF UD-IQ2_XXS [ 66 ] | 0.61 | 1.0 | 2.8 | 46.8 | 2.1 |
| Checkpoint | Size (GB) | 7-task | MMLU | GSM8K | HE | MT | M500 | A24/25 | A@16 |
|---|---|---|---|---|---|---|---|---|---|
| Qwen3-14B bf16 | 29.5 | 74.3 | 77.1 | 88.2 | 57.3 | 40.8 | 97.5 | 76.7/60.0 | 73.6 |
| Smaller models at 4–5 bits per parameter (reference) | |||||||||
| Qwen3-4B GGUF Q4_K_M [ 70 ] | 2.50 | 66.7 | 68.3 | 84.8 | 70.1 | 30.0 | 96.3 | 73.3/50.0 | 65.3 |
| Qwen3-8B GGUF Q3_K_M [ 72 ] | 4.12 | 69.2 | 71.0 | 86.5 | 61.0 | 31.6 | 95.8 | 56.7/50.0 | 64.1 |
| Qwen3-14B, 2.6 bits per parameter | |||||||||
| Ours: Rec-h2 | 3.74 | 69.9 | 69.5 | 87.7 | 65.2 | 32.0 | 92.7 | 50.0/33.3 | 46.5 |
LLM Quantization
Large language model quantization reduces numerical precision to lower memory use and accelerate training or inference.
See all 381 papers