arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2611.26450cs.AI
收藏

大语言模型内部的CPU:将精确电路零梯度编译到预训练权重中

A CPU Inside an LLM: Zero-Gradient Compilation of Exact Circuits into Pretrained Weights

Tanmay Sah

AI总结:

本研究提出零梯度电路嫁接原语,将精确算术等电路编译到预训练LLM权重中,在多基准算术任务上超越LoRA方法,同时保持自然语言能力与低内存开销。

摘要:

预训练语言模型(LMs)在无梯度微调或外部工具解释器的情况下,对精确的多位数算术运算仍不可靠。本文引入闭式零梯度电路嫁接原语,无需训练样本和运行时钩子,直接将确定性计算编译到预训练LM权重中,同时限制每层归一化漂移并保留自然语言(NL)能力。该构造结合三种分析机制:(1)无偏置SwiGLU/GeGLU层上的两层Mellin-GLU求积,将未知的每token RMSNorm缩放转化为沿对数间隔门网格的平移(动态范围>250倍),且符合IEEE 754误差边界;(2)通过带符号切比雪夫不定RoPE自汇聚注意力和无记忆SiLU反对称GatedDeltaNet移位实现跨token尺度抵消;(3)轴对齐宽度扩展(d→d+K),搭配√(d/(d+K))归一化补偿、以1000为基数的规范BPE发射,以及差分(+254,-256)绑定的未嵌入操作。自动化5级编译器在恒定TC⁰深度中合成4-8位带符号{+,-,×}电路,同时生成3文字节布尔电路(准确率100%,N=1728;含42层Gemma 4 E4B审计)和5位多数/奇偶电路(准确率100%)。在6位算术任务(N=1200,BF16)上,IBM Granite 4.2 3B(1.07M-1.33M活跃非零参数,≤0.036%)和Alibaba Qwen 3.5 4B(2.25M-2.39M非零参数,≤0.057%)的ALU前缀准确率分别达99.17%和100.00%(搭配FP32辅助模型时为100%),句中恢复准确率为98%-100%,优于12.8K样本LoRA(准确率42.2%/61.7%,内联延续率0%)。因子化块稀疏辅助模型在A100上的内存占用为7.89/10.65 GiB(INT8/INT4+FP32辅助模型下为4.60/8.14 GiB),且通过所有14/14个预注册的>2K token Tango拆分测试(N=4392;OOD触发数0/11134)。

英文摘要:

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\times$ 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 \to d+K$) with $\sqrt{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 $\{+,-,\times\}$ circuits in constant $\mathsf{TC}^0$ 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, $\le 0.036\%$) and Alibaba Qwen 3.5 4B (2.25M-2.39M non-zeros, $\le 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 $>2$K-token Tango splits ($N=4{,}392$; 0/11,134 OOD triggers).

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