Clustering the sketch: conductance communities in a 262k-token gradient kernel, scored by an LLM judge

The error-law page established what a CountSketched preconditioned gradient kernel costs and how accurate it is; this page asks whether the thing it preserves is useful. We run on 261,632 per-token gradient rows of Pythia-14M (512 Pile sequences × 512 positions, 16,384 total sketch dims native), in two arms — all parameters vs embeddings frozen — and at two folded widths per arm (4,096 and 1,024 total dims, derived offline by , no model passes). Every discovered cluster is then scored by an LLM judge with the : explain the cluster from ten members, then classify held-out members against distractors; balanced accuracy is the cluster's "goodness". Six clusterings, one seeded judge, cross-run membership matching.

Freezing the embeddings doesn't just shrink the sketch error — it changes what the clustering finds (cross-arm ARI 0.03–0.05: near-disjoint), and what the no-embed kernel finds is better: mean judge accuracy 0.87 vs 0.78, winning every size bin above 100 rows.

Grouped bars: mean balanced accuracy for six runs. All-parameters arm around 0.75 to 0.80 at native, 1024-fold and 256-fold; embeddings-frozen arm flat at 0.87 across all three widths.
Fig. 1 · Judge accuracy per run (bars: mean ±95% CI over clusters; hatched = folded widths). The no-embed arm is better and flat across widths; the full arm is worse everywhere. Config caveat: the no-embed discover ran a finer-grained recalibrated termination (430–511 clusters at 0.70 coverage vs 33–48 at 0.78–0.88), so cluster counts aren't comparable across arms — the goodness and matched-size comparisons below are.

§1 Embeddings change what is discovered

The error-law study showed the embedding block's ε-floor heavy hitters dominate the full kernel's geometry at 14M; here that has a semantic consequence. Full-native and no-embed-native agree at ARI 0.047 over all rows — and 0.003 restricted to rows clustered in both — with median best-Jaccard 0.01 in both directions: there is essentially no cluster in one arm whose membership survives into the other. This is not sketch noise (the two folded widths of the full arm agree with each other at ARI 0.52–0.67). Freezing embeddings is not a cost optimisation; it selects a different — and per §2, better — similarity structure. The same lesson at MoE scale: excluding expert tensors flips 41% of nearest-neighbour structure on granite-1B (E2, MoE page to follow).

§2 No-embed clusters are better at matched size

Goodness falls with cluster size in both arms and the two inventories have very different size profiles (median scored size 158 vs 1,423), so the honest comparison is within size bins:

Grouped bars by cluster-size bin: both arms near 0.9 for 20-100 rows; embeddings-frozen wins every bin above 100 rows, 0.75 versus 0.42 in the 5,000-50,000 bin.
Fig. 2 · Mean judge accuracy by cluster size, native runs. At 20–100 rows the arms tie (≈0.90); above 100 rows the no-embed arm wins every bin, and at 5k+ rows the full arm's clusters collapse to near-chance (0.42) while no-embed holds 0.75. The full kernel's big communities are embedding-geometry blobs; the no-embed kernel's big communities remain coherent, explainable structures. (Full-arm bins ≥300 hold only 3–7 clusters each.)

§3 Folding destroys identity long before judgeability

Two panels versus sketch width. Left: median best-Jaccard and ARI to the native clustering fall steeply from 4096 to 256, for both arms. Right: mean balanced accuracy is nearly flat across the same widths for both arms.
Fig. 3 · The width ablation's two faces. Left: cluster identity versus the native run (median best-Jaccard, solid; both-clustered ARI, dashed) decays as the sketch folds down — no-embed native↔4,096-fold is the strongest agreement in the study (ARI 0.57), native↔1,024-fold collapses (0.19, coverage 0.33). Right: the judge can't tell the difference — mean accuracy is flat in width for the no-embed arm (0.872/0.870/0.872). Folding changes which clusters exist, not how coherent the survivors look. Production verdict, matching the error law: 4,096 total dims is free at this kernel's stable rank; 1,024 halves the discovered structure.

