suffix-decoding -- speculate from text you have already seen, with no draft model

Two ways to propose several words without a second model, then keep only the prefix the target itself would have written. Suffix mode indexes text already seen and proposes whatever followed a match. Averaging four seeds, accepted length is longer when the text is fully repeated than when it is novel, and that curve is not higher at every step between them. One run on screen can stay flat or get shorter. Jacobi mode writes a lookahead window from the last context token plus a position index, and pools short runs from that trajectory even when the index has no match. It does not copy a repeated n-gram.

Interactive page: speculative decoding without a second model. Suffix mode takes the proposal from the text the system has already seen -- the prompt, the conversation, this generation's own output -- indexed in a depth-bounded suffix tree. Jacobi mode writes a lookahead window and pools n-grams from that trajectory even when the tree has no match, then keeps only the prefix the reference itself would emit. The Jacobi window is the last context token plus a position index, not a copy of a repeated n-gram. Anchor: the companion to speculative-decoding, which owns the verify-and-accept mechanism this page reuses and deliberately does not re-teach. Contrast it with radix-attention, whose tree is a prefix tree: there one path is inserted per request, from its start; here one path is inserted per position, so a node's count is the number of positions that produced it.

Source: SuffixDecoding, <https://arxiv.org/abs/2411.04975>.

What it shows

In suffix mode, the property that makes the tree interesting is the four-seed curve. Accepted length is longer when the text is fully repeated than when it is novel: an agent loop re-emitting a similar tool call, a document being quoted back, structured output with a fixed skeleton. That curve is not higher at every step between them. One run on screen can stay flat or get shorter. Both ends are reachable from the repetitiveness handle. Jacobi mode does not move with that handle.

Real vs modelled -- stated on the page too

🟢 REALthe corpus, the suffix tree and every node count, the longest-recurring-suffix match, the occurrence positions, the proposal, and the accepted length -- a literal longest-common-prefix against the reference continuation
🟡 MODELLEDthat the reference continuation is what the big model would emit. Corpus and reference come from one seeded process whose repetitiveness is the page's knob
🟡 MODELLEDthe draft-model baseline curve -- an analytic geometric accept model, drawn dashed and labelled

The draft baseline is nearly flat in repetitiveness on purpose: a draft model's per-token agreement is a property of the model pair, not of the text.

The trade, against the draft model

Both curves share one axis. No draft weights and no draft forward passes -- but the proposal is only as good as what has been seen before, so its mean accepted length swings far harder with the input than a draft model's does. Measured on the page (4 seeds × 12 rounds per point, proposal length 6, tree depth 6):

repetitivenesssuffix tree, mean accepteddraft model, mean accepted (modelled)
0.000.292.21
0.300.752.34
0.602.002.47
0.802.732.56
1.004.232.65

In suffix mode the tree moves 14.6× across the range while the draft moves 1.20×, and the two curves cross between repetitiveness 0.75 and 0.80 (2.27 vs 2.54, then 2.73 vs 2.56). That crossing is the whole point: which one wins is a property of the text, not of the method.

Interactions

#Contract itemHere
1scrub / steptransport steps the four phases (match · propose · verify · commit), autoplays and loops; ?step=N
2hover-to-inspecta tree child → its continuation, how often it was seen, and what share of the context's occurrences it accounts for; a proposed token → the match length and count that produced it, its rival candidates, and whether it survived; the occurrence map → what the node's count actually counts
3direct manipulationcanvas handles for repetitiveness and proposal length, plus an editable corpus text field. In suffix mode, extra corpus text is indexed at the head of the corpus and changes an accept only when it changes a continuation count. At repetitiveness 0.75, seed 5, proposal length 6, depth 6, 12 lines and 12 rounds, the offered context-plus-continuation leaves round 1 at 4 accepted. At repetitiveness 0 with those same controls, round 1 starts at 1, and both the offered line and the continuation alone move it to 3. Jacobi mode does not read those counts
4live animationthe match sweeps along the context each frame; the verify phase sweeps the one-forward bracket
5resize the problemtree depth, lines already seen, rounds, proposal length

A/B compare renders novel text (repetitiveness 0.05) against an agent loop (0.90). In suffix mode, challenge mode asks for a mean accepted length above 3.0, and then for a configuration where the draft model wins. Jacobi mode does not solve those two by turning the repetitiveness handle.

Render tier

T1 (Canvas2D token chips, the tree's continuation bars, the occurrence map, the two-curve axis; no heatmap needed).

Wiring

layout.mount + controls (rho, plen, depth, corpus, rounds, draftA, seed, extra) + transport over rounds × 4 phase records (autoplay, loop) + animate + onPointer handle drags (routed through controls.set, committed non-silently on release so the deep link syncs) hover. URL hooks: ?step, ?rho, ?plen, ?depth, ?corpus, ?rounds, ?draftA, ?seed, ?extra, ?hover=x,y, ?play=1. All randomness comes from tensor.js rng(seed), so a given URL reproduces the same run exactly; the swept curve is also exposed as window.__suffixCurve so a headless check can read the whole curve, which a screenshot cannot. Source: page.js.