Skip to main content
Back to timeline
arXivSource publication:

A language model writes an EEG network without a single gradient step: all 2,730 weights by hand, 0.834 balanced accuracy from five subjects

Synopsis

Weight-space programming lets a language model read and edit a trained network's weights directly, and had been shown on game-playing networks and language models. Applied to EEG and ECG models, Claude Opus 5.5 wrote all 2,730 weights of TinyEEGNet with no gradient step and only five practice subjects, reaching 0.834 balanced accuracy on 65 unseen subjects, on par with 0.806 for the same architecture trained on 30 subjects and above 0.704 trained on five; it could not infer a network's task from its weights, nor improve an already well-trained network.

Source-provided article image: Mixed Signals: Weight-Space Programming for EEG and ECG
arXiv

Interpretation

A language model can write a working physiological-signal classifier directly, without gradient descent. The standard route has an optimizer set the weights through millions of small gradient steps on labeled examples; earlier weight-space programming demonstrations covered game-playing networks and language models, not EEG or ECG models. On the eyes-open versus eyes-closed task from the PhysioNet EEG motor imagery dataset, the network written by Claude Opus 5.5 reached 0.834 balanced accuracy (95% CI 0.794–0.872) on 65 unseen subjects, on par with 0.806 for the same architecture trained by gradient descent on 30 subjects and above 0.704 trained on five.

The model can also find a recording artifact an ECG network relies on without being told the cause, and switch it off inside the weights. Such shortcuts are usually patched by targeted gradient fine-tuning once the cause is already known. With mains hum, a calibration pulse at recording start, or an approximately 25 Hz low-pass muscle filter planted in PTB-XL ECGs, Claude Opus 5.5 and GLM-5.3 each named all three artifacts in all four runs, and DeepSeek-V4.1-Flash named the hum and the pulse; before editing the artifact flipped 75%–91% of myocardial infarction calls, after Opus's and GLM's edits at most 3%, and MI-AUC rose from 0.67–0.69 to 0.83–0.86.

Writing a network draws on the model's prior knowledge of EEG structure rather than on fitting data. The models failed the reading task: none could tell from the weights alone what a network had been trained to do, and GLM's best score of 0.33 with electrode names was close to its 0.29 on control networks never trained on any task. Opus's eyes network detects alpha rhythm over the back of the head, and its fist network is mirror-symmetric and combines eye movement, the slow potential over the opposite motor cortex and a beta drop; Opus estimated 0.97 for its eyes network, which actually scored 0.834.

Perspective

The results come from two public datasets, the PhysioNet EEG motor movement/imagery data (109 subjects, 64 electrodes) and PTB-XL (21,388 recordings with diagnostic labels), on two networks: the 2,730-weight TinyEEGNet and the 941,189-weight ECGResNet, with all scoring on subjects or recordings the models never saw. The authors limit the intended setting to small networks deployed on edge devices and wearables, and suggest a language model as an initialization pass before gradient descent.

The ECG electrode-swap repair, the hidden-artifact debugging and the from-scratch writing use a single run per model and setting, so run-to-run variation is not yet investigated; a single model, gpt-oss-120b, grades all textual answers; both datasets are public and likely part of the language models' training corpora, so what is called prior knowledge of physiology may partly be knowledge of these specific datasets; writing the networks cost 8.50 and 9.08 USD in API fees for Opus and took 38–39 minutes of wall-clock time, while gradient descent trains the same network on five subjects in 2–5 seconds on one NVIDIA A100 GPU.