Rust in Everything
← Papers

Mixed Signals: Weight-Space Programming for EEG and ECG

Dara Varam, Taraneh Aminosharieh Najafi, David Atienza

2026-11-12▲ 3arXiv 2611.13758v1Hugging Face

AI-generated from the full paper (deepseek-flash). It may contain mistakes; check the original.

TL;DR

A first evaluation of weight-space programming on EEG and ECG networks shows LLMs can write working classifiers from scratch and switch off hidden recording artifacts through reasoning alone, but cannot identify a trained network's task from its weights or improve an already well-trained model.

Problem

Weight-space programming lets a language model read a network's weights as text and edit them, previous demonstrations covered game-playing networks, language models and diffusion models. The paper asks whether the same approach transfers to biosignal models, where labels and subjects are scarce and models must often run on constrained wearable hardware. The open question is whether an LLM can tell what an EEG or ECG network does, improve it, repair it, diagnose why it fails on unseen data, and write a working network from nothing, without any gradient step.

Method

Five experiments of increasing difficulty are run on two networks: TinyEEGNet, a reduced EEGNet with 2,730 weights, and ECGResNet, a one-dimensional residual network with 941,189 trainable weights. The experiments are (1) reading the task from weights, (2) improving a healthy network, (3) repairing a planted fault (EEG) or swapped arm electrodes (ECG), (4) debugging a hidden recording artifact without being told its cause, and (5) writing every weight of an empty network from 5 practice subjects. Three LLMs are compared with the same harness and prompts: Claude Opus 5.5, GLM-5.3 and DeepSeek-V4.1-Flash, with gpt-oss-120b grading textual answers. Success rules were fixed before each experiment and every result is scored on data the model never saw. Baselines are gradient-descent training, random edits of the same size (placebo), bias recalibration, fine-tuning, last-layer re-training, and two hand-crafted EEG pipelines (relative alpha power, and CSP with shrinkage LDA).

Results

  • A network written purely by reasoning from 5 practice subjects matched gradient descent trained on 30 subjects, using far fewer subjects. §III-E
  • Opus's written eyes-open/closed network scored above both hand-crafted pipelines fitted on the same 5 subjects, while the open-weight models' networks scored below them. §III-E
  • Without being told the cause, models named the hidden ECG artifacts, and their edits reduced the share of MI calls the artifact could flip and raised MI-AUC on new ECGs, though no edit beat the pass mark. §III-D
  • No model could identify the task of a trained network from its weights; the best score was close to what the same model achieved on control networks never trained on any task. §III-A
  • None of the models improved a healthy network, and the standard training-based fixes did no better on the same networks. §III-B
  • With feedback, Opus and DeepSeek recovered the accuracy lost to invisible EEG faults almost fully but without naming the mechanism, while on the ECG arm swap only Opus moved the network and it fell just short of the textbook check. §III-C

Limitations

  • Experiments 3 (ECG), 4 and 5 use a single run per model and setting, so run-to-run variation is not investigated (stated in §IV).
  • A single LLM (gpt-oss-120b) grades all textual answers; the paper states a manual check of a subset or a panel of graders would strengthen this validation (stated in §IV).
  • Both PhysioNet datasets are public and likely in the LLMs' training corpora, so reported prior knowledge of physiology may partly be knowledge of these specific datasets (stated in §IV).
  • The two hand-crafted baselines of experiment 5 were added after the LLM runs, so their success rule was not fixed in advance (stated in §IV); more broadly, no model beat the best gradient-based fix once the cause of a failure was known, and none could improve a well-trained network (stated in §V).

Key points

  • TinyEEGNet has 2,730 weights with batch normalization folded into the convolutions, so every weight is an ordinary multiply-and-add; ECGResNet has 941,189 trainable weights (943,877 numbers with batch-normalization statistics). §II-B
  • Success rules for all five experiments were fixed before running, and models were scored afterwards by the authors on data the language model never saw. §II-F
  • In experiment 1, Opus usually recognized the dataset from electrode layout and sampling rate and then picked its best-known task, so answers came from dataset knowledge rather than from the weights. §III-A
  • Telling the models something was broken produced clearly different outputs from asking them to improve a healthy network; Opus and DeepSeek repaired the visible faults even without feedback and named the mechanism in 83–100% of these runs. §III-C
  • For invisible EEG faults, no model named a swapped output or mirrored electrodes in more than 17% of runs with feedback; they found edits that feedback rewarded and that happened to cancel the fault. §III-C
  • In experiment 4, Opus described the muscle filter as a steep 25 Hz low-pass filter flat to 21 Hz, at half strength at 25 Hz and empty above 29 Hz, against true values of 20, 25 and 30 Hz; no model invented a non-existent cause. §III-D
  • Opus's eyes network filters each electrode into alpha, theta and beta bands and compares neighboring rows of electrodes, while its fist network is mirror-symmetric and combines eye movement, slow cortical potential and beta drop cues. §III-E
  • The authors conclude models succeed not by fitting data but by recalling structural priors of what a given classifier should look like, and suggest WSP as an initialization pass before gradient descent. §V

Mind map

WSP for EEG and ECG
Networks and data
TinyEEGNet, 2730 weights
ECGResNet, 941189 weights
Public PhysioNet datasets
Models compared
Claude Opus 5.5
GLM-5.3
DeepSeek-V4.1-Flash
gpt-oss-120b as grader
Five experiments
1 Read the task
2 Improve healthy net
3 Repair planted fault
4 Debug hidden artifact
5 Write from zero
Main findings
Task not readable from weights
Healthy nets not improved
Hidden artifacts named and removed
Written net matches 30-subject training
Limitations
Single run per setting in exp 3 ECG, 4, 5
Single LLM grader
Public data may be in training corpora
Hand-crafted baselines added after runs