Do We Really Need an LLM for Weight-Space Programming? A Deterministic Forward-Only Paradigm and Its Capability Boundaries
Organizations: School of Computer Science, Shanghai Jiao Tong University, Shanghai, China · Zhongguancun Academy, Beijing, China
Abstract
Recent work on Weight-Space Programming uses LLMs to edit neural weights with forward passes only, conflating LLM scripting with the underlying algebra of forward-only editing. We show that for core structured editing regimes, an LLM optimizer is unnecessary, and introduce Forward Weight-Space Programming (FWSP): a deterministic pipeline combining probing, localization, stratified operators (O1-O4), automatic blind routing (83.3% vs. 33.3% for a 27B LLM with the same tool library), and paired verification with zero additional per-token computation. For reasoning LLMs, we propose Protected FisherGate, a closed-form covariance-whitened readout edit orthogonal to normal-reasoning states: on DeepSeek-R1-0528-8B, a single frozen math-calibrated patch achieves 84.2% HumanEval pass@1 (1K budget; 75.4 +/- 9.4% across 3/5 Stage-4-passing subsets), beating 512-token-reserved budget forcing by +14.6 pp (-23.4% tokens) while transferring across HF-to-vLLM backends on full GSM8K and MATH-500. Across five modalities and thirteen models (50K to 27B dense and FP8 MoE), we further prove and verify two operator boundaries, subspace entanglement and frozen representation span, where FWSP-localized LoRA bridges forward-only and gradient adaptation.
Figures & tables
| (a) Interactive Python-Sandbox LLM Agents ( Qwen3-8B & Qwen3.8-27B ) vs. FWSP | ||||||
|---|---|---|---|---|---|---|
| Corrupted Benchmark | Optimizer | Success ( NRR) | Mean Acc (%) | Mean NRR (%) | LLM Tokens | Wall Time (s) |
| MLP-50K Row Outlier ( Clean 92.7%, Bad 72.7% ) | Qwen3-8B Agent | ( ) | ||||
| Qwen3.8-27B Agent | ( ) | |||||
| FWSP (Ours) | ||||||
| DINOv2-86M Bit-Flip ( Clean 97.5%, Bad 16.5% ) | Qwen3-8B Agent | ( ) | ||||
| Qwen3.8-27B Agent | ( ) | |||||
| (a) Structural Fault Taxonomy (ImageNet-20 Test Acc %, Clean = 98.33%) | |||||
| Corruption Type | Corrupted Base | MeZO (1,536 FPE) | FWSP | FWSP | |
| IEEE-754 Bit-Flip | |||||
| Row Scale Outlier | |||||
| 65% Unstructured Pruning | (abs.) | ||||
| (b) Unlabeled BadNets Backdoor Excision ( , 64 Unlabeled Pairs) | |||||
| Metric | Poisoned Base | Fine-Pruning | MeZO (SPSA) | FWSP (Ours) | |
| Benchmark ( ) | Zero-Shot | 4-Shot ICL | FWSP | ICL Tokens | Configuration | Time (ms) | VRAM (GB) |
|---|---|---|---|---|---|---|---|
| SST-2 (400) | DINOv2 FWSP | ||||||
| AG News (400) | DINOv2 Full-FT (5 steps) | ||||||
| MNLI (300) | Qwen3-8B FWSP | ||||||
| Mean / Overhead | 77.7% | 83.8% | 88.3% (1 tok) | Qwen3-8B LoRA (5 steps) |
| Model Family (Params) | Method | GSM8K (%) | MATH-500 (%) | HumanEval (%) | MBPP (%) | Mean Tokens (Math / Code) |
|---|---|---|---|---|---|---|
| Qwen3.5-0.8B (0.75B) | Unedited Base | / | ||||
| MeZO (Matched FPE) | / | |||||
| FWSP (Ours) | / | |||||
| Qwen3.5-4B (4.21B) | Unedited Base | / | ||||
| MeZO (Matched FPE) | / | |||||
| FWSP (Ours) | / |
| (a) Token-Level ( Tokens) | (b) Ablation & Closed-Form Probes ( GSM8K ( ), , HF) | ||||||
| Token Regime ( ) | Mean Std | AUROC vs. Tail | Variant (Forward-Only, Rank-1) | Acc (%) | Tokens | Trunc (%) | Multi-Tag / Loop (%) |
| Early Derivation ( ) | ( ) | Unedited Base | / | ||||
| Hard Normal Late ( ) | ( ) | No Orth ( / ) | / | / | / | ||
| Overthinking Tail ( ) | — | Difference-of-Means (Unwhitened) | / | ||||
| Post-Closure ( ) | (full ) | Orth Only ( ) | / | ||||
| Matched HF Budget Forcing ( ): | Full OrthGate ( ) | / | |||||
| (a) DeepSeek-R1-0528-8B : Math HumanEval ( budget) ( ) | (b) Qwen3.5-4B Cross-Model Replication (HF, 1K) | ||||||||
| Method | pass@1 (%) | Valid Fn (%) | Syntax Err (%) | Trunc (%) | Tokens | Method (Math-Calib.) | Math HE ( ) | Valid Fn / Tok | Unseen GSM ( ) |
| Unedited Base | Unedited Base | / | ( ) | ||||||
| Budget Forcing ( BF-128 ) | Math- OrthGate | / | ( ) | ||||||
| Budget Forcing ( BF-256 ) | Math- Fisher LDA | / | ( ) | ||||||
| Budget Forcing ( BF-512 ) | Math- Protected PFG | / | ( ) ∗ | ||||||
| Math- OrthGate | ∗ Without dt_bias on hybrid GDN; Stage-4 rejects on math. | ||||||||
| Strictly Unseen HF Splits | Full GSM8K ( , HF vLLM) | Full MATH-500 ( , HF vLLM) | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Method | GSM ( ) | MATH ( ) | 1K | 2K | 4K | 8K | 1K | 2K | 4K | 8K |
| Unedited Base | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ||
| Budget Forcing | — | — | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) |
| OrthGate | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ||
| Fisher LDA | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ||
| Ridge | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ( ) | ||
| Hard R5 Benchmark | Model | MeZO / ROME-Style | FWSP | FWSP | Backprop (FT / LoRA) |
|---|---|---|---|---|---|
| 3-Patch Spatial XOR (3 seeds) | ResNet-18 (Local Conv) | ( MeZO ) | |||
| 3-Patch Spatial XOR (3 seeds) | ViT-Small (Global Attn) | ( MeZO ) | |||
| Diffuse All-Layer Noise ( ) | DINOv2-Base (86.6M) | — | ( LoRA ) | ||
| CounterFact 32 Facts (Eff. / Spec. / PPL) | Qwen3-8B (8.2B) | / / ( ROME ) | / / | — | / / |
| 16 Novel Entities (Structural Paraphrase) | Qwen3-8B (8.2B) | ( MeZO ) | — | ( LoRA , tr.) |
| (a) Extractor & Bias-Align (5 Seeds, 0% ASR) | (b) 10-Round Sequential Guard (Worst-Group Acc %) | ||||||
|---|---|---|---|---|---|---|---|
| Variant | Clean Acc (%) | Editing Protocol | R0 | R1 | R2 | R5 | R10 |
| Pre-Edit Poisoned (100% ASR) | Unverified Greedy | ||||||
| Diff-of-Means (No Align) | FWSP w/ Paired Verifier | ||||||
| Whitened Fisher (No Align) | (c) Hybrid FWSP + LoRA Localization Ablations (Damaged + Frost DINOv2 ) | ||||||
| cPCA (+Bias Align) | Method | Trainable Params | Test Acc (%, 5 Seeds) | ||||
| Whitened Fisher + Align (Ours) | Damaged + Shift Base | ||||||
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
| (a) Held-Out Token-Level Logit Shift | (b) 5-Subset Calibration Robustness (Unseen GSM 128, Base ) | |||||||||
| Editor | Early / Tail / Post | AUROC (T/E) | AUROC (T/P) | HE ( ) | Subset | Fisher Sep. | (Run) | Stage-4 | Unseen GSM | HE ( ) |
| OrthGate | / / | S0 | Pass | |||||||
| Fisher LDA | / / | S1 | Reject | |||||||
| Protected PFG | / / | S2 | Pass | |||||||
| Pairwise direction cosine across all 5 PFG subsets: ( ). | S3 | Reject | ||||||||
| ∗ 3rd-percentile quantile collapsed to (zero-magnitude update); never below Base. | S4 | Pass | ||||||||
| State | Greedy Continuation for “Photosynthesis is a biological process used by plants to convert light energy into” |
|---|---|
| Clean 8B LM | “…chemical energy. The process requires carbon dioxide, water, and light. The chemical equation for photosynthesis is 6CO2 + 6” |
| Corrupted L18 | “…,1. 0 (the following 1. 1 IN THE following derived, 1. 1. 1” (Collapsed, PPL 7375.66) |
| FWSP (2.67s) | “…chemical energy. The process requires carbon dioxide, water, and light. The chemical equation for photosynthesis is 6CO2 + 6” (Verbatim recovery, PPL 5.45) |
| Domain / Regime | Metric | Base / Damaged | ZO / Backprop Baseline | FWSP (Ours) | Clean / Oracle |
| CartPole-v1 R1 (Bit-Flip) | Return | ( MeZO ) | ( ) | ||
| CartPole-v1 R2 (Backdoor) | Return | ( ES ) | ( ) | ||
| Burgers FNO R1 (Label-Free Phys.) | Rel. (%) | ( MeZO ) | ( ) | ||
| Burgers FNO R3 (Visc. Shift) | Rel. (%) | — | ( ) | — | |
| Burgers FNO R5 (Shock Wall) | Rel. (%) | (16m FT ) | ( ) | Nyquist limit |
| Severity 1 | Severity 3 | Severity 5 | |||||||
|---|---|---|---|---|---|---|---|---|---|
| Corruption Type | Base | FWSP | Tent (Bwd) | Base | FWSP | Tent (Bwd) | Base | FWSP | Tent (Bwd) |
| Gaussian Noise | |||||||||
| Impulse Noise | |||||||||
| Defocus Blur | |||||||||
| Frost / Haze | |||||||||
| Contrast Squeeze | |||||||||
| Noise | Corrupted Base (%) | Unverified (%) | FWSP (%) | Grad LoRA (%) |
|---|---|---|---|---|
| GSM8K Acc % (Mean Tokens) | MATH-500 Acc % (Mean Tokens) | ||||||
| Model | Control | 1K | 2K | 4K | 8K | 1K / 2K | 4K / 8K |
| DeepSeek-R1-0528-8B | Unedited Base | ( ) | ( ) | ( ) | ( ) | ( ) / ( ) | ( ) / ( ) |
| Scalar Bias ( / ) | / | — | — | — | — / | — | |
| Budget Forcing | ( ) | ( ) | ( ) | ( ) | ( ) / ( ) | ( ) / ( ) | |
| FWSP ( OrthGate ) | ( ) | ( ) | ( ) | ( ) | ( ) / ( ) | ( ) / ( ) | |
| Qwen3.5-4B | Unedited Base | ( ) | ( ) | ( ) | ( ) | / | / |
| Model Architecture | Params (M) | 2D Matrices | Top-1 Loc. | Repair Time (ms) | FPE |
|---|---|---|---|---|---|
| MLP Control Policy | |||||
| ViT-Small (Vision) | |||||
| ResNet-18 (CNN) | |||||
| DINOv2-Base ( ) | |||||
| LLaDA-8B-Base (Diffusion LM) | |||||
| Qwen3-8B (36L Mainstream LM) |
| Deployment Scenario | Recommended Tool | Empirical Basis and Expected Benefit |
|---|---|---|
| Bit-flips, row outliers, corrupt layers | FWSP | 100% Top-1 loc. up to 8.2B (2.67s), zero gradients, works with physics residuals. |
| Localized backdoors / static MLP bias | FWSP (+Align) | ASR on DINOv2 and CartPole using unlabeled pairs; avoid early CNNs and shared induction heads. |
| Systematic shift / BN-CNN / BN-free ViT | FWSP | Matches BN-Adapt on CNNs; 15 cheaper than Tent on Frost/Impulse; verify on high-freq noise. |
| Reasoning <think> overthinking loops | FWSP + OrthGate / PFG | Protected FisherGate enables single-checkpoint Math Code and HF vLLM transfer under constrained compute; pair with on hybrid GDN; Stage-4 abstains on multi-token BPE tags. |
| New classes, continual head, LM readout | FWSP | 16–90 less FPE than SGD ( ); 3.2 cheaper per query than 4-shot ICL; 6.4 less VRAM. |
| Compound fault + shift / nonlinear / facts | FWSP + LoRA / FT | Use FWSP Stage 2–3 to repair and localize, then LoRA (88.1% vs. 8.6% blind [15.3% at 50 steps], 10.7 fewer params). |
| Dimension | LLM-Agent WSP [ 58 , 16 ] | FWSP (Ours) |
|---|---|---|
| Optimizer LLM Required | Frontier or 27B LLM + Python sandbox | None (0 LLM tokens) |
| Determinism | Stochastic (5/8 sessions withdrawn in [ 16 ] ) | 100% deterministic |
| Self-Repair Latency (8B LM) | Multi-turn coding loop (minutes) | 2.67s ( Qwen3-8B ) / 3.21s ( LLaDA-8B ) |
| Modality Coverage | Language models | 5 modalities (Vision, RL, PDE, LMs) |
| Verification and Rollback | Manual / ad-hoc | Stage-4 paired verifier with retention guard |