Can a Frontier LLM Repair a Quantized Network by Tool-Free Weight-Space Programming?

Steffen UrbanarXiv 2026

TL;DR

What happens if you hand a frontier LLM a massive wall of raw neural network weights as plain text—with no Python interpreter, no calculator, and no training data—and ask it to fix a broken 4-bit quantized model? Remarkably, it doesn’t hallucinate random numbers; it independently arrives at a published post-training quantization algorithm and executes the mental math across 2,200 convolutional kernels by hand, recovering nearly all of the lost accuracy.

What Problem Does This Paper Address?

To shrink neural networks for edge devices, engineers use post-training quantization (PTQ): squashing 32-bit floating-point weights down into low-bit integers without retraining. At 8 bits, simple round-to-nearest (RTN) quantization works fine. At 4 bits, however, rounding errors compound across layers, causing model accuracy to plummet. Usually, we fix this using calibration data or specialized numerical scripts.

Steffen Urban asks a deliberately extreme question: Can a general-purpose LLM diagnose and repair a quantized neural network purely by reading its weights in context? By stripping away code execution, calculators, and evaluation feedback loops, the paper probes the absolute limits of "tool-free weight-space programming"—testing what patterns an LLM notices in raw parameter matrices and how reliably it can carry out mental arithmetic at scale.

Methods

The author trained SmallCNN, a compact 20,280-parameter convolutional network (four 3x3 conv blocks plus a linear layer), small enough to fit inside an LLM's context window as text. Standard 4-bit RTN quantization drops its test accuracy from 81.42% down to 60.39%.

Figure 1: SmallCNN. One CIFAR-10 test image per class. The highlighted one is passed through the float network. Each stack shows

Four Claude models (Opus 5.5, Sonnet 5.5, Haiku 5.5, and Fable 5.2) were tested across four tool-free protocols:

  • P1 (Whole Network, One Answer): The LLM sees the float weights (scaled by step size) alongside the 4-bit RTN integers, is told accuracy dropped to ~60.4%, and outputs sparse edits in a single response.
  • P2 (Layer by Layer): Same setup as P1, but fed across 11 conversational chunks so the LLM gets a fresh output-token budget per chunk.
  • P3 (Float Weights Only): The LLM receives only raw float weights (no RTN baseline, no mention of an accuracy drop) and must write out all 20k quantized weights and scales from scratch.
  • P4 (Float + BatchNorm Stats): Same as P3, plus BatchNorm running means and variances—testing whether the LLM uses activation statistics for data-free bias/rounding corrections.

Datasets

The target SmallCNN model was trained and evaluated on CIFAR-10 (using a 45k/5k train/validation split and the standard 10k test set). Crucially, the LLMs never see a single CIFAR-10 image; only the human researcher uses the dataset afterward to score the LLM-edited networks and validate error models. No new datasets are introduced.

Key Insights and Ideas

  • Rediscovering SQuant in Chain-of-Thought: In P1 and P2, Opus 5.5 and Sonnet 5.5 reason that because natural images are spatially smooth, a 3x3 kernel responds primarily to the sum of its weights. If nine weights in a kernel all happen to round up, they create a systematic DC bias shift in the layer's output. The LLMs counteract this by flipping weights sitting closest to a .5 rounding boundary until each kernel's rounding-error sum is near zero—effectively arriving at kernel balancing, the core step of the published data-free PTQ method SQuant.
  • Why Per-Weight Accuracy Lies: Making an individual weight less accurate (rounding 1.55 down to 1 instead of 2) makes the network much more accurate if it cancels out positive rounding errors elsewhere in the same 3x3 patch.
  • LLMs Need a Reason to Optimize: In P3 and P4—where models weren't told plain RTN fails and weren't shown rounding residuals directly—they named advanced error-cancelling techniques in their reasoning, declined to use them, and defaulted to plain RTN (occasionally clipping isolated outlier weights). Without a stated defect, LLMs treat textbook rounding as "good enough."
  • Output Budgets Bottleneck Mental Math: In P1, models found the right algorithm immediately, applied it to conv1, and stopped—explicitly stating the arithmetic for the remaining layers wouldn't fit in one reply.