§4 Good clusters are the reproducible ones — until the sketch dies

Joining goodness with cross-width membership matching (full arm, native↔4,096-fold): the top goodness quartile reproduces at median Jaccard 0.99 vs 0.54 for the bottom quartile, matched pairs' goodness scores agree at Pearson 0.89, and Spearman(goodness, best-Jaccard) = 0.37. At native↔1,024-dims the relationship inverts (top-quartile Jaccard 0.001, bottom 0.77): heavy folding kills the small coherent clusters first and preserves the large mushy ones. Goodness and repeatability co-vary while the representation is faithful, and decouple in opposite directions when it isn't — so the pair (goodness, cross-width Jaccard) is a usable health check for any production width. (No-embed joins are underpowered — 120-cluster sampled scoring leaves 14–22 matched scored pairs.)

What the judge is actually looking at — every scored cluster, both native arms, hover for members:

0.4 0.6 0.8 1.0 chance 20 100 1,000 10,000 100,000 cluster size (rows, log) balanced accuracy all parameters (44 clusters) embeddings frozen (120 scored of 430) hover a cluster for its members · click to pin
Fig. 4 · Every scored cluster in both native runs: size against judge accuracy. Hover a point to see the judge's explanation and member contexts (click to pin, Esc to dismiss). The all-parameters arm's large clusters sink toward chance; the no-embed arm's stay explainable. In each example, [orange] is the row's own target; shaded tokens are other window tokens in the same cluster and pale gold ones are kNN-adjacent to it (gold tier: no-embed arm only — the full arm's graph is not retained).
Fig. 5 · Forty randomly-chosen clusters from the scatter above (both native arms), to click through. Left: arm, size and judge accuracy. Right: the judge's explanation, the cluster's dominant target tokens, and five member examples — the predicted-at token [highlighted] with a few tokens of continuation; \n and <TAB> mark whitespace. Shaded tokens belong to the same cluster and pale gold ones are kNN-adjacent to it (gold tier: no-embed arm only), so multi-token features show up as runs of adjacent shading.
hover a cluster for its members · click to pin 0.6 0.8 1.0 judge BA · unscored
Fig. 6 · Every cluster of the best run (no-embed, native D·S = 4096), laid out by t-SNE on inter-cluster kNN edge mass — the geometry the conductance discovery actually walked. Point size ∝ log cluster size; colour = judge accuracy (grey = outside the scored sample). Hover for five member examples with the predicted-at token [highlighted] and a few tokens of continuation; click to pin, Esc to dismiss. Shaded tokens in an example belong to the same cluster; pale gold ones are kNN-adjacent to it — runs of adjacent shading are the multi-token features (à la SAE visualizers).

§5 Addendum (2026-07-16): replication — enumeration is a race; geometry and goodness replicate

An "anomaly" forced this section into existence: a seed-replication arm (fresh hash seeds + a different VJP backend on a different pod) returned 61 clusters where the native run found 430, and three hash-seed-only replicates at 32,768 dims returned 73, 231 and 94. That looks like the pipeline barely replicates. It doesn't mean that — the attempt logs say something much more specific.

Cluster count is not a property of the kernel — it is the stopping time of a race, and the race is the only part of this pipeline that fails to replicate.

Discovery terminates on unvisited (not unclustered) mass. Roughly 80% of rows sit in one giant PPR basin — the "main body" — and when a random seed lands there and its sweep prefix swallows >99% of the support, the whole support is marked visited unclustered, the remaining-mass counter collapses below the 2% threshold, and enumeration ends. Every run's fate is set by when it first draws that event (per-attempt hazard ≈ 1/150, so the stopping time is geometric with enormous spread):

Unvisited fraction of rows vs discovery attempt for all five replicate runs; each run declines gradually then falls off a cliff (the main-body wipe) at a different attempt: 20, 52, 99, 144, 567
Fig. 7 · The discovery race, all five end-to-end runs. Each trajectory chips downward as clusters claim rows, then hits its main-body cliff at a different attempt (wideA 20, seed2 52, wideB 99, wideC 144, native 567) and terminates at the 2% line shortly after. Cluster count is ~monotone in cliff time: 73, 61, 231, 94, 430. Thin orange lines: discovery re-run on seed2's byte-identical graph with fresh rng seeds — same race, different draws (cliffs at 83–303). Thin blue lines: re-runs on the rebuilt native graph — no cliff at all; all four glide to the 800-attempt cap at ~570–590 clusters. Whether the trap exists is a property of the graph, and graph-building numerics decide it.

Strip the race away and replication is strong. On rows clustered in both runs, native↔seed2 agree at conditional ARI 0.65 / NMI 0.79; the wide pairs at conditional ARI 0.70 / 0.82 / 0.60. Median best-Jaccard is direction-dependent in exactly the way truncation predicts — the shorter enumeration matches into the longer one far better than the reverse (seed2→native 0.31 with 43% of clusters finding a ≥0.5-Jaccard partner; native→seed2 0.15, because most of native's 430 simply never got enumerated on the other side). And the judge cannot tell any replicate's clusters apart: mean balanced accuracy 0.872 / 0.862 / 0.892 / 0.876 / 0.892 (native, seed2, wideA, wideB, wideC) — early-stopping runs find fewer clusters, not worse ones.

What re-rolls the race? Numerics smaller than you'd guess. Holding the preconditioner fixed on one pod and flipping only the VJP backend (serial/chunk-4 → batched/chunk-8) leaves the kernel's geometry intact — exact-diagonal correlation 0.999998 — but moves individual rows hard in the tail: median 6.2%, p99 77% relative change, concentrated in small-norm rows (well-predicted tokens whose bf16-autocast per-token gradients are ill-conditioned). Each backend is separately deterministic (re-running seed2's sketch bit-reproduces it to ≤10−6). A perturbation of that shape barely moves cluster geometry, but it re-wires a few kNN edges — and that, it turns out, can add or remove the trap itself.

The decisive experiment: replay discovery on the byte-identical graphs under four rng seeds each (harness validated — seed2's graph + its original seed reproduces 61 / 75 / 0.40 exactly). Two regimes appear. seed2's graph is trapped: fresh seeds give 118, 219, 196 clusters (coverage 0.55–0.60) against the original's unlucky 61 — a lottery. The archived native graph is trap-free: all four seeds run the full 800-attempt cap with no giant wipe and enumerate 564–587 clusters (±2%) at coverage 0.75–0.79 — on such a graph the attempt budget, not the race, limits enumeration. One caveat that is itself a finding: the archived "native" graph is a same-config rebuild (the original was lost to a pod wipe), and the original rng replayed on it diverges (571-at-cap vs the original's wipe-at-567 → 430) — so execution-context noise doesn't just re-roll the race, it rewires whether the trap exists. Matching the original 430-cluster inventory against the rebuild's replay gives the graph-replicate rung of the ladder: conditional ARI 0.45 / NMI 0.72, median best-Jaccard 0.39 / 0.34, ~40% of clusters keeping a ≥0.5-Jaccard partner.

Two practical consequences. For reading results: cluster counts and coverage are draws from a wide distribution — compare runs on conditional agreement, per-cluster best-Jaccard and judge goodness, never on inventory size. For the algorithm: termination should count unclustered mass among non-main-body rows (or cap per-attempt wipes) so that enumeration length stops being a lottery; until then the cheap fix is re-running discovery — CPU-only, ~11 s/attempt — with a few rng seeds and keeping the longest enumeration. And the judge stays blind to all of it: mean balanced accuracy is 0.86–0.89 on every rung of the replication ladder, from bit-identical reruns to cross-backend, cross-graph, cross-pod replicates. What this pipeline finds is stable; how much of it a single run enumerates is not.

§6 Addendum (2026-07-16): the EK-FAC arm — a stronger metric that loses the plot

Would the Kronecker-factored metric behind LLM-scale influence functions (EK-FAC — per-layer eigenbasis whitening with corrected eigenvalues) beat our diagonal? Same 261,632 rows, same hash seeds, same discovery config, only the preconditioner swapped. The exact kernel answers first: EK-FAC whitens to near-isotropy — stable rank 4.7 → 617 — while keeping pairwise agreement moderate (Pearson 0.864, kNN@1 0.687 vs the diagonal; damping-insensitive over ±10×). The error law then prices it: ĉ = √(1+reff) ≈ 25 vs 2.4, so at this page's native width the EK-FAC kernel estimate carries ~19% error against the diagonal's ~2% — matching accuracy would take ~100× the width. And the judged outcome is chance: 175 clusters, mean balanced accuracy 0.520, median 0.500, none above 0.75 (diagonal: 0.872 / 0.90 / 45% above 0.9), with total inventory replacement (median best-Jaccard 0.005 both directions — more disjoint than any arm pair in this study). Compute cost was near-parity (40.5 rows/s; the rank-1-per-layer rotation trick works) — the cost is informational: EK-FAC divides out exactly the concentrated gradient directions that carry judgeable structure, then the flattened remainder defeats the sketch. Verdict for this pipeline: the diagonal + top-PC projection is the operating point; EK-FAC stays an exact-kernel influence tool at probe scale.

hover a cluster for its members · click to pin 0.6 0.8 1.0 judge BA · unscored
Fig. 8 · All 175 conductance clusters of the ekfac arm (Pythia-14M, EK-FAC preconditioner, 261,632 per-token rows), laid out by t-SNE on inter-cluster kNN edge mass. Point size ∝ log cluster size; colour = judge accuracy (grey = outside the scored sample). Hover for five member examples: the row's own target in [orange], shaded tokens belong to the same cluster, pale gold ones are kNN-adjacent — multi-token features appear as runs of adjacent shading. Click to pin, Esc to dismiss.
rows
261,632 per-token gradients — Pythia-14M, pile-10k, 512 seqs × 512 positions, marginal preconditioner q = 1/(v+ε), CountSketch D=4 × S=4096 (16,384 total dims, fp16 features)
arms
all parameters (P = 14.1M) vs embeddings frozen (P = 1.2M non-embedding); widths: native 16,384 + offline per-table folds to 4,096 / 1,024 total dims
clustering
ACL push PPR (α = 0.001, εPPR = 1e-5 recalibrated from the paper's 1e-7), k = 45 self-tuning kNN graph, sweep cuts, Algorithm-1 discovery; full arm termination 0.001/uncapped, no-embed 0.02/cap-800 (config asymmetry noted)
scoring
detection protocol: explainer + judge = claude-sonnet-5 (seed 20260714), 10 train / 10 held-out / 10 distractors, balanced accuracy; zero skips on full arms, seeded 120-cluster samples on no-embed runs
matching
per-cluster best-Jaccard counterparts over shared rows + run-level ARI/NMI; goodness×Jaccard join on matched scored pairs
Code · ArcadiaImpact/gradient-kernel (clustering subsystem per CLUSTERING_SPEC.md; scoring in clustering/scoring.py; figures scripts/make_pilot_figures.py; results doc commit c02e948).
Artefacts · HF arcadia-impact/gradient-kernel-cluster-pilot-20260714 (all six clusterings, scores, comparisons, membership matches, PILOT_RESULTS.md).
Compute · gk-ladder A100 + gk-gpu RTX PRO 4000, ≈$25; ~10k claude-sonnet-5 judge calls. Pods stopped after verified upload.