r/MachineLearning • u/Cy74 • 12h ago
Research Let every Transformer layer reach states at all depths (WhiteMatter) [R]
In a standard Transformer, each layer only reads the KV cache from its own depth. A shallow layer cannot use what deeper layers already computed for earlier tokens. When deep layers need to reach shallow ones, that information also has to pass through the residual stream, which has limited bandwidth.
Our recent work, WhiteMatter: All-to-All Cross-Layer Connections via KV Source Mixing, lets every layer read from every depth. Each layer's keys and values are a learned mix of hidden states from all layers. In addition, we can share KV among reader layers to reduce the KV cache size.
Main results:
- WhiteMatter matches a standard Transformer with 50% more layers (4%-8% lower perplexity vs same depth).
- With half the KV cache, it still beats matched standard Transformers.
The catch: a token's shallow layers now depend on the deep layers of earlier tokens, so training and prefill cannot process all tokens at once.
To keep parallel training & prefill, we proposed cyclic iteration, which matches token-by-token quality in 4 parallel passes, compared to 53 for the Jacobi method used in prior works (12.5x faster at matched quality). It's still slower than vanilla prefill, which is the main thing we are working on next. However, decoding has the same speed as standard transformer, or can even be faster because of the reduced GPU memory requirement.
Paper: https://arxiv.org/abs/2608.18486
Video: https://www.youtube.com/watch?v=NCjJzBGdgTU
Code: https://github.com/Cy-47/White-Matter
Strongly recommend watching our video. It should feel much easier to follow than text!