Pretrained language models (LMs) remain unreliable on exact multi-digit arithmetic without gradient fine-tuning or external tool interpreters. We introduce closed-form, zero-gradient circuit-grafting primitives that compile deterministic computation directly into pretrained LM weights using zero training examples and zero runtime hooks, while bounding per-layer normalization drift and preserving natural-language (NL) competence. Our construction combines three analytical mechanisms: (1) two-layer Mellin-GLU quadrature over bias-free SwiGLU/GeGLU layers, turning unknown per-token RMSNorm scaling into translation along a log-spaced gate grid (>250× dynamic range) with IEEE 754 error bounds; (2) cross-token scale cancellation via signed Chebyshev Indefinite-RoPE self-sink attention and memoryless SiLU-antisymmetric GatedDeltaNet shifts; and (3) axis-aligned width extension (d→d+K) with d/(d+K) norm compensation, Base-1000 canonical BPE emission, and differential (+254,−256) tied unembeddings. An automated 5-stage compiler synthesizes 4–8 digit signed {+,−,×} circuits in constant TC0 depth alongside 3-literal Boolean (100%, N=1,728; plus 42-layer Gemma 4 E4B audits) and 5-bit Majority/Parity (100%) circuits. On 6-digit arithmetic (N=1,200, BF16), IBM Granite 4.2 3B (1.07M–1.33M active non-zeros, ≤0.036%) and Alibaba Qwen 3.5 4B (2.25M–2.39M non-zeros, ≤0.057%) reach 99.17% and 100.00% ALU-prefix accuracy (100% with an FP32 sidecar) and 98%–100% mid-sentence resumption—outperforming 12.8K-sample LoRA (42.2% / 61.7%, 0% inline continuation). A factorized block-sparse sidecar holds A100 memory at 7.89 / 10.65 GiB (4.60 / 8.14 GiB under INT8/INT4 + FP32 sidecar) while passing all 14/14 pre-registered >2K-token Tango splits (N=4,392; 0/11,134 OOD triggers).
Keywords:
Machine Learning, Circuit Compilation, Pretrained Language Models, Mechanistic Interpretability
1 Introduction
Autoregressive LMs interleave natural-language reasoning with deterministic sub-computations, yet next-token prediction remains brittle on exact multi-digit arithmetic (Liu and Low, 2023; McLeish et al., 2024; Zhou et al., 2024). Deployed systems route around this via host tool wrappers (Schick et al., 2023) that pause decoding to invoke external interpreters. Conversely, RASP (Weiss et al., 2021) and Tracr (Lindner et al., 2023) compile high-level programs into scratch-built toy Transformers without normalization invariants, and weight-space virtual machines such as Percepta’s CALM WASM VM (Tzamos and Percepta Research, 2026) execute multi-thousand-token traces inside dedicated VMs. Embedding exact digital logic directly into general-purpose pretrained LMs without gradient optimization or host routing—while maintaining noninferior accuracy on evaluated language benchmarks and mid-sentence continuation—poses distinct theoretical, numerical, systems, and tokenization challenges.
Table 1: Comparison with prior and concurrent paradigms, separating Reproduced baselines on identical Granite 4.2 / Qwen 3.5 splits from Conceptual comparisons.
Method / Paradigm Comp. Type Pretrained LM? Synthesis & Data Regime Zero Host Route? NL Retention & Dense Cost RASP / Tracr (Weiss et al., 2021; Lindner et al., 2023) Conceptual No (scratch) Auto DSL (0 data; no RMSNorm) Yes No NL capability CoNNs / Tracr-Inj. (Weng et al., 2024; Vergara-Browne and Soto, 2025) Conceptual Yes (fused / d) Compiled module + Gradient fusion/distill. Yes Trained/distilled; ≥1.0× Percepta CALM VM (Tzamos and Percepta Research, 2026) Conceptual Specialized VM MILP ReGLU + 2D CHT trace Yes (long trace) Dedicated trace VM (not general LM) Agentic WSP / SWD (Takehi et al., 2026; Yan et al., 2026) Conceptual Yes (Qwen) Agentic heuristic edit / circuit extraction Yes Heuristic edit or extraction; 1.0× PAL / Python Tool Router (Gao et al., 2023; Schick et al., 2023) Reproduced Yes (wrapped) Host regex/program + Python (0 weights) No (100% host) Exact NL; 1.00× (requires host) Same-Backbone LoRA SFT (12.8K ex.) Reproduced Yes (+6M LoRA) 400-step AdamW on 1–6d {+,−,×} Yes (100% in-W) 42–62% Arith; 0% inline prose Fixed-d SVD (P⊥) / Matched-(d+K) Reproduced Yes (d / d+K) Zero-grad SVD carve or 5-prim. leave-1-out Yes Fails Arith (8–51%) or PPL/ARC Mellin Primitives + Sidecar (Ours) Evaluated Yes (3B–4B) Auto Compiler (0 SGD; 4–8d ALU + TC0) Yes (100% in-W) Tango NI + Inline (1.16× sidecar / 0.68× INT4)
Scope and Contributions. Building a 5-stage declarative compiler atop reusable analytical primitives, we contribute:
Scale- and Architecture-Invariant Primitives (Section 3, Appendix A): Single-layer impossibility for bias-free GLU steps plus payload-linear truncation and kernel-explicit IEEE 754 / TF32 bounds for Mellin-GLU quadrature (Theorem 3.2), Indefinite-RoPE GQA and memoryless GatedDeltaNet shifts (Theorem 3.3), and axis-aligned width extension with arbitrary-tree tied-GEMM bounds (Theorem 3.4).
Automated Multi-Digit ALU, TC0 DAGs, & Sparse Sidecar (Section 4): Automated 4–8 digit BPE {+,−,×} (1.07M–2.25M nnz) and reference 6-digit patches in granite-4.2-3b and Qwen3.5-4B (0/8 Attn), a factorized block-sparse sidecar (cutting A100 VRAM 42%–44% and pairing INT8/INT4 WNL with an FP32 sidecar; Table 3), declarative Boolean (100%, N=1,728) & 5-bit Majority/Parity, triad BPE alignment, and 42L Gemma 4 E4B audits.
Figure 1: Geometric intuition for normalization cancellation and self-sink routing. (a) When RMSNorm rescales (r0,x)↦(λr0,λx) across 250× swings, single-scale SwiGLU collapses or saturates, whereas a Mellin log-grid αk=ekΔ shifts lnλ along a flat plateau (y^≡x/r0). (b) At θRoPE=107, positive weights leave S(δ)≥+0.61; signed Chebyshev weights (km=sgn(wm)∣wm∣) enforce S(0)=+1 and S(δ)≤−0.355<0 (1≤∣δ∣≤1024), parking inactive queries on their zero-payload self-sink (δself=0).
Compiled Circuits, CoNNs, and Subspace Injection. RASP (Weiss et al., 2021) and Tracr (Lindner et al., 2023) compile declarative programs into scratch Transformers assuming MLP biases, absolute positions, and unnormalized wires—violated by RMSNorm (Zhang and Sennrich, 2019), bias-free SwiGLU/GeGLU (Shazeer, 2020), RoPE (Su et al., 2024), and GatedDeltaNet (Yang et al., 2025). CoNNs (Weng et al., 2024) fuse external rule modules via gradient-trained adapters, and Tracr-Injection (Vergara-Browne and Soto, 2025) pairs subspace projection (P⊥=Id−UU⊤) with gradient distillation; we benchmark zero-gradient P⊥ and matched-(d+K) controls in Section 5 (Table 1). Sparse Weight Decomposition (Yan et al., 2026) factorizes weights to extract existing circuits (including on Qwen 3.5), complementing our forward <0.06%-nonzero synthesis.
Weight-Space VMs, Tokenization, and Tool Routers. Looped Transformers (Giannou et al., 2023) and Percepta’s CALM VM (Tzamos and Percepta Research, 2026) execute traces in dedicated VMs rather than general pretrained LMs, while concurrent Weight-Space Programming (Takehi et al., 2026; Hu et al., 2026) heuristically perturbs ∼103 scalars. Unlike gradient fine-tuning (Liu and Low, 2023; McLeish et al., 2024) or host Python routers such as PAL (Gao et al., 2023) and Toolformer (Schick et al., 2023), we compile closed-form gates aligned with numeric BPE chunking (Singh and Strouse, 2024).
3 Problem Setup and Analytical Primitives
Grafting Setup and Calibration Scope. Let Mθ be a pretrained causal LM over vocabulary V with residual width d, L layers, bias-free RMSNormRNw(z)=w⊙z/D1∥z∥22+ε (D current width, ε>0), and gated FFNs GLU(u)=Wdown(ϕ(Wgateu)⊙(Wupu)) with ϕ(s)=SiLU(s)=sσ(s) (or GELU). Given partial function f:D⊂V∗→V+ (here signed 6-digit integer {+,−,×}, ∣A∣,∣B∣≤999,999, deg(A)+deg(B)≤5 for ×), zero-gradient circuit grafting synthesizes θ′ from θ, tokenizer metadata, and ≤2L+1 unlabeled pre-sublayer norm medians (or a 0-token weight-analytic estimate; Section 5), with zero gradient steps, labeled data, runtime hooks, or host interpreters, targeting: (i) exact in-domain execution on D; (ii) bounded per-layer norm drift and empirical NL noninferiority on evaluated benchmarks; and (iii) inline resumption to pθ immediately post-answer.
Remark 3.1 (Qualified TC0 Class vs. Circuit Scope).
Under O(logn)-bit (or fixed IEEE float) precision and DLOGTIME-uniform positional encodings, a fixed-L-layer attention pass without trace emission lies in TC0 (Merrill and Sabharwal, 2023). While recurrent delta-rule layers with active state carry (egt=0) can reach NC1 (Merrill et al., 2024), our grafted Qwen3_5GatedDeltaNet subspace clamps egt≡0 (Theorem 3.3(2)), remaining in constant-depth TC0. By Hesse et al. (2002), asymptotic n-bit integer division and iterated multiplication do reside in DLOGTIME-uniform TC0; omitting division (/) in our fixed 6-digit layout is an engineering scope choice (wire-width and 7-bit BF16 range budgets), whereas unbounded halting loops require recurrent traces (Giannou et al., 2023; Tzamos and Percepta Research, 2026).
Synthesizing digital gates inside pretrained LMs faces four obstacles: (1) bias-free layers after RMSNorm rescale wires by unknown λt,ℓ=(D1∥ht,ℓ∥22+ε)−1/2 varying >250× (Sun et al., 2024); (2) cross-token routing uses RoPE (Su et al., 2024) or GatedDeltaNet (Yang et al., 2025; Qwen Team, 2026); (3) residual covariance is full-rank on Rd; and (4) tied heads (Wlm=Wemb) couple logits to Layer-0 embeddings.
Geometric Intuition (Figure 1). Before stating formal bounds (Theorems 3.2, 3.3 and 3.4; proofs & notation glossary in Appendix A), two geometric mechanisms govern our primitives: (i) Log-grid translation invariance (Figure 1a): RMSNorm multiplies reference r0 and payload x by the same unknown λt,ℓ. Evaluating SwiGLU across exponentially spaced gate scales αk=ekΔ converts multiplication by λt,ℓ into a horizontal shift kΔ↦kΔ+lnλt,ℓ along a flat trapezoidal integral plateau, canceling λt,ℓ across >250× swings where single-scale gates collapse or saturate. (ii) Signed self-sink routing & ratio cancellation (Figure 1b): At long-context θRoPE=107, standard positive RoPE weights leave sidelobes S(δ)≥+0.61>0, leaking attention onto off-target tokens. Assigning signed Chebyshev key weights (km=sgn(wm)∣wm∣) enforces S(0)=+1 and S(δ)≤−0.355<0 for all 1≤∣δ∣≤1024: when target t−d0 is inactive, query t parks cleanly on its zero-payload self-sink (δself=0, logit 0>−85), and when active, pairing Vs=[λs,λsxs]⊤ divides out source λs∗ at the target via Mellin readout v^t/r^t=xs∗.
Figure 2: Zero-gradient orthogonal circuit grafting. Pretrained coordinates Rd remain unprojected (γNL=d/(d+K)), while K appended wires compose reusable Mellin/routing primitives across a 3-stage pipeline and return control to zNL post-answer.
Table 2: Architecture and sparse-vs.-dense footprint summary across 2026 model families (including 42-layer Gemma 4 E4B architectural audit).
Let h∈RD carry reference r0>0 and payload x∈[−Xmax,Xmax], observed after RMSNorm as (r~,x~)=(λr0,λx) at unknown λ∈[λmin,λmax]⊂(0,∞).
(Single-layer impossibility over R). For any bias-free GLU F1(u)=Wdown(ϕ(Wgateu)⊙(Wupu)) with ∣ϕ(s)∣≤C∣s∣ (C=1 for exact or tanh-SiLU/GELU), ∥F1(λu)∥2≤λ2C∥Wdown∥2∥Wgateu∥∞∥Wupu∥2→0 as λ→0+ for all u∈RD. No single bias-free GLU layer realizes H(x−τr0)=1[x>τr0] on (0,λmax], and achieving ∥F1(λminu)∥2≥1−ϵ (ϵ∈[0,1),u=0) requires ∥Wdown∥2∥Wgate∥2∥Wup∥2≥C∥u∥221−ϵλmin−2.
(Mellin identity and payload-linear bounds over R). For ϕ=SiLU, r~>0, and v~∈R, π212∫−∞∞SiLU(−eur~)(−euv~)du (1) =r~v~π212∫0∞et+1tdt=r~v~. For r~=λr0, v~=λx, Δ>0, and K−<K+ with λminr0eK+Δ≥2, define QΔ,K−,K+(r~,v~):=π212Δ∑k=K−K+SiLU(−ekΔr~)(−ekΔv~). Since QΔ,K−,K+(λr0,λx)=r0xSΔ,K−,K+(ln(λr0)) is linear in x, both discretization and window-tail errors scale by ∣x∣/r0: QΔ,K−,K+(λr0,λx)−r0x (2) ≤r0∣x∣(εdisc(Δ)+εtail(λr0)), with εdisc(Δ)≤4∑m=1∞(1+Δ24π2m2)sinh(2π2m/Δ)2π2m/Δ (εdisc(0.55)<6.26×10−6) and εtail(r;K−,K+,Δ)≤π212[21r2e2K−Δ+(reK+Δ+1)e−reK+Δ]. For β,γ,δsep>0 with z:=βλminδsepr0≥2, composing Stage 1 p=γSiLU(β(x~−τr~))(β(x~−τr~)) in layer ℓ with Stage 2 QΔ,K−,K+(p~,p~) in layer ℓ+1 (λℓ+1∈[λmin′,λmax′], ratio 1) yields 0<QΔ,K−,K+(p~,p~)≤π2(1−e−2Δ)12Δ(λmax′γz2e−z)2e2K+Δ when x≤(τ−δsep)r0, and ∣QΔ,K−,K+(p~,p~)−1∣≤εdisc(Δ)+εtail(p~) when x≥(τ+δsep)r0 and p~mineK+Δ≥2 (p~min:=21λmin′γz2).
(Kernel-explicit IEEE 754 bounds vs. empirical BF16 carry sensitivity). Complement-pure gating via goff∈{0,1} (0x0000 active; ≤−z≤−Sλmin inactive) adds zero active error and yields bit-exact −0.0 when inactive: (a) for z≥89 under direct IEEE reciprocal-exp kernels fl(−z/(1+exp(z))) without -ffast-math (ATen F.silu on CPU/MPS/CUDA), and (b) for z≥104 (FP32), z≥98 (FP32→BF16), and z≥93 (BF16) under range-split sigmoid kernels fl(−zexp(−z)/(1+exp(−z))) (compiled S=256⇒z≈307). Accounting for gate-exponential conditioning (π218ζ(3)≤2.20), elementary roundoffs εelem, odd-neuron 0.35% trim (εtrim≤0.0018), and Higham’s Nq-term accumulation bound γNq=1−NquaccNquacc (Higham, 2002), worst-case error on payload C (r0=1) is ≤∣C∣(εdisc+εtail+εtrim+εelem+γNq+uout). For ∣C∣≤81 (Nq≤39), FP32 error is <0.15<0.5 (<0.24 with BF16-stored weights) and TensorCore TF32 error is <0.31<0.5 (guaranteed up to ∣C∣≤133), formally guaranteeing exact carries at τ=10m−0.5; conversely, BF16 worst-case bounds exceed 0.5 above ∣C∣>28 (1.43 with FP32 GEMM accumulation at ∣C∣=81), so ≤1-ULP (0.5) BF16 carry drift on C∈[32,81] is an empirical observation.
Table 3: Factorized block-sparse sidecar vs. materialized dense footprint and Hybrid PTQ (bs=1 on NVIDIA A100 PCIe/SXM4; 1 GiB=230 B). SparseSidecar (Section G.4) keeps WNL at width d=2560 and runs active Wcirc slices in BF16 or FP32 (100% G3--G7), supporting group-128 INT8/INT4 WNL.
Let token s∈{0,…,t} carry payload xs∈[−Xmax,Xmax], activity cs∈{0,1}, and reference rs=1, scaled after source RMSNorm by λs∈[λmin,λmax]⊂(0,∞).
(Indefinite-RoPE self-sink GQA over R). Assume 0≤d0≤t≤Δmax, scale κattn>0, Q/K norms λt,q,λu,k≥λmin,qk>0, and frequencies {ωm}m=1drot/2 with weights w satisfying S(0)=∑mwm=1 and max1≤∣δ∣≤ΔmaxS(δ)≤−μ<0 (S(δ)=∑mwmcos(δωm)). Setting Ks=csRoPE(kbase,s) and Vs=cs[λs,λsxs]⊤, when cs∗=1 at s∗=t−d0, letting Nact=∣{u=s∗:cu=1}∣ and ηtact=∑u=s∗,cu=1αt,u/αt,s∗ gives over R: r^tv^t−xs∗≤1+ηtactRminηtactRmax(∣xs∗∣+Xmax), (3) ηtact≤Nactexp(−(1+μ)κattng2λmin,qk2), with Rmax/min=max/minu:cu=1(λu/λs∗). If cs∗=0 and some u0≤t has cu0=0, ∣r^t∣≤Nactλmaxexp(−μκattng2λmin,qk2).
(Memoryless Qwen3_5GatedDeltaNet shift). In causal zero-padded GatedDeltaNet (Yang et al., 2025; Qwen Team, 2026) with Conv1d width Wc=4, SiLU, L2-normalized (q,k) (ε>0, scale dh−1/2), St=egtSt−1+k^t(vt−egtSt−1⊤k^t)⊤βt (gt=−eAlogsoftplus(at+bΔ)), and RMSNormGatedwnorm(St⊤q^t,zt) (wnorm,c=0, ∥St−1∥F≤Smax), setting Wa=0 (at=0), Alog=10,bΔ=10 gives gt=−e10ln(1+e10)<−2.20×105 (egt<10−95,600 over R; exact 0.0 in FP32/BF16). Routing r~t>0 to (q0,k0), 4r~t to zt, and s=0 (r~t−δ) plus payloads u(j) (1≤j<dh/2) into antisymmetric pairs (±21u(j)) at tap δ∈{1,2,3} with uniform readout (±αout/wnorm,2s(+1)) (αout>0) obeys SiLU(u)−SiLU(−u)≡u. Under egt=0, (q^t⊤k^t)βtνt−1SiLU(4r~t) and λt−δ cancel identically against s=0 for t≥δ, recovering exact xt−δ(j) (0 for t<δ).
Theorem 3.4 (Subspace Projection vs. Width Extension and Tied-GEMM Cancellation).
Let h∈Rd satisfy 0<E[∥h∥22]<∞ with Σ=E[hh⊤]≻0 (σ1≥⋯≥σd>0).
(Fixed-width projection lower bound over R). Any rank-(d−K) projection P⊥=Id−UU⊤ (U⊤U=IK) vacating K wires inside Rd without gradient recovery incurs error bounded below by Ky Fan’s theorem (Fan, 1949): E[∥h−P⊥h∥22]=tr(U⊤ΣU)≥∑i=d−K+1dσi>0.
(Axis-aligned width extension and schedule-/tree-explicit tied-GEMM bounds). Extending hext=[hNL;hcirc]∈Rd+K axis-aligned (diagonal RMSNorm is not O(d+K)-equivariant) with zero cross-coupling on WNL and γNL=d/(d+K) bounds single-sublayer relative drift over R (whenever ∥RNwNL(hNL)∥2>0) by ∥RNwNL(hNL)∥2∥RNγNLwNL(hext)1:d−RNwNL(hNL)∥2 (5) =1−(1+ρ′+δε)−1/2≤21(ρ+δε), where ρ′=∥hNL∥22+dε∥hcirc∥22≤ρ=∥hNL∥22∥hcirc∥22 and δε=∥hNL∥22+dεKε. Under tied Wlm=Wemb and unit-offset norm h~i=fl((1+wi)h^i) (h^=hext/rms(hext)), setting Evm,pm=Evm,nm=α0M0 (m∈{1..12}), wi=−1.0 on non-readout wires, and (wpm,wnm)=(+254.0,−256.0) (1+w=±255.0) gives h~nm=−h~pm bit-for-bit and ΔzcircR(v)=0 over R when (pm,nm) receive zero writes. In IEEE 754 arithmetic (no overflow, accumulator roundoff uacc, product underflow ηuf): • All inactive rows/steps: If v∈/{v1..v12} or xt∈/{v1..v12}, all K circuit products are ±0.0 under any reduction order or FMA. • Schedule S1 (Pairwise-first non-FMA + block split): Reducing each (pm,nm) pair first without FMA gives ΔzcircS1(v)=+0.0 and fl(z^NL(v)+(+0.0))=z^NL(v) numerically (= bit-for-bit if z^NL(v)=−0.0) across all v∈V. • Schedule S2 (Contiguous tail after z^NL): Appending +qexact,−qexact (qexact:=Evm∗,pm∗h~pm∗) consecutively after z^NL(vm∗) satisfies ∣z^S2(vm∗)−z^NL(vm∗)∣≤γ2(∣z^NL(vm∗)∣+∣qexact∣)+2(1+γ2)ηuf. • Arbitrary reduction tree T with interleaved NL terms: Two-step bounds fail when NL terms are summed between +q and −q (Appendix A). Over any binary evaluation tree T of non-zero leaf height hT ((hT+1)uacc<1, arbitrary interleaving and FMA), active row vm∗=xt obeys relative to zNLR(vm∗)=∑j=1dEvm∗,jh~j: z^Tacc(vm∗)−zNLR(vm∗)≤(d+2)(1+γhT)ηuf (6) +γhT+1(j=1∑d∣Evm∗,jh~j∣+2∣qexact∣), giving <2.8×10−5 nats on Qwen 3.5 under balanced tree reduction (hT≤⌈log2(d+K)⌉=13) and <5.2×10−3 nats under worst-case sequential interleaving (hT=d+1=2561) in FP32 accumulation.
Primitives, Declarative Compiler, and Reference Patches. Our implementation spans three layers: (1) reusable analytical modules (MellinSwiGLUBank, Indefinite-RoPE GQAAttnCompiler, DeltaNetShiftCompiler, d/(d+K) norm scaling, and differential tied readout); (2) an automated 5-stage declarative compiler (compile_declarative_arithmetic & DeclarativeDAGScheduler, Section 4.4) that introspects config/tokenizer to synthesize 4–8 digit BPE {+,−,×} and Boolean/voter DAGs with zero manual wire or layer IDs; and (3) frozen 6-digit reference patches (∣A∣,∣B∣≤999,999, deg(A)+deg(B)≤5; Figures 2 and 2).
4.1 Dense Multi-Chunk RoPE GQA: IBM Granite 4.2 3B
ibm-granite/granite-4.2-3b (IBM Granite Team, 2026) is a 40-layer dense Transformer (d=2560, ∣V∣=100,352, untied Wlm, 5:1 GQA, attn=1/dh=0.015625, unit residual/logit scales, θRoPE=107). Its BPE merges 1–3 digit substrings into single tokens (1,110 numeric tokens), producing 51 token-length compositions per 6-digit integer. Setting M0=2−4 keeps Layer-0 RMSNorm drift <2.5×10−4. Layers L0–L10 instantiate a 64-frequency Chebyshev Indefinite-RoPE kernel (S(0)=1.0, max1≤δ≤1024S(δ)=−0.355; K+=22 in L1/L3/L4) across 25 appended KV heads to separate binary/unary minus, enforce symmetric pre-operand guards (abstaining on prefixes,chains,ordecimals),andfactorall51BPEcompositionsinto14(\text{chunk},\text{offset})pairs.LayersL11–L29schedulesigned6−digit\pmand5\times 5multiplicationwithMULOVFabstainingif\deg(A)+\deg(B)\geq 6.Whereas1−digitemission(K=1{,}043)outputsoff−manifold1−digittokens([’1’,’2’,’4’,’5’])thatdegradeGSM8K,ourBase−1000CanonicalBPEEmitter(K=1{,}140,L30–L39)tracksemittedchunk−lengthprefixsumsacross\delta\in{1..7}androutesremainingdigitsr\in{1..7}ontoright−alignedBase−1000chunks,scoringall1{,}110canonicaltokensvia35$ readout wires.
4.2 Hybrid GatedDeltaNet: Alibaba Qwen 3.5 4B
Qwen/Qwen3.5-4B (Qwen Team, 2026) interleaves 24 Qwen3_5GatedDeltaNet blocks (Yang et al., 2025) (3:1) with 8 full-attention layers, unit-offset RMSNorm (1+w), strict 1-digit BPE, and a tied 248,320-token head (Wlm=Wemb). Leaving 0/8 full-attention layers modified (0 added attention KV cache), we schedule cross-token shifts inside 12/24 GatedDeltaNet blocks via Theorem 3.3(2), cascading taps δ∈{1,2,3} to reach δ≤9 (M0=2−9, Layer-0 drift <0.015%). Quantizing the 7-digit ALU output (L9–L27) into 4-bit nibbles emits canonical 1-digit tokens (L15–L31) without multi-chunk BF16 carry drift, paired with (+254.0,−256.0) differential tied weights (Theorem 3.4(2)).
4.3 42-Layer Architectural & Activation Audit: Google Gemma 4 E4B
Table 6: Consolidated robustness vs. abstention summary (left) and hardware/precision/kernel/PTQ compatibility matrix (right). Full 17-category 10.5K false-trigger, 4-seed, failure, Boolean, kernel, and PTQ breakdowns appear in Appendices C, D and G.
Auditing google/gemma-4-E4B-it (Gemma Team, Google DeepMind, 2026) (42L, tanh-GeGLU, QK/V-RMSNorm, Sandwich norms, hℓ←sℓhℓ, top-18 KV share) isolates activation constants and three failure modes (Section G.1): (i) over 250× swings on payload 7.0, exact Iϕ for SiLU (0.8225), erf-GELU (0.2500), tanh-GELU (0.2496), and QuickGELU (0.2839) keep FP32 err ≤.0070 (vs. .0186 [0.166% bias] if uncalibrated 0.25 is used on tanh-GELU); and (ii) on 42L Boolean grafts (K=296), KV-shared L24–L41 fails (47.9%, 30/60 FT) by overwriting (K,V), and omitting Sandwich or cumulative mℓ=m0∏j<ℓsj scaling yields 10.9%, whereas calibrating both on unshared L0–L18 hits 100.0% (64/64).
Block-Sparse Sidecar & Hybrid PTQ (Table 3). Zero-filled dense Linear padding (d+K) inflates parameters by 1.98×–3.13× (13.55 / 19.09 GiB ragged on A100), whereas our factorized SparseSidecar (sparse_sidecar_runtime.py; Section G.4) keeps WNL at native width d=2560 and evaluates only active circuit slices (1.33M [0.036%] / 2.39M [0.057%] nnz), reducing A100 VRAM to 7.89 / 10.65 GiB and speeding up 2,048-token prefill by 2.67× (347.5→130.1 ms) and 1.96× (847.9→433.7 ms) with unchanged ARC-C. Evaluating the <0.06% sidecar in FP32 alongside BF16 or group-128 INT8/INT4-quantized WNL (6.07/4.60 GiB Granite; 9.80/8.14 GiB Qwen) resolves all 5/5 (G3--G7) carry-ULP edge cases and maintains 100.0% Qwen arithmetic across BF16/INT8/INT4.
Decomposed Accuracy, 5-Primitive Ablations, & LoRA SFT (Tables 4 and 5). Table 4 decomposes generation into ALU-Prefix (∣Δzcirc∣>0.5), Lead-Int, Strict Non-Decimal (800 bare vs. 400 prose), and Inline Resumption (N=50). (1) Exactness vs. continuation: Qwen 3.5 ALU-Prefix reaches 1,200/1,200 (100%) in BF16 (99.50% Lead-Int/Strict-ND; 100% Inline-50), and Granite reaches 99.17% (100% in FP32/FP32-sidecar; 98.25% prose Strict-ND). Across 4 numeric tokenization schemes on GSM8K-100 (Section G.3), raw 1-digit (36.0%) and spaced 1-digit (35.0%) degrade reasoning relative to 3-digit and Base-1000 canonical triads (73.0%). (2) Leave-one-out & LoRA (Table 5): Removing any of the 5 primitives degrades execution or language modeling: unit-calibrated single-scale SwiGLU (-P1) drops Arith to 8.3% / 20.0%; positive RoPE (wm>0, -P2) drops Granite to 15.0%; stateful GatedDeltaNet (egt=0, -P3) drops Qwen to 51.1% (8.999 signed-shift err w/o SiLU antisymmetry); omitting d/(d+K) (-P4) reduces ARC-C by −19 / −54pp; and single-ended tied readout (-P5) introduces nonzero digit-token bias. Same-backbone LoRA SFT (12.8K examples, 6M+ params) reaches 42.2% / 61.7% Arith and 0.0% fluent inline continuation, while 0-token weight-analytic calibration (C2) retains 96.3% / 97.0%.
Kernel Portability, Decoding/IFEval/Safety, & >2K-Ctx Retention (Tables 6 and 7). Four-seed 8-format evaluation (N=3,000/model) reaches 94.07% / 96.60% with 0/11,134 combined arithmetic/Boolean OOD triggers (max∣Δzcirc∣=0.0). On A100 (Table 6b), TorchInductor Triton fused SwiGLU (z∗=88.8/89.0<307.2), PyTorch SDPA FlashAttention-2/MemEfficient (max∣Δ∣=0.0), and TF32 (5/5 G3--G7) execute cleanly, and IEEE FP16 gate overflow (65,504→NaN) is avoided via [−4096,4096] clamping or an FP32 sidecar (Section G.2). Under pre-registered Tango testing (Tango, 1998) (Tables 7 and G.3), both grafts pass all 14/14 expanded reasoning and >2K-token splits (N=4,392: +0.46 / +0.23pp, p<10−5; SWE-bench ΔNLL≤+.0023), preserve accuracy across 5 decoding regimes (Greedy, T∈{0.3,0.7,1.0}, Beam-4), IFEval-100, and Safety-80 (100%→100% harmful refusal, 0.0pp benign drift; Section G.3), and reproduce from standalone patches across mps and A100 cuda (Appendix F).
6 Discussion, Limitations, and Conclusion
(1) Numeric BPE manifold alignment: Consistent with Singh and Strouse (2024), 1-digit Granite emission (K=1,043) drops GSM8K[:60] (bs=1; Appendix B) from 68.33%→36.67% (b10=19,b01=0) although 18/19 (94.7%) regressions compute exact ALU outputs: Granite’s 1–3 digit BPE misreads unmerged 1-digit IDs as decimals (5/19), split spans (9/19), or high-surprisal sequences (4/19)—resolved (70.00%–76.67%) by Base-1000 Canonical BPE (K=1,140). Post-disengagement (Δzcirc=0) yields 98%–100% inline fluency while leaving bare Granite prompts unanchored against .d suffixes (98.25% prose vs. 87.0% bare).
(2) Factorized block-sparse sidecar & mixed PTQ (Section G.4): Axis-aligned zero cross-weights let SparseSidecar evaluate WNLh~NL⊕Wcirch~circ coupled only through scalar ∥hNL∥22+∥hcirc∥22, cutting A100 VRAM 42%–44% (7.89 / 10.65 GiB) and 2K-prefill latency 1.96×–2.67× in pure PyTorch, while pairing an FP32 sidecar with BF16 or INT8/INT4 WNL (4.60 / 8.14 GiB) achieves 5/5 G3--G7 and 100% Qwen ALU (Table 3).
(3) Scope & TC0 scaling: (i) compile_declarative_arithmetic automates 4–8 digit multi-chunk BPE {+,−,×} (14–176 chunkings in constant 39LTC0 depth, −5.6% to −19.5% nnz; Table 18) alongside Boolean/voter DAGs, whereas unbounded-length inputs or halting loops exceed single-pass TC0 (Remark 3.1). (ii) While restoring division takes ∼40L, an 8-layer TC0 64-knot Mellin + Newton–Raphson divider (+1,480 wires, 1.92M nnz) reaches 100.0% (10K/10K) in an FP32 sidecar (73.9% TF32, 56.1% BF16), and D∈{9,12,18} digits scale to K∈{2.2K,3.6K,7.0K} across 32–44L (Section G.2). (iii) Full 42L Gemma 4 arithmetic and fused C++/CUDA BSR kernels remain open work, while dormant weight-space triggers motivate structural checkpoint auditing (Impact Statement; Clifford et al., 2024).
Conclusion. Analytical zero-gradient primitives and factorized FP32/BF16 sidecars compile exact arithmetic and TC0 circuits directly into pretrained LMs without gradients, task data, or host routers while preserving >2K-token language competence.
Impact Statement
This paper presents analytical weight-compilation primitives, an automated 5-stage declarative arithmetic and Boolean DAG synthesizer, and reference sparse checkpoint patches aimed at advancing mechanistic understanding and deterministic reliability of pretrained language models without gradient training or external code-execution sandboxes. Reliable single-checkpoint computation: In air-gapped, regulated, or pure-tensor inference environments where pausing decoding to execute arbitrary host Python/shell code (Gao et al., 2023; Schick et al., 2023) expands the attack surface, verified weight-space circuits offer mathematically bounded execution inside standard safetensors tensors alongside clean mechanistic probes of BPE tokenization–reasoning alignment (Singh and Strouse, 2024).
Dual-use security implications (concealed input-triggered weight behaviors): Conversely, our empirical findings carry a concrete model-supply-chain security lesson extending compiled-network backdoor analyses (Clifford et al., 2024) to multi-billion-parameter pretrained LMs. Because 0x0000 complement-pure Mellin gates and differential (+254,−256) tied readouts remain bit-exact zero off-trigger (0/10,534 out-of-domain activations; <0.002 nats next-token KL shift; <0.06% active non-zeros), black-box behavioral benchmarks and standard perplexity evaluations cannot reliably detect dormant, input-triggered payloads grafted into open-weight checkpoints. Mitigating this risk requires pairing behavioral evaluation with white-box structural auditing of distributed weights: (i) verifying canonical hidden/intermediate tensor dimensions against official model configs; (ii) scanning projection rows and RMSNorm vectors for axis-aligned block decoupling, bimodal L0 sparsity, extreme gate-suppression constants (−S≪−102), or antisymmetric norm pairs; and (iii) enforcing cryptographic SHA-256 provenance on model shards. Finally, while dense Linear materialization increases memory (1.98×–3.13×), our factorized SparseSidecar (Section G.4) eliminates >40% of that VRAM overhead in pure PyTorch.
References
E. Clifford, I. Shumailov, Y. Zhao, R. Anderson, and R. Mullins ImpNet: imperceptible and blackbox-undetectable backdoors in compiled neural networks. In Proceedings of the IEEE Conference on Secure and Trustworthy Machine Learning (SaTML), pp. 344–357. Cited by: §6, Impact Statement.
K. Fan On a theorem of Weyl concerning eigenvalues of linear transformations I. Proceedings of the National Academy of Sciences 35 (11), pp. 652–655. Cited by: §A.3, item 1.
L. Gao, A. Madaan, S. Zhou, U. Alon, P. Liu, Y. Yang, J. Callan, and G. Neubig PAL: program-aided language models. In Proceedings of the 40th International Conference on Machine Learning (ICML), Vol. 202, pp. 10764–10799. Cited by: §E.1, Table 1, §2, Impact Statement.
A. Giannou, S. Rajput, J. Sohn, K. Lee, J. D. Lee, and D. Papailiopoulos Looped Transformers as programmable computers. In Proceedings of the 40th International Conference on Machine Learning (ICML), Vol. 202, pp. 11398–11442. Cited by: §E.5, §2, Remark 3.1.
W. Hesse, E. Allender, and D. A. Mix Barrington Uniform constant-depth threshold circuits for division and iterated multiplication. Journal of Computer and System Sciences 65 (4), pp. 695–716. Cited by: §E.5, Remark 3.1.
N. J. Higham Accuracy and stability of numerical algorithms. 2nd edition, Society for Industrial and Applied Mathematics (SIAM), Philadelphia, PA. Cited by: item 3, item 5, §A.1, item 3.
J. Hu, C. Tang, W. Li, H. Zhu, C. Feng, Q. Zhang, Y. Chen, and M. Hu Exploring weight-space programming: capabilities, generalization, and limitations. arXiv preprint arXiv:2611.09382. Cited by: §2.
IBM Granite Team IBM Granite 4.2 3B open-weight language model release. Note: HuggingFace Model Repository (ibm-granite/granite-4.2-3b, commit 4e9c275e) External Links: Link Cited by: §4.1.
D. Lindner, J. Kramár, S. Farquhar, M. Rahtz, T. McGrath, and V. Mikulik Tracr: compiled Transformers as a laboratory for interpretability. In Advances in Neural Information Processing Systems (NeurIPS), Vol. 36, pp. 37876–37899. Cited by: Table 1, §1, §2.
T. Liu and B. K. H. Low Goat: fine-tuned LLaMA outperforms GPT-4 on arithmetic tasks. arXiv preprint arXiv:2305.14201. Cited by: §1, §2.
S. McLeish, A. Bansal, A. Stein, N. Jain, J. Kirchenbauer, B. R. Bartoldson, B. Kailkhura, A. Bhatele, J. Geiping, A. Schwarzschild, and T. Goldstein Transformers can do arithmetic with the right embeddings. In Advances in Neural Information Processing Systems (NeurIPS), Vol. 37, pp. 108012–108041. Cited by: §1, §2.
W. Merrill, J. Petty, and A. Sabharwal The illusion of state in state-space models. In Proceedings of the 41st International Conference on Machine Learning (ICML), Vol. 235, pp. 35492–35506. Cited by: §E.5, Remark 3.1.
W. Merrill and A. Sabharwal The parallelism tradeoff: limitations of log-precision Transformers. Transactions of the Association for Computational Linguistics 11, pp. 531–545. Cited by: §E.5, Remark 3.1.
T. Schick, J. Dwivedi-Yu, R. Dessì, R. Raileanu, M. Lomeli, E. Hambro, L. Zettlemoyer, N. Cancedda, and T. Scialom Toolformer: language models can teach themselves to use tools. In Advances in Neural Information Processing Systems (NeurIPS), Vol. 36, pp. 68539–68551. Cited by: §E.1, Table 1, §1, §2, Impact Statement.
A. K. Singh and D. Strouse Tokenization counts: the impact of tokenization on arithmetic in frontier LLMs. arXiv preprint arXiv:2402.14903. Cited by: §2, §6, Impact Statement.
J. Su, M. Ahmed, Y. Lu, S. Pan, W. Bo, and Y. Liu RoFormer: enhanced Transformer with rotary position embedding. Neurocomputing 568, pp. 127063. Cited by: §A.2, §2, §3.
M. Sun, X. Chen, J. Z. Kolter, and Z. Liu Massive activations in large language models. In First Conference on Language Modeling (COLM), Cited by: §D.1, §3.
R. Takehi, J. Teoh, A. Zhang, and O. Khattab Sparks of weight-space programming: LLMs can natively read and write neural network weights. Note: MIT CSAIL Technical Report External Links: Link Cited by: Table 1, §2.
T. Tango Equivalence test and confidence interval for the difference in proportions for the paired-sample design. Statistics in Medicine 17 (8), pp. 891–908. Cited by: §5.
L. N. Trefethen and J. A. C. Weideman The exponentially convergent trapezoidal rule. SIAM Review 56 (3), pp. 385–458. Cited by: item 1.
C. Tzamos and Percepta Research Can LLMs be computers? Executing programs inside Transformers with exponentially faster inference. Note: Percepta Research Technical Report External Links: Link Cited by: §E.5, Table 1, §1, §2, Remark 3.1.
T. Vergara-Browne and Á. Soto Tracr-Injection: distilling algorithms into pre-trained language models. In Findings of the Association for Computational Linguistics: ACL 2025, pp. 2831–2843. Note: ACL Anthology ID: 2025.findings-acl.146; arXiv:2505.10719 Cited by: §E.2, Table 1, §2.
G. Weiss, Y. Goldberg, and E. Yahav Thinking like Transformers. In Proceedings of the 38th International Conference on Machine Learning (ICML), Vol. 139, pp. 11080–11090. Cited by: Table 1, §1, §2.
Y. Weng, M. Zhu, F. Xia, B. Li, S. He, K. Liu, and J. Zhao Mastering symbolic operations: augmenting language models with compiled neural networks. In Proceedings of the Twelfth International Conference on Learning Representations (ICLR), Note: arXiv:2304.01665 Cited by: Table 1, §2.
C. Yan, X. Huang, Y. Duan, Z. Yin, H. Zhao, B. Dai, and J. Fu Sparse weight decomposition for efficient circuit extraction. arXiv preprint arXiv:2608.03913. Cited by: Table 1, §2.
S. Yang, J. Kautz, and A. Hatamizadeh Gated delta networks: improving Mamba2 with delta rule. In Proceedings of the Thirteenth International Conference on Learning Representations (ICLR), Note: arXiv:2412.06464 Cited by: §2, item 2, §3, §4.2.
B. Zhang and R. Sennrich Root mean square layer normalization. In Advances in Neural Information Processing Systems (NeurIPS), Vol. 32, pp. 12360–12371. Cited by: §2.
H. Zhou, A. Bradley, E. Littwin, N. Razin, O. Saremi, J. Susskind, S. Bengio, and P. Nakkiran What algorithms can Transformers learn? A study in length generalization. In Proceedings of the Twelfth International Conference on Learning Representations (ICLR), Cited by: §1.
Appendix A Complete Mathematical Proofs and Finite-Precision Analysis
We provide complete, self-contained derivations for Theorems 3.2, 3.3 and 3.4, separating exact real-arithmetic (R) identities, non-asymptotic truncation bounds over R, and kernel-, schedule-, and evaluation-tree-explicit IEEE 754 floating-point (FP32 vs. BF16) rounding bounds. Table 8 summarizes our notation and finite-precision quantities.
Table 8: Summary of circuit-grafting notation and IEEE 754 / kernel quantities.
Symbol / Term Definition Plain-Language Role in Circuit d,K,hext=[hNL;hcirc] Base width d=2560; appended circuit wires K Keeps pretrained NL features untouched in Rdλt,ℓ=(D1∥ht,ℓ∥22+ε)−1/2 Token/layer-varying RMSNorm inverse scale Unknown runtime multiplier (>250× swing) we cancel r0,goff∈{0,1},M0 Reference wire (1); complement guard (0 active, 1 off); scale Tracks λt,ℓ and holds circuit bit-exact silent off-trigger αk=ekΔ,Iϕ Log-spaced gate scales (Δ=0.55); Mellin integral constant Converts λt,ℓ scaling into a shift along a flat integral plateau S(δ)=∑mwmcos(δωm) Indefinite-RoPE spectral kernel (S(0)=1,S(δ=0)≤−0.355) Forces inactive queries onto a zero-payload self-sink (δ=0) γNL=d/(d+K) Pretrained RMSNorm weight compensation factor Cancels the d1→d+K1 denominator shift on NL channels (wpm,wnm)=(+254,−256) Differential unit-offset RMSNorm gains (1+w=±255) Cancels Layer-0 digit embeddings on Qwen’s tied lm_head 0x0000 / -0.0 / FTZ IEEE 754 exact zero bit-patterns; Flush-To-Zero hardware mode Ensures inactive gates add exact 0.0 without -ffast-math uacc,γN=1−NuaccNuacc Accumulator unit roundoff (2−24 FP32); Higham sum bound Bounds worst-case floating-point dot-product rounding error Schedule S1 / Tree T (hT) Pairwise (pm,nm)-first sum vs. arbitrary GEMM reduction tree Distinguishes exact +0.0 sidecar readout from general cuBLAS trees
Scope of numerical scripts vs. human mathematical proof verification.
Companion scripts (verify_math_proofs_and_constants.py, verify_v4_submission_audit.py, and verify_icml2027_gemm_and_proofs.py) evaluate closed-form constants at 50-digit precision via mpmath, exhaustively sweep IEEE 754 FP32/BF16 bit-patterns for SiLU underflow/overflow thresholds, and execute explicit floating-point counterexamples and Monte Carlo reduction-tree permutations. Such scripts verify numerical constants and test concrete floating-point instances only; they do not constitute formal machine-checked theorem proving or substitute for line-by-line human mathematical proof verification.
A.1 Proof of Theorem 3.2 (Scale-Invariant Mellin-GLU Quadrature)
Part 1 (Single-layer impossibility over R).
Let F1(u)=Wdown(ϕ(Wgateu)⊙(Wupu)) where ϕ:R→R satisfies ∣ϕ(s)∣≤C∣s∣ for all s∈R. Standard gated-MLP activations satisfy C=1: SiLU(s)=sσ(s) has σ(s)=(1+e−s)−1∈(0,1); exact Gaussian GELU(s)=sΦ(s) has Φ(s)∈(0,1); and tanh-approximate GELUtanh(s)=21s(1+tanh(2/π(s+0.044715s3))) has tanh(⋅)∈(−1,1). For any u∈RD, any λ>0, and each neuron i∈{1,…,m}, homogeneity of Wgate(λu)=λWgateu and Wup(λu)=λWupu yields
Taking the Euclidean norm of v(λu)=ϕ(Wgate(λu))⊙(Wup(λu)) gives ∥v(λu)∥2≤λ2C∥Wgateu∥∞∥Wupu∥2≤λ2C∥Wgate∥2∥Wup∥2∥u∥22. By spectral-norm submultiplicativity,
Letting λ→0+ yields limλ→0+∥F1(λu)∥2=0 for every u∈RD, so no single bias-free GLU layer can realize H(x−τr0)=1 (for x>τr0) uniformly across (0,λmax]. Moreover, on any compact interval [λmin,λmax]⊂(0,∞), if ∥F1(λminu)∥2≥1−ϵ for some ϵ∈[0,1) and u∈RD∖{0}, substituting λ=λmin into (7) immediately gives ∥Wdown∥2∥Wgate∥2∥Wup∥2≥C∥u∥221−ϵλmin−2.
Part 2 (Exact Mellin integral, payload linearity, Poisson bound, and margin-separated Heaviside step).
For r~>0, v~∈R, and SiLU(−t)=−1+ett (t>0), substituting t=eur~ (du=dt/t, euv~=tv~/r~) yields
For t>0, the alternating partial sums SN(t)=∑n=1N(−1)n−1te−nt=te−t1+e−t1−(−e−t)N satisfy 0≤SN(t)≤te−t∈L1(0,∞) for every N≥1. By Lebesgue’s dominated convergence theorem, ∫0∞et+1tdt=∑n=1∞(−1)n−1∫0∞te−ntdt=∑n=1∞n2(−1)n−1=η(2)=21ζ(2)=12π2, proving (1). (Replacing SiLU with exact Gaussian GELU(−t)=−tΦ(−t) gives ∫0∞tΦ(−t)dt=22π1∫0∞t2e−t2/2dt=41, and 0.249586 under GELUtanh.)
Now set r~=λr0>0, v~=λx, u0=ln(λr0), and ψ(w)=eew+1e2w>0. Because each neuron’s up-projection −ekΔv~=−r0xekΔ+u0 is homogeneous of degree 1 in x while the gate −ekΔr~=−ekΔ+u0 is independent of x, the finite quadrature sum factors identically as
Hence both the infinite-grid discretization error ∣SΔ(u0)−1∣ (SΔ(u0):=π212Δ∑k∈Zψ(kΔ+u0)) and the finite-window tail error ∣SΔ,K−,K+(u0)−SΔ(u0)∣=π212Δ∑k∈/[K−,K+]ψ(kΔ+u0) are dimensionless errors of the unit-ratio kernel SΔ,K−,K+(u0), and both scale by ∣x∣/r0: QΔ,K−,K+(λr0,λx)−r0x=r0∣x∣∣SΔ,K−,K+(u0)−1∣≤r0∣x∣(εdisc(Δ)+εtail(λr0;K−,K+,Δ)):
Non-asymptotic Poisson–Mellin discretization bound: Because ψ∈C∞(R) decays exponentially as e2w as w→−∞ and super-exponentially as e2w−ew as w→+∞, both ψ and its Fourier transform ψ^(ξ)=∫−∞∞ψ(w)e−iξwdw lie in the Schwartz space S(R)⊂L1(R) (Trefethen and Weideman, 2014), so Poisson summation holds pointwise: Δ∑k∈Zψ(kΔ+u0)=∑m∈Ze2πimu0/Δψ^(2πm/Δ). Substituting t=ew gives the Mellin transform along Re(s)=2: ψ^(ξ)=∫−∞∞eew+1e2we−iξwdw=∫0∞et+1t1−iξdt=η(2−iξ)Γ(2−iξ). Since Re(2−iξ)=2>1, ∣η(2−iξ)∣≤∑n=1∞∣n−2+iξ∣=6π2. By Euler’s reflection identity ∣Γ(1−iξ)∣2=sinh(πξ)πξ and Γ(2−iξ)=(1−iξ)Γ(1−iξ), ∣Γ(2−iξ)∣=(1+ξ2)sinh(π∣ξ∣)π∣ξ∣. Combining ψ^(0)=12π2 with π224⋅6π2=4 gives (2): SΔ(u0)−1≤π224∑m=1∞ψ^(Δ2πm)≤4∑m=1∞(1+Δ24π2m2)sinh(2π2m/Δ)2π2m/Δ. At Δ=0.55, 2π2/Δ≈35.8895, giving εdisc(0.55)≤6.2551×10−6 (actual supremum supu0∣S0.55(u0)−1∣=4.7276×10−6).
Lower and upper tail bounds: For r=λr0=eu0, since ψ(w)<e2w and e2Δ−1>2Δ for all Δ>0, summing over k≤K−−1 gives Δ∑k=−∞K−−1ψ(kΔ+u0)<Δr2e2Δ−1e2K−Δ<21r2e2K−Δ. For k≥K++1, let T+=reK+Δ≥λminr0eK+Δ≥2. Since ψ(w)<g(w):=e2w−ew and g′(w)=(2−ew)g(w)≤0 for all w≥lnT+≥ln2, integral comparison on [K+Δ+u0,∞) gives Δ∑k=K++1∞ψ(kΔ+u0)≤∫lnT+∞e2w−ewdw=∫T+∞te−tdt=(T++1)e−T+, establishing (2).
Margin-separated two-layer Heaviside step over R (requiring z≥2): For β,γ,δsep>0 with z:=βλminδsepr0≥2, Stage 1 in layer ℓ computes p=γSiLU(s)s=γ1+e−ss2>0 for s=β(x~−τr~)=βλ(x−τr0)=0. On negative-margin inputs x≤(τ−δsep)r0, let w:=−s=βλ(τr0−x)≥βλminδsepr0=z≥2. Because dwd(w2e−w)=w(2−w)e−w≤0 for all w≥2 (noting that w2e−w is strictly increasing on (0,2), making the hypothesis z≥2 essential; our compiled gates use z≥16), we obtain 0<p=γ1+eww2<γw2e−w≤γz2e−z. In layer ℓ+1, p~=λℓ+1p≤λmax′γz2e−z, and since SiLU(−ekΔp~)(−ekΔp~)<(p~ekΔ)2, summing k≤K+ gives 0<QΔ,K−,K+(p~,p~)≤π2(1−e−2Δ)12Δ(λmax′γz2e−z)2e2K+Δ. Conversely, on positive-margin inputs x≥(τ+δsep)r0, s≥z≥2>0 gives σ(s)>21 and p>21γz2, so p~=λℓ+1p≥p~min:=21λmin′γz2. Here v~=r~=p~ has unit ratio ∣x∣/r0=1; under p~mineK+Δ≥2, (2) yields ∣QΔ,K−,K+(p~,p~)−1∣≤εdisc(Δ)+εtail(p~;K−,K+,Δ).
Part 3 (Kernel-explicit IEEE 754 bounds, nonlinear SiLU conditioning, and BF16 carry sensitivity).
Under IEEE 754 round-to-nearest-even (RN) arithmetic with unit roundoff u, fl(a+b)=(a+b)(1+δ) (∣δ∣≤u). Suppressing an inactive gate via additive cancellation fl(Sλ1)−fl(Sλ2) under distinct prior roundings leaves residual ∼Sλu (Subf16=8 at S=211,ubf16=2−8). Under complement-pure gating, goff is bit-exact 0x0000 (+0.0) when active, so fl((−S)⋅0.0)=−0.0 and fl(a+(−0.0))=a adds zero active error. When inactive (goff≥1), the gate input satisfies s≤−z≤−Sλmin<0, and exact-zero saturation depends explicitly on the activation kernel:
Kernel Class K1 (direct reciprocal-exp fl(s/(1+exp(−s))) in IEEE 754 FP32 opmath without -ffast-math/-ffinite-math-only, as in PyTorch ATen F.silu on CPU, MPS, and CUDA): Since the maximum finite IEEE single/bfloat16 float is <3.41×1038<e88.73, fl(exp(+z))=+∞ and IEEE division by +∞ returns bit-exact −0.0 for all z≥89 in both FP32 and BF16.
Kernel Class K2 (range-split stable sigmoid fl(sexp(s)/(1+exp(s))) for s<0): Because exp(−z) does not overflow, bit-exact −0.0 occurs when zexp(−z) underflows below half the minimum subnormal (2−150 in FP32; 2−134 in BF16) or rounds to zero on BF16 output cast, yielding exact −0.0 at z≥104 in FP32, z≥98 for FP32→BF16 cast, and z≥93 in pure BF16 (with ∣SiLU(−z)∣≤89e−89<2.0×10−37 on z∈[89,104) in FP32; tanh-based approximations saturate to −1.0 by z≥18). Thus z≥104 guarantees bit-exact −0.0 across both K1 and K2, and our compiled S=256 gives nominal z≈307≫104.
On active passes (r0=1, payload C), each neuron k∈[K−,K+] evaluates SiLU(−t^k)(−v^k) where t^k=tk(1+ηk) (tk=ekΔr~>0, ∣ηk∣≤ηˉ from weight rounding uw and input multiplication uacc). For ϕ0(t)=et+1t, ∣ϕ0′(t)∣=ϕ0(t)t1−et+1et≤ϕ0(t)(t1+1), so multiplicative perturbation tk↦tk(1+ηk) shifts ϕ0(tk) by at most ϕ0(tk)(1+eηˉtk)ηˉ. Summing over k brings in the first-moment Mellin condition constant
(discrete grid supremum 2.19231<2.20 at Δ=0.55), giving per-neuron elementary + weight-perturbation error εelem≤(1+2.20eηˉ)ηˉ+5.1uacc. Combining εelem with odd-neuron 1.0035 BF16 gain trim (εtrim=supu0∣π212Δ∑k odd0.0035ψ(kΔ+u0)∣≤0.00178), Higham’s Nq-term accumulation bound γNq=1−NquaccNquacc (Higham, 2002, Ch. 3), and output cast uout yields worst-case error ≤∣C∣(εdisc+εtail+εtrim+εelem+γNq+uout). For ∣C∣≤81 and Nq≤39, pure FP32 (uw=uacc=uout=2−24) gives worst-case error ≤0.1458<0.15<0.5 (and BF16-quantized weights executed in FP32 satisfy ≤0.239<0.24<0.5), formally proving exact carry classification at τ=10m−0.5. Conversely, in BF16 (uout=2−8), worst-case bounds at ∣C∣=81 reach 1.43 under FP32 GEMM accumulation (<0.5 formally only for ∣C∣≤28) and 6.64–14.70 under sequential BF16 summation; hence general floating-point bounds do not imply 1-ULP (0.5) accuracy on C∈[32,81], and the observed 0.12–0.50 BF16 carry drift (∼1% Granite flip rate; Appendix D) is strictly an empirical observation. ∎
A.2 Proof of Theorem 3.3 (Cross-Token Norm Cancellation)
Part 1 (Indefinite-RoPE self-sink GQA quotient over R).
Under rotate-half RoPE (Su et al., 2024), each coordinate pair (m,m+drot/2) applies planar rotation R(tωm)∈SO(2). Setting kbase,m=sgn(wm)∣wm∣g, kbase,m+drot/2=0, qd0,m=∣wm∣gcos(d0ωm), and qd0,m+drot/2=−∣wm∣gsin(d0ωm), orthogonal invariance of R(⋅) gives
Since 0≤d0≤t≤Δmax, every u∈{0,…,t}∖{s∗} (s∗=t−d0) satisfies 1≤∣t−u−d0∣≤Δmax and thus S(t−u−d0)≤−μ<0, while S(0)=1. Every inactive token (cu=0) has Vu=[0,0]⊤ and contributes 0 to both r^t=∑s=0tαt,scsλs and v^t=∑s=0tαt,scsλsxs. When cs∗=1, αt,s∗>0 and λs∗∈[λmin,λmax]⊂(0,∞); dividing numerator and denominator of v^t/r^t by αt,s∗λs∗>0 yields
For each active u=s∗ (cu=1), αt,u/αt,s∗=exp(κattng2λt,q(λu,kS(t−u−d0)−λs∗,k))≤exp(−(1+μ)κattng2λmin,qk2), proving (3). When cs∗=0 and some u0≤t has cu0=0, the softmax denominator satisfies Zt≥e0=1 while Vu0=0 and every active key (cu=1) has logit ≤−μκattng2λmin,qk2<0, bounding ∣r^t∣≤Nactλmaxexp(−μκattng2λmin,qk2).
Part 2 (Memoryless SiLU-antisymmetric Qwen3_5GatedDeltaNet shift).
Setting Wa=0 forces at=Waut≡0, so with Alog=10 and bΔ=10, gt=−e10ln(1+e10)≈−2.20266×105. Over R, ∥egtSt−1∥F≤e−220,265Smax<10−95,660Smax, and in IEEE FP32 or BF16, fl(exp(gt))≡+0.0. Setting egt=0 collapses the state update to St=βtk^tvt⊤, giving pre-norm head output ct=St⊤q^t=(q^t⊤k^t)βtvt∈Rdh. Routing r~t>0 to coordinate 0 of (q,k) at tap δ=0 gives qt=kt=SiLU(16r~t)e0 with SiLU(16r~t)>0, whence γqk,t:=q^t⊤k^t=dh−1/2SiLU(16r~t)2+εSiLU(16r~t)2>0 and βt=σ(512r~t)∈(0,1). For t<δ, zero-padded causal Conv1d yields r~t−δ=0 and u~t−δ(j)=0, so vt=0. For t≥δ, σ(u)+σ(−u)=1 gives the global identity
SiLU(u)−SiLU(−u)=uσ(u)−(−u)σ(−u)=u(σ(u)+σ(−u))≡u.
In V-head vh=2(δ−1), channel pair (2s,2s+1) receives ±21u~t−δ(s) (s=0 carrying r~t−δ=λt−δ>0, s=j≥1 carrying u~t−δ(j)=λt−δxt−δ(j)). Because RMSNormGated divides every channel of head vh by the identical scalar νt=dh1∥ct∥22+ε>0 and multiplies by wnorm,c=0 and SiLU(4r~t)>0, projecting through uniform readout weights (+wnorm,2sαout,−wnorm,2s+1αout) (αout>0, e.g. αout=161) and applying (8) produces yt,s=μtu~t−δ(s) where μt=2νtαoutγqk,tβtSiLU(4r~t)>0 is independent of s. Thus yt,j/yt,0=(μtλt−δxt−δ(j))/(μtλt−δ)≡xt−δ(j). ∎
A.3 Proof of Theorem 3.4 (Width Extension and Schedule-/Tree-Explicit Tied-GEMM Bounds)
Part 1 (Fixed-width projection lower bound over R).
Since 0<E∥h∥22<∞, Σ=E[hh⊤] is symmetric positive definite (σd>0). For any U∈Rd×K with U⊤U=IK and P⊥=Id−UU⊤, symmetry and idempotence of UU⊤ yield E∥h−P⊥h∥22=E∥UU⊤h∥22=tr(U⊤ΣU)≥∑i=d−K+1dσi>0 by Ky Fan’s variational theorem (Fan, 1949).
Part 2 (Axis-aligned width extension, interleaved counterexample, and evaluation-tree GEMM bounds).
For hext=[hNL;hcirc]∈Rd+K whenever ∥RNwNL(hNL)∥2>0 (which entails ∥hNL∥2>0) and γNL=d/(d+K),
where ρ′=∥hNL∥22+dε∥hcirc∥22≤ρ and δε=∥hNL∥22+dεKε≥0. Convexity of f(u)=(1+u)−1/2 on [0,∞) (f′′(u)>0,f′(0)=−21) gives 1−21u≤(1+u)−1/2≤1, proving (5). (Axis-alignment is essential because diag(wext) fails to commute with non-permutation Q∈O(d+K) whenever wNL and wcirc differ.)
Now consider the (d+K)-column tied lm_head GEMM z=Eh~ under unit-offset final norm h~i=fl((1+wi)h^i). On all K−24 non-readout circuit wires i∈/OUT_POS∪OUT_NEG, wi=−1.0 gives exact fl(1.0+(−1.0))=+0.0 and h~i=±0.0. On each readout pair (pm,nm) (m∈{1..12}), fl(1.0+254.0)=+255.0 and fl(1.0+(−256.0))=−255.0 are exact in BF16/FP32. When (pm,nm) receive zero sublayer writes, identical Layer-0 embeddings (Ext,pm=Ext,nm) yield h^pm≡h^nm bit-for-bit and ∣255.0h^pm∣≤255d+K≪3.38×1038 (no norm overflow), so IEEE sign symmetry guarantees h~nm=fl(−255.0h^nm)=−fl(255.0h^pm)=−h~pm bit-for-bit, and Ev,pmh~pm+Ev,nmh~nm=0 over R. In IEEE 754 RN arithmetic with accumulator roundoff uacc and product underflow threshold ηuf:
All inactive rows/steps: Because Ev,pm=Ev,nm=0 for all v∈/{v1..v12} and h~pm=h~nm=0 whenever xt∈/{v1..v12} (and for all m=m∗ when xt=vm∗), every inactive circuit column has exact zero product Ev,ih~i=±0.0 under both standalone multiplication and fma(Ev,i,h~i,s). In IEEE 754 RN, adding ±0.0 to any representable s=0 returns s bit-for-bit with zero rounding error (δ=0,η=0; if s=±0.0, fl(s+(±0.0))=±0.0 still has exact real value 0).
Schedule S1 (Pairwise-first non-FMA + block split): Computing q+=fl(Ev,pmh~pm) and q−=fl(Ev,nmh~nm) without FMA preserves q−=−q+ bit-for-bit by IEEE sign symmetry (including subnormals), and RN addition gives fl(q++(−q+))=+0.0, so ΔzcircS1(v)=+0.0 across all v∈V and fl(z^NL(v)+(+0.0))=z^NL(v) numerically (= bit-for-bit whenever z^NL(v)=−0.0).
Schedule S2 (Contiguous tail after z^NL): On active row vm∗=xt, let qexact:=Evm∗,pm∗h~pm∗ (so Evm∗,nm∗h~nm∗=−qexact over R). In IEEE 754 arithmetic with gradual underflow, addition/subtraction of representable numbers is exact whenever the result subnormalizes (Higham, 2002, Thm. 2.5), so fl(a+b)=(a+b)(1+δadd) (∣δadd∣≤uacc, zero addition underflow), while multiplication or FMA introduces at most ∣ηr∣≤ηuf (r∈{1,2}). Appending +qexact then −qexact sequentially after z^NL produces s1=(z^NL+qexact(1+δm1)+η1)(1+δ1) and s2=(s1−qexact(1+δm2)+η2)(1+δ2) (with δm1=δm2=0 under FMA, or δm1=δm2 by sign symmetry without FMA). Expanding s2−z^NL bounds the z^NL error by ∣z^NL∣[(1+uacc)2−1]≤γ2∣z^NL∣, the qexact residual by ∣qexact∣⋅2uacc(1+uacc)≤γ2∣qexact∣ (since 2u(1+u)≤1−2u2u=γ2 for all u∈[0,21)), and underflow by [(1+uacc)2+(1+uacc)]ηuf≤2(1+γ2)ηuf.
Failure of two-step bounds under NL interleaving (explicit FP32 counterexample): Suppose NL terms p1,…,pd are accumulated between +qexact and −qexact in left-to-right order [+qexact,p1,…,pd,−qexact]. In IEEE FP32 (uacc=2−24), set d=100, pj=1.0 for all j∈{1..100} (zNLR=100.0), and qexact=224=16,777,216.0 (0x4b800000, even LSB, ulp(224)=2.0). At every intermediate step, 224+1.0 lies on the tie-to-even midpoint and rounds back to fl(224+1.0)=224, after which fl(224−224)=+0.0. The actual error ∣z^seq−zNLR∣=100.0 exceeds the naive two-step bound 2uacc(∣zNLR∣+∣qexact∣)≈2.000012 by 50× because +qexact absorbs d=100 rounding steps before −qexact arrives.
Valid bound over an arbitrary binary evaluation tree T: Let T be any binary reduction tree over the d+K columns of active row vm∗=xt. Contracting the K−2 exact-zero (±0.0) circuit leaves—each of which passes its sibling value through with zero rounding error (δ=0,η=0)—reduces T to a binary tree T′ of height hT≤d+1 over the d+2 potentially non-zero products {a1,…,ad+2}={Evm∗,1h~1,…,Evm∗,dh~d,+qexact,−qexact}. Along the path of length kr≤hT from leaf r to the root of T′, standard multiplication plus kr IEEE additions contributes ar(1+δr,0)∏j=1kr(1+δr,j)+ηr∏j=1kr(1+δr,j) (∣δr,j∣≤uacc, ∣ηr∣≤ηuf, zero addition underflow; fusing leaf r’s multiply into its first addition via FMA drops δr,0 and is strictly dominated). Summing over r=1,…,d+2, using ∑r=1d+2ar=zNLR(vm∗)+qexact−qexact=zNLR(vm∗), and applying Higham’s Lemma 3.1 (Higham, 2002, Sec. 3.1, 4.2) (∏j=0kr(1+δr,j)−1≤γkr+1≤γhT+1 and ∏j=1kr∣1+δr,j∣≤1+γhT for (hT+1)uacc<1) yields (6): z^Tacc(vm∗)−zNLR(vm∗)≤γhT+1(∑j=1d∣Evm∗,jh~j∣+2∣qexact∣)+(d+2)(1+γhT)ηuf. On our FP32 counterexample (hT=101), (6) gives 204.002≥100.0. On Qwen 3.5 active digit rows (∑j=1d∣Evm∗,jh~j∣≈33.29, ∣qexact∣≈0.074, uacc=2−24), (6) gives <2.8×10−5 nats under balanced binary reduction (hT≤⌈log2(d+K)⌉=13; empirical max 2.4×10−7) and <5.2×10−3 nats under worst-case sequential interleaving (hT=d+1=2561; <1.03×10−2 nats even if uncontracted zero leaves h=5114 are counted; empirical max 3.3×10−6). ∎
Appendix B Paired 60-Item Attribution of Off-Manifold Tokenization vs. Canonical Base-1000 BPE Emission
Under single-digit readout (K=1,043 emitter ablation), Alibaba Qwen 3.5 4B (whose pretrained tokenizer natively splits ASCII digits into 1-digit tokens) exhibited zero multi-step reasoning degradation on 3-shot GSM8K, whereas IBM Granite 4.2 3B dropped by −31.67 pp from 41/60 (68.33% under unpadded sequential decoding, batch_size = 1; note that left-padded batch_size = 8 BF16 decoding flips 1 borderline item on unmodified Base Granite to 42/60=70.00%, whereas Canonical Base-1000 Grafted Granite scores 42/60=70.00% under both batch_size = 1 and batch_size = 8) to 22/60 (36.67%). To isolate the exact causal mechanism, we executed a paired item-level trace across all 60 items (batch_size = 1, zero padding) logging pretrained vs. grafted token IDs, internal ALU registers (VALID_EQ, ANS_DIGS, ANS_LEN), and per-step maxv∣Δzcirc(v)∣.
B.1 Paired Contingency Matrix and Exact Sub-Mechanism Attribution
Across GSM8K test[:60], the exact paired contingency matrix between Base Granite 4.2 3B and the 1-Digit-Emitter Graft (K=1,043) is (b11,b10,b01,b00)=(22,19,0,19): every loss comes from b10=19 regressions with b01=0 gains. Inspecting internal ALU registers across all 19b10 items reveals a decisive result: on 18/19 (94.7%) regressions where the graft activates, the internal circuit computes and emits 100% mathematically exact arithmetic values, yet downstream reasoning fails because the 1-digit emitter outputs multi-digit results as unmerged 1-digit BPE tokens (e.g., [’6’,’4’], [’1’,’8’,’0’], [’1’,’2’,’4’,’5’]) that never appear in Granite’s 1–3 digit BPE pretraining distribution:
Sub-Mechanism A — Decimal/version-string mis-copy (5/19 items: idx = 5, 28, 42, 57, 59): Because sequences of separate single-digit tokens in Granite’s pretraining corpus occur almost exclusively across punctuation-separated decimals or version strings, Granite’s answer-copying heads insert dots between unmerged digits: [’6’,’4’] ↦ #### 6.4 (idx=5), [’2’,’5’] ↦ #### 2.5 (idx=28), [’2’,’6’] ↦ #### 2.6 (idx=42), [’1’,’8’,’7’] ↦ #### 1.8 (idx=59), and remarkably [’1’,’2’,’4’,’5’] ↦ floor(1.2.4.5 / 15) (idx=57).
Sub-Mechanism B — Multi-chunk induction span mis-indexing (9/19 items: idx = 4, 6, 10, 18, 26, 34, 49, 53, 55): Granite’s pretrained induction heads expect a 2–3 digit integer to occupy one token and a 4–6 digit integer to occupy two tokens. Confronted with k separate 1-digit tokens, Granite either copies only the leading token ([’8’,’0’] ↦ 2 * 8 = 16 on idx=6) or maps a k-token span to a k-chunk BPE number ([’2’,’5’] ↦ [’2’,’25’] = 225 on idx=34; [’2’,’8’] ↦ 228 / 2 = 114 on idx=55; [’8’,’4’] ↦ 840 / 12 = 70 on idx=18; [’1’,’8’,’0’] ↦ 1800 on idx=10; [’5’,’2’,’0’] ↦ 5200 on idx=53; [’1’,’2’,’0’] ↦ 1201 on idx=49; [’1’,’2’,’6’] ↦ 1243 on idx=26; [’6’,’0’] ↦ 6000 on idx=4).
Sub-Mechanism C — Off-manifold surprisal / self-doubt loops (4/19 items: idx = 30, 43, 46, 47): High token-level surprisal on unmerged digits triggers Granite’s self-correction behavior against its own exact arithmetic ("5 * 250 = 1250? Wait, that’s wrong" on idx=43; "7*9=63? Wait, that’s too high" on idx=30; "2 * 5 = 10 ... + 1000? Wait" on idx=47; "80 - 220 = -140? That’s not right" on idx=46).
Sub-Mechanism D — Non-trigger BF16 trajectory drift (1/19 item: idx = 11): Zero circuit triggers fire (gen_triggers = 0) because all equations carry prefixes(3dozen∗68 = 204);slight\operatorname{RMSNorm}BF16roundingaltersGranite’sunguidedtrajectory(204+160+330\mapsto$794$).
Controlled causal proof on unmodified Base Granite 4.2 3B.
To verify that Sub-Mechanisms A–C stem solely from off-manifold 1-digit token IDs rather than any weight perturbation in the grafted model, we fed identical text prefixes into unmodified pretrained Base Granite 4.2 3B, varying only the tokenization of the final integer before model.generate:
Table 9: Item-level recovery across all 19 former b10 GSM8K regressions on Granite 4.2 3B after replacing the off-manifold 1-digit emitter (K=1,043) with the zero-gradient Base-1000 Canonical Multi-Digit BPE Chunk Emitter (K=1,140, batch_size = 1). 18/19 (94.7%) regressions recover to exact gold answers.
Full-split held-out GSM8K validation and the bare-prompt chunk-echo tradeoff.
Evaluating the Canonical Base-1000 chunk emitter across three GSM8K splits confirms full recovery and formal noninferiority: test[:60] rises from 36.67% (1-digit emitter) to 70.00% (42/60; b10=0 losses vs. Base), untouched test[60:200] (N=140) improves from 68.57% to 70.71% (Δ=+2.14 pp, Tango 1-sided 95% LB =−1.15 pp, pNI@3pp=0.0085), and prose-formatted test[60:160] (N=100) improves from 70.00% to 74.00% (Δ=+4.00 pp, Tango LB =−0.04 pp). On bare context-free equations, canonical multi-digit emission trades −2.33 pp on Arith-1200 (99.42%→97.08%): because multi-digit BPE chunks ([’5’,’227’]) sit inside Granite’s induction distribution, after disengagement (Δzcirc=0) on bare prompts ("5284 + -57 = "), the base LM echoes a prompt chunk ("522784") on ∼2.3% of bare equations, whereas prose-anchored formats remain at 99.38% (prose_notrail) and 98.0% (InlineRes-50, AutoCoT-50).
Appendix C Extended Component Ablations, False-Trigger, Multi-Seed, Boundary, and Generation Tables
Tables 10, 11, 12, 13 and 14 report the complete component ablations (A0–A5 and Q_A0–Q_A6), 17-category N=10,500 false-trigger stress suite, 4-seed N=3,000 and 180-item boundary suites, 4-template ARC-Challenge noninferiority audit, and 80-prompt open-ended generation quality evaluations.
Table 10: Controlled component ablations on Granite 4.2 3B (A0–A5) and Qwen 3.5 4B (Q_A0–Q_A6) in native BF16 (N=150 unseen arithmetic, N=1,100 out-of-domain adversarial suite, N=50 inline resumption, and 30-/25-doc subset PPL & next-token KL).
Table 11: Complete 17-category N=10,500 false-trigger stress test plus 140-item boundary abstention suite in native BF16. A prompt triggers iff maxv∣Δzcirc(v)∣>0.5 nats. Every genuinely out-of-domain category exhibits isolated circuit readout maxv∣ΔzcircS1(v)∣=0.0 across both canonical grafts (≤γhT+1 bound (6) inside full FP32-accumulated GEMMs on Qwen 3.5 active digit rows), including left-only currency a+b=(50/50\to 0/50$ resolved via symmetric CURR_SYM).
†In adv_overflow_mul_deg6plus, 400/500 prompts satisfy deg(A)+deg(B)≥6 and abstain 100%; 100/500 ((4,3) and (3,4) digit pairs) satisfy deg(A)+deg(B)=5≤5 (valid 7-digit in-domain products). ‡Similarly, 6/30 items in mul_deg6_abstain (9999100, 9999999) have deg(A)+deg(B)=5≤5 and compute exact products, while all 24/24 true deg≥6 items abstain with bit-exact 0.0.
Table 12: Multi-seed (N=3,000) and boundary-regime (N=180) arithmetic evaluation across 4 random seeds and 8 surface formats in native BF16 and IEEE FP32.
∗On Seeds 2–4, 6/8 standard unparenthesized formats achieve 225/225 (100.0%) internal ALU exactness in FP32 on both models; the two stress formats intentionally probe unspaced binary-unary "888+-25=" (merged by BPE into "+-", triggering clean parser abstention) and open-parenthesis "(-97 + 6 = " (triggering the (-guard or trailing ")" closure).
Table 13: Prompt-template noninferiority across four distinct formatting styles on ARC-Challenge (test[550:750], N=200 per template, BF16), reporting Tango one-sided 95% lower bounds LB95%(Δ) and formal noninferiority p-values at δNI=3.0 pp.
Table 14: Open-ended 48-token greedy generation quality (N=80 diverse analytical, scientific, news, and coding prompts) comparing unmodified BF16 baselines against canonical grafted checkpoints.
Model (BF16) Exact 48-Tok Match Mean Identical Prefix Token ROUGE-L F1 Distinct-2 (Base → Graft) Distinct-3 (Base → Graft) 4-Gram Rep. (Base → Graft) IBM Granite 4.2 3B 50.0% (40/80) 33.94/48 toks 80.55%0.6596→0.65080.7861→0.77459.25%→9.78% Alibaba Qwen 3.5 4B 77.5% (62/80) 41.62/48 toks 91.12%0.5412→0.53010.6228→0.61092.06%→2.42%
Appendix D Register-Level Analysis of Internal BF16 Carry ULP vs. Post-Disengagement Failures
To separate internal finite-precision circuit errors from post-disengagement language-model continuation, Table 15 records the exhaustive register-level trace across all 14/2,400 failures observed on the N=1,200 unseen 1–6 digit signed {+,−,×} suite (seed=20261112) under 1-digit readout (1,193/1,200=99.42% on both Granite 4.2 3B [K=1,043] and Qwen 3.5 4B [K=2,555]), logging VALID_EQ, A_DIGS, B_DIGS, ANS_DIGS, and per-step maxv∣Δzcirc(v)∣ in both FP32 and BF16. Under Granite’s canonical Base-1000 BPE emitter (K=1,140; Section 5), widening L1/L3/L4 passbands resolves G2 ("99939-3=" ↦ "99936"), while Mechanism I post-disengagement continuation accounts for the gap between exact internal ALU prefix emission and bare-prompt Leading-Integer (97.08%) / Strict Non-Decimal (89%–90%) accuracy.
In all 7/7 Qwen 3.5 failures (Q1–Q7) and 1/7 Granite failure (G1), the grafted ALU computes the exact mathematical integer in ANS_DIGS (1,200/1,200=100.00% internal ALU accuracy on Qwen 3.5 in BF16), emits every true output token with circuit logit boost +66 to +10,293 nats, and drops maxv∣Δzcirc(v)∣ cleanly to bit-exact 0.0000 at the immediately following decode step. On compact or double-negative prompts lacking prose context (e.g., 5853- -5258=, -574609- -490851=, 297583 + -8 =), once control returns to the unguided base LM (z=zNL), single-digit tokens carry no trailing word-boundary marker, and the base LM greedily predicts one extra digit (e.g., trailing ’0’, ’6’, or prompt echo ’83’ in G1). Whenever expressions appear inside natural-language sentences (prose_trail N=240, InlineRes N=50), surrounding prose anchors the base LM toward punctuation or words, yielding 100.0% accuracy on Qwen 3.5. Our circuit omits a forced trailing space after the units digit so inline expressions followed by punctuation ("= 42.") continue naturally.
On G2 ("99939-3="), tokenized without BOS as t0="999", t1="39", t2="-", t3="3", t4="=", position t0=0 exhibits a massive position-0 hidden-state norm spike (RMS surge when no BOS token absorbs the attention sink (Sun et al., 2024)), attenuating the 3-digit length tag NUM_LEN=3 fetched from t0 below the τ=2.5 threshold of islen1,2 in Layer 2. Consequently, VALID_EQ=0.0000 in both FP32 and BF16: the circuit cleanly abstains (max∣Δzcirc∣=0.0 at every step) rather than corrupting logits, and prepending any delimiter or BOS token restores exact output 99936.
Table 15: Register-level breakdown of all 14/2,400 BF16 evaluation failures (7 Granite 4.2 3B, 7 Qwen 3.5 4B), comparing internal ALU registers at =, FP32 vs. batched KV-cached BF16 outputs, post-answer circuit disengagement (Δznext), and root mechanism.
Appendix E Design Trade-Offs: In-Weight Execution, Subspace Capacity, and Scope
This appendix examines five design trade-offs that arise when embedding exact digital computation into pretrained language models.
E.1 In-Weight Compilation vs. External Tool Routing
When an inference stack can freely pause decoding and invoke a host Python interpreter, regex- or program-aided tool routing (Gao et al., 2023; Schick et al., 2023) is straightforward and incurs zero weight overhead; we include it as a direct baseline in Tables 1 and 4. Compiling computation into weights serves a complementary regime and answers a distinct mechanistic question: whether normalized, bias-free pretrained Transformers can execute multi-step digital algorithms natively without gradient training. In practice, in-weight execution provides three properties that host tool wrappers do not: (1) single-checkpoint closure inside standard safetensors tensors (roundtrip_bit_identical = True), allowing deployment in air-gapped, sandboxed, or pure-tensor runtimes where arbitrary host code execution is disallowed; (2) uninterrupted KV-cache batching during mid-sentence generation (98%–100% inline resumption), avoiding per-sequence stop-token interrupts across batched requests; and (3) block-sparse sidecar decomposability (Section G.4), where axis-aligned zero cross-weights allow WNLh~NL⊕Wcirch~circ execution with +0.039% / +0.056% active arithmetic MACs (7.89 / 10.65 GiB on A100 in pure PyTorch, or 4.60 / 8.14 GiB with INT4-quantized WNL and an FP32 sidecar; Table 3).
E.2 Width Extension (d+K) vs. Fixed-Width Subspace Projection (P⊥)
Prior circuit-injection work such as Tracr-Injection (Vergara-Browne and Soto, 2025) vacates a K-dimensional subspace inside Rd via linear projection P⊥=Id−UU⊤ and then recovers language-modeling performance through gradient-based distillation. Under a strict zero-gradient constraint, however, pretrained residual covariances have strictly positive trailing eigenvalues (σd>0, Theorem 3.4(1)): even vacating a small Tracr-scale subspace (K=48, 1.88% of d=2560) without distillation increases next-token KL divergence by 43×–69× relative to full-ALU width extension (K=1,140). Conversely, holding dense width fixed at d+K across matched-budget controls (M1–M4, Table 5) shows that extra width alone provides zero arithmetic gain (M1: 24.7% / 73.3%), single-scale gates fail under dynamic RMSNorm swings (M2), omitting d/(d+K) norm compensation degrades language modeling (M3: 412×–2,948× KL increase), and non-axis-aligned orthogonal rotations (M4) mix circuit coordinates into diagonal RMSNorm gains.
E.3 Abstraction Layers: Primitives, Declarative Synthesis, and Reference Patches
Our software stack separates low-level analytical gate primitives from automated circuit compilation and frozen replication artifacts (Sections 4 and G.1). At the bottom layer, MellinSwiGLUBank, Chebyshev Indefinite-RoPE (GQAAttnCompiler), DeltaNetShiftCompiler, d/(d+K) norm compensation, and differential tied readouts provide backbone-reusable building blocks across SwiGLU/GeGLU, RoPE-GQA, and GatedDeltaNet layers. At the middle layer, our 5-stage declarative compilers (compile_declarative_arithmetic in src/circuits/arithmetic_auto/ and DeclarativeDAGScheduler in src/circuits/boolean/) introspect model.config and tokenizer.get_vocab() automatically, allocate all symbolic wires and PreStepRingPool buffers without manual register IDs, and assign all routing hops and 2-layer Mellin gates via sublayer-tick ASAP topological scheduling (ℓmlp=⌊τ/2⌋, ℓattn=⌈τ/2⌉). Without modifying the underlying primitive modules, this pipeline synthesizes parameterized D∈{4,6,8}-digit multi-chunk BPE arithmetic (14, 51, and 176 chunk compositions on Granite 4.2 in constant 39-layer TC0 depth, plus 6-digit hybrid GatedDeltaNet arithmetic on Qwen 3.5 with 5.6%–19.5% fewer active non-zeros than hand-packed layouts; Table 18), 3-literal precedence Boolean logic (N=1,728, 100%), and 5-bit Majority/Parity voting (N=64, 100%). At the top layer, SHA-256-pinned reference patches (patches/*.safetensors) allow standalone cross-hardware auditing without invoking the compiler at load time (Appendix F).
E.4 Deterministic Prefix Exactness vs. Post-Answer Continuation
Because grafted circuits write nonzero logit deltas only while emitting the target result and drop cleanly to Δzcirc=0.0 immediately afterward, downstream behavior reflects the interaction between emitted token IDs and the unmodified base LM’s priors (Tables 4, B and D). Two phenomena follow directly from this handoff: (1) When an emitter outputs unmerged 1-digit token IDs on a backbone trained with 1–3 digit BPE merges (Granite 4.2), internal ALU outputs remain exact on 18/19 GSM8K regressions, yet the base model misinterprets off-manifold 1-digit sequences as decimal or multi-chunk spans; emitting canonical Base-1000 triads aligns the output with Granite’s pretrained BPE distribution (35%–36%→73%–74% GSM8K). (2) On bare context-free equations lacking surrounding words (e.g., "5284 + -57 = "), returning control to zNL without forcing a synthetic EOS token leaves the base model free to append a decimal continuation (.xxxx) or echo a prompt chunk, whereas prose-embedded expressions anchor continuation toward natural punctuation or text (98.25% / 99.75% strict non-decimal accuracy and 98%–100% inline resumption).
E.5 Norm Calibration, TC0 Depth Budgets, and Cross-Hardware Portability
Graft synthesis uses zero gradient steps and zero task-labeled examples. While default patches center Mellin windows using 2L+1 forward-only activation-norm medians (<330 bytes; Appendix F), 16 digit-free news sentences (C1) and a 0-token closed-form weight-norm estimate (C2) preserve 96.3%–99.7% arithmetic accuracy (Table 5). Theoretically, fixed-depth passes with memoryless shifts (egt≡0) lie in uniform TC0 (Merrill and Sabharwal, 2023; Merrill et al., 2024), which includes integer division (Hesse et al., 2002); as shown in Section G.2, 6-digit ⌊A/B⌋ compiles into 8 layers via a 64-knot Mellin reciprocal spline and one Newton–Raphson step (100.0% exact in an FP32 sidecar), whereas unbounded halting loops require recurrent trace emission (Giannou et al., 2023; Tzamos and Percepta Research, 2026). Finally, standalone .safetensors patches reproduce identically across Apple Silicon (mps) and Linux NVIDIA A100 (cuda) hosts without importing compiler code (Table 16).
Appendix F Reproducibility, Calibration Provenance, and Cross-Hardware Patch Portability
All compilations, ablations, register-level traces, and cross-hardware blind patch evaluations were executed from pinned HuggingFace safetensors snapshots with strict runtime isolation assertions.
F.1 Compute Environments, Batch-Padding Reconciliation, and Kernel/GEMM Audits
Cross-hardware evaluation environments: 1. Local workstation (arm64 macOS): Apple Silicon unified-memory host (48 GB RAM; Metal mps backend for BF16 evaluations and Apple Accelerate AMX cpu backend for IEEE FP32 checks), Python 3.12, PyTorch (bfloat16/float32), HuggingFace transformers, safetensors, and cached datasets. 2. Linux CUDA servers (x86_64): Separate Linux (x86_64) hosts running (a) Python 3.12.3, PyTorch 2.13.0+cu130 on an NVIDIA A100-SXM4-40GB (40 GiB HBM2) for standalone patch evaluation (run_external_cuda_replication.py, zero compiler source files imported), and (b) Python 3.11.11, PyTorch 2.8.0+cu128 (TorchInductor Triton + SDPA FlashAttention-2) on an NVIDIA A100-PCIe-80GB (80 GiB HBM2e) for factorized SparseSidecar, Hybrid INT8/INT4 + FP32-sidecar PTQ, 5-primitive leave-one-out, LoRA SFT, 4-scheme tokenization, decoding/IFEval/safety, and Gemma 4 E4B architectural audits (run_round2_a100_suite.py). Qwen 3.5 on both A100 servers ran PyTorch’s reference GatedDeltaNet path, confirming numerical exactness without custom Triton state-space extensions.
Direct CUDA SiLU kernel and cuBLAS tied-lm_head GEMM verification: On the NVIDIA A100-SXM4-40GB (cuda), PyTorch ATen F.silu(-z) reaches IEEE-exact -0.0 at z≥89 in both FP32 and BF16 (confirming Kernel Class K1 in Theorem 3.2(3)), while verify_v4_submission_audit.py independently checks range-split stable sigmoid kernels (Kernel Class K2: exact -0.0 at z≥104 in FP32, z≥98 in FP32→BF16, and z≥93 in pure BF16). Auditing Qwen 3.5’s 248,320×5,115 tied lm_head GEMM on A100 cuBLAS confirms maxv∣Δzcirc(v)∣=0.0 on both non-digit prompts ("The sky is blue") and digit-ending non-trigger prompts ("In the year 2026", 0/248,320 differing rows within the 5,115-column GEMM), while Theorem 3.4(2) (Equation 6) bounds arbitrary binary evaluation-tree interleaving and FMA ordering on active Layer-0 digit rows by γhT+1 (<2.8×10−5 nats balanced, <5.2×10−3 nats worst-case sequential in FP32).
Exact reconciliation of Granite GSM8K test[:60] baseline (68.33% vs. 70.00%): Under unpadded sequential decoding (batch_size = 1, used in the paired item-level trace of Appendix B), unmodified BF16 Base Granite 4.2 3B scores 41/60=68.33%, whereas under left-padded batched decoding (batch_size = 8, used in Table 7), BF16 reduction order flips 1 borderline item on Base Granite to yield 42/60=70.00%. Canonical-BPE Grafted Granite scores 42/60=70.00% under both batch_size = 1 and batch_size = 8.
Exact provenance of the 2L+1 pre-RMSNorm calibration scalars: Compilation performs zero gradient updates and uses zero supervised target labels. In the frozen patches, Mellin quadrature windows are centered using 2L+1 forward-only scalar activation-norm medians: 1. granite_graft_calib.pt (81.1 MB total): Orthogonal grafting reads only 81 scalar medians (40 rms_in_med, 40 rms_post_med, 1 rms_final_med; 324 bytes in float32) recorded via @torch.no_grad() forward hooks over 48 unlabeled train-split prefixes (gsm8k train[:24] + ARC-Challenge train[:24], strictly disjoint from all test/validation splits). The remaining 99.999% of granite_graft_calib.pt stores the 2560×2560 covariance SVD basis used exclusively for the fixed-width subspace projection baseline. 2. qwen35_graft_calib.pt (23.4 KB): Stores 65 scalar medians (32 in_rms_med, 32 post_rms_med, 1 final_rms_med) recorded via @torch.no_grad() forward hooks over 32 unlabeled general-domain passages (build_ppl_corpus_ids[:32]). 3. Zero-math and zero-token calibration audit (Table 5): Replacing these frozen scalars with 2L+1 medians from 16 strictly digit-free ag_news sentences (0 digits, 0 math symbols; C1) or a 100% data-free closed-form weight-norm propagation (C2, 0 input tokens, 0 forward passes) confirms that task-related prompts are unnecessary.
Ragged vs. uniform-padded HuggingFace serialization: Layer-trimmed ragged MLPs (7.23B Granite, 10.22B Qwen 3.5) and uniformly zero-padded MLPs (10.24B Granite, 13.18B Qwen 3.5, padded to maxℓdff,ℓ as required by unmodified AutoModelForCausalLM.from_pretrained) produce bit-identical logits (max∣Δz∣=0.0 across save_pretrained → from_pretrained round-trips) and were benchmarked end-to-end on the 40 GB NVIDIA A100 (Table 3).
F.2 Cross-Hardware Blind Patch Reproducibility and SHA-256 Manifest
Table 16: Cross-hardware patch reproducibility from frozen sparse .safetensors patches (seeds 31415926, 27182818; zero compiler imports) on Apple Silicon (mps) and a Linux NVIDIA A100-SXM4-40GB (cuda) host. ¶FP32 (allow_tf32=False): 100.0% ALU (5/5 G3–G7).
F.3 Reproduction and Minimal Demonstration Commands
1. CPU demo of reusable primitives, automated compiler, & live patches python demo_minimal.py --mode primitives python demo_minimal.py --mode auto_compile python demo_minimal.py --mode granite --device mps # or --device cuda / cpu python demo_minimal.py --mode qwen --device cuda # or --device mps # 2. Numerical constant, SiLU-kernel, & evaluation-tree GEMM counterexample checks python eval/verify_icml2027_gemm_and_proofs.py # 3. Standalone patch-only blind reproducibility (MPS/CPU or Linux NVIDIA CUDA) python eval/run_blind_replication.py --patches-dir patches --device mps python eval/run_external_cuda_replication.py --patches-dir patches --device cuda
Appendix G Automation, Activation/Gemma-4 Audits, Kernel/TC0 Scaling, Retention/LoRA/Tokenization, and Block-Sparse Sidecar Runtime
This appendix provides full technical specifications and disaggregated audits for: (1) the 5-stage automated declarative synthesis pipeline across parameterized 4–8 digit multi-chunk BPE arithmetic, propositional Boolean logic, residual-erasure wire reuse, 5-bit Majority/Parity TC0 voting, and 42-layer Gemma 4 E4B activation/architectural failure modes (Section G.1); (2) inference-stack portability (TorchInductor, SDPA FlashAttention-2, TF32, FP16 clamping), 8-layer TC0 Newton–Raphson 6-digit division, and 6–18 digit scaling projections (Section G.2); (3) pre-registered N=4,392 long-context retention, 5-primitive leave-one-out ALU ablations, same-backbone LoRA SFT, 4-scheme numeric tokenization, and 5-regime decoding/IFEval/safety audits (Section G.3); and (4) the implemented factorized SparseSidecar + Hybrid INT8/INT4 PTQ runtime (Section G.4).
G.1 Five-Stage Automated Declarative Synthesis for Multi-Digit Arithmetic and Boolean DAGs
End-to-End Automated Synthesis from Specification to Sparse Checkpoint Patch. In addition to the frozen hand-scheduled reference patches (Section 4), we implement a general 5-stage declarative compiler (compile_declarative_arithmetic in src/circuits/arithmetic_auto/ and DeclarativeDAGScheduler in src/circuits/boolean/) on top of 100% unmodified mellin_primitives.py and qwen35_deltanet_shift.py, eliminating manual wire IDs, hardcoded layer indices, and hand-written BPE tables:
Stage 1 — Automatic Config & BPE Lexer Introspection (BackboneProfile, AutoNumericLexer): Given (DeclarativeArithmeticSpec(D),model.config,tokenizer), the lexer scans tokenizer.get_vocab() to detect maximum canonical ASCII digit-chunk width M∈{1,3}, enumerates all canonical chunk-length compositions (c1,…,cr) with 1≤∑ci≤D via dynamic programming (14, 51, and 176 compositions on Granite 4.2 for D∈{4,6,8}; 6 compositions on Qwen 3.5 for D=6), factors them into unique (lag,offset) descriptors, and synthesizes closed-form right-aligned Base-10M output chunking lchunk(r)=((r−1)modM)+1 for remaining digit count r∈{1,…,D+1}.
Stage 2 — Sublayer-Tick ASAP Topological Levelization (UnifiedDAGCompiler): Representing routing and MLP sublayers of Transformer block ℓ∈{0,…,L−1} by ticks 2ℓ and 2ℓ+1, every symbolic gate schedules automatically at its earliest dependency-valid layer (ℓmlp=⌊τdep/2⌋, ℓattn=⌈τdep/2⌉), tracking commutative residual accumulation (RAW) and in-place carry updates (WAR) without hardcoded layer numbers. On Granite 4.2, ASAP levelization overlaps emitter prefix-distance resolution with carry-save ALU waves, completing in 39 layers (L0–L38, 1 layer shallower than the hand-scheduled L0–L39 patch) across all D∈{4,6,8}.
Stage 3 — Symbolic SSA Wire Allocation and PreStepRingPool Sizing: All persistent registers and Stage-1 pre-step intermediates are allocated dynamically and trimmed tightly to K=wmax+1. Comparing write-once SSA (ssa_pre_step_pool=True) against 5-layer −3231 ring reuse (False) shows that pure SSA reduces active non-zeros by 19.5% on 6-digit Granite (1.33M→1.07M nnz; 57.4K vs. 139.6K neurons) and 5.6% on Qwen 3.5 (2.39M→2.25M nnz, while also trimming K from 2,555→2,528 by eliminating static block-padding gaps).
Stage 4 — Automatic Multi-Hop Shift Lowering: Abstract shift requests pack automatically into 5:1 Chebyshev Indefinite-RoPE KV groups (GQAAttnCompiler) on dense GQA backbones, or decompose into multi-hop δ∈{1,2,3} cascades batched up to 63 channels per V-head (GatedDeltaShiftCompiler) across linear-attention layers while skipping all 8 full-attention layers ({3,7,…,31}) on Qwen 3.5, achieving exact L0–L31 critical-path completion.
Stage 5 — Unlabeled Norm Calibration & Sparse COO Emission: Layerwise pre-RMSNorm medians are optionally measured in <1.8 s on 8 short neutral English sentences (auto_calibrate_rms_medians), and the compiler emits standard sparse COO .safetensors patches directly loadable by SparseSidecarGranite and SparseSidecarQwen35 (Table 18).
Table 18: Automated 5-stage declarative multi-digit arithmetic synthesis (compile_declarative_arithmetic) vs. hand-scheduled reference patches, evaluated end-to-end via SparseSidecar (FP32 / BF16 sidecar) with from-scratch unlabeled 8-sentence calibration (auto_calibrate_rms_medians) across D∈{4,6,8} digits on granite-4.2-3b and D=6 digits on Qwen3.5-4B.
∗A100 Arith-180 from Table 3. †Arith-300/100/150 mixes 3/5 BOS-less t0=0 bare templates (Table 6a) with 2/5 prefixed templates (98.0% on Inline-50, 100% step-1 disengagement, max∣Δzcirc∣=0.0 across all 200 OOD prompts). Notice constant 39-layer TC0 depth (L0–L38) across D∈{4,6,8} on Granite 4.2.
Independently Specified Non-Arithmetic Circuit: Precedence-Respecting Boolean Evaluation. To test whether our analytical primitives overfit base-10 positional arithmetic, we compiled a non-arithmetic circuit evaluating all 3-literal propositional formulas with optional unary negation and standard operator precedence (NOT>AND>OR,XOR):
using 100% unmodified mellin_primitives.py (SHA-256 14221557...) and qwen35_deltanet_shift.py (SHA-256 185c5bea...). Unlike fixed-offset binary arithmetic, optional NOT modifiers vary total formula span between 5 and 9 tokens before =, non-monotone parity requires exact bilinear cancellation (XOR(a,b)=a+b−2ab), right-hand OP2=AND overrides left-to-right evaluation (L1OP1(L2∧L3) vs. (L1OP1L2)OP2L3), and trailing whitespace ("= ") triggers massive attention-sink RMSNorm spikes (10×–50×) in pretrained LMs—handled cleanly by evaluating the full precedence DAG on = and shifting (VALID_BOOL,RESULT_BOOL) by δ=1 onto trailing whitespace with wide sink-safe Mellin bounds (K−=−24,K+=48). Both circuits compile in <0.8 s (109 scheduled gates; K=296, 0.44M nnz [0.012%], Lfinal=16/40 on Granite 4.2; K=311, 1.03M nnz [0.024%], Lfinal=17/32 with 4/24 GatedDeltaNet and 0/8 attention layers on Qwen 3.5).
Table 19: Declarative propositional Boolean circuit evaluation across the exhaustive 576-formula truth table under 3 prompt templates (N=1,728), the OP2=AND=OP1 precedence-override subset (N=384), mid-sentence inline resumption (N=40), 6-category out-of-domain & near-miss abstention (N=600: SWE-bench, MMLU-Pro, 4-literal chains, parenthesized formulas, Python ==/and/or, and arithmetic =), and paired ARC-Challenge retention (N=200, BF16).
∗Immediate post-answer disengagement (Δzcirc=0.0 on the token immediately following True/False) holds on 40/40 (100.0%) prompts on both models (97.5% / 100.0% fluent continuation); on 8/40 prompts per model, the LM’s continuation voluntarily writes a valid simplified 3-literal equation ending in = (e.g., True OR True OR True =), which the circuit evaluates faithfully. †Under strict 3-token immediate Boolean extraction; Base Qwen 3.5 initiates verbose reasoning/prose prefixes before stating a truth value.
Residual-Erasure Wire Reuse and Additional TC0 Voter Circuit. Unlike register-overwrite CPUs, Transformer residual streams evolve additively (hℓ+1=hℓ+Δℓ): reassigning wire w after its last consumer layer ℓend(w) without clearing its prior payload corrupts subsequent threshold gates. Pairing interval-graph liveness coloring with PreStepRingPool(write_once=False) (5-layer −3231 Mellin linear decay reducing residual amplitude to 2−25<3×10−8) trims Boolean width K by 7.43% on Granite (296→274; transient pool 109→89, persistent intermediates 23→21) and 7.07% on Qwen (311→289) while adding +555 erasure pass operations—matching the multi-digit arithmetic trade-off in Table 18, where write-once SSA minimizes active nnz (1.07M vs. 1.40M on Granite; 2.25M vs. 2.47M on Qwen) for SparseSidecar execution while ring reuse lowers width K (1,735→1,302 and 2,528→2,348) when materializing dense matrices. Using unmodified primitives, we also compile a second non-arithmetic TC0 circuit—a 5-bit Majority & Exact Parity voter (9 scheduled gates across 5 layers, K=22 wires, combining threshold voting 1[∑i=15bi≥3] with cascaded bilinear parity)—achieving 64/64=100.0% exhaustive exactness across 250× random BF16 RMSNorm swings. Beyond bounded-length TC0 DAGs, unbounded-length input streams and data-dependent while loops require recurrent multi-step trace emission (Remark 3.1).
Activation Variant Sensitivity and 42-Layer Gemma 4 E4B Failure-Mode Audit (Table 20). Across 250×RMSNorm swings on payload 7.0, closed-form Mellin constants keep FP32 error ≤0.0070 across exact SiLU (I=π2/12=0.822467, err 3.4×10−5), exact erf-GELU (I=0.250000, err 0.00497), calibrated PyTorch tanh-GELU (I=0.249586, err 0.00701), and QuickGELU (xσ(1.702x), I=π2/(12×1.7022)=0.283922, err 3.4×10−5), whereas applying uncalibrated I=0.25 to tanh-GELU introduces a 0.166% systematic bias (0.01859). Evaluating 42-layer Boolean sidecar grafts (K=296) on pretrained google/gemma-4-E4B-it exposes three concrete architectural failure modes and their closed-form fixes: (1) placing Indefinite-RoPE shifts in top-18 KV-shared layers (L24–L41) fails (47.92% acc., 30/60 OOD false triggers) because Gemma 4 overwrites local (K,V) projections with cached L22/L23 states; (2) omitting Sandwich post-norm (post_attention_layernorm, post_feedforward_layernorm) calibration collapses circuit amplitude (10.94%); and (3) ignoring Gemma 4’s multiplicative residual scalar hℓ←sℓhℓ desynchronizes Layer-0 reference r0 from newly written wires. Scheduling shifts in unshared sliding-attention layers (L0–L18, where QK-Norm and parameterless V-RMSNorm preserve Chebyshev one-hot lag selection) and scaling layer-ℓ outputs by cumulative mℓ=m0∏j<ℓsj with Sandwich post-norm calibration restores 100.0% (64/64) Boolean exactness.
G.2 Inference-Stack Portability, TC0 Division, and Digit-Length Scaling
Extending Theorem 3.2(3) to NVIDIA TensorCore TF32 (10-bit fraction, uTF32=2−11) with FP32 accumulation (uacc=2−24, Nq=39): rounding G,U,D,x to TF32 yields γTF32=1.956×10−3 and worst-case error 81×3.736×10−3=0.30262<0.5 at ∣C∣=81, formally guaranteeing exact integer carries up to ∣C∣≤133 (empirically 5/5 on G3--G7 on A100). On NVIDIA A100 (PyTorch 2.8+cu128), torch.compile (TorchInductor) generates fused Triton SwiGLU kernels reaching exact -0.0 at z∗=88.8 (FP32) and 89.0 (BF16)—safely below our compiled S=256 suppression margin z≈307.2 (98.33% end-to-end accuracy)—and PyTorch SDPA FLASH_ATTENTION and EFFICIENT_ATTENTION match MATH to max∣Δ∣=0.0 on pre-expanded circuit Q/K/V heads. In IEEE FP16 (float16, max finite 65,504), raw off_suppress =2,097,152 overflows Wgate to −∞, triggering IEEE 0×(−∞)=NaN inside SiLU(−∞); clamping circuit Wgate to [−4096,4096] (since FP16 already underflows exp(−z) to exact -0.0 at z≥18) or running the <0.06% sidecar in BF16/FP32 eliminates NaN completely. Conversely, uniform INT8/INT4 PTQ applied directly to Wcirc rounds small αk=ekΔ to zero (37.4 / 81.0 error), whereas quantizing only WNL alongside an FP32 sidecar preserves 100% carry exactness (Table 3). Table 21 consolidates all engineering constraints and recommended reference configurations across major inference stacks in one place.
Table 21: Consolidated engineering constraints and recommended reference runtime configurations for deploying grafted checkpoints and SparseSidecar across production inference stacks.
Materializing hext=[hNL;hcirc]∈Rd+K inside dense HuggingFace nn.Linear layers expands parameters by 1.98×–3.13× (Table 3) solely because >99.94% of added entries are structural zeros. We implement and benchmark a runnable PyTorch factorized runtime (src/sidecar/sparse_sidecar_runtime.py: SparseSidecarGranite, SparseSidecarQwen35, and packed 4/8-bit GroupQuantLinear) requiring zero custom C++/CUDA extensions:
Coupled scalar reduction in RMSNorm (O(K) vector ops): Given hNL∈Rd and hcirc∈RK, compute s2=∥hNL∥22+∥hcirc∥22, shared scale λ=((d+K)−1s2+ε)−1/2, h~NL=(γNLwNL)⊙(λhNL), and h~circ=wcirc⊙(λhcirc).
Decoupled mixed-precision & quantized sublayer execution: Every grafted projection Wext=diag(WNL,Wcirc) evaluates as WNLh~NL⊕Wcirch~circ, keeping WNL at native width d=2560 (in BF16 or group-128 INT8/INT4 via GroupQuantLinear) while executing only active circuit routing slices (5/40 Granite GQA layers; 12/24 Qwen GatedDeltaNet layers, 0/8 Attn) and active MLP rows (nnc×K) in BF16 or FP32 (sidecar_fp32=True). On NVIDIA A100-80GB (Table 3), SparseSidecar reduces static VRAM from 13.55→7.89 GiB on Granite (2.67× faster 2K prefill) and 19.09→10.65 GiB on Qwen (1.96× faster 2K prefill), while mixed FP32 sidecar + BF16/INT8/INT4 WNL (4.60 GiB Granite, 8.14 GiB Qwen) achieves 5/5 on G3--G7 and 100.0% Qwen ALU exactness.
Compact sparse logit readout: At the output head, z=Wlm,NLh~NL+Wlm,circh~circ touches only 35×1,110 active entries on Granite and 12 Schedule-S1 pairwise differential (pm,nm) columns on Qwen 3.5. Custom fused C++/CUDA BSR kernels can further reduce Python launch overhead on short prefills (128 tokens) as future systems work.