How DeepSeek's Multi-Head Latent Attention Works

MLA caches one 512-dimensional latent per token instead of 128 heads’ worth of keys and values, and matrix absorption means it never has to decompress them. We derive it step by step: joint compression, absorption, why RoPE breaks it, and the decoupled RoPE branch that fixes it.

Date: October 27, 2026  |  Estimated Reading Time: 13 min  |  Author: Chi Zhang

How RoPE Improves on Sinusoidal Positional Encoding

Sinusoidal encoding has a neat rotation property, but it breaks once the encoding goes through attention’s projection matrices. We expand the dot product to see why, then put RoPE through the same expansion and watch the absolute positions cancel out.

Date: September 13, 2026  |  Estimated Reading Time: 9 min  |  Author: Chi Zhang