[논문리뷰] A CPU Inside an LLM: Zero-Gradient Compilation of Exact Circuits into Pretrained Weights
링크: 논문 PDF로 바로 열기
저자: Tanmay Sah (Independent Researcher)
1. Key Terms & Definitions (핵심 용어 및 정의)
- Zero-Gradient Circuit Grafting: Gradient step, labeled data, runtime hook, 외부 interpreter 없이 pretrained LM의 weight에 deterministic circuit(산술 및 Boolean)을 closed-form으로 직접 compile하는 방식이다. 필요한 입력은 원래 weight, tokenizer metadata, 그리고 ≤2L+1개의 unlabeled norm median(또는 0-token weight-analytic 추정치)이 전부다.
- Mellin-GLU Quadrature: 2-layer bias-free SwiGLU/GeGLU에서 gate scale을 log 간격 grid(αₖ = e^{kΔ}) 위에 배치하는 기법이다. 이렇게 하면 RMSNorm이 곱하는 알 수 없는 per-token scale λ가 grid 위의 평행이동(translation)으로 바뀌고, **>250×**의 dynamic range에서도 scale이 상쇄된다.
- Indefinite-RoPE Self-Sink Attention: Signed Chebyshev key weight로 RoPE kernel을 S(0)=+1, S(δ)≤−0.355 (1≤|δ|≤1024)가 되도록 구성한다. 비활성 query는 payload가 0인 자기 자신 위치(self-sink)에 머물러 off-target token으로 attention이 새지 않는다.
- Axis-Aligned Width Extension (d→d+K): 기존 residual 좌표 ℝᵈ는 투영(projection)하지 않고 그대로 둔 채 K개의 circuit 전용 wire를 덧붙이는 방식이다. √(d/(d+K)) norm compensation으로 RMSNorm drift를 보정한다.
- Base-1000 Canonical BPE Emission: 계산 결과를 모델 tokenizer의 canonical numeric chunk(1–3 digit)로 출력하는 emitter다. 1-digit 단위의 off-manifold token 출력이 GSM8K reasoning을 떨어뜨리는 문제를 해결한다.
2. Motivation & Problem Statement (연구 배경 및 문제 정의)
이 논문은 pretrained LM이 정확한 multi-digit 산술을 안정적으로 수행하지 못하는 문제를, fine-tuning이나 외부 tool 호출 없이 weight 안에 exact circuit을 직접 compile하는 방식으로 해결하려 한다. 실제 서비스되는 시스템은 decoding을 멈추고 외부 interpreter를 부르는 tool wrapper에 의존하는데, 이는 공격 표면(attack surface)을 넓힌다. 한편 RASP/Tracr는 MLP bias, absolute position, 정규화되지 않은 wire를 전제로 처음부터 만든 toy Transformer에만 적용되므로, 최신 LM의 RMSNorm, bias-free SwiGLU, RoPE, GatedDeltaNet 구조와 맞지 않는다. 저자가 꼽은 핵심 장애물은 네 가지다.
- RMSNorm 이후 wire scale이 >250× 범위에서 변동한다.
- Cross-token routing이 RoPE나 GatedDeltaNet에 의존한다.
- Residual covariance가 ℝᵈ 전체에서 full-rank다.
- Tied head에서는 logit이 Layer-0 embedding과 결합되어 있다.
또한 subspace projection(P⊥) 기반의 기존 injection 방식은 NL 성능을 손상시키고, LoRA SFT는 산술 정확도와 문장 중간 continuation 측면에서 한계가 있다.
3. Method & Key Results (제안 방법론 및 핵심 결과)
저자는 세 가지 analytical primitive 위에 5-stage declarative compiler를 구축해 pretrained LM 안에 일종의 "CPU"를 graft한다.
- (1) Mellin-GLU Quadrature (Theorem 3.2): 단일 bias-free GLU layer로는 Heaviside step을 구현할 수 없음을 증명한다. 이어서 2-layer log-grid quadrature로 scale-invariant한 step을 구현하고 IEEE 754/TF32 error bound를 제시한다.
- (2) Cross-Token Norm Cancellation (Theorem 3.3): Indefinite-RoPE GQA, 그리고 state carry를 e^{g_t}≡0으로 고정한 memoryless SiLU-antisymmetric GatedDeltaNet shift로 token 간 operand를 옮긴다. Source scale λ는 V=[λ, λx] pairing으로 나눠 없앤다.
- (3) Width Extension + Differential Tied Readout (Theorem 3.4): (+254, −256) differential tied unembedding을 사용해 trigger가 없을 때 logit 변화를 정확히 0으로 유지한다.
파이프라인은 Parser, Signed ALU(ripple carry와 5×5 multiplication), Canonical BPE Emitter의 3단계로 구성된다.
- IBM Granite 4.2 3B: 40-layer dense GQA 모델이며 K=1,140 wire를 사용한다.
- Alibaba Qwen 3.5 4B: hybrid 구조로, full-attention layer는 0/8 수정하고 GatedDeltaNet만 사용한다. K=2,555 wire를 쓴다.
- Gemma 4 E4B: 42-layer 모델에 대해서는 architectural audit을 수행했다.
주요 정량 결과:
- 산술 정확도: 6-digit signed {+,−,×}(N=1,200, BF16)에서 ALU-prefix accuracy는 Granite 99.17%(FP32 sidecar 사용 시 100%), Qwen 100.00%다. Inline resumption은 98–100%다. 반면 같은 backbone에 12.8K 샘플로 학습한 LoRA SFT는 42.2% / 61.7%에 그치고 inline continuation은 0%다.
- NL 보존: Unseen 1–6 digit 산술 정확도는 base 대비 24.7%→96.7%(Granite), 73.7%→99.7%(Qwen)로 오른다. PPL 변화는 42.10→42.06, 29.81→29.84로 미미하고, mean KL은 0.0017 / 0.0008이다.
- Ablation: 개별 primitive를 하나씩 제거하면 다음과 같이 성능이 무너진다.
- Single-scale SwiGLU로 바꾸면 산술 정확도가 8.3% / 20.0%로 떨어진다.
- Positive RoPE를 쓰면 Granite가 15.0%가 된다.
- Stateful GDN을 쓰면 Qwen이 51.1%가 된다.
- Norm compensation을 빼면 ARC-C가 57.5% / 38.5%로 떨어진다.
- Zero-gradient SVD projection(P⊥)은 width extension보다 next-token KL이 43×–3,800× 높다.
- Retention: 사전 등록된(pre-registered) 14/14 Tango noninferiority split을 모두 통과했다(N=4,392, >2K-token long-context 포함). 대상은 GSM8K, ARC-C, MMLU-Pro, LogiQA, PubMedQA, SWE-bench NLL이다. OOD false trigger는 0/11,134건이다.
- Systems: Factorized block-sparse sidecar는 dense padding 대비 A100 VRAM을 13.55/19.09 GiB → 7.89/10.65 GiB로 줄인다. 2,048-token prefill은 347.5→130.1 ms(Granite), 847.9→433.7 ms(Qwen)로 빨라진다. INT8/INT4 PTQ와 FP32 sidecar를 함께 쓰면 메모리는 4.60 / 8.14 GiB까지 내려간다. 추가 non-zero parameter는 전체의 ≤0.036%(Granite 1.33M), ≤0.057%(Qwen 2.39M)에 불과하다.
- 기타 circuit: 3-literal Boolean DAG(N=1,728)와 5-bit Majority/Parity 모두 100%를 달성했다.
4. Conclusion & Impact (결론 및 시사점)
이 논문은 analytical zero-gradient primitive와 factorized FP32/BF16 sidecar만으로, gradient나 task data, host router 없이 pretrained LM에 exact 산술과 TC⁰ circuit을 compile하면서 언어 능력을 유지할 수 있음을 보였다.
학술적 의의
- RASP/Tracr 계열의 compiled Transformer 연구를 실제 수십억 parameter 규모의 pretrained 모델로 확장했다.
- Numeric BPE manifold alignment가 reasoning에 영향을 준다는 mechanistic 증거를 제시했다.
산업적 의의
- Air-gapped 환경이나 규제 환경처럼 외부 코드 실행이 어려운 곳에서, 수학적으로 오차 bound가 보장된 in-weight 연산이 대안이 될 수 있다.
한계
- Division은 현재 scope에서 빠져 있다(부록에서 FP32 sidecar 기반 divider를 별도로 실험).
- Unbounded-length 입력과 halting loop는 단일 pass의 TC⁰ 범위를 넘어선다.
- Gemma 4 전체 산술 graft와 fused CUDA BSR kernel은 향후 과제로 남아 있다.
보안 시사점
- 이렇게 graft된 payload는 trigger가 없을 때 bit-exact하게 0이다(OOD activation 0/10,534, KL shift <0.002 nats).
- 따라서 black-box 벤치마크나 perplexity 평가로는 탐지할 수 없다.
- 저자는 open-weight checkpoint에 대해 white-box structural auditing과 SHA-256 provenance 검증이 필요하다고 경고한다.
⚠️ 알림: 이 리뷰는 AI로 작성되었습니다.
관련 포스트
Review 의 다른글
- 이전글 [논문리뷰] WorldRuler: Interactive World Modeling under Configurable Rules
- 현재글 : [논문리뷰] A CPU Inside an LLM: Zero-Gradient Compilation of Exact Circuits into Pretrained Weights
- 다음글 [논문리뷰] AURA: AUdio-dRiven streaming Avatar
댓글