# Fourier Magnitude KV Cache Quantization

> Source: <https://discuss.huggingface.co/t/fourier-magnitude-kv-cache-quantization/178815#post_7>
> Published: 2026-08-23 10:51:15+00:00

It looks like you’ve pushed the exploration quite a bit further:

My short version is: **I think the correction is substantive, but I do not think it removes the interesting signal. It narrows it into something more testable.**

What I would carry forward from the current state is less:

Fourier / phase is uniquely special

selective layers are redundant

early decode anchors give a sub-int8 recipe

and more:

the exact K representation being quantized matters a lot, and low-bit perturbation of the K that is actually stored/reused after normalization + RoPE can be genuinely fragile.

I would probably make that tensor/locus distinction the organizing boundary from here.

For current Transformers Gemma 3, the K path is essentially:

```
hidden state
    ↓
k_proj
    ↓
k_norm
    ↓
RoPE
    ↓
past_key_values.update(K, V, ...)
    ↓
attention
```

You can see that ordering directly in the [Gemma 3 implementation in Transformers](https://github.com/huggingface/transformers/blob/v5.15.0/src/transformers/models/gemma3/modular_gemma3.py).

That means a hook on `k_proj`

is testing a different object from the post-KNorm/post-RoPE K entering the cache. Once I separated those, the picture became much easier to interpret.

My default route from here would be:

```
intervention/storage locus
        ↓
storage-only mechanism
        ↓
teacher-forced distributional validation
        ↓
better K quantizer geometry
        ↓
joint K/V rate accounting
        ↓
only then packed bytes / kernels / serving claims
```

The part I found most convincing is that the effect still survives a **post-forward storage-only control**: keeping the forward that creates a K state completely full precision, then demoting only the persistent cached copy, can still alter later logits and later generation.

So there does seem to be a real cache-reuse phenomenon left after the retractions.

What seems to survive the selective-layer correctionIf I were choosing the next path by goal, I would use something like this:

```
If the goal is to understand the mechanism:

    corrected storage-only teacher-forced KL/NLL
        ↓
    locate which older prompt regions / K states matter
        ↓
    test whether sensitivity tracks age, content, attention, or quantizer error

If the goal is a practical low-bit cache:

    stop increasing the FP window for now
        ↓
    improve K quantizer geometry
        ↓
    compare against a strong int8 / KIVI-like baseline
        ↓
    reintroduce a residual only if it buys a real rate-quality improvement

If the goal is a deployable codec:

    first get a fidelity-successful K/V policy
        ↓
    define an actual packed representation
        ↓
    count metadata and real bytes
        ↓
    then measure latency / throughput / context scaling
```

So, from my side, I would not read the corrections as the exploration collapsing. The interesting part seems to have **narrowed from a fairly broad Fourier/anchor story into a cleaner question about K representation, cache locus, and future error propagation**.

That is a smaller claim, but it also looks much easier to falsify, compare against existing KV methods, and turn into a reproducible next experiment.
