ntrillard demonstrates that quantizing the Fourier magnitude spectrum of K and V cache values to 4-bit while preserving phase at full precision achieves 96.9% token match with fp16 reference on Gemma-3-1B, a 5-10x improvement over standard min-max quantization.

  • Fmag4 (4-bit magnitude + full precision phase) yields 96.9% token match and 62% memory savings compared to bf16.
  • Standard 4-bit quantization achieves only 54.9% token match on the same prompts.
  • The method doubles maximum context length from 68K to 137K for Qwen2.5-7B on a 10GB GPU without increasing total memory budget.
  • Phase is identified as the primary carrier of structural information, while the magnitude spectrum is smooth and compressible.

This approach allows users to significantly extend context windows within fixed hardware constraints by leveraging the Fourier transform for more efficient KV cache storage.