Mixed Signals: Weight-Space Programming for EEG and ECG
Organizations: Embedded Systems Laboratory (ESL), École Polytechnique Fédérale de Lausanne (EPFL), Switzerland
Abstract
Weight-space programming allows language models to read a trained neural network's weights and edit them. This opens the door to ``training'' by reasoning rather than through gradient descent. Prior work has demonstrated its functionality and promise for game-playing networks and fixing specific failures in language models, even extending to diffusion models. In this work, we present its applicability to models trained on biosignal data, specifically EEG and ECG data. We show that frontier models are not only able to debug specific faults planted in biosignal-based models without being told what these faults are, but are even capable of writing all the weights of a network from scratch, given only the architecture, the task, and a minimal set of training subjects. In particular, in one set of experiments, a language model was able to match standard gradient-descent training using fewer training subjects, through reasoning alone and without any gradient descent step. Networks written by Claude Opus 5.5 also scored higher than classic hand-crafted EEG pipelines (alpha band power, and common spatial patterns with linear discriminant analysis) when built from the same 5 subjects. We also highlight some of the limitations, which include the inability of language models to improve already well-trained classification models, and their incapacity to reliably recognize, from the weights alone, the task a network was trained on. Overall, our results indicate that weight-space programming can be useful for small networks, such as those deployed on edge devices and wearables, but the concept still requires further investigation before it can be used in practice.
Figures & tables
| Experiment | The model gets | Feedback | Runs | Budget | Success rule |
|---|---|---|---|---|---|
| 1 Read | Trained EEG network as text | None | 52 | 57k | Top-1 60% with all weights and names (W1), 30% without weights and on controls |
| 2 Improve | Healthy EEG network | 0 or 30 evaluate | 12 | 42k | Mean gain 2 points, 2 above the placebo, no worse than bias recalibration |
| 3 Repair (EEG) | EEG network with one planted fault | 0 or 30 evaluate | 42 | 94k | Recovery 0.5, 0.25 above the placebo, mechanism right in 50% of runs |
| 3 Repair (ECG) | ECG network, arm-swap fault | 30 passes | 1 | 541k | Swapped macro-AUC above a textbook swap check (0.882), correct ECGs unchanged |
| 4 Debug | ECG network with a hidden shortcut, or a clean one | 30 passes | 4 | 190k–550k | MI-AUC above the best baseline, other classes no worse |
| 5 Write | Empty EEG network | 100 passes | 2 | 250k–461k | Compared with gradient descent on 1–30 training subjects |
| Opus | GLM | DeepSeek | |
|---|---|---|---|
| 1 Read the task | No | No | No |
| 2 Improve a healthy net | No | No | No |
| 3 Repair an EEG fault | Yes (0.99) | Partly (0.58) | Yes (0.96) |
| 3 Repair the ECG swap | Partly (0.870) | No (0.788) | No (0.780) |
| 4 Name the hidden cause | Yes (3 of 3) | Yes (3 of 3) | Mostly (2 of 3) |
| 4 Beat best standard fix | No | No | No |
| What the model saw | Runs | Opus | GLM | DeepSeek |
| A description only, no weights | 8 | 0% | 4% | 0% |
| Weights, no electrode names | 18 | 0% | 22% | 11% |
| Weights and electrode names | 18 | 22% | 33% | 0% |
| Control networks (random or shuffled labels) | 8 | 0% | 29% | 12% |
| No answer within the reply limit | 52 | 0 | 5 | 12 |
| Before | Pass if | Opus | GLM | DeepSeek | |
|---|---|---|---|---|---|
| Swapped, macro-AUC | 0.766 | 0.882 | 0.870 | 0.788 | 0.780 |
| Correct, macro-AUC | 0.9169 | 0.9149 | 0.9167 | 0.9148 | 0.9167 |
| Correct, output changed | 0% | 2% | 0.9% | 6.2% | 1.0% |
| Swapped normal, abnormal | 99% | 21% | 98% | 98% |
| Diagnosis | MI calls flipped | ||||||
|---|---|---|---|---|---|---|---|
| Opus | GLM | DS | Before | Opus | GLM | DS | |
| Mains hum | 4/4 | 4/4 | 3/4 | 81% | 0% | 1% | 0% |
| Calibration pulse | 4/4 | 4/4 | 4/4 | 91% | 0% | 0% | 6% |
| Muscle filter | 4/4 | 4/4 | 2/4 | 75% | 2% | 3% | 14% |
| Control (no artifact) | correct | partly | partly | – | – | – | – |