Weight-Space Programming for Medical Imaging: Do We Still Need Training Data?
Problem Statement
Medical image classifiers normally need labelled data, which is costly, privacy-restricted and often unavailable for rare conditions or new modalities. Zero-shot vision-language models such as MedSigLIP avoid labels but are huge and give uneven performance. This paper tests a radically different route to label-free models: having an LLM turn textual medical knowledge directly into network parameters.
Key Novelty
- Defines 'weight-space programming' (WSP) for medical imaging, in which an LLM writes or adapts a network's raw parameters in a single reply, without gradient descent, tool use or seeing any image.
- Benchmarks frontier LLMs (reported as Claude Opus 5.5 and GPT-6 Astra) as data-free 'weight authors' across 7 tasks and 4 modalities (chest X-ray, breast ultrasound, abdominal CT, pelvic MRI), against both zero-shot MedSigLIP and Adam-trained supervised baselines.
- Releases the full protocol, generation logs and all LLM-generated weights, enabling reproducible study of LLM-authored parameters and their failure modes (e.g., a systematic error producing far-below-chance AUC).
Evaluation Highlights
- LLM-written LeNet-style CNNs beat chance on all 6 MedMNIST tasks (mean test AUC 0.719 for Opus, 0.711 for Astra). Both outperform zero-shot MedSigLIP on 5 of 6 tasks while using more than 10,000 times fewer parameters.
- Adam training on only 256 labelled images beats both LLMs on every MedMNIST task (mean AUC 0.828). On SynthUterus MRI, Opus reaches AUC 0.764 while Astra collapses to 0.136 because of a systematic error.
Signal Assessment
Methodology
- Define a small LeNet-style CNN architecture and prompt each LLM to output its complete set of weights and biases in a single response, using only its medical and visual knowledge (no images, no tools, no optimisation).
- Load the generated parameters and evaluate them as classifiers on 7 tasks: 6 MedMNIST tasks (chest X-ray, breast ultrasound, abdominal CT) plus SynthUterus pelvic MRI, reporting test AUC.
- Compare against zero-shot MedSigLIP and against the same CNN architecture trained with Adam on limited labels (e.g., 256 images), then analyse failure cases such as Astra's systematic error on SynthUterus.
System Components
A paradigm in which an LLM writes or adapts a network's parameters directly as text output, replacing gradient-based training on data.
A small convolutional classifier whose full parameter set is compact enough for an LLM to generate in a single reply and that suits low-resolution MedMNIST inputs.
The frontier LLMs, as named in the paper, that encode medical knowledge (e.g., visual cues for pathology) into filters and classifier weights without seeing data.
A large medical vision-language model used as the label-free foundation-model comparison, over 10,000 times larger than the LLM-written CNNs.
The same CNN architecture trained on small labelled sets (e.g., 256 images), used to measure how much training data the LLM-authored weights are worth.
Seven classification tasks across four modalities (chest X-ray, breast ultrasound, abdominal CT, pelvic MRI) used to evaluate generalisation of the WSP approach.
Results
| Metric/Benchmark | Baseline | This Paper | Delta |
|---|---|---|---|
| Mean MedMNIST AUC: Opus vs Adam (256 labels) | 0.828 | 0.719 | -0.109 |
| Mean MedMNIST AUC: Astra vs Adam (256 labels) | 0.828 | 0.711 | -0.117 |
| Mean MedMNIST AUC: Opus vs chance | 0.500 | 0.719 | +0.219 |
| MedMNIST tasks won vs zero-shot MedSigLIP | MedSigLIP (more than 10,000x the parameters) | 5 of 6 tasks (both LLMs) | Wins 5/6 tasks with a far smaller model |
| SynthUterus AUC: Opus vs chance | 0.500 | 0.764 | +0.264 |
| SynthUterus AUC: Astra vs chance | 0.500 | 0.136 | -0.364 (systematic error) |
Key Takeaways
- LLMs can act as 'compilers' from domain knowledge to working weights. For tiny, label-free models this can beat large zero-shot VLMs, which is useful for edge deployment or as a knowledge-driven initialisation.
- A few hundred labels still win: even 256 labelled images with Adam beat LLM-written weights on every MedMNIST task. WSP is better framed as a prior or warm start to combine with few-shot fine-tuning than as a replacement for data.
- LLM-authored weights can fail systematically and silently (e.g., AUC 0.136). Validation, even on a handful of labelled examples, is essential to catch errors such as polarity or label inversion before any clinical use.
Abstract
Can a large language model (LLM) write the parameters of a medical image classifier from medical knowledge alone, without any training data? Such classifiers normally require labelled images, which are costly and often unavailable. We investigate this question through weight-space programming (WSP), in which an LLM writes or adapts the weights and biases of a neural network directly, without optimisation on training data. Claude Opus 5.5 and GPT-6 Astra each generate the parameters of a small LeNet-style CNN in a single reply, without tool use and without access to any image. We compare these networks against zero-shot MedSigLIP and against the same architecture trained on labels using the Adam optimiser, across 7 classification tasks in four modalities: chest X-ray, breast ultrasound and abdominal CT (all from MedMNIST), and pelvic MRI (SynthUterus). The LLM-written networks perform above chance on all six MedMNIST tasks, with a mean test AUC of 0.719 for Opus and 0.711 for Astra. Both models outperform MedSigLIP on 5 of 6 tasks while using more than 10,000 times fewer parameters. However, the same network trained with Adam on only 256 labelled images achieves a higher AUC on every MedMNIST task (mean AUC 0.828). On SynthUterus, Opus attains an AUC of 0.764, whereas Astra falls below chance (AUC 0.136) owing to a systematic error. These results show that LLMs can write functional medical classifiers, but that they do not yet replace training data. We release the protocol, logs and all generated weights at https://github.com/MaximilianLindholz/weight-space-programming-medical.