Macalinao Studio · Learn

Inside the model / an interactive field experiment

Keep less. Recover what?

A smaller cache needs structure. Compress four numbers, store the latent representation, then inspect what reconstruction preserves—and loses.

The values [2,2,1,1] can be represented by pair averages [2,1] and reconstructed exactly by duplication. Keeping only [2] reconstructs [2,2,0,0], with squared error 2. Pair averages of [2,3,1,2] give [2.5,1.5]; duplicating them loses within-pair differences, with squared error 1. The reading below remains available without JavaScript.

Listen to this experiment

Highschool · locally generated Kokoro Heart narration. The transcript follows the audio. Optional guided snapshots show the main example from each paragraph; they do not claim word-level timing.

Read the complete narration transcript

Keep less. Recover what? This scene asks when a shorter representation can preserve information, and when it cannot. The demonstration uses pair averages. It is not an implementation of DeepSeek latent attention.

Begin with two, two, one, one. The averages of the two pairs are two and one. Store those two values, then duplicate each one. You recover the original four numbers exactly. If you keep only the first average, the reconstructed second pair becomes zero. The squared error is then two.

In Workbench, break the equal pair structure. The values become two, three, one, two. Pair averages are two point five and one point five. Duplicating them cannot recover the differences within each pair. Even with two stored values, squared error is one.

Predict whether reconstruction will be exact before stepping through compression, storage, and reconstruction. The byte count describes only this toy payload. Real memory also includes model weights and other overhead. Compression error here is not a measure of a language model’s answer quality.

Compression is a representation choice

Repeated structure can let fewer numbers describe a larger set. But fewer stored values do not automatically preserve everything. Change the input structure or reduce the latent size, then inspect reconstruction error.

This toy uses pair averages and a fixed duplication rule. DeepSeek’s Multi-head Latent Attention instead uses learned projections for joint key/value compression, with additional positional treatment. It is not a process of simply averaging pairs in an existing cache.

Storage versus approximation

Our defined encoder computes c₁ = (x₁+x₂)/2 and optionally c₂ = (x₃+x₄)/2. The decoder returns [c₁,c₁,c₂,c₂], using zeros for the omitted second pair. Error is Σᵢ(xᵢ−x̂ᵢ)². A two-byte scalar convention gives 8 bytes for four original values versus 2r bytes for r latent values.

These are payload counts for this toy only. They omit shared projection weights, positional components, batching, layers, allocator overhead and execution costs. The reconstruction error here is not a model-accuracy score or a benchmark of MLA. Real low-rank projections are learned with the architecture; some operations can be combined algebraically without materializing a full reconstruction.

Source and scope

DeepSeek-V2 · section 2.1, Multi-head Latent Attention. The scene’s numbers and outcomes are authored teaching fixtures. No model inference or performance benchmark is being run.

Keep exploring

Dedicated scene narration and its transcript are available above. Existing lesson narration remains available in the connected lesson. Scene controls stay in this tab and do not change your saved lesson or study-coach progress.