Weight-space programming and mechanistic interpretability for model editing in particle physics
Organizations: Dipartimento di Informatica, Università di Milano, Via Celoria 18, I-20133 Milano, Italy · INFN, Sezione di Milano, Via Celoria 16, I-20133 Milano, Italy · Niels Bohr Institute, University of Copenhagen, Denmark
Abstract
We demonstrate that weight-space programming and edits guided by sparse autoencoders can remove unwanted aspects of a particle-physics foundation model through direct edits to its weights. In a foundation model trained on jets, we observe that adding a single soft neutral particle causes large changes in jet classification, violating infrared safety. We locate the responsible attention heads with mechanistic analysis and trace the flaw's origin to pretraining on datasets with different reconstruction thresholds. We then propose two targeted approaches to repair the flaw: by removing three latent directions identified with sparse autoencoders, and by letting language-model agents edit the weights directly, without gradients and with only 50 queries to the model. Both their edits individually remove almost the entire flaw and leave the rest of the model's response nearly unchanged. Compared to fine-tuning, both methods change far fewer parameters. Although built only on and QCD jets, the edits carry over to all signal classes, the pretrained generator, and a newly trained regression head.
Figures & tables
Appendix figures & tables8 assets
Supplementary material from the paper’s appendix.
Appendix
| Variant | Remaining response | accuracy (clean) | Physical response | Changed parameters |
| Attention only, both neutral types (selected) | 0.06 | 0.0001 | 63 240 | |
| Attention only, photons only | 0.0003 | 0.92 | 63 240 | |
| Whole body and classifier, both neutral types |
| Variant | Remaining response | accuracy (clean) | Physical response | Changed parameters |
| One reader | 0.0001 | 511 | ||
| Two readers | ||||
| Three readers (selected) | 0.11 | |||
| Three readers, half strength | 0.87 |
Model Editing
Model editing changes targeted facts or behaviors in trained models while aiming to preserve their other capabilities.
See all 75 papers