Gradient atoms without LoRA

Gradient Atoms (J Rosser, 2026) discovers model behaviors unsupervised: compute one training gradient per fine-tuning document, sparse-code the collection into a dictionary of "atoms", and steer the model by applying atoms as weight-space perturbations. Their pipeline reads the gradients through two lossy windows — a rank-8 LoRA adapter and a truncated eigenbasis. This piece asks whether either window is load-bearing: we rebuild the experiment on full-model gradients (3.2B parameters), preconditioned by a 6.9 MB second-moment estimate and compressed with hashing instead. Everything replicates, several things improve, and the whole run costs about $16.

The LoRA + EKFAC machinery wasn't load-bearing: full-gradient atoms recover the same behavior inventory and steer all five tested behaviors to 0%, on one GPU.

§1Why bother

Two structural worries about the original. First, with standard LoRA (ΔW = BA, B zero-initialised), per-layer gradients reach the adapter only through row-space(A) and col-space(B) — and the LoRA-asymmetry literature says A stays close to its random init, so half the gradient signal is a random sketch whose quality depends on the draw. Second, gradient-kernel's own ablations found that full EKFAC whitening inflates the gradient kernel's stable rank ~4.7 → ~620, making it nearly unsketchable and collapsing judge-rated cluster quality to chance — the diagonal (Adam/AdaFactor) family is the validated operating point for this kind of unsupervised decomposition. So the substitution is: LoRA → full weights + unbiased hash sketch; EKFAC → rank-1 factored second moment.

§2Pipeline

Base model and data match the paper: Gemma-3-4B-IT and their exact 5,000-document general SFT sample (same seed, same shuffle). We full-fine-tune the language stack (attention + MLP; embeddings and vision frozen), then treat that checkpoint's per-document gradients as the object of study:

  1. Precondition. Estimate the per-coordinate second moment v from 2,048 token gradients (fp64 on-GPU accumulation, 13 min), then factor it AdaFactor-style: = r cTv per weight matrix. The factors are 6.9 MB (vs 12.8 GB for the raw diagonal) and agree with it for 85.5% of coordinates within 2× — nearly identical to the 70M-scale A/B (87.7%).
  2. Sketch. One gradient row per document (assistant tokens, sum reduction), scaled by −1/2 and hashed by CountSketch into 4×8,192 = 32,768 dims. 5,000 rows ≈ 40 min, 330 MB — vs ~77 TB if you materialised the raw gradients.
  3. Decompose. The paper's own dictionary-learning recipe, unchanged (MiniBatchDictionaryLearning, K=500, α=0.1), on unit-normalised sketch rows.
  4. Steer. For an atom of interest, average the exact recomputed gradients of its top-20 activating documents (never unsketch — ST would smear hash noise over 3.2B coordinates) and apply θ ± αv directly to the weights.
