The 3D version of this simulator renders each RVQ codebook as a ring of spheres orbiting in a 3D scene, even though the quantizer itself works in a 2D feature plane. This 2D counterpart is a genuinely different, independently-computed view: it draws that native 2D plane directly — one scatter panel per codebook level — instead of projecting it onto a ring, and adds a live rate-distortion chart the 3D version never plots at all.
e_0 = z (target embedding, 2D)
for k = 1..K:
p_k(i) = softmax( -‖e_{k-1} − C_k[i]‖ / T ) over codebook C_k
c_k = sample i ~ p_k (this level's token)
e_k = e_{k-1} − C_k[c_k] (residual passed down)
distortion_k = ‖e_k‖ (plotted per level, live)
Each panel shows codebook C_k as dots sized by their live softmax probability p_k(i) — a genuinely new readout the 3D scene never exposes (it only pulses the winner after the fact). The blue dot is the residual arriving at that level; the orange ring marks the sampled codeword; the arrow traces e_{k-1} → e_k exactly as the algebra above computes it.
A real finding, verified numerically: at the default temperature (T=0.70) the softmax is already flat enough that sampling is close to uniform — averaged over 400 generated frames, the mean residual norm stays essentially flat across levels (≈0.87 at every level) instead of shrinking, because near-uniform sampling barely favors nearby codewords. Only once T is lowered toward greedy (T≈0.05-0.20) does the cascade behave like real coarse-to-fine quantization, with the same codebooks and target trajectory driving the average residual down from ≈0.38 after level 1 to ≈0.11 after level 4. Drag the temperature slider down to watch the rate-distortion chart go from flat to a genuine downward staircase live.
- Levels — how many residual codebooks stack (K). More levels lower the residual error (at low T) but need more tokens per frame.
- Codewords per level — codebook size; a bigger codebook can represent finer nuances but is a harder search.
- Temperature — sampling randomness; watch perplexity rise toward the codebook size as T increases, and the rate-distortion chart flatten out.
- Coding gain — ‖e_0‖ / ‖e_K‖, how much the cascade shrank the original embedding's magnitude; 1.0× means the cascade added no information at all.
Where this deliberately differs from the 3D model: there is no orbiting ring geometry here — the same coarse-to-fine RVQ cascade is instead visualized through its literal 2D feature-plane geometry, softmax probability sizing, and a rate-distortion chart, three views the 3D rings never expose directly.