Key Results

  • Near-Complete Recovery (P2): Given one response per chunk, Opus 5.5 manually balanced all 2,200 kernels (making 1,364 weight edits, 96% identical to a Python reference script). It boosted 4-bit test accuracy from 60.39% to 77.95%—just 3.5 percentage points shy of the FP32 model (81.42%) and 2.8 pp below data-driven AdaRound (80.71%).
Figure 4: P2: cumulative test accuracy after editing up to a layer,
  • Signal-to-Noise Restoration: Opus 5.5's manual kernel balancing raised the accumulated output SNR at the final logits from a noisy 3.5 dB (RTN) up to 12.8 dB.
  • Outlier Clipping Wins From Scratch (P4): When quantizing raw floats without RTN hints, Fable 5.2 ignored BatchNorm stats entirely but visually spotted isolated weight outliers, shrinking row scales slightly to clip them. This reached 69.97%, beating an automated MSE scale search (64.6%), though control tests suggest luck in conv2 played a role.
  • The Price of Artisanal Arithmetic: While a Python script runs kernel balancing in milliseconds on a CPU, having LLMs sum residuals in chain-of-thought burned 3.6M output tokens (~$81 total at list API prices; ~$13 for Opus 5.5's winning P2 run).

Limitations and Future Work

  • Single Runs & API Friction: Because of token costs, each result reflects a single run (where single weight flips in early layers can swing accuracy by ~1 pp). Midway through experiments, proprietary API safety classifiers also mysteriously began blocking weight-editing prompts, forcing harness changes.
  • Recall vs. Derivation: Because P1/P2 pre-divided weights by the scale ($u = w/s$), rounding residuals were easy to spot. Furthermore, it remains unclear whether the LLMs derived kernel balancing from first principles or recalled SQuant/adaptive-rounding concepts from pretraining.
  • Next Steps: The author suggests testing prompts without weights (to separate recall from derivation), stating the RTN accuracy drop in raw-float protocols (P3/P4), adding compressed weight encodings, and giving the LLM a tiny evaluation budget.

Summary updated

Abstract

We give four large language models (LLMs) of the Claude family the complete weights of a 20k-parameter CIFAR-10 CNN as text and ask them to produce a 4-bit network without tools, data or the ability to run inference. Standard round-to-nearest (RTN) quantization to 4 bit lowers the test accuracy from 81.4% to 60.4%. We design four evaluation protocols that differ in the input and task description given to the LLMs and analyze their responses. In the first two protocols the LLMs are given the float and the 4-bit RTN network and are told that the accuracy has dropped significantly. In the last two they receive only the float network and the task to quantize it, which tests whether they apply an optimization on their own or fall back to plain RTN. Our analysis shows that a frontier LLM can recover most of the lost accuracy. Given one answer per layer, Opus 5.5 raises the accuracy of the 4-bit network to 77.95% by balancing the rounding errors within each 3x3 kernel, reasoning over the integer weights without tools. This is 3.5 pp below the float network and 2.8 pp below AdaRound, which learns the rounding from calibration data. Given only the float network, the LLMs name error-cancelling corrections but do not apply them and fall back to plain RTN, at most with mildly clipped scales, which still lifts Fable 5.2's quantized network to 70.0%. We analyze in detail what the LLMs did and why it works. Code and prompts can be found at https://github.com/urbste/weight-space-programming-ptq
BibTeX
@misc{urban2026can,
  author = {Steffen Urban},
  title = {{Can a Frontier LLM Repair a Quantized Network by Tool-Free Weight-Space Programming?}},
  year = {2026},
  eprint = {2611.33031},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.33031},
}
Figure