Explore the research collection
2 entries · Follow this search
- Post
Sparks of Weight-Space Programming: LLMs can natively read & write neural network weights
Blog post (2 Nov 2026) reporting early experiments on 'Weight-Space Programming': a general-purpose frontier LLM (GPT-6 Astra) reading and writing a neural network's raw weights directly, by reasoning - no optimizer, no gradient descent, sometimes no environment feedback at all. Complete logs of every experiment are released (github.com/RikiyaT/lm_understand-logs). READING: (Exp 1) given all 17,253 weights of an MLP policy as text, Astra names which of four PPO-trained games (Breakout/Pong/Pac-Man/Freeway, identical architecture and settings) each network was trained on - all four correct, without being given the options. (Exp 2) it identifies what shape each of three small DDPM diffusion models generates, from the weights alone, finding the shape's edges in the output layer (it draws outlines, missing that the shapes are filled - evidence it reads weight structure rather than simulating forward passes). (Exp 3) given only the middle four blocks of 7.2M char-level transformers, it names the training language (Python/romaji/English) for all three and identifies every induction ('copying') head with no false positives, effectively rediscovering the Elhage et al. weight-multiplication analysis unprompted. WRITING/FIXING: (Exp 4) a PPO Kinetix car-policy stuck in a local minimum (0% success) is fixed in one shot with no tools - Astra adds a small position/speed-reading path that switches off after the jump; 3.5% of weights changed, 100% success over 1,024 episodes. (Exp 5) zero-shot, from rules and source code only, it writes MinAtar policies from scratch that beat PPO-100M in all three games (Breakout 517.4 vs 15.8) and roughly match PPO-500M (Breakout 20x its score; Asterix close; Seaquest 60%). (Exp 6) at 1.48M weights (9x9 Go) via a Python sandbox, with zero forward passes it beats smaller PPO nets in over half its games; with 50 forward passes it beats an equal-sized PPO net trained on 20M games - it writes the net as an explicit program (liberties, groups in atari, capture/save heuristics) compiled into weights. (Exp 8) the headline: Qwen3.5-0.8B's known reasoning-loop failure is traced to one direction written by the MLPs of layers 15 and 19; subtracting it from 64 output columns in each (131,072 weights, 0.016% of the model) with a budget of 50 forward passes raises MATH-500 7.9% -> 48.1%, GSM8K 13.8% -> 67.1%, IFEval 21.0% -> 62.3%, and cuts token-limit hits 93% -> 33%. HONEST LIMITS, reported by the authors themselves: (Exp 7) Astra cannot tell which of two Gemma 3 270M fine-tunes is sycophantic from weights alone (0/4 attempts) - it succeeds only when also given attention patterns on texts it writes; and on Gemma 3 270M, which rarely loops, its edits move MATH-500 by at most ~1 point - weight editing removed an obstacle hiding an ability but could not add an ability the model lacked. Caveats: a blog post, not a peer-reviewed paper; all results are first-party, produced with a closed frontier model; the authors flag context-length and harness inefficiency as the current limits and say a benchmark and harness for Weight-Space Programming are in progress. Framing warning: the X post that circulated this (@MTSlive) attributes the work to 'Researchers at MIT' - no MIT affiliation appears anywhere in the post (acknowledgements thank discussants at Berkeley Sky Lab, CMU, and cmpnd), so that attribution is unsupported. In the catalog's weight-editing thread (cf. EngramEdit ID 1626, Qwenputer), this is the reasoning-native counterpart: no trained editor or compiler, just a frontier model reading and writing weights from a natural-language spec.
- Post
Reactive Optimizers — OPAL (OPtimizer with an Agent in the Loop)
Thesis: optimizers are static — hand-crafted or discovered offline, then run unchanged. A reactive optimizer instead puts a zero-shot LLM agent (Claude Opus 5.5 in all blog experiments; nothing learned or retained across runs) inside a single training run and gives it code as the entire interface. The agent iteratively rewrites two programs: `updater.py`, the optimizer itself, executed every step — the whole algorithm is up for rewriting, not just hyperparameters — and `analysis.py`, self-written probes that extract the training-dynamics statistics the agent chooses to watch (per-parameter-group gradient norms, update size relative to weights, cosine between consecutive gradients, per-tensor spike detection). One agent conversation spans the run, so it remembers what it tried and why. In the released package, checks run every 50 steps, decisions are capped (default ≤50, front-loaded into the first 5% of the run), and the agent's remit is bounded: it cannot touch model, data, loss, batch size, step count, or evaluation, and until its first edit the wrapped run is bit-for-bit identical to the plain run. Guardrails in the package: a new updater takes over on all ranks at once and runs a 20-step trial — an error reverts to the previous program; a first-step failure is undone exactly when a snapshot of parameters + optimizer state fits in `snapshot_limit_gb` (default 2 GB); a later failure is NOT undone and the agent is only told; an `eval_integrity` check flags a program that moves parameters away for an evaluation and back. Training can run asynchronously while the agent thinks (blocking=False), edits landing a median of 65 updates later on Goldfish. Headline claim (authors'): where no recipe has been tuned for the setting, OPAL — always INITIALIZED from an existing recipe — matches or beats the best recipe one could pick off the shelf one-shot. Baselines, precisely: for settings derived from modded-nanogpt Track 3 (162M GPT on FineWeb), five leaderboard records transplanted with natural adjustments (#46, #30, #21 Shampoo, #36 tuned Muon, #2 AdamW; at quarter batch, all LRs ×¼) — OPAL initialized from #36 ranked first in every new setting (quarter batch; Chinese, Thai, Kyrgyz from 1 GB Goldfish sets; Chinese/Thai bars are means of 3 runs). Goldfish Amharic (125M GPT, 1 GB, 10 epochs; metric bits/sentence on held-out FLORES-200): official recipe 83.48 → OPAL from that recipe 81.11; an LR sweep found a static recipe at 80.89 — ahead of OPAL-from-official — but OPAL initialized from the swept recipe ended ahead again at 80.73 (Swahili similar: 79.37 → 77.60). Image generation: LightningDiT-XL/1 on ImageNet, FID-50K 1.83 vs official recipe's 2.18 with guidance (4.33 vs 5.15 without); RAEv2-B (official recipe already a Muon variant, GMuon) 3.19 vs 3.39 in the blog — the repo table shows prompt sensitivity: 3.10 with an efficiency-asking prompt, 3.46 with the neutral prompt. SiT-B/2 (repo table): FID-50K 35.7 → 23.6. On the original, heavily tuned modded-nanogpt setting the gain is small (validation loss 3.2749 vs record #36's 3.2781), and the README documents a run that ended WORSE (3.2878 on OPAL 0.2.0). What the agent actually does, from the decision logs: builds intricate per-parameter-group multi-stage LR schedules (including mid-run LR increases; A/B/A tests alternating two LRs for a few hundred updates each and keeping the winner; re-planned earlier cooldowns from loss trends); migrates tensors from AdamW to Muon module-by-module (attention/MLP first, then adaLN split into chunks, timestep embedder last); on modded-nanogpt it measured that token-embedding entries are ~15 in size where adjacent bf16 values are 0.0625 apart, so as the LR decayed, rounding would discard a growing share of each update — from update 1,040 it kept that one matrix's Adam moments in float32 with compensated rounding on writeback and left everything else alone. Loss-spike defense: in a SiT run it traced 17 of 18 logged gradient spikes to the timestep embedder and wrote per-tensor clipping thresholds set from each tensor's own recent gradient norm (global threshold kept as backstop); in a controlled ResNet-18/CIFAR-10 experiment with four inserted stretches of random images and labels (agent not told), the first two stretches cost it −50.0 and −66.3 accuracy points (≈ the static baselines), but between stretches it added loss damping, replaced it with clipping, then wrote a gate that holds back batches whose loss is far above recent clean ones — the third stretch cost −12.1 and the fourth +0.7, while Muon+clip, AdamW+clip and Stable-SPAM still lost 28.5–76 points per stretch. Overfitting: ResNet-18 on CIFAR-10 with 10% wrong labels, no augmentation, agent sees train + dev metrics but is never told about the label noise — AdamW ends at test loss 2.49 / 73.5% accuracy (early-stopped 1.01 / 72.9%; weight-averaged 0.83 / 77.5%) and predicts the wrong trained label on 100% of the 4,500 mislabeled training images; OPAL ends at 0.69 / 78.6%, predicts the wrong label on only 4% (true label on 78%), via progressively higher learning rates plus a self-chosen weight average ("extended SWA") selected on the dev set. Toy control check (2D landscapes, OPAL restricted to heavy-ball with momentum resets/return-to-best): mean log10(f − f*) −11.6 vs −2.2 for the best of 12 common static recipes and −7.4 for the best of 382,080 swept recipes. Cost: ≈100 decisions on LightningDiT cost $6.42 at Opus 5.5 list price on top of ~74 H100-hours (~$510 AWS on-demand); asynchronous mode adds 1.01–1.14× wall-clock vs the static run (blocking at every decision: 1.30–4.39×). Authors' stated limits: gains shrink when a run is short AND its recipe is already fine-tuned (the two conditions coincide in the original modded-nanogpt setting; other settings train 8–120× more updates); reactive behavior is another source of nondeterminism and makes training less reproducible; most experiments run once, a few three times; the current implementation does not support sharded training or optimizer compilation. Repo README adds: v0.3.4, single GPU / single-node DDP only (no multi-node, FSDP, DeepSpeed); "the agent can make a run worse: it cannot restart or roll back training, it can only fix its programs at the next decision"; results vary run to run because the agent chooses differently. Repo ships a one-line `opal.wrap()` wrapper around any torch.optim optimizer, `opal doctor` / `opal estimate` / `opal show` / `opal report` tooling, examples, a CPU test suite, and an experimental Codex backend (gpt-6.1-sol); 34 stars, created the day of the thread.