long-context kv-cache delta-rule nvfp4 quantization-error gated-deltanet w4a4-quantization mmlu-pro
Abstract
Hybrid LLMs pair softmax attention with linear-attention layers such as Gated DeltaNet (GDN), whose recurrent state summarizes the context in fixed size. Early community 4-bit quantizations of Qwen3.8-27B (48 GDN layers, 16 attention layers) left the GDN block in 8- or 16-bit precision -- especially its decay and write-strength gates -- on the intuition that errors in a recurrence accumulate over long contexts. We test that intuition by building Minima: NVFP4 W4A4 on all 496 linear layers, GDN included. Across perplexity at 4K/32K, MMLU-Pro, GSM8K, AIME'25, GPQA-Diamond, LiveCodeBench, and RULER retrieval to 64K, Minima matches BF16 within seed noise (5-task average -0.52) while being the smallest (17.5 GiB) and fastest-prefill (+14-19%) recipe we compare, and its 32K perplexity gap shrinks with position. A four-part mechanism study explains why: (i) NVFP4's 16-element block scaling localizes the residual stream's extreme outliers, equalizing activation error across layer roles; (ii) the supposedly fragile gate projections are the least sensitive -- softplus/exponential and sigmoid parameterizations compress ~11% GEMM error to ~2% output error; (iii) the delta-rule recurrence holds injected noise at a flat plateau over 32K tokens and forgets a state impulse within hundreds of steps, because each write overwrites the state along the current key direction; (iv) the per-token quantization cost washes out with context instead of compounding. We also repair a global-scale mismatch that arises when per-module-calibrated NVFP4 checkpoints are served by kernels that fuse those modules into one GEMM, and show calibrated FP8 KV-cache scales are performance-free. The result: a practical recipe -- quantize everything, ship KV scales -- and a mechanistic account of why the recurrent half of a hybrid LLM is the easy half to quantize. Checkpoint: https://huggingface.co/minima-ai/mnma_qwen3.8_27b_nvfp4
한국어 요약
한 줄 요약
Gated DeltaNet(GDN) 기반의 Qwen3.8-27B 모델을 NVFP4 W4A4로 전체 496개의 선형층을 4비트로 양자화하여 BF16 수준 성능을 달성한 연구.
핵심 기여도
- GDN의 decay gate와 write-strength gate를 포함한 모든 선형층을 NVFP4 W4A4로 양자화한 최초의 모델(Minima) 구축.
- 32K 토큰에서 perplexity 차이가 위치에 따라 감소하며, BF16 수준 성능 유지.
- GDN의 delta-rule recurrence가 32K 토큰 이상에서도 상태 오류를 플랫하게 유지.
- FP8 KV-cache 스케일링을 통해 KV 메모리 절감(50%)과 성능 저하 없이 83%의 페널티 회복.
핵심 아이디어
Gated DeltaNet(GDN)은 고정 크기의 재귀 상태로 컨텍스트를 요약하는 선형 어텐션 레이어로, 기존 연구에서는 재귀 오류가 누적될 수 있다고 가정해 8비트 이상으로 보호했다. 그러나 본 연구는 NVFP4 W4A4 양자화를 통해 GDN 전체를 4비트로 처리해도 성능 저하 없이 작동함을 입증했다.
GDN의 재귀 상태 업데이트는 $ S_t = \alpha_t S_{t-1} + \beta_t k_t (v_t - S_{t-1}^\top k_t)^\top $ 형태로, 각 단계에서 상태가 덮어쓰여 오류가 누적되지 않도록 설계되어 있다. 특히, gate parameterization(softplus/exponential, sigmoid)가 GEMM 오류를 약 11%에서 2%로 압축하며, delta-rule이 오류를 효과적으로 제거한다.
기술적 접근법
- **모델**: Qwen3.8-27B (48 GDN, 16 attention 레이어)
- **양자화**: NVFP4 W4A4 (E2M1 4-bit 값 + E4M3 스케일, 16-element block scaling)
- **모듈**: GDN의 decay gate($\alpha_t$), write-strength gate($\beta_t$) 포함
- **KV-cache**: FP8 스케일링 적용, 50% 메모리 절감
- **성능**: 17.5 GiB 모델 크기, prefill 속도 +14~19% 개선
주요 결과
- **Perplexity**: 32K 토큰에서 BF16 대비 -0.52 이내, 위치에 따라 차이 감소
- **MMLU-Pro, GSM8K, AIME'25, GPQA-Diamond, LiveCodeBench, RULER**: BF16 수준 유지
- **FP8 KV-cache**: 32K 토큰에서 +0.41 perplexity 페널티, 83% 회복
- **성능**: 17.5 GiB 크기, prefill 속도 +14~19% 개선
의의 및 한계
- **의의**: GDN 기반 재귀 레이어는 양자화에 강하고, 전체 4비트 양자화가 실용적임을 입증.
- **한계**: NVFP4의 block scaling이 특정 아키텍처에만 효과적일 수 있으며, GEMM 병합 시 전역 스케일 불일치가 발생할 수 있음.
- **기계적 설명**: GDN의 재귀 구조가 오류 누적을 방지하고, gate 비선형성이 오류를 압축하는 메커니즘을 제시.
실용적 활용
- 4비트 양자화가 GDN 기반의 대형 언어 모델에서 실용적 성능을 유지하면서도 메모리와 속도를 개선.
- NVFP4 W4A4와 FP8 KV-cache 스케일링을 활용한 모델 배포 전략은 클라우드 인프라에서 특히 유용.
- GDN 레이어는 양자화에 안정적이므로, 향후 대규모 모델의 효율적 서비스에 적합.