One Million Tokens in 20GB: Calibration-Free 2-Bit SRFT KV-Cache Compression for Looped MoE Inference on Apple Silicon
Abstract
Long-context inference on unified-memory edge machines is governed by KV-cache capacity and memory bandwidth. On a 32 GB Apple M6 Mac mini (26.8 GB Metal working set, 150 GB/s DRAM), the 26.4B looped Mixture-of-Experts model Inkling-2-Mini (48 logical visits, 1M native context) exhausts memory by 64K tokens in stock oMLX (and by 512K even after fixing its 40 sliding-window visits to bounded ring buffers). We show that three structural properties of modern hybrid NoPE architectures -- bounded sliding windows, a 1,024-token banded relative bias whose tail is identically zero, and unit-RMS value normalization -- combine with an orthonormal Subsampled Randomized Fourier Transform (SRFT) to enable calibration-free, scale-free 2.000-bit Value and 2.125-bit Key Lloyd-Max compression (2.0625 effective bits/coordinate, smaller than bf16) on the 8 global visits' far prefix , merged with the exact bf16 local window and learned sink via online log-sum-exp. A custom GQA-packed Metal decode kernel with a 256-entry half4 LUT and Block-8 lazy exp2 rescaling reaches 73.4 GB/s and runs Inkling-2-Mini at 17.09 tok/s at 256K ( faster than bf16), 13.81 tok/s at 512K, and 9.52 tok/s at 1,048,576 tokens in 19.49 GiB peak memory (4.37 GiB KV). Across WikiText-2 windows, 3.06-bit SRFT is lossless (PPL ), 2.56-bit K3/V2 adds , and 2.06-bit adds while achieving 100% (3/3) exact 7-digit passkey retrieval at 8K, 16K, and 32K.
Create a lesson
Related papers
AlignPred: Error-Controlled KV Cache Compression via Alignment and Predictive Coding
Shared title terminology · Xu Yang, Jiapeng Zhang, Zhiwei Zuo et al.
Compositional Performance Modeling of LLM Inference Clusters with Hierarchical KV Caching
Shared title terminology · Ruiyang Ma, Sheng Qi, DaiKang Kuang et al.
Characterization of Request and Token Energy Costs for LLM Inference Workloads on GPU Platforms
Shared title terminology · Prabhu Vellaisamy, Vanessa Lam, Shawn Blanton et al.
A Photonic-CXL Memory Appliance for Scalable KV Cache Management in LLM Inference
Shared title terminology · Jing Ding, Yash Nishant, Chandrish Ambati et al.
HiPerfCC-KVCache: Accelerating Confidential LLM Serving with Hierarchical KV Caching
Shared title terminology · Haoxuan Xu, Shaoyu Wang, Minghao Lin et al.
How Far Are We From On-Device VLM Inference? A Measurement Study on Edge NPUs
Shared title terminology · Huan Yang, Shiqi Jiang, Yu Mao et al.