Weight-space programming audits and fixes small clinical AI networks

Weight-space programming for auditing clinical decision networks

Artificial Intelligence

Summary

Machine learning models used in medical treatment sometimes have hidden mistakes that regular tests don’t find. The authors explored whether a language model can read and adjust the actual network settings to spot and fix these flaws. They trained small networks with intentional errors and found that the language model could identify most problems and repair them by tweaking a few settings. However, it still cannot guarantee that a network is completely correct.

What this means in practice

  • For clinical ai engineers: Identify and repair specific flaws in small clinical decision networks using language models without running code or accessing data directly.
  • For medical software testers: Use weight-space programming insights to design better tests for detecting hidden errors in AI models handling treatment planning.

Authors

Humza Nusrat, Omar Nusrat

Abstract

Machine learning models in radiotherapy are commissioned by testing them on cases with known answers, which may not reveal a shortcut that the test cases share with the training data. Frontier language models have recently been reported to read and write the raw weights of small neural networks, an ability called weight-space programming. The purpose of this study was to determine whether such a model, given only a clinical protocol and a network's weights, can audit and repair the network. Networks with 433 to 4,801 parameters were trained to screen head-and-neck planning requests against four rules. Flaws were planted through the training data: confounds that hid each rule, a 3 Gy shift in the cord threshold, and a hidden trigger. Claude Opus 5.5 audited each network blind, without tools, data or code execution, and every claim and repair was tested on about 420,000 requests. The language model named the broken rule in 16 of 18 flawed networks (95% CI 67% to 97%), including all 15 with a confound or a threshold shift. It repaired each of the 16 by changing a median of 3 parameters. Fine-tuning on protocol-labeled requests also repaired every network, but changed nearly every parameter. Each confound and shift it found was visible in single units, and a simple statistic chosen for each flaw type found the same flaws. It cleared 2 of 5 healthy networks without being forced and found 1 of 3 triggers. Testing against the protocol detected every flaw, and black-box testing found the confounds and the shift faster. The results indicate that, in small networks, weight-space programming can locate and repair flaws that silence an input or shift a threshold, but cannot yet certify that a network is correct.