RidgeFill: Training-Free Late-Layer Cache Fill for Faster Prefill
Dylan Johnston, Robert P. Smith
Independent Researcher
Published November 6, 2026 · on the feed November 10, 2026 · ▲ 2 · arXiv 2611.09709
The abstract
RidgeFill shortens prefill by not computing most of a model's upper layers for the prompt. The lower layers run exactly up to a split; from the split layer's state a per-layer map predicts every later layer's input, and each late layer writes its cache from that prediction. The design follows YOCO and DeepSeek-V4.1-Flash, where the projection is trained into the model. RidgeFill retrofits it onto models that were never trained for it: the map is a ridge regression fitted once in closed form from one pass over calibration text, the layer's own projections run unchanged, and a chosen set of rows, the last few thousand tokens, and every decoding step run the full model. Nothing is trained and no token is dropped. Most of the work was in measurement, finding a repeatable methodology. Loss averaged over all tokens hides RidgeFill's error. Needle retrieval in the filled region, loss on tokens that depend on distant context, and splice tests that swap filled keys or values for exact ones show which component carries it: the keys on Llama-3.1-8B, half of it in their scale, and the values and the recurrent state on Qwen3.5-9B. On Qwen3.8-27B in a llama.cpp fork on an A100, time to first token is 1.25 to 1.31x faster at 16K to 120K tokens with the maps in VRAM; RULER changes by -1.2 and -1.4 points and LongBench v2 by -1.4; the 95 % intervals include zero but do not rule out losses of a few points. On Qwen3.8-Flash-Next in vLLM it is 1.50 to 1.60x faster than exact at 9K to 32K tokens, with RULER's needle tasks at 99.8 against 100.0 and perplexity on novel tokens 2.65 % higher [-0.02 %, +4.93 %]. On three 8 to 9B reference models, at the same split and tail as the identity fill, the fitted map retrieves 49.1 and 49.6 more filled-region RULER points on the two dense models (at that split Llama's loss is worse), and its long-document loss is +/-0.03 nats of the released SwiftKV checkpoint's.
The Brief
3:07A short podcast summary of the paper. Written and voiced by AI.
Transcript
RidgeFill. Training-Free Late-Layer Cache Fill for Faster Prefill. By Dylan Johnston and one other, working independently. Published on the sixth of November.
Prefill over a long prompt normally means computing every layer of the model for every prompt token, and the measure that tracks it here is time to first token. Designs such as YOCO and DeepSeek-V4.1-Flash already avoid computing much of the upper stack for the prompt, but there the projection that makes this possible is trained into the model. A model that was never trained that way has no such shortcut.
RidgeFill retrofits the idea onto those models. The lower layers run exactly, up to a chosen split. From the state at the split layer, a per-layer map predicts the input of every later layer, and each late layer writes its cache from that prediction instead of from a full computation. Most of the upper layers are simply never computed for the prompt.
The map is a ridge regression, fitted once in closed form from a single pass over calibration text. Each layer's own projections run unchanged. Not everything is filled: a chosen set of rows, the last few thousand tokens, and every decoding step all run the full model. Nothing is trained, and no token is dropped.
Most of the effort, the authors say, went into measurement, into finding a methodology that repeats. Loss averaged over all tokens hides RidgeFill's error. What exposes it is needle retrieval inside the filled region, loss on tokens that depend on distant context, and splice tests that swap filled keys or values for exact ones. Those tests show which component carries the error. On Llama-3.1-8B it is the keys, with half of it in their scale. On Qwen3.5-9B it is the values and the recurrent state.
On Qwen3.8-27B, running in a llama.cpp fork on an A100 with the maps held in VRAM, time to first token is one point two five to one point three one times faster, across prompts of sixteen thousand to one hundred and twenty thousand tokens. RULER drops by one point two and by one point four points, and LongBench v2 by one point four. The ninety-five percent intervals include zero, but they do not rule out losses of a few points.
On Qwen3.8-Flash-Next in vLLM, RidgeFill is one point five to one point six times faster than exact prefill, at nine thousand to thirty-two thousand tokens. RULER's needle tasks score ninety-nine point eight against one hundred. Perplexity on novel tokens is two point six five percent higher, with an interval running from just below zero up to about four point nine percent.
A third comparison uses three reference models in the eight to nine billion range, holding the split and the tail fixed and swapping in an identity fill. Against that, the fitted map retrieves forty-nine point one and forty-nine point six more RULER points in the filled region on the two dense models, though at that split Llama's loss is worse. Its long-document loss lands within zero point zero three nats of the released SwiftKV checkpoint.
Much of this account is about measurement rather than speed. The speedups come stated next to intervals that leave room for a loss of a few points, and next to the warning that loss averaged over all tokens would have hidden the error altogether. With nothing trained and no token dropped, any price is paid in what the filled cache gets wrong, and the targeted tests are how the authors locate it, component by component and model by model.
More with an account
Listen to every day’s papers
Daily playlists, deep dives, quests for the papers, and quizzes on their key terms.
Join free