Mixed Signals: Weight-Space Programming for EEG and ECG
Abstract: Weight-space programming allows LLMs 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 LLMs, 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 LLM 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 LLMs 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.
Paper Prompts
Sign up for free to create and run prompts on this paper.
Explain it Like I'm 14
1. What is the paper about?
This paper studies a new way to create and repair neural networks, which are computer programs used to recognize patterns.
Usually, neural networks learn by looking at many examples and adjusting millions of numbers called weights. This process is called gradient descent. It is similar to training a student by giving them lots of practice questions and correcting their mistakes little by little.
The paper tests a different idea called weight-space programming. Instead of using a normal training algorithm, a LLM, such as Claude, looks directly at the network’s weights and changes them by reasoning about what the network should do.
The researchers ask whether this can work for biosignals:
- EEG: electrical signals from the brain
- ECG: electrical signals from the heart
2. What questions did the researchers ask?
The main question was:
Can a LLM create or fix an EEG or ECG network simply by reasoning about the numbers inside it?
The researchers tested five increasingly difficult abilities:
- Reading a network: Can the LLM figure out what task an existing network performs?
- Improving a network: Can it make a healthy, already-trained network work better?
- Repairing a known problem: Can it find and fix a deliberately planted fault?
- Debugging an unknown problem: Can it discover why a network fails on new data?
- Writing a network from nothing: Can it fill in all the weights of an empty network so that it works?
The researchers also wanted to know whether this method could be useful when there is only a small amount of training data. Medical data can be difficult to collect, and people’s brain and heart signals can be quite different from one another.
3. How was the research carried out?
The data
The researchers used two public datasets.
- The EEG dataset contained recordings from people whose eyes were open or closed, or who imagined moving their left or right hand.
- The ECG dataset contained heart recordings labeled with conditions such as heart attack, normal heart activity, and other heart problems.
The researchers separated the people into different groups for training, testing, and practice. This was important because the final tests used people the LLMs had never seen before.
The neural networks
The researchers used two networks:
- A small EEG network with 2,730 weights
- A much larger ECG network with about 941,000 weights
A weight is simply a number that controls how strongly one part of a network affects another part. Together, the weights are like the settings inside a very complicated machine.
The LLMs
Three LLMs were tested:
- Claude Opus 5.5
- GLM-5.3
- DeepSeek-V4.1-Flash
The models were given information about the networks and, in some experiments, a small amount of practice data. They were allowed to run the networks and see their results, but they were not allowed to use ordinary gradient-descent training.
This is similar to giving someone a machine, a few test materials, and instructions, then asking them to adjust the machine by thinking carefully rather than using an automatic tuning system.
Measuring success
The researchers tested the edited or newly written networks on data that the LLMs had not seen.
For EEG, they mainly used balanced accuracy, which checks how well the network recognizes both categories fairly.
For ECG, they mainly used AUC, a score showing how well the network separates different medical conditions. A higher score means better separation.
The results were compared with:
- Ordinary gradient-descent training
- Simple repairs, such as changing the final output settings
- Traditional EEG methods designed by experts
4. What did the researchers find?
The models could not reliably read a network’s purpose
When shown the weights of a trained EEG network, the LLMs usually could not tell whether it recognized eyes open versus eyes closed or left-hand versus right-hand movement.
Their guesses were often no better than guesses made from completely random networks.
This suggests that the models were often relying on what they already knew about the dataset, rather than truly understanding the information stored in the weights.
The models could not improve a healthy network
When the researchers gave the models an already well-trained network, none of them made it better.
This is important because it shows that weight-space programming is not automatically a replacement for normal training. If a network is already working well, simply asking a LLM to improve it may not help.
The models were good at repairing clear faults
The researchers deliberately damaged some EEG networks. For example:
- One filter was made far too strong.
- An output setting was shifted.
- The left and right electrodes were switched.
- The two output categories were exchanged.
Claude and DeepSeek were usually able to repair the obvious faults. When they received feedback about how well their edits worked, they could also fix some less obvious problems.
However, they sometimes fixed the problem without correctly understanding what had gone wrong. In other words, they could sometimes find a useful adjustment by trial and error, even when their explanation was incorrect.
The models found hidden problems in ECG recordings
This was one of the strongest results.
The researchers trained ECG networks using misleading clues, or shortcuts, instead of the actual heart signal. These clues included:
- Electrical interference, called mains hum
- A calibration pulse at the start of a recording
- Removal of high-frequency details by a filter
In the training data, these clues were connected with heart attacks. The network therefore learned that the recording artifact meant “heart attack,” even though the artifact was not part of the patient’s heart condition.
When tested on new data, the shortcut caused many mistakes.
Claude successfully identified all three hidden artifacts. It then changed the network so that it relied much less on them. The percentage of heart-attack predictions changed by the artifact dropped from about 75–91% to roughly 0–2%.
The other models also performed fairly well, although DeepSeek was less successful with one of the artifacts.
However, none of the LLMs beat the best carefully designed standard repair once the researchers already knew what the problem was.
The models could write a small EEG network from scratch
In the most surprising experiment, all three LLMs received an EEG network whose weights were all set to zero. They had to create every weight themselves.
Claude used recordings from only five people and wrote a network that recognized whether a person’s eyes were open or closed. Its accuracy on 65 unseen test subjects was about 0.834.
For comparison:
- Normal training with five people reached about 0.704
- Normal training with 30 people reached about 0.806
- Claude’s hand-written network reached about 0.834
So, for this particular task, Claude performed about as well as or better than ordinary training using many more people.
The network also used sensible information about brain activity. For example, it looked at alpha waves, which are brain rhythms often stronger when a person’s eyes are closed.
The models also created networks for recognizing imagined left- versus right-hand movement. These networks worked, although Claude did not outperform ordinary training with 30 people on this task.
The method was slow
Although writing the network was interesting, it took about 38–39 minutes. Ordinary gradient-descent training took only about 2–5 seconds on the researchers’ computer.
Therefore, weight-space programming was not faster in this study. Its possible advantage is that it may work with much less labeled data, not that it saves time.
5. Why are these findings important?
The study suggests that LLMs may have useful knowledge about physiology and signal processing. They may understand general ideas such as:
- Brain waves have different frequency ranges.
- Different electrodes measure activity from different body locations.
- Heart recordings can contain machine noise.
- A network should focus on the heart signal rather than recording equipment.
This knowledge may help a LLM design a small network even when only a few training examples are available.
This could be useful for small devices such as:
- Smartwatches
- Medical monitors
- Brain-computer interfaces
- Wearable health sensors
These devices often have limited computing power and may need small, efficient networks.
6. Limitations and possible future impact
The results are promising, but they do not show that LLMs can replace normal neural-network training.
The study has several limitations:
- Some difficult experiments were performed only once for each model, so the results might change in repeated tests.
- The datasets were public and may have appeared in the LLMs’ training data.
- The LLMs worked best with small networks.
- They could not reliably discover what an existing network was designed to do.
- They could not improve an already well-trained network.
- Writing a network took much longer than ordinary training.
- Some results were judged partly by another LLM, which could introduce mistakes.
Overall, the paper presents mixed results. LLMs were surprisingly good at finding hidden recording problems, repairing certain faults, and writing some small EEG networks from scratch. But they were not good at understanding every network or making strong networks even better.
The most likely future use is not replacing ordinary training completely. Instead, a LLM might first design a reasonable starting network, diagnose problems, or suggest repairs. Then ordinary training could finish the job. This combination could help build small medical and wearable devices when only limited data is available.
Practical Applications
Immediate Applications
The paper supports near-term use mainly as a research, engineering, and quality-assurance tool for compact EEG/ECG models. The results do not yet justify autonomous clinical deployment, but several workflows could be implemented now with human oversight.
- Automated debugging of biosignal models — Healthcare AI, medical-device engineering, research
- Potential tool: an interactive “model debugger” that combines weight inspection, activation analysis, controlled perturbations, and plain-language explanations.
- Immediate workflow: run the debugger on validation and cross-site data, review the proposed edit, and compare the modified model against standard fine-tuning and artifact-removal baselines.
- Dependencies: reliable evaluation data, access to model weights and intermediate activations, sandboxed execution, and mandatory human approval before deployment.
- Repair of known implementation and data-pipeline faults — ECG acquisition, EEG systems, medical-device software
- Potential product: a model-validation utility that checks for channel permutations, polarity inversions, abnormal filter magnitudes, and inconsistent output mappings.
- Example workflow: detect an ECG arm-lead swap, generate a proposed correction, then verify that performance improves on corrupted signals without changing predictions on correctly recorded ECGs.
- Dependencies: the fault must be sufficiently localized or diagnosable; corrections require regression tests, version control, and clinical-device change-management procedures.
- Artifact and shortcut audits before deployment — Clinical AI, hospital interoperability, medical-device certification
- Potential tool: a pre-deployment audit report containing suspected shortcuts, affected recordings, influential network components, and before/after robustness metrics.
- Practical value: early detection of failures caused by mains interference, calibration pulses, filtering settings, lead-placement errors, or site-specific acquisition conventions.
- Dependencies: representative multi-site data, accurate labels, appropriate privacy controls, and confirmation that the proposed edit does not remove clinically meaningful signal.
- Rapid prototyping of compact wearable and edge models — Wearables, brain–computer interfaces, rehabilitation, embedded systems
- Potential products: low-power EEG headbands, assistive interfaces, rehabilitation controllers, or demonstration-grade BCI prototypes using compact networks.
- Immediate workflow: specify the architecture, preprocessing, electrode layout, and target task; provide a small calibration set; generate candidate weights; then validate on held-out subjects.
- Dependencies: the task must have strong physiological priors, the architecture must be small and fully specified, and external-subject validation is essential. The paper’s results should not be interpreted as evidence of reliable patient-level performance.
- Low-data baseline generation for biosignal research — Academic research, clinical studies, small laboratories
- Potential workflow: generate a physiology-informed initialization or complete compact baseline, then compare it with conventional training, CSP/LDA, band-power features, and subject-adaptation methods.
- Dependencies: performance may depend on the LLM’s prior knowledge of the dataset or task. Results must be replicated on private and geographically diverse datasets rather than relying only on public benchmarks.
- Human-readable model documentation and review — Academia, software engineering, regulated AI
- Potential tool: a model-card generator that links weight changes to signal-processing interpretations and records every prompt, tool call, and validation result.
- Dependencies: explanations may be plausible but incorrect; they should be treated as hypotheses and checked with ablation studies, perturbation tests, and domain experts.
- Educational platforms for signal processing and neural networks — Education and training
- Potential product: an interactive laboratory environment with a sandboxed Python session, visualized weights, signal perturbations, and automatic evaluation.
- Dependencies: tasks should use non-sensitive or synthetic data, and the system should clearly distinguish explanatory demonstrations from clinically valid modeling.
- Open-weight, on-premises debugging assistants — Hospitals, regulated software, public-sector research
- Potential workflow: run an open model inside a hospital or laboratory environment, enforce file-access restrictions, and retain an auditable record of every proposed edit.
- Dependencies: sufficient local compute, model licensing, security evaluation, reproducibility across model versions, and independent validation of all edits.
Long-Term Applications
The more ambitious uses require broader validation, improved automation, and safeguards against incorrect or unjustified weight edits. They are plausible research directions rather than deployment-ready capabilities.
- Automated personalization of wearable biosignal models — Digital health, consumer wearables, rehabilitation
- Possible workflow: infer a physiology-informed network from a few subject-specific recordings, test it against population-level priors, and optionally use gradient descent only for final personalization.
- Dependencies: strong cross-subject generalization, uncertainty estimates, protection against demographic and device bias, and prospective validation. The current paper does not establish reliable personalization.
- LLM-generated initialization followed by conventional optimization — Machine learning infrastructure, biosignal modeling, robotics, edge AI
- Potential tool: a compiler-like pipeline that converts a task description and sensor layout into initial weights, then automatically fine-tunes and evaluates them.
- Dependencies: evidence is still needed that WSP initialization consistently outperforms random or hand-crafted initialization across datasets and architectures. Training speed may also dominate any benefit: in the paper, gradient descent took seconds while WSP required tens of minutes.
- Cross-hospital robustness and shortcut removal — Clinical decision support, medical-device regulation
- Potential product: a deployment-monitoring service that detects distribution shifts, attributes performance degradation to recording conditions, and proposes a model patch or retraining dataset.
- Dependencies: access to multi-institutional data, privacy-preserving evaluation, reliable causal tests, calibration monitoring, and regulatory approval. The paper shows that WSP can diagnose artifacts but did not outperform the best known fix once the cause was identified.
- On-device model repair and self-maintaining wearables — Embedded systems, IoT, robotics, energy-constrained computing
- Potential workflow: detect a known fault, apply a cryptographically signed weight update, run a safety test suite, and roll back if performance or stability worsens.
- Dependencies: formal constraints on permissible edits, secure update mechanisms, deterministic behavior, limited compute and memory, and a fail-safe fallback. Unrestricted autonomous weight editing would be inappropriate for safety-critical devices.
- Clinical model certification and continuous auditing — Healthcare policy, regulators, quality assurance
- Potential outputs: auditable evidence packages containing weight provenance, stress-test results, identified shortcuts, proposed corrections, and comparisons with standard baselines.
- Dependencies: standardized benchmarks, reproducible prompts and models, independent graders, manual expert review, and clear regulatory definitions of whether an LLM-generated weight edit constitutes a new medical device or a software change.
- Zero- or few-shot development for specialized sensors — Industrial monitoring, occupational health, sports, agriculture, and field medicine
- Potential workflow: describe the sensor physics and target event, provide a small calibration set, generate a compact network, and validate it against expert-designed signal-processing baselines.
- Dependencies: the paper only evaluates EEG and ECG tasks with strong known priors. New domains may require substantial domain adaptation, verified labels, and protection against confident but physiologically meaningless designs.
- General-purpose weight-space programming for small control and robotics models — Robotics, autonomous systems, industrial control
- Potential product: a natural-language controller-maintenance system that proposes weight patches after a sensor or actuator fault.
- Dependencies: the current results do not demonstrate safety, stability, or reliable task inference in robotics. Any deployment would require formal verification, simulation, hardware-in-the-loop tests, and strict bounds on allowable edits.
- Personal health and daily-life assistants using local biosignal models — Consumer health, accessibility, home monitoring
- Dependencies: clinical validation, false-alarm control, informed consent, privacy protections, model transparency, demographic fairness, battery constraints, and explicit limits on interpreting outputs as medical diagnoses. The paper’s findings support prototyping these systems, not immediate consumer or clinical claims.
Glossary
- Adam optimizer: An optimization algorithm that adapts learning rates for individual model parameters during training. “We train the network with the Adam~\cite{kingma2017adammethodstochasticoptimization} optimizer”
- AdamW: A variant of Adam that decouples weight decay from the gradient-based parameter update. “We train with AdamW~\cite{loshchilov2019decoupledweightdecayregularization}”
- Alpha band: The EEG frequency range approximately from 8 to 13 Hz, often associated with relaxed wakefulness. “relative alpha-band power (8--13 Hz, 8 posterior electrodes)”
- Artifact: An unwanted signal component introduced by recording equipment, procedures, or external interference. “a recording artifact that appears in 98\% of the ECGs with MI”
- AUC (area under the curve): A performance measure, usually the area under a receiver operating characteristic curve, used to evaluate classification. “We report balanced accuracy for EEG and AUC for ECG.”
- Balanced accuracy: The average of the recall values obtained for each class, useful when class frequencies differ. “reaching a balanced accuracy of 0.834”
- Band-pass filter: A signal-processing filter that preserves frequencies within a specified interval while attenuating frequencies outside it. “Recordings are band-pass filtered at \SIrange{1}{40}{Hz}”
- Batch normalization: A neural-network technique that normalizes intermediate activations to stabilize and accelerate training. “Batch normalization is folded into the preceding convolutions”
- Calibration set: A dataset used to adjust or guide a model without being used as the main training or final testing set. “The calibration set is the only EEG data the LLM ever sees”
- Causal evidence: Evidence indicating that a suspected factor produces or contributes to an observed model behavior. “diagnosis points (cause, which recordings carry it, causal evidence, location in the network).”
- Common spatial patterns (CSP): A spatial-filtering method that finds projections maximizing variance differences between two classes of multichannel signals. “common spatial patterns (CSP, 8--30 Hz, 6 filters)”
- Convolution: An operation that applies a learned filter across portions of an input signal or feature map. “a stem convolution with 64 filters across all 12 leads”
- Convolutional neural network: A neural network that uses convolutional operations to learn local patterns in structured data. “an EEGNet-style classifier”
- Cross-subject generalization: The ability of a model trained on some subjects to perform well on previously unseen subjects. “models degrade on subjects they were not trained on”
- Diffusion model: A generative model that produces data by learning to reverse a gradual noising process. “Claude Opus 5.5 edited the text encoders of a diffusion model”
- Early stopping: A regularization method that ends training when performance on validation data stops improving. “with early stopping on the validation set”
- Electrocardiography (ECG): The measurement and analysis of the heart’s electrical activity. “We use the PTB-XL dataset~\cite{wagner2020ptbxl}: 21,799 clinical 12-lead ECG recordings”
- Electroencephalography (EEG): The recording and analysis of electrical activity produced by the brain. “We use the PhysioNet EEG Motor Movement/Imagery dataset”
- Fine-tuning: Further training of an already trained model on a particular dataset or task. “fine-tuning on the practice data”
- Gradient descent: An iterative optimization method that updates model parameters in the direction that reduces a loss function. “without any gradient descent step”
- Hidden shortcut: A spurious feature used by a model because it correlates with the target in the training data but does not represent the intended signal. “with a planted shortcut”
- Linear discriminant analysis (LDA): A supervised method that projects data to separate classes using linear decision boundaries. “common spatial patterns (CSP, 8--30 Hz, 6 filters) followed by a shrinkage linear discriminant analysis (LDA).”
- Macro-AUC: An average of class-specific AUC values, giving each class equal weight. “a test macro-AUC of 0.917 and 0.918”
- Mains hum: Electrical interference, commonly at the power-line frequency, that contaminates recorded signals. “We use 3 artifacts: mains hum”
- Myocardial infarction (MI): Damage to heart muscle caused by insufficient blood supply, commonly called a heart attack. “myocardial infarction (MI)”
- One-dimensional residual network: A one-dimensional convolutional neural network that uses residual connections to facilitate the training of deeper models. “a standard one-dimensional residual network”
- One-shot: Performed in a single attempt or operation rather than through repeated iterative updates. “in a single-shot manner”
- Output bias: A learned additive parameter that shifts a neural network’s output before the activation function. “one output bias shifted up by 3”
- Pooling: An operation that reduces the spatial or temporal resolution of feature maps while retaining salient information. “two pooling stages”
- Proximal policy optimization (PPO): A reinforcement-learning algorithm that updates a policy while constraining changes to maintain stable learning. “against 15.8 for a proximal policy optimization (PPO) agent”
- Residual block: A neural-network component that adds a block’s transformed input to its original input through a shortcut connection. “four residual blocks”
- Scalp recording: A physiological recording obtained from sensors placed on the scalp. “64-electrode scalp recordings”
- Shrinkage: A statistical regularization technique that pulls estimated parameters toward a simpler target to reduce variance. “a shrinkage linear discriminant analysis (LDA)”
- Sigmoid output: An output produced by applying the sigmoid function, which maps a value to the interval from zero to one. “a five-output linear layer with sigmoid outputs”
- Spatial filter: A learned combination of signals from multiple sensors designed to emphasize or suppress spatial patterns. “16 spatial filters over the 64 electrodes”
- Spurious correlation: A statistical association that does not reflect the intended causal relationship between variables. “robustness to spurious correlations”
- Standardization: Rescaling data using a reference mean and standard deviation, often to produce zero-mean, unit-variance features. “standardized per channel”
- Temporal filter: A filter that detects or emphasizes patterns occurring over time, often within a particular frequency range. “8 temporal filters (64 samples each)”
- Transfer generalization: The ability of a model to maintain performance when applied to data from a different population, site, or distribution. “Some fail on data from a new site because they learned a shortcut”
- Validation set: A dataset used during model development to select settings or monitor performance without serving as the final test set. “with early stopping on the validation set”
- Weight-space programming (WSP): The process of using a LLM to inspect, modify, or create neural-network weights directly rather than training through gradient updates. “Weight-space programming (WSP) proposes a different author for networks' weights”
- Zero-shot: Performed without task-specific examples or training instances. “Given the weights of an EEG or ECG network, and little or no data”