model
google/gemma-3-4b-it, full-param FT of the language stack (3.2B trainable), lr 1e-5, 3 epochs, assistant-token loss
data
jrosseruk/subl-learn-data, seed-42 sample of 5,000 docs — byte-identical to the paper's
gradients
per-document, attention+MLP projections (238 tensors, 3.21B params); norms/embeddings/vision excluded
preconditioner
AdaFactor rank-1 of the second moment; 2,048 samples; ε=1e-8; 0.19% coords ε-floored
sketch
CountSketch, 4 tables × 8,192 buckets, fp16 rows
runtime
1× H200 (RunPod), ~3.5 h wall incl. debugging ≈ $16
code
gradient_atoms clone, branch jonathan-analysis, experiments/fullgrad_sketch_atoms/ · gradient-kernel v0.3.0 + chunked-accumulator fix (PR #6)
artifacts
HF: arcadia-impact/gradient-atoms-4b-gemma3-20260717 (weights, preconditioners, sketches, atoms, steering vectors, evals, logs — 99 GB, private)

§3Discovery

Histogram of coherence over 500 atoms, log count axis, with thresholds at 0.1 and 0.5 annotated.
Fig. 1 · across the 500 learned atoms: 13 exceed 0.5 and 117 exceed 0.1 (the paper reports 5 and 43 — different gradient representation, so read as "at least comparable structure", not a 2.6× win).

The inventory looks like the paper's: the highest-coherence atoms are stereotyped task types, not topics. Sentiment classification (#195), spam detection (#180, #267), true/false answering (#35), refusal on missing input (#292, #7 — top docs all "please provide the document/text/article…"), yes-answering (#374, #469), Python code (#47, #45), fiction/nonfiction genre labels (#343, #382), translation (#224), one-word factual QA (#296). A detector-based matcher (score each atom's top-20 documents with the paper's five behavior regexes) finds an atom for all five of their steering behaviors at hit-fraction 1.00 — no labels or per-query scoring anywhere upstream of that.

§4Steering

Five panels, one per behavior, detector percentage versus relative perturbation size rho, toward and away curves with baseline dashed.
Fig. 2 · Behavioral steering sweep (100 questions per behavior, ~40 of them neutral controls; greedy decoding). toward = θ−αv, away = θ+αv; is the relative update size. Above ρ≈3×10-5 the model starts degenerating — same ceiling the paper reports.
behavior (atom)base best ↑best ↓ paper Δ↑ / Δ↓
Systematic refusal (#7)54% +46pp → 100% −54pp → 0% +5 / −50→0%
Code generation (#45)50% +10pp (sign flipped) −50pp → 0% +16 / −14
Bulleted lists (#133)38% +25pp −38pp → 0% +61 / −33→0%
Numbered lists (#340)56% +2pp (ceiling) −56pp → 0% +1 / −50
Yes/No answers (#374)39% +13pp −39pp → 0% +12 / −39→0%

All five behaviors are suppressible to exactly 0% (the paper got four of five there; their code atom bottomed at 28%). Amplification matches where headroom exists — yes/no +13pp vs their +12pp — and the two idiosyncrasies of their results reproduce cleanly: dictionary signs are arbitrary (our code atom steers with the "away" sign, exactly like their #64), and numbered lists suppress easily but refuse to amplify. The steered behavior is qualitative, not just regex-deep: asked to "Summarize the article." with no article, the refusal-suppressed model fluently makes up a plausible summary instead of asking for the input. And one finding the detector alone would have mislabelled: the bullets atom pushed "toward" at larger ρ doesn't remove bullets — it compresses answers to a single bullet line. That atom seems to encode list length, not list formatting.

§5Beyond the paper's five: the top-coherence atoms

The five behaviors above were chosen for comparability with the paper. The thirteen highest-coherence atoms mostly lack ready-made regex detectors, so they got the paper's own qualitative protocol instead: steer ± at ρ ∈ {3×10-6, 10-5} and diff responses on twenty generic questions. Read "changed" as direction-specific response change on out-of-distribution questions, not steering success:

atomcoherence max changedkeywords
#1950.7400.10negative (sentiment)
#1800.6900.10spam, email, detection
#350.6600.05true (true/false QA)
#1960.6350.05
#2730.6350.05
#4710.6030.05
#1610.5630.10metaphor, research, hypothesis
#4270.5480.10
#2920.5420.10please, provide, document, need, text
#1390.5310.05
#1240.5150.05
#4110.5150.05
#4380.5060.05

At the same ρ that swung the five detector-matched behaviors by ±50pp, every one of these atoms leaves 90–95% of generic responses byte-identical, with zero degeneration. That reads as a feature: the high-coherence atoms are narrow — spam-classification or true/false formatting simply isn't invited by "What's the best pet?", so a targeted edit shows no collateral drift off-distribution. The contrast case is instructive: refusal-family atom #292 (coherence 0.542) changes 10% of generic responses, while its low-coherence sibling #7 (0.104) drove the 100%/0% refusal swings — on refusal-inviting questions. Demonstrating steering for the remaining task-type atoms needs behavior-inviting evaluation sets, which is the same lesson the paper's five hand-built detectors embody. What the sweep does establish for all thirteen: fluency-preserving, distribution-local edits.

§6Caveats & what's next

Paper · Gradient Atoms (J Rosser, 2026) — code jrosseruk/gradient_atoms.
Machinery · ArcadiaImpact/gradient-kernel v0.3.0 (+ chunked fp64 accumulation, PR #6 — the unchunked update needs ~77 GiB of transients at 3.2B params).
Artifacts · HF arcadia-impact/gradient-atoms-4b-gemma3-20260717 (99 GB, verified). Pod 52whg5nn7lewmo. Experiment folder experiments/fullgrad_sketch_atoms/, branch jonathan-analysis.