Paper compiles exact arithmetic into Granite 4.2 3B and Qwen 3.5 4B weights with no training

Paper compiles exact arithmetic into Granite 4.2 3B and Qwen 3.5 4B weights with no training

The paper starts from a familiar weakness: pretrained language models remain unreliable on exact multi-digit arithmetic unless they are fine-tuned with gradients or hand the work to an external tool interpreter. The authors propose a third route. They introduce closed-form, zero-gradient "circuit-grafting" primitives that compile deterministic computation directly into the weights of a pretrained model. The method uses zero training examples and zero runtime hooks. It also bounds per-layer normalization drift and is meant to preserve the model's natural-language competence.

The construction combines three analytical mechanisms. First, a two-layer Mellin-GLU quadrature over bias-free SwiGLU/GeGLU layers turns the unknown per-token RMSNorm scaling into a translation along a log-spaced gate grid. That grid covers more than a 250-fold dynamic range and comes with IEEE 754 error bounds. Second, cross-token scale cancellation uses signed Chebyshev Indefinite-RoPE self-sink attention and memoryless SiLU-antisymmetric GatedDeltaNet shifts. Third, an axis-aligned width extension (from d to d+K) with d/(d+K) norm compensation is paired with Base-1000 canonical BPE emission and differential (+254,-256) tied unembeddings.

An automated 5-stage compiler uses these pieces to synthesize 4-8 digit signed addition, subtraction and multiplication circuits in constant TC^0 depth. It also produces 3-literal Boolean circuits and 5-bit Majority/Parity circuits. The Boolean results are reported at 100% (N=1,728, with extra audits on the 42-layer Gemma 4 E4B), and the 5-bit Majority/Parity circuits also at 100%.

The headline test is 6-digit arithmetic (N=1,200, BF16). IBM Granite 4.2 3B, with 1.07M-1.33M active non-zeros (no more than 0.036%), reaches 99.17% ALU-prefix accuracy. Alibaba Qwen 3.5 4B, with 2.25M-2.39M non-zeros (no more than 0.057%), reaches 100.00%. With an FP32 sidecar both reach 100%. The grafted models also show 98%-100% mid-sentence resumption. The authors say this outperforms a LoRA baseline trained on 12.8K samples, which they report at 42.2% / 61.7% with 0% inline continuation.

On cost, a factorized block-sparse sidecar holds A100 memory at 7.89 / 10.65 GiB, or 4.60 / 8.14 GiB under INT8/INT4 plus the FP32 sidecar. In long-context checks the grafted models passed all 14 of 14 pre-registered Tango splits longer than 2K tokens (N=4,392), with 0 of 11,134 out-of-distribution triggers.

Key facts

  • The method compiles exact arithmetic and Boolean circuits into pretrained weights with zero training examples, zero gradients and zero runtime hooks.
  • On 6-digit arithmetic (N=1,200, BF16), IBM Granite 4.2 3B scores 99.17% and Alibaba Qwen 3.5 4B scores 100.00% ALU-prefix accuracy; both reach 100% with an FP32 sidecar.
  • The grafted models are reported at 98%-100% mid-sentence resumption, against a 12.8K-sample LoRA baseline reported at 42.2% / 61.7% with 0% inline continuation.
  • Granite uses 1.07M-1.33M active non-zeros (no more than 0.036%) and Qwen 2.25M-2.39M non-zeros (no more than 0.057%).
  • An automated 5-stage compiler covers 4-8 digit signed addition, subtraction and multiplication in constant TC^0 depth, plus 3-literal Boolean and 5-bit Majority/Parity circuits.

Why it matters

Reliable exact arithmetic is a long-standing gap for language models, which usually need fine-tuning or an outside calculator to get it. This paper claims a third option: write the computation straight into the weights, analytically, with no training data and no hooks at inference time. If it holds up, it would show that deterministic circuits can sit inside a pretrained model while ordinary language ability is preserved. The abstract reports that the grafted models keep 98%-100% mid-sentence resumption, where a LoRA baseline reaches 42.2% / 61.7%.

Who it affects

Mainly researchers working on model interpretability, weight-level editing and exact computation inside transformers. The evaluated models are IBM Granite 4.2 3B and Alibaba Qwen 3.5 4B, with extra Boolean audits on Gemma 4 E4B, so the results concern small open models rather than frontier systems. Anyone who now relies on tool calls or fine-tuning for arithmetic could in principle be affected if the approach generalises.

How to use it

Nothing here is a ready-to-run tool. The abstract describes an automated 5-stage compiler that synthesizes the circuits, and it reports memory use on an A100: 7.89 / 10.65 GiB for the factorized block-sparse sidecar, or 4.60 / 8.14 GiB under INT8/INT4 plus an FP32 sidecar. No code release, open weights, or peer review status is mentioned. Practitioners should treat it as a research result to follow, not something to deploy.

How solid is it

The evidence is the authors' own abstract on a Hugging Face papers page, and the claims have not been independently verified. The numbers are specific: 99.17% and 100.00% on 6-digit arithmetic with N=1,200, 100% on 3-literal Boolean circuits with N=1,728, and 14 of 14 pre-registered Tango splits passed with 0 of 11,134 OOD triggers. The abstract does not define 'Tango' splits or 'ALU-prefix accuracy', and it does not say which metric the LoRA figures 42.2% / 61.7% refer to or which model each belongs to.

Risks and caveats

The reported scope is narrow: 4-8 digit signed addition, subtraction and multiplication, plus small Boolean circuits, on two 3B-4B models with Gemma 4 E4B used for Boolean audits. The abstract does not state results for arithmetic beyond 4-8 digits or for other operations, and it gives no inference-speed or latency figures. The 99.17% Granite score is in BF16, and 100% requires the FP32 sidecar. The denominator of the 0.036% and 0.057% non-zero fractions is not stated. The LoRA comparison is hard to read without knowing which metric each figure measures.

“compile deterministic computation directly into pretrained LM weights using zero training examples and zero runtime hooks”

— From the paper's abstract