Every load-bearing number we re-derived from the released per-item data reproduces, and the evaluation methodology is a genuine contribution. However, the production speedups are modest (1.25–1.6×), the 27B deployment has no identity-fill arm to isolate the ridge map's contribution, and the Flash-Next perplexity cost is described more weakly than the data support.
Soundness
3/4
Presentation
3/4
Contribution
3/4
Confidence
4/5
✓ 19 confirmed
Summary
The paper proposes RidgeFill, a training-free way to shorten long-prompt prefill. Layers below a split S run exactly. For most prefix rows in each later layer ℓ, the layer input is predicted as x^ℓ=Aℓx, where Aℓ,bℓ come from a closed-form ridge regression fitted once on calibration activations. The layer then runs only its K/V projections (attention layers) or its recurrent-state update (Gated DeltaNet layers) from that prediction. A tail of the last T tokens, an optional set of selected exact rows, and all decoding steps run the full model.
The evidence comes in three parts. (i) Production deployments: on Qwen3.8-27B in a llama.cpp fork, TTFT is 1.25–1.31× faster at 16K–120K with RULER −1.2/−1.4 and LongBench v2 −1.4 (intervals include zero). On Qwen3.8-Flash-Next in vLLM, TTFT is 1.50–1.60× faster at 9K–32K, with near-identical RULER needles and +2.65 % novel-token perplexity. (ii) A reference study on Llama-3.1-8B, Qwen3.5-9B and Qwen3-8B compares against the identity fill (POP), SwiftKV, exact-row selectors and controls. (iii) A methodological argument: averaged loss hides cache-fill error, so filled-region needle retrieval, key-token loss and key/value splices should be used. The splices locate the error in the keys on Llama and in the values/recurrent state on Qwen3.5.
The paper is unusually candid about negative results. These include the shallow-split loss failure on Llama, rows that hurt on Qwen3-8B, POP being cheaper than RidgeFill below ~46–59K tokens at 5/8 depth, the confounded Flash-Next timing, and the fact that the 27B runs were not pre-registered. A data repository with per-item results, recompute scripts and a Lean formalisation of the idealised statements accompanies it.
Strengths
Results reproduce from released per-item data
§4–§6, Tables 8–23, Appendices A and C; data repository v1.8
We recomputed all headline tables from raw records, independently of the authors' scripts: 27B TTFT, RULER, LongBench v2, KL and multi-user; Flash-Next timing, PPL and RULER; reference RULER contrasts, Appendix C, rows, splices, SwiftKV and POP non-inferiority. Every point estimate matches, usually to the last printed digit, and every bootstrap endpoint lies within the Monte Carlo spread across seeds (checks 01–08, 13–16). The authors' own gate (recompute/run_all.sh) also passes 1,381/1,381 claims, and 97 % of those values appear verbatim in the paper (check 19).
Discriminating evaluation design
§3.1–§3.3, Fig. 8, Table 6, Table 22
Fig. 8 argues convincingly that averaged loss is the wrong instrument. On Qwen3-8B, fitted and identity fill differ by 0.019 nats on novel tokens but by 93.7 vs 44.0 on filled-region retrieval (confirmed, check 04). The other measures are also well chosen: filled-region needles, key-token loss, count-matched random rows, a longer-tail control and question-blind rows (Table 6). They separate 'which rows' from 'how much compute', e.g. selected rows beat random rows by +29.6/+18.3 points (check 07).
Splice tests localise the error
§6.6, Table 23, Fig. 14
Swapping exact keys or values into the filled cache shows that 97.0 % of Llama's added loss sits in the keys, and half of it in their scale. On Qwen3.5, values carry 52.0 % and keys 25.8 %. On Qwen3-8B, exact keys alone make loss 3× worse (−222 %). All 17 ΔNLL values and the derived percentages reproduce (check 08). This mechanistic decomposition is useful to anyone building cache-approximation methods, beyond RidgeFill itself.
Candid reporting of negative and mixed results
§1 (last paragraphs), §4.5, §6.4, §6.5, §8
The paper keeps results that cut against it: Llama at the primary split is worse than no fill on 32/36 documents ≥64K; rows lower Qwen3-8B retrieval (24 samples worse, 10 better; check 07 confirms); RidgeFill costs more MACs than POP below ~46K/~59K at 5/8 depth (check 09 confirms); the cwe drop of −10/−13.5 on the 27B; the PCIe confound on Flash-Next; and the unregistered 27B runs. §8 is a model limitations section.
Simple, deployable, well-engineered method
§2.2, §4.3, Appendix F
The fit is one pass of running sums and one CPU solve per layer. The closed form, the streamed-sum equivalence and the penalty convention were all verified numerically against the authors' (check 12). The llama.cpp fork is byte-identical to upstream with fill off on 7 comparisons, and resident and streamed maps give identical outputs (§4.3). Map sizes match the published files (check 18).
Weaknesses
Production result does not isolate the ridge map
major · §4, Table 9; §8 'The 27B'
The 27B deployment has no identity-fill (POP) or no-fill arm. It also keeps 28–31 % of the prefix exact through a two-sweep probe and applies a value rescale (§2.4, §4.1). The measured −1.2/−1.4 RULER cost therefore cannot be attributed to the fitted map rather than to the selector and tail. The reference study shows the map's advantage over identity depends heavily on model and depth (+3.3 on Qwen3.5, a hybrid like the 27B; check 04). So the headline production claim does not show that RidgeFill beats the simpler identity fill at scale. Fix: add an identity-fill arm with the same selector, tail and rescale on the 27B, at least for RULER 16K/32K.
Flash-Next perplexity cost is understated
major · Abstract; §5.3, Table 15
The abstract and Table 15 report +2.65 % [−0.02 %, +4.93 %] and stress that the interval includes zero. Re-running the stratified BCa over 100 seeds puts the lower endpoint in [−0.27, +0.11]; it excludes zero in 19 % of seeds. More directly, 70 of 90 documents have higher NLL under RidgeFill (sign test p=1.1×10), and the per-document mean of is +3.32 % (check 06). The data show a small but real perplexity increase. report it as such, with the sign test, rather than as an interval that 'does not exclude zero'.
Questions for the authors
On the 27B, what are RULER 16K/32K scores for an identity-fill arm with the same probe-selected rows, tail and value rescale? If it is within a point of RidgeFill, the production benefit comes from the selector, not the map.
Do you agree that 70/90 documents with higher NLL (sign test p≈10−7) establish a real Flash-Next perplexity increase? Would you restate the abstract accordingly?
Where does the gap between the measured 27B speedup (~1.3×) and the MAC ceiling (1.43/1.72) go: map reads, the probe sweep, or kernel efficiency of the K/V-only path? A profile would show whether the ceiling is reachable.
With POP given the same 4,096-token tail, how do quality and wall-clock compare at 5/8 depth? The MAC crossover depends on that tail difference.
Does fitting maps on longer calibration documents (64K+) recover Llama's filled-region retrieval at 64K (30.3)?
Why do selected rows hurt Qwen3-8B on multi-needle tasks? Have you checked whether the selected rows displace needle rows from the tail budget, or whether exact rows interact badly with filled neighbours through the keys (cf. the −222 % key splice)?
Verification
We ran 19 checks, all with scripts, and all 19 confirmed the paper's numbers. We sparse-fetched the per-item results from the data repository (tag v1.8) and recomputed every headline table with our own code: 27B TTFT/VRAM, RULER, LongBench v2, KL, multi-user; Flash-Next TTFT, PPL, RULER; reference filled-region contrasts, Appendix C, exact rows, splices, SwiftKV, POP non-inferiority. We used independent bootstraps across many seeds. We also rebuilt the MAC model from public configs, numerically tested the attention and terminal-state bounds and the ridge closed form (including the authors' fitting code), built the Lean project, and ran the authors' gate (1,381/1,381). No discrepancies were found. The checks did surface interpretation issues that appear as weaknesses: a real Flash-Next PPL increase (sign test), a narrower exactness condition for the ρ correction, the POP cost comparison's dependence on tail length, and a 32K ΔNLL driven by five documents. Model runs (GPU inference, map refitting) were not repeated.
Horton, M. et al. (2024). KV Prediction for Improved Time to First Token. arXiv:2410.08391.
Cited for a claim it does not support (Sec. 7, 'Fill, trained retrofit'). The paper says KV Prediction 'reports a 25 to 50 % cut in prefill compute with little loss in accuracy, and quality falling off quickly beyond 50 %'. Those are SwiftKV's statements: its abstract says '25-50%', and its body says 'Beyond 50% SwiftKV, model quality drops quickly'. KV Prediction reports TTFT-FLOPs reduction factors of 1.34x to 11x, with substantial loss relative to the base model (e.g. 0.78 of base TriviaQA accuracy at 1.34x, 0.66 at 1.93x). It makes no 50 % cliff claim. The sentence appears to attribute SwiftKV's numbers to the wrong reference, which also makes the following 'Both SwiftKV and POP report quality falling off' read as if three sources agree.
Suggestions
Add an identity-fill (and no-fill) arm on the 27B with the same selector, tail and rescale, so that the production result isolates the fitted map.
Restate the Flash-Next perplexity result as a small but statistically clear increase: report the sign test (70/90 documents) alongside the BCa interval.
Extend 27B RULER to 64K and 128K, where the speedup claims are made, with more than 20 items per task. Replace or supplement LongBench v2 CoT with a format that yields an extractable answer for most items.
Profile the 27B and Flash-Next prefill to account for the gap to the MAC ceiling, and report timing variability (more requests, multiple documents, intervals).
Report a tail-matched POP comparison and measured wall-clock against POP at 5/8 depth.
Test longer calibration documents for the maps, given the retrieval decline from 8K to 64K on Llama.
In the abstract, state the RULER length range (8K–32K vs 8K–64K) and that the SwiftKV comparison is at split 1/2.
Correct the KV Prediction attribution in §7, and qualify the 'exactly' in the Appendix H ρ derivation to the case where calibration and request gate weights agree.
Release the vLLM fork patches, or describe them in enough detail for the Flash-Next timings to be reproduced, and add an upstream equivalence check for its exact path.
Ethics and integrity
No integrity concerns. Every value we recomputed from the released raw data matched the paper. AI-tool use is disclosed. The second author also authored the cited Flash-Next quantization and vLLM image (Smith 2026a/b); these self-citations are visible by name but not flagged as a potential conflict, and a one-line disclosure would help. Calibration/test overlap was checked and disclosed (Appendix G). We found no text in the paper, source or repository addressed to reviewers.
Scope of this review
We could not rerun the model inference itself (no GPU; the deployments need an A100 or 2×R9700 and large checkpoints), so the stored per-item outputs, timings and log-probabilities were taken as given and every downstream number was recomputed from them. Gold answers for 27B RULER and LongBench v2 are hashed, so correctness relied on the stored judge fields. The released maps were not refitted, since that requires model activations. The vLLM fork patches are not public, so the Flash-Next engine code could not be inspected. The data repository (~600 MB) was sparse-fetched under /tmp rather than stored in the workspace.
The attention sensitivity bound 2Vaij(e∣ε∣−1) holds and is tight (check 10). The terminal-state share and the γm/(1−γ) bound are correct (check 11). The 219-theorem Lean project builds with no sorry or extra axioms, and its headline statements match Table H.1 (check 17).
−
7
eΔ−1
Fix:
Quality evidence at scale is underpowered, and speedups are modest
major · §4.4–§4.6, Tables 8, 9, 11; §5.3, Table 16
27B RULER uses 20 items per task (CI half-width ~2 points) and stops at 32K, whereas the speedup claim extends to 120K. LongBench v2 has a ±3.6-point CI. About 37 % of its items give no extractable answer (189/181) and 60 % hit the 1,024-token cap (check 03), so it is a weak instrument. The paper says intervals 'do not rule out losses of a few points', which is accurate. The gains of 1.25–1.31× (27B) and 1.50–1.60× (Flash-Next) sit below the MAC ceilings (1.43/1.72; 1.64–1.88) and are unprofiled. Each timing is a median of 3–5 requests with no intervals (checks 01, 06), and Flash-Next uses prefixes of one document. Fix: add RULER at 64K/128K on the 27B, more items per task, and a profile showing where the gap to the ceiling goes.
Advantage over POP is narrow and configuration-dependent
minor · §2.5, §6.4, Table 21, Fig. 7
At the primary split, POP beats RidgeFill on loss for Llama (0.63 nats) and Qwen3.5 (0.008 nats), and on retrieval for Qwen3-8B (98.7 vs 93.7) (§6.4). At 5/8 depth RidgeFill is non-inferior on retrieval, but it costs more MACs than POP below ~46K (Llama) and ~59K (Qwen3-8B). Our independent MAC model reproduces these crossovers (check 09). It also shows that the comparison hinges on POP's 1-token tail versus RidgeFill's 4,096-token tail: with the same tail, RidgeFill is cheaper at every length, and removing the map cost moves the crossover to 40.9K. Wall-clock POP-vs-RidgeFill timing is not reported. Fix: report a tail-matched POP arm and measured wall-clock, so readers can see when the fitted map pays off.
Exact-row selection does not transfer across models
minor · §2.4, §6.5, Table 22; §8
Three deployments use three different selectors: reference '+rows', Flash-Next protected token classes, and the 27B probe. Each was tuned on its own development data. On Qwen3-8B the reference selector hurts retrieval (93.7 → 89.9, −8.9 vs exact; 24 worse / 10 better, all on multi-needle tasks; check 07), and no explanation is tested. The rows also depend on the question (question-blind −16.0/−14.0). The evidence that any single selector generalises is therefore thin. Fix: report the selector ablation on the 27B, and test the reference selector on a fourth model.
Terminal-state correction's 'exact' claim is narrower than stated
minor · §2.3; Appendix H (ρ derivation)
Appendix H shows that adding ρℓΔMℓ 'removes the shift exactly'. This holds only when ΔMℓ equals δ∑jwj for the current request. In the paper, however, ΔMℓ is averaged over 13 calibration prompts. In simulation with request-specific gates, the residual had a median of 15 % and a 90th percentile of 37 % of the error (check 11). Quality mode is off in the main runs and not ablated alone, so this affects only the motivation. Fix: qualify the statement.
Calibration length below test length
minor · §8 'Calibration length'; Appendix G; Table C.1
All maps are fitted on documents of at most ~30K tokens, but tests run to 128K. Llama RidgeFill retrieval drops from 79.8 at 8K to 30.3 at 64K (confirmed, check 05). The paper discloses this but does not test longer calibration, which is the obvious first fix and is cheap given the closed form.
Abstract mixes ranges and splits
minor · Abstract; §1; Table 18; §6.3; Table 12
The abstract's '49.1 and 49.6' uses Llama's 8K–32K contrast, whereas §1 and Table 18 headline +39.7 at 8K–64K. Both are correct (check 04), but the abstract does not say which range it uses. Similarly, 'within 0.03 nats of the released SwiftKV checkpoint' is measured at split 1/2, not at the primary split the sentence appears to refer to (check 16). The 27B mean ΔNLL at 32K (−0.214, CI excluding zero) is driven by five copy-heavy documents, while RidgeFill is worse on 72/100 documents (check 13). Any summary should avoid reading that number as an improvement.
Misattributed numbers in related work
minor · §7 'Fill, trained retrofit' (tex line 959)
§7 says KV Prediction (Horton et al., 2024) 'reports a 25 to 50 % cut in prefill compute with little loss in accuracy, and quality falling off quickly beyond 50 %'. Those statements are SwiftKV's. KV Prediction reports TTFT-FLOP reductions of 1.34–11× with substantial accuracy loss, and makes no 50 % cliff claim. This also inflates the following sentence ('Both SwiftKV and POP report quality falling off'). Fix: correct the attribution.
Partial registration and closed vLLM patches
minor · §5.2, §9
Only 27 of 42 ledger entries are published in full, and the 27B final runs were not registered. The vLLM fork patches behind the Flash-Next results are not public, so those timings cannot be reproduced. In addition, the Flash-Next exact baseline is the fork's own exact path and was never checked against upstream (§5.2), unlike the 27B's byte-identity check.
Changing row j's value by delta changes query i's attention output by exactly a_ij*delta. Changing its logit by eps changes the output by at most 2 V a_ij (e^{|eps|} - 1).
Value identity holds to 4.5e-16 (relative). Logit bound: max LHS/RHS = 1.000000 (never above 1) over 200,000 instances. The naive float64 difference a'v - av exceeds the bound in 1,523 of 20,000 instances, but every one of the 40 worst is <= 1 in 60-digit arithmetic, so these are cancellation artefacts. The optimiser's float64 sup of 1.414 comes from underflow (weights ~1e-170) and is 0.5 in 60 digits. The bound is tight: a_ij -> 0, eps -> 0 with v_j = -v_others gives a ratio of 0.999999. The Lean statements match the paper (hypothesis: all value norms <= M). The project has 219 theorem/lemma declarations, with no 'sorry', 'admit' or axiom declarations. The bound is per row and per query, and only motivates ranking by attention; the reference selector measures attention in lower layers as a proxy, which the bound itself does not cover.
numpy/mpmath: 20,000 random instances for the value identity; 200,000 random and adversarial instances (value of row j opposite to all others, a_ij down to 1e-15, eps up to 20) for the logit bound, with a cancellation-free closed form cross-checked in 60-digit arithmetic; a 300-start Nelder-Mead maximisation of LHS/RHS re-evaluated in 60 digits; an explicit near-extremal construction; and a grep of the Lean statements.
Terminal-state correction: in M_t = g_t M_{t-1} + u_t with a constant shift of the filled updates, adding rho*dM removes the shift exactly, and any other scale leaves part of it. The filled share of the final state is ~0.005 at gate 0.90 and 0.65 at 0.995 (Fig. 4: 200 rows, last 50 exact) and is bounded by gamma^m/(1-gamma) = 7.2e-7 for gamma=0.4, m=16.
Fig. 4 shares are 0.0052 (paper ~0.005) and 0.6498 (0.65). The bound evaluates to 7.158e-7 (7.2e-7), and share/bound <= 0.873 over 20,000 sequences. The rho scale is exact (residual 4.5e-16) when dM = delta * sum_j w_j of the same request. A 0.9*rho scale leaves 10 % and the unscaled dM overshoots by 28 %, both as stated. Caveat for the review: dM is an average over 13 calibration prompts (Sec. 2.3), so the exactness holds only when the request's gate-weight sum equals the calibration average. In the simulation with request-specific gates the residual was median 15 %, 90th percentile 37 %, max 201 % of the error. With a non-constant shift it was 3 %, and with the erase term 48 % (which the paper does not claim is exact). The correction was off in all main runs (Sec. 4) and was not ablated on its own (Sec. 5.3), so this affects only the motivation of quality mode.
Closed forms plus numpy simulation: 20,000 random gate sequences for the bound; 200 simulated requests with data-dependent gates and 80 % of rows filled, comparing dM taken from the same request with dM averaged over 13 'calibration' requests; relaxations (non-constant shift, the delta rule's erase term).
Ridge map: A = Y^T X (X^T X + alpha I)^-1 on centred data, b = mu_l - A mu_S, alpha = lambda tr(X^T X)/d_in. Fitted from running sums streamed one document at a time (fp32 products summed in fp64), with the same result as solving on all rows at once.
The closed form equals the objective's minimiser to 6.8e-14 (relative), with gradient ~0. Independent streamed fp64 sums match the batch solve to 1.7e-11. The authors' code (fp32 products, fp64 accumulators, first-batch mean shift) matches an fp64 batch solve on the same inputs to 8.3e-7 (A) and 1.5e-6 (b), so 'the same result' holds up to fp32 rounding. Without the shift, fp32 accumulation would be off by 1.1e-2. The code's alpha scale is mean(diag(Cxx)) of the centred scatter, which equals tr(X^T X)/d_in with X centred as Sec. 2.2 defines it. With raw X the penalty would be 366x larger on this data, so the definition matters and is consistent. The bias is unpenalised, matching b = mu_l - A mu_S. The residual() helper (ridge toward identity) is defined but not called anywhere in the repository. The released maps themselves were not refitted (that needs model activations and a GPU).
numpy fp64: closed form vs direct augmented least squares of the stated objective with unpenalised intercept; an independent streamed-sum implementation over 31 uneven documents; the authors' RidgeStats/RidgeFit (torch CPU, imported from the data repo) on data with a large common offset; the alpha convention.
27B agreement with stock (Tables 12/13): 16K mean KL 0.0894 [0.0399, 0.1556], median 0.0040, p99 0.965, top-1 94.64 %, dNLL -0.0330, median +0.0044; 32K 0.2656 [0.0599, 0.6017], 0.0042, 12.77, 93.60 %, -0.2142 [-0.5629, -0.0025], +0.0071. Table 13 bins (86/7/7; 82/13/5) reproduce the means. Stock is closer to BF16 than RidgeFill on 22 of 25 documents; code item stock 14.37 / BF16 15.87 / RidgeFill 0.005 nats.
All point values match: mean KL 0.0894/0.2656, median 0.0040/0.0042, p99 0.9653/12.7717, top-1 94.637 %/93.596 %, dNLL -0.0330/-0.2142, median dNLL +0.0044/+0.0071, and every Table 13 bin count, KL and dNLL to 4 decimals. The doc-weighted Table 13 recombines to Table 12. CI endpoints with an independent seed: [0.0408, 0.1547] and [0.0615, 0.6108] for KL, [-0.0869, +0.0051] and [-0.5703, -0.0026] for dNLL; these differ from the paper only by bootstrap seed noise, and the 32K dNLL interval excludes zero under both seeds. BF16: stock closer on 22/25 by mean |target log-prob difference| (10/10 and 5/5 in the RidgeFill-worse and typical groups, 7/10 where RidgeFill was better). By |mean NLL - BF16 NLL| it is only 16/25, so the result depends on the per-token metric. Code item: 14.37 / 15.87 / 0.0052, ln(248,320) = 12.42. Additional context: the five largest documents carry 64 % (16K) and 88 % (32K) of the summed KL. RidgeFill's loss is above stock's on 66/100 (16K) and 72/100 (32K) documents (sign test p = 9e-4 and 6e-6). The negative mean dNLL at 32K, whose interval excludes zero, therefore reflects five copy-heavy documents and not a typical improvement. The paper's medians and Table 13 disclose this, but the abstract-level reading of a 'negative dNLL' should not be taken as RidgeFill being better.
Recomputed from the 200 per-document records (per-position KL lists, top-1 flags and target log-probs in results/qwen38-27b/results/kld/), with my own percentile bootstrap (numpy, independent seed), copyable-share bins from PER-DOC-KL.json, and the BF16 comparison from bf16/*.json.
Mixed serving (Table 14): RidgeFill shortens the new 16K request's TTFT by 12-16 % and raises other users' throughput by 3-10 %. The worst stall is shorter in every schedule; p99 ITL is shorter at C2 and longer at C4/C8. All Table 14 cells.
Every cell matches to the printed precision (e.g. Unified C4 p99 148.03/668.95 vs 148.0/669.0; Separate C8 tok/s 88.88/91.98). TTFT reductions are 15.0, 13.6, 13.9, 11.7, 15.9 and 14.8 %, so the range is 11.7-15.9 % ('12 to 16 %'; Unified C8 is 11.7 % and rounds to 12). Throughput gains are +8.4, +4.8, +3.0, +9.8 and +3.5 %. Max ITL is shorter in all 5 schedules; p99 is shorter at C2 and longer at C4/C8, as stated. The paper suggests the anomalous stock C4 p99 (148 ms) may be noise, but the two repetitions agree (145.9 and 150.1 ms), so the effect reproduces within the cell. With two repetitions per cell and no intervals, the +3.0 % (Unified C8) and +3.5 % (Separate C8) throughput gains cannot be separated from run-to-run variation: per-repetition p99 values at C8 vary by up to 57 ms.
Recomputed all 29 cells from the raw per-token timestamps of the background users and the injector's TTFT in results/qwen38-27b/results/mix///result.json (two repetitions per arm and schedule), with my own code, then the percentage changes.
Non-inferiority uses the more conservative of the one-sided bootstrap bound and the binomial floor -100(1-0.05^{1/n}): -1.38 (n=216), -1.36 (219), -2.18 (136), -2.15 (138). Against POP at 5/8 depth, RidgeFill is non-inferior at a 3-point margin.
The floors are -1.377, -1.359, -2.179 and -2.147, matching. All Table 21 means match: Llama 99.8/94.1/95.0/98.7, RF-POP +4.60, RF-identity +3.68, with the BCa lower endpoint ranging +1.84..+2.02 and the upper +6.07..+6.43 over seeds (paper [+2.0, +6.2]); Qwen3-8B 98.7/98.7/98.9/99.1, +0.36, +0.18 [0.00, +0.91..+1.09] (paper [0.0, +0.9]). The reported NI bounds (-2.18, -2.15) are the floor in both cases: RidgeFill never scores below POP on any filled sample (0 of 136 and 0 of 138), and the bootstrap bounds are +2.94 and +0.00. The bound therefore depends only on n, not on the data, which the paper states. The 3-point margin claim holds. In simulation, the min(bootstrap, floor) rule held size at n=216 (0.044 vs nominal 0.05; MC SE 0.007). At n=136 the bootstrap alone was anti-conservative (0.081), but the floor makes the combined rule conservative (0.000 at a 2-point margin, because the floor -2.18 sits below the margin). So the construction is valid and conservative for these sample sizes.
Computed the floors in closed form. Recomputed Table 21 from the ruler-deep sample records (filled rows, 136 Llama / 138 Qwen3-8B) with my own task-stratified BCa (5,000 resamples; 20 seeds for the two-sided interval), and the one-sided bootstrap bound separately from the floor. Monte Carlo (1,000 trials) of the type-I error of 'declare NI if min(bootstrap bound, floor) > -margin' for paired near-ceiling binary data whose true difference sits exactly at the margin.
With the same tail, released SwiftKV minus RidgeFill = +0.010 nats [-0.004, +0.025] (a tie), and SwiftKV maps + tail beat ridge by 0.024 nats on long-document novel-token loss at split 16.
Table 19 matches: +0.0953/+0.5676, +0.0610/+0.1148, +0.0850/+0.3390. On novel tokens, released - RF = +0.0102 [-0.0043, +0.0246] and maps+tail - RF = -0.0240 [-0.0367, -0.0155] with the declared seed, which match the paper; the interval endpoints are stable across seeds. The split is 1/2, i.e. 16 of 32 layers on Llama. maps+tail beats RF on 86/126 documents and in every domain except chat (-0.001). With the declared seed, the key-token contrasts reproduce exactly: +0.2286 [-0.0203, +0.4848] and -0.2243 [-0.4149, -0.0568]. However, the printed upper end of +0.485 for released - RF on key tokens sits at the 1st percentile of 200 other seeds (median +0.498), so its interval width is resampling-dependent; its lower end crosses zero for 98.5 % of seeds, so the 'includes zero' reading is robust. The 'tie' reading of the novel-token contrast holds: no seed's interval excludes zero. The abstract's 'within 0.03 nats' is supported: the point estimate is 0.010 and the upper end is at most 0.026 over seeds. By domain, the released checkpoint is worse than RidgeFill on papers (+0.038) and encyclopedia (+0.032), and better on prose (-0.016).
Recomputed Tables 19 and 20 from the 126 raw per-document records in results/reference/llama-3.1-8b-instruct-nll (set longppl; arms swiftkv-native@1/2, swiftkv@1/2, kva@1/2, exact@-). Key tokens are over the 80 documents that have them. My own domain-stratified BCa (5,000 resamples) was run with 20 seeds, with the authors' declared seed 20261004, and with 200 further seeds to measure the Monte Carlo spread of the endpoints.
The Lean project (219 theorems) formalises the idealised statements in Table H.1, including the impossibility of 'lossless and faster' for AffineFill/ContextFill and the additivity behind the count-matched random-row control.
The build completed successfully (3,122 jobs, exit 0) with no 'declaration uses sorry' warnings. There are 219 theorem/lemma declarations across 14 files, matching the paper. No banned tokens. Every module except VecNorm.lean has #print axioms: 142 declarations depend only on [propext, Classical.choice, Quot.sound] and one depends on no axioms. All 12 Table H.1 files exist, and their headline statements match the descriptions. AffineFill: no linear map plus bias equals RMS normalisation (ε>0), with or without a gain whose first entry is nonzero. ContextFill: for any Q, K and V≠0, no per-row φ, and none after an injective map, equals causal single-head attention with a residual on 2-row prompts. RandomControl: randomGain is additive in the count and proportional, k/n times the total. ImpactBound: keeping the top-sensitivity rows minimises the bound. GdnContraction: a Frobenius contraction for β∈[0,2] and a unit key. StCorrection: the γ^m/(1−γ) bound and the numeric <1e-6 at γ=0.4, m=16. Speedup: 1/r ≤ L/S, and ≥1 when f ≤ c. As the paper itself states, these are idealised results: e.g. the RandomControl additivity is linearity of an expected gain under an additive gain model, and RidgeSums' batch identity is an algebraic identity of Gram sums. They support design reasoning, not the size of any measured effect. SoftmaxShift.lean is present but unused, as disclosed.
Copied code/lean/kva_lean to /tmp, installed the pinned toolchain (leanprover/lean4:v4.34.1) with elan, fetched Mathlib v4.34.1 oleans from the Mathlib cache, and ran lake build. The script re-runs lake build, parses every #print axioms result, counts theorem/lemma declarations with comments stripped, greps for sorry/admit/axiom/opaque/native_decide/implemented_by, and prints the headline (#print-axioms'd) statements of each Table H.1 file so they can be read.
Map sizes: 32 MiB per layer in bf16 at d = 4096; 1.2 GiB for 48 int8 layers on the 27B (d = 5120, scale per 128); 0.60 GiB for 24 Flash-Next maps (d_in 10,240, d_out 2,560). The reported extra VRAM is consistent with these sizes.
Reference map: 4096×4096×2 B = 32.000 MiB. 27B: 26,634,240 B per map, and 48 maps = 1.191 GiB (paper 1.2); each published proj8 file is 26,634,680 B, i.e. the prediction plus a 440-B safetensors header. Flash-Next: 26,629,120 B per map, and 24 maps = 0.595 GiB (paper 0.60); the published files are 26,629,560 B (the HF API confirms this). At the run revision 0b6f2ce0, the Flash-Next repository holds 0.651 GiB: 24 maps, correction.safetensors (54 MiB), rowsel.safetensors (2.8 MiB) and ridgefill.json, i.e. 27 data/config files, plus 7 documentation files. This matches '0.65 GiB across 27 files'. The later source/ bf16 fit (1.47 GB) is not counted, as the paper says. The 27B GGUF the fork loads is 1,452,188,032 B (1.35 GiB; HF API confirms): Q8_0 weights of 1,275 MiB plus the 108-MiB correction. Table 8: resident 1.55–2.94 GiB and streamed 0.26–1.69 GiB, which round to the stated 1.6–2.9 and 0.3–1.7 GiB. Resident minus streamed is a constant 1,282–1,326 MiB, consistent with the ~1.3 GiB of maps moving between host and device. The remainder grows with prompt length, so the VRAM overhead is not only the maps; Table 8 shows this, but the §2.2 size statement alone understates the extra memory at long prompts (2.9 GiB at 120K).
Computed byte counts from the stated formats (int8 weights, a bf16 scale per 128 weights of each row, a bf16 bias). Compared them with the per-file byte counts recorded in the data repository's provenance/external.tsv and with the Hugging Face API at the recorded revisions (paths-info and a recursive tree listing). Converted the Table 8 VRAM deltas to GiB.
Released code: every number in the paper is recomputed from the stored per-sample records by recompute/*.py (run_all.sh) and gated against derived/claims.csv.
run_all.sh exited 0 in 42 s and printed 1,381 claim lines. The gate reports '1381 of 1381 claims match; 0 mismatched, 0 missing, 0 printed twice, 0 unlisted'. Of the 1,262 numeric claim values, 1,227 (97.2 %) appear verbatim in the paper. The 35 that do not are values printed at extra precision (e.g. 14.373 → 14.37, 3.935), internal counts (LB3.n_items 520, S11.n 400), development/provenance quantities (calibration minutes, determinism-fix cost 5.3–6.6 %, token-class ratios), and a few contrasts not printed in the main text (LB7d quality vs RidgeFill −0.86 [−2.61, +0.92]; R5 S22/POP ratios, which check 09 reproduced independently; AB llama identity-rows NI bound −2.20). None contradicts a printed number. Checks 01–18 independently re-derived the load-bearing numbers rather than relying on this gate.
Ran the main entry point, bash recompute/run_all.sh (every script with python -I -B, 2 threads), from the v1.8 checkout, then recompute/gate.py on its output. Because the gate only compares against the authors' own claims file, I also looked up every numeric expected value of derived/claims.csv in the paper text (with Unicode minus signs normalised).
All 12 medians match to 0.005 s, all 8 ratios match to 0.0005 (e.g. 16K resident 12.966/10.380 = 1.2491 vs 1.249; 120K streamed 1.2932 vs 1.293), VRAM deltas match exactly (1592/268 ... 3014/1732 MiB). Each median is over exactly 3 timed requests after a warm-up. Filled share for 28-31% exact prefix rows: 0.517-0.540 at 16K (claimed 54%), 0.666-0.695 at 120K (claimed 67%). Ceilings 1/(1-0.30)=1.429, 1/(1-0.42)=1.724 match 1.43/1.72. Abstract's '1.6-2.9 GiB' is 1.55-2.94 GiB (rounding acceptable). Exact-row counts are not logged in these files, so the 28-31% share itself was not verified. n=3 timed requests per cell; no variability is reported.
Recomputed medians of the three timed requests' server prompt_ms from raw result.json files (data repo v1.8), ratios stock/arm, and peak_mib differences; checked filled-share and MAC-ceiling arithmetic.
27B RULER 85.69 -> 84.51 at 16K (-1.19 [-3.13, +0.79]) and 87.85 -> 86.42 at 32K (-1.42 [-3.21, +0.35]); cwe -10.0 / -13.5
All 26 per-task means match Table 10 exactly. 13-task means 85.69/84.51 and 87.85/86.42, deltas -1.19/-1.42, all exact. Independent CIs [-3.18, +0.75] and [-3.21, +0.37] vs paper [-3.13, +0.79] and [-3.21, +0.35] (within 0.05, Monte Carlo noise). cwe CIs [-32.0, +12.5] and [-36.0, +9.0] vs paper [-32.0, +12.0] and [-36.0, +9.0]. cwe length-cap counts 8 vs 12 and 4 vs 7 match the text. Prompt hashes are identical across arms for all 520 pairs. vt is 0 in both arms, and all 20 vt answers hit the 30-token cap. Including vt dilutes the 13-task mean by a factor of 12/13. Per-item scores could not be re-derived because the gold answers are not released.
Recomputed per-task and 13-task means from 1,040 stored per-item scores. Used an independent numpy paired bootstrap (seed 12345, 10,000 resamples within task). Checked prompt hashes across arms and length-cap counts.
27B LongBench v2: 38.57 vs 37.18 (-1.39 [-4.97, +2.19]); 48 vs 41 discordant, sign test p = 0.525; 189/181 no extractable answer; 301/302 hit 1,024-token cap
All 12 group n, accuracies and deltas match exactly. Every paper CI endpoint lies within the spread of endpoints across 20 bootstrap seeds (e.g. Overall: lo in [-5.17, -4.97], hi in [+2.19, +2.39] vs paper [-4.97, +2.19]). The endpoints are lattice-valued and move by one step of 100/n between seeds. Discordant counts are 48/41 and the exact sign test gives p = 0.525. Re-extraction agrees with the stored 'pred' on all 1,006 records. No-answer counts are 189/181 and pass-1 length stops 301/302 (59.8%/60.0%), all matching. Extra: 131 items have no answer in either arm. Among items with an answer, accuracy is 61.78% (stock) vs 58.07% (RidgeFill). Correctness relies on the stored 'judge' field because gold answers are hashed.
Recomputed all 12 group rows from 503+503 per-item records and the domain index. Re-extracted answers from pass-2 text with the official LongBench v2 regex. Ran an exact binomial sign test and 20 independent paired percentile bootstraps (10,000 resamples each).
n = 216/136/219/138 match. Arm means match Appendix A exactly: Llama 49.4/9.7 (8K-64K) and 60.7/11.6 (8K-32K), Qwen3.5 81.4/78.1, Qwen3-8B 93.7/44.0. Deltas +39.70, +49.08, +3.31, +49.64 vs paper +39.7, +49.1, +3.3, +49.6. BCa intervals [+32.79, +46.41], [+39.75, +57.72], [-1.14, +7.65], [+43.30, +56.16] all lie within 0.5 of the paper's. The abstract's '49.1 and 49.6' is the 8K-32K contrast for Llama, while §1 and Table 18 headline +39.7 (8K-64K). Both are correct but the ranges differ. The filled-region population is a minority at short lengths (21 of 100 samples at 8K on every model). The needle_filled flag is stored, not recomputable, because needle positions are not in the records.
Read the per-sample reference RULER records and selected filled-region samples via the stored needle_filled flag. Recomputed arm means and paired deltas, then my own stratified BCa (within task, jackknife acceleration, 5,000 resamples, a different seed from the paper's).
Appendix C per task x length RULER cells aggregate to Appendix A filled-region arm values with n = 216/219/138; Llama RidgeFill 79.8 at 8K and 30.3 at 64K
228 cell values plus their n match the records within 0.05. The n-weighted aggregates reproduce Appendix A: Llama 8K-64K RidgeFill 49.42 (49.4), identity 9.74 (9.7), rows 99.54 (99.5); Qwen3-8B rows 89.85 (89.9); Qwen3.5 8K-64K 81.40/78.08 (81.4/78.1). Qwen3.5's pooled single_1 row prevents an 8K-32K aggregation from the table alone, so that column was checked against the records: 83.63/80.40 vs 83.6/80.4. Llama RidgeFill at 8K alone is 79.76 (n=21) and at 64K alone 30.32 (n=80), matching 79.8/30.3.
Parsed all Appendix C rows from the LaTeX and recomputed each cell (n and six arms) from the per-sample records. Aggregated the paper's cells, weighted by n, to the Appendix A 8K-32K and 8K-64K columns.
Flash-Next: TTFT 1.50/1.54/1.60x at 9K/16K/32K (85-92% of ceiling 1.64/1.78/1.88), 64K 82.6 -> 47.5 s (1.74x); PPL gap +2.65% [-0.02, +4.93] (CI does not exclude zero); quality mode +1.60% [-0.83, +4.32], QM-RF -1.02% [-2.87, +0.80]; RULER 99.8 vs 100.0 (2 of 221 filled samples short)
Speedups 1.5032/1.5397/1.5996 (RidgeFill) and 1.2525/1.2166/1.2711 (quality mode) match Table 16. Ceilings 1.636/1.778/1.882. Measured/ceiling 0.919/0.866/0.850 (claimed 85-92%). 64K medians 82.62/47.52/55.61 s give 1.739x and 1.486x. PPL gap point estimates are exact (+2.65%, +1.60%, -1.02%), and every paper CI endpoint lies inside the range across 100 seeds. Re-scoring reproduces all stored scores (0 mismatches). Filled rows: 221 of 325. RidgeFill 99.85/99.77, quality mode 99.92/99.89. The two failures are niah_multivalue_32768 #3 and #23 at 0.75. Caveat on interpretation: the RidgeFill BCa lower endpoint sits at zero. Across 100 seeds it ranges over [-0.27, +0.11] and excludes zero in 19% of seeds. 70 of 90 documents have higher NLL under RidgeFill (sign test p = 1.1e-7; paired t = 2.10). So 'does not exclude zero' understates the evidence of a small but real perplexity increase. The per-document mean of exp(dNLL)-1 is +3.32% vs +2.65% for exp(mean)-1. Timings are 5 requests on prefixes of one document, with no intervals.
Recomputed timing medians from raw request logs and ceilings from r = S/L + (1-S/L)T/N. Recomputed novel-token NLL from stored log-probs and masks. Ran my own stratified BCa over 100 seeds. Re-scored all 975 RULER outputs with RULER's string_match_all against stored refs, and recomputed the filled region from needle spans.
Exact rows: RF+rows non-inferior to exact on Llama/Qwen3.5 (+0.2, LB -1.38; 0.0, LB -1.36); beat random rows by +29.6/+18.3 and longer tail by +24.8/+16.5; question-blind -16.0/-14.0; Qwen3-8B rows hurt 93.7 -> 89.9 (-8.9 vs exact), 24 worse / 10 better, random 8/10
All 14 point estimates match within 0.05 (e.g. Llama rows-random +29.60, Qwen3-8B rows-exact -8.88). 13 of 14 intervals are within 0.6 of the paper's. Llama rows-random [+23.16, +36.21] vs paper [+23.3, +36.9] lies inside the 40-seed spread (hi in [36.21, 36.95]). NI bounds equal the floors: -1.38 (n=216; BCa90 lower -0.12 is less conservative) and -1.36 (n=219; all diffs = 0). Qwen3-8B transitions: selected rows 24 worse / 10 better, random rows 8 worse / 10 better, exactly as stated. All losses are on multi-needle tasks. The net -5.25 sample-equivalents (-3.80 points) reflects partial-credit scoring. Random and longer-tail controls differ on 13 of 138 samples with equal means of 93.84, as the caption says. The 'count-matched' property of the random rows is not recorded in the per-sample files and was not verified.
Paired contrasts from per-sample records with my own stratified BCa. Non-inferiority bound = min(one-sided 95% BCa lower, binomial floor). Counted per-sample transitions against RidgeFill alone. Ran a 40-seed spread for the one endpoint outside tolerance.
All 17 dNLL values match to 3 decimals (e.g. Llama RidgeFill +1.006, keys +0.031, Qwen3-8B keys +0.143). Loss removed: 96.96 % (97.0), 88.10 % (88.1), 50.13 % (50.1), 25.79 % (25.8), 52.00 % (52.0), 91.47 % (91.5), 0.37 % (0.4), -222.37 % (-222.4), -4.66 % (-4.7), 98.82 % (98.8), 11.85 % (11.9). RULER filled: Llama n=136, RF 60.7, keys 99.1 / gap 98.6 %, values 79.6 / gap 48.6 %; Qwen3-8B n=138, RF 93.7, keys 94.2 / 10.7 %, values 82.4 / -221.4 %, and RF differs from exact on 20 samples as stated. All 22 paper CI endpoints lie inside the range of endpoints over 40 seeds (e.g. Qwen3-8B keys lower endpoint -271.4 vs seed range [-274.7, -269.8]); a single fixed seed differs by up to 2.9 points on that heavy-tailed ratio. Caveats: (i) the caption says no value-scale run exists for Qwen3-8B, but the records carry kva+vtail for all 90 documents (dNLL +0.071, i.e. worse than RidgeFill's +0.044; ~-61 % loss removed) and it is not reported; (ii) tail-scale rows come from the nll-causal re-run; the original cell gives nearly the same values (Llama key scale 50.1 %, value scale -9.5 %; Qwen3.5 key scale 0.2 %), so the choice of run does not matter. Claims.json's '96.9 %' was a planning typo; the paper says 97.0 %.
Independent recomputation from raw per-document NLL records (results/reference/*-nll, *-nll-causal for the tail-scale arms) and filled-region RULER records; own stratified (by domain) BCa on the ratio of means, plus a 40-seed sweep of the interval endpoints.
MAC model: RidgeFill (4,096 tail + maps) is cheaper than POP above ~14K (Llama split 16) and ~46K (Llama split 20). On Qwen3-8B, split 13 is cheaper than POP's split 24 above ~10.6K (24 % less at 32K); split 22 is 1.04x POP at 32K, 0.99x at 64K, crossing at ~59K.
Crossovers: Llama S16 14,334 tokens (paper ~14K), Llama S20 45,661 (~46K), Qwen3-8B S13 10,552 (~10.6K), Qwen3-8B S22 58,891 (~59K). Qwen3 S13/POP at 32,768 = 0.759 (24 % less); S22/POP = 1.0416 at 32K (1.04x) and 0.9938 at 64K (0.99x). Llama S20/POP = 1.209/1.091/1.023 at 8K/16K/32K, so it costs more across 8K-32K as stated. The project's compute.py agrees with the independent model to <1e-5. The 59K crossover is not among the 1,381 gated claims but reproduces. The planning estimate of ~76K came from a dense-only count: dropping the attention-context term moves the Qwen3 crossover to 71.7K. Dropping the maps moves it to 40.9K, and giving POP the same 4,096 tail makes RidgeFill cheaper at every length, so the comparison depends on POP's 1-token tail and on charging the maps. The model counts MACs only (no norms, softmax, RoPE); the measured POP-vs-RidgeFill wall-clock is not reported.
Independent MAC model from public config.json dims (q/k/v/o + SwiGLU MLP per row, explicit causal QK^T+PV sums, K/V projections for filled rows, H^2 map per filled row per late layer, lm_head for the last token). Bisection for crossovers. Cross-checked against the project's own code/kva/compute.py imported from the data repo, with sensitivity variants.