WorksComputer Science
WeightLoop: Weight-Space Programming with Experimental Feedback
Abstract
Weight-space programming (WSP) shows that language models can reason about and rewrite neural network weights; recursive self-improvement (RSI) motivates feedback-driven improvement. Models guiding experiments receive concrete feedback: completed assays reveal prediction errors and inform what to test next. We introduce WeightLoop, a framework that turns experimental feedback into persistent updates to deployed predictors. GPT-6 Astra inspects a task specification and the model implementation, then writes a bounded, reusable parameter-editing program. As new measurements arrive, the program identifies prediction discrepancies, validates candidate edits using observed outcomes, and writes the selected changes back to the original model. The editor remains fixed while the predictor evolves, enabling repeated updates without further LLM calls or gradient retraining while preserving the original inference interface. In offline replay, targeted edits improve mean ranking utility in seven of eight endpoint-budget settings (all eight versus random edits) and mean final discovery across three sequential tasks. WeightLoop connects WSP with an RSI-inspired improvement loop, making experimental evidence a direct driver of model change and subsequent decisions.
Introduction
An experiment does more than test a prediction: it produces evidence that can change the next decision. In experimental decision-making [11, 17, 18], a predictor ranks candidate interventions, but their effects become known only after measurement. Historical data provide reusable knowledge, yet a new objective may have only a few dozen functional measurements. These results can expose task-specific errors in an otherwise useful model. The challenge is therefore not only to evaluate predictions, but to incorporate evidence into the deployed predictor so subsequent decisions reflect what has been learned. Cellular perturbation research [6, 16] and virtual cells [3] provide a demanding example.
From model editing to weight-space programming. Model-editing research studies targeted corrections to neural parameters [7, 12, 13, 14, 20]. Takehi et al. introduced weight-space programming (WSP), demonstrating language models interpreting and rewriting weights according to natural-language objectives in specified settings [21].
This opens a possibility: can an LLM program how a deployed model should change when experimental evidence arrives? Beyond producing one parameter correction, such a program could connect successive measurements to the model’s future behavior.
Where the improvement loop lives. Recursive self-improvement (RSI) motivates systems such as STOP, whose improvement program revises itself [23]. In WeightLoop, the sequence is concrete: the LLM writes an editor once; each returned assay batch lets that editor revise the predictor; the revised predictor recommends the next batch. The editor code and LLM remain fixed during this loop. New measured outcomes determine the parameter changes, without another LLM call or gradient retraining. The scientific predictor is the object of this improvement loop.
The WeightLoop workflow. Given a task objective and model, GPT-6 Astra [15] identifies task-relevant mutable parameters and writes a bounded editing program. When feedback arrives, the program evaluates discrepancies between predictions and measurements, constructs candidate changes, and selects a validated update. Changes are written into the checkpoint, which reloads through its original inference interface. The updated predictor guides the next decision, and the process repeats as measurements arrive (Figure 1). Feedback therefore changes the model itself, beyond adjusting one recommendation list.
Figure 1. WeightLoop separates one-time program construction from repeated execution with experimental feedback. The LLM builds a reusable editor; returned measurements validate parameter changes, followed by model save, reload, and the next decision. Weight values and ranking gains illustrate a HepG2 example.
We study two complementary settings: single-round ranking and sequential discovery. Cellular growth, migration, autophagy, and LDL-uptake measurements supply concrete feedback across objectives. Here, biology supplies measurable outcomes for testing a reusable editing workflow. Neural, linear, and tree-based predictors offer different parameter structures for the same workflow. Recorded measurements enable offline replay to test whether updates improve subsequent decisions and remain usable after checkpoint writeback and reload. Together, these experiments demonstrate how WSP can turn returned measurements into an ongoing source of model improvement.
WeightLoop
Fixed editor, updating predictor
GPT-6 Astra [15] constructs the editor from the task objective, model implementation, parameter structure, and available feedback. It produces an executable editor specifying mutable parameters, candidate updates, validation rules, and model saving. The editor uses measured support to update the predictor through repeated numerical execution, with no additional LLM calls. For original parameters , editor , and accumulated support recording identities, inputs, and measured outcomes,
where applies the remaining candidates, budget, and decision rule; outside . Updates are constructed on support-training records, selected on support-validation records, then reconstructed on all support. No qualifying improvement gives . Each update starts from , so patches do not compound. Only observed outcomes enter support; outcomes of unmeasured candidates and the permanent test set are excluded.
A concrete program-design choice. The neural editor exposes the functional output weights as its update interface. The model code separates a reusable molecular encoder from a linear functional readout: changing one readout weight alters that feature’s contribution while preserving both the representation and the RNA auxiliary branches. This structure also makes a candidate change exactly computable from cached activations, so the editor can test individual connections without backpropagation. Its diagnostic asks whether weakening a connection improves the ordering of measured genes; its validation combines a pairwise ranking loss with top-budget utility. For coefficient and leaf-value updates, the implemented objective is instead residual prediction error. Thus the program construction ties the mutable interface and validation criterion to the model structure and task objective. Once those choices are encoded, measurements determine the affected coordinates and accepted parameter values on each execution.
Neural output-weight editing
A ReLU MLP encodes static GO [22], scGPT [6], and MAP-KG features, with availability indicators, as . Its original fit used functional labels and historical RNA auxiliary supervision; candidate-specific perturbation RNA is not an inference input. The functional prediction in assay units is
Only the 128 entries of are editable. The encoder, bias, input transform, original 25-label output scaler , RNA head, and source parameters remain fixed; the edit reweights the existing representation.
Diagnose, select, and write. Feedback consists of newly measured gene effects. If a hidden feature gives high scores to genes with weak measured effects, attenuating its output connection can reduce ranking errors. The editor tests this possibility against the observed measurements. Using the original 25-label output scaler, let and . Let and . The pair-support loss is
The logistic comparison follows learning-to-rank formulations [4]. We cache and probe each connection by halving , which changes standardized predictions by exactly . Its diagnostic gain is the resulting decrease in . The top positive gains above determine at most coordinates for six update settings: and ,
Equal-label pairs have zero weight; an all-tied set has zero loss. Diagnostic and update ties follow fixed orders. Three identity-based support folds select the lowest mean validation loss subject to non-decreasing mean validation utility (BU@10 for single-round ranking). Each fold diagnoses coordinates using only its training genes. The accepted update is rebuilt on all feedback and written to the model’s output-weight vector. Its effect is gene-specific: , so it can change ordering while preserving the learned representation.
Matched controls permute the same diagnostic update across coordinates. For a given support set and update setting, they preserve the number and norm of changes and receive the same six-setting validation opportunity. Single-round ranking uses three fixed permutations; sequential discovery uses one and may acquire different subsequent support.
Coefficient and leaf-value editing
With standardized feedback and original prediction , define residuals . Ridge [10] adds and , where centering uses the fitting support, , and . XGBoost [5] retains all 300 tree structures and revises each supported prediction leaf by , with . Here is the support size; counts support records reaching leaf . Unsupported leaves remain unchanged. Three-fold support MSE selects these updates; no improvement retains the original model. These supervised analytical operators change coefficients or native leaf values while retaining input/output transforms and inference code.
Evaluation and Results
We evaluate single-round ranking and sequential discovery using public functional screens. Editor design used DepMap experiments; the resulting rules were fixed for HL60 and sequential evaluation. Each prediction or batch choice precedes access to its evaluation outcomes. Tables present the complete endpoint–budget grid under matched feedback budgets.
Single-round ranking
The single-round experiment asks whether one feedback update improves subsequent ranking. It covers HepG2/Jurkat negative Chronos effects from DepMap 24Q4 [2, 8], HL60 proliferation, and serum-gradient migration inhibition [1]. Five gene partitions and two seeds per endpoint give 40 initial models. Feedback is the 75 genes in the corresponding training set but outside the initial 25; query genes are excluded from both. All six arms share the query pool. The existing reference and initial models were each fitted for 1600 updates; editing maintains the model using the additional measurements.
For budget , let be normalized over all positions. We report
where zero is the same-pool random expectation and one the oracle. Paired summaries average seeds within each gene partition of a study.
Edited utility exceeds Random in all eight settings and improves over Original in seven (Table 1). HepG2 improves in all five paired folds at both budgets, connecting the mean gains to consistent within-task improvements.
| Endpoint | Orig. | Rand. | Edited | Full | |
| HepG2 growth | 20 | 0.5239 | 0.5270 | 0.5419 | 0.6254 |
| HepG2 growth | 50 | 0.5208 | 0.5309 | 0.5421 | 0.6025 |
| Jurkat growth | 20 | 0.5223 | 0.5270 | 0.5344 | 0.5993 |
| Jurkat growth | 50 | 0.5175 | 0.5304 | 0.5355 | 0.6038 |
| HL60 proliferation | 20 | 0.2251 | 0.2239 | 0.2254 | 0.2201 |
| HL60 proliferation | 50 | 0.2523 | 0.2590 | 0.2665 | 0.2632 |
| HL60 migration | 20 | −0.0171 | −0.0246 | −0.0147 | 0.0832 |
| HL60 migration | 50 | 0.0103 | 0.0051 | 0.0087 | 0.0581 |
Table 1. Single-round ranking: all eight endpoint–budget settings, mean BU over five folds and two seeds. Rand.: three-control mean; Full: original 100-label fit.
Tracing a recommendation. In the HepG2 example of Figure 1, the editor selects , : validation loss falls 0.54235 → 0.53837 and BU@10 rises 0.43363 → 0.47502. Figure 1 shows two realized weight changes. Top20 retains 19 genes, adds SNRPB, and removes GEMIN2; query BU@20 rises 0.604554 → 0.621258 (BU@50: 0.559769 → 0.560715).
Sequential discovery
Sequential discovery reuses 15 initial 25-label models for LC3/NBR1 autophagic flux [19] and reduced LDL uptake in HuH7 cells with lipoprotein-rich medium [9]: three endpoints, five gene folds, and one seed. Unchanged, targeted-edit, and permuted-edit policies each acquire five batches of 20 genes. Each batch is chosen before its measurements become available. Later edits use only that policy’s acquired feedback; the initial 25 labels influence but do not reenter . Each patch is reconstructed from , with a validation guard at .
For acquired set from candidate pool , discovery is . Its oracle normalization changes with , so policies are compared at the same acquisition count. Permanent-set predictions are evaluated after all 45 trajectories finish, separately from discovery in the queried pool.
Edited selection improves mean over both controls in all three tasks, with 4/5, 4/5, and 3/5 positive paired folds (Table 2). Identical first batches locate these differences in later feedback-driven selections. Permanent-set BU@50 increases by 0.0254, 0.0098, and 0.0096 (Figure 2e). Of 75 targeted updates, 56 change weights, at most 16 each; the final update serves only permanent-set prediction.
Figure 2. Measured feedback changes discovery and prediction. (a–c) Complete acquisition curves and paired final ; diamonds are means. HuH7 has an expanded scale. (d,e) All paired gene-fold scores for and permanent-set BU@50. (f) Modified-weight counts, including no-ops; fold order 0–4 is shared. The last update affects only permanent-set prediction. Folds partition the same studies.
| Task | Original | Permuted | Edited | Pos. | |
| LC3 | 0.1757 | 0.1894 | 0.2091 | +0.0334 | 4/5 |
| NBR1 | 0.1671 | 0.1735 | 0.1878 | +0.0207 | 4/5 |
| HuH7 | 0.0038 | 0.0073 | 0.0185 | +0.0147 | 3/5 |
Table 2. Sequential discovery: mean from the same initial models. : edited minus original; Pos.: positive paired folds. HuH7: LDL decrease, lipoprotein-rich conditions.
The paired panels connect these aggregate improvements to actual model updates. Discovery measures the value of genes selected for assay, whereas permanent-set utility measures ranking of genes that never supplied feedback. Their joint mean improvement links the selection loop to predictions beyond the acquired set. The edit-count panel makes the mechanism visible: individual feedback batches can retain the original model or select different numbers of coordinates. Thus the fixed program translates changing evidence into adaptive model states, rather than applying the same perturbation after every batch.
Coefficient and leaf interfaces
Ridge and XGBoost reuse the two DepMap cells, five folds, and one seed (20 models), with 25 initial labels and 75 feedback genes. Here support MSE selects updates and query MSE is primary; ranking is secondary. Coefficient updates reduce MSE by 10.0% and 13.0%, and leaf updates by 2.4% and 2.6% (Table 3); all four mean BU@20 values also increase. Parameter edits also improve MSE over same-feedback affine calibration in three of four model–cell settings.
| Model | Orig. | Edited | Aff. | Full | BU@20 |
| Ridge/H | 0.3023 | 0.2720 | 0.2844 | 0.2705 | +0.1086 |
| Ridge/J | 0.3239 | 0.2817 | 0.3110 | 0.2852 | +0.0586 |
| XGB/H | 0.3218 | 0.3140 | 0.3188 | 0.2807 | +0.0069 |
| XGB/J | 0.3346 | 0.3258 | 0.3183 | 0.2957 | +0.0013 |
Table 3. All coefficient/leaf settings: original-unit MSE and edited-minus-original ; Aff.: feedback-fitted affine calibration; Full: 100-label fit. H=HepG2, J=Jurkat.
Persistent model updates. In a deployed predictor with 3,604,535 network parameters, the HepG2 update changes only 16 weights (0.00044%) and reproduces all 914 edited predictions exactly after native checkpoint reload. These are 16 of the 128 functional output weights; the network count includes the encoder and RNA head. Both remain unchanged, as do the separately stored source adapters. Reordered queries also reproduce all saved scores, and a single-gene inference check passes with the original input/output transforms. The update therefore persists in the predictor and serves subsequent queries through the original inference interface.
Conclusion
WeightLoop converts experimental feedback into persistent model updates. A fixed, LLM-constructed editor selects parameter changes from observed measurements, and the updated predictor guides the next decision. Ranking, sequential acquisition, and multiple parameter interfaces demonstrate how WSP connects accumulating scientific evidence to future experimental choices through the original prediction interface.
Ethical Considerations
The study uses public functional-screen measurements, with no new human-subject experiments or personal data collection. Recommendations guide research assays; biological efficacy requires validation in the intended setting. Retaining the original model makes parameter updates reversible and supports traceable deployment.
References
- [1]Nathan M. Belliveau, Matthew J. Footer, Emel Akdoğan, Aaron P. van Loon, Sean R. Collins, and Julie A. Theriot. 2023. Whole-Genome Screens Reveal Regulators of Differentiation State and Context-Dependent Migration in Human Neutrophils. Nature Communications 14, 1 (2023), 5770. doi:10.1038/s41467-023-41452-xDOI
- [2]Broad DepMap. 2024. DepMap 24Q4 Public. Figshare+, dataset, version 1. doi:10.25452/figshare.plus.27993248.v1DOI
- [3]Charlotte Bunne, Yusuf Roohani, Yanan Rosen, Ankit Gupta, Xikun Zhang, Marcel Roed, et al. 2024. How to Build the Virtual Cell with Artificial Intelligence: Priorities and Opportunities. Cell 187, 25 (2024), 7045–7063. doi:10.1016/j.cell.2024.11.015
- [4]Chris Burges, Tal Shaked, Erin Renshaw, Ari Lazier, Matt Deeds, Nicole Hamilton, and Greg Hulden. 2005. Learning to Rank Using Gradient Descent. In Proceedings of the 22nd International Conference on Machine Learning. Association for Computing Machinery, 89–96. doi:10.1145/1102351.1102363DOI
- [5]Tianqi Chen and Carlos Guestrin. 2016. XGBoost: A Scalable Tree Boosting System. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining. Association for Computing Machinery, 785–794. doi:10.1145/2939672.2939785DOI
- [6]Haotian Cui, Chloe Wang, Hassaan Maan, Kuan Pang, Fengning Luo, Nan Duan, and Bo Wang. 2024. scGPT: Toward Building a Foundation Model for Single-Cell Multi-omics Using Generative AI. Nature Methods 21 (2024), 1470–1480. doi:10.1038/s41592-024-02201-0
- [7]Nicola De Cao, Wilker Aziz, and Ivan Titov. 2021. Editing Factual Knowledge in Language Models. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing. Association for Computational Linguistics, 6491–6506. doi:10.18653/v1/2021.emnlp-main.522DOI
- [8]Joshua M. Dempster, Isabella Boyle, Francisca Vazquez, David E. Root, Jesse S. Boehm, William C. Hahn, Aviad Tsherniak, and James M. McFarland. 2021. Genome-Scale Screening for Modifiers of Cellular LDL Uptake. PLOS Genetics 17, 1 (2021), e1009285. doi:10.1371/journal.pgen.1009285
- [9]Arthur E. Hoerl and Robert W. Kennard. 1970. Ridge Regression: Biased Estimation for Nonorthogonal Problems. Technometrics 12, 1 (1970), 55–67. doi:10.1080/00401706.1970.10488634DOI
- [10]Ross D. King, Jem Rowland, Stephen G. Oliver, Michael Young, Wayne Aubrey, Emma Byrne, Maria Liakata, Magdalena Markham, Pinar Pir, Larisa N. Soldatova, Andrew Sparkes, Kenneth E. Whelan, and Amanda Clare. 2009. The Automation of Science. Science 324, 5923 (2009), 85–89. doi:10.1126/science.1165620DOI
- [11]Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. 2022. Locating and Editing Factual Associations in GPT. In Advances in Neural Information Processing Systems, Vol. 35. https://proceedings.neurips.cc/paper_files/paper/2022/hash/f6d3d5a3a2e789b065b33b3fa3182-Abstract-Conference.htmlarxiv.org/abs/2202.05262
- [12]Kevin Meng, Armin Grangier, Alex Andonian, Yona? Belinkov, and David Bau. 2023. Mass-Editing Memory in a Transformer. In International Conference on Learning Representations. https://openreview.net/forum?id=MkbcAHlYGySarxiv.org/abs/2210.07229
- [13]Eric Mitchell, Charles Lin, Antoine Bosselut, Chelsea Finn, and Christopher D. Manning. 2022. Fast Model Editing at Scale. In International Conference on Learning Representations. https://arxiv.org/abs/2110.11309
- [14]OpenAI. 2026. GPT-5 Astra. OpenAI API model documentation. https://developers.openai.com/api/docs/models/gpt-5-astra Accessed: 2026-11-03.
- [15]Yusuf Roohani, Kevin Huang, and Jure Leskovec. 2023. Predicting Transcriptional Outcomes of Novel Multigene Perturbations with GEARS. Nature Biotechnology (2023), doi:10.1038/s41587-023-01905-6 Published online 17 August 2023.DOI
- [16]Yusuf Roohani, Andrew Lee, Qian Huang, Jian Vora, Zachary Steinhart, Kexin Huang, Alexander Marson, Percy Liang, and Jure Leskovec. 2025. BioDiscoverAgent: An AI Agent for Designing Genetic Perturbation Experiments. In International Conference on Learning Representations. https://proceedings.iclr.cc/paper_files/paper/2025/hash/4252dc9451833302900f85d5cfac792-Abstract-Conference.htmlarxiv.org/abs/2405.17631
- [17]Burr Settles. 2009. Active Learning Literature Survey. Computer Sciences Technical Report 1648. University of Wisconsin–Madison. https://research.cs.wisc.edu/techreports/2009/TR1648.pdf
- [18]Christopher J. Shoemaker, Tina Q. Huang, Nicholas R. Weir, Nicole J. Polyakov, Sebastian W. Schultz, and Vladimir Denic. 2019. CRISPR Screening Using an Expanded Toolkit of Autophagy Reporters Identifies TMEM41B as a Novel Autophagy Factor. PLOS Biology 17, 4 (2019), e2007044. doi:10.1371/journal.pbio.2007044DOI
- [19]Anton Sinitsyn, Vsevolod Plokhotnyuk, Dmitriy Pyrkin, Sergei Popov, and Artem Babenko. 2020. Editable Neural Networks. arXiv:2004.00345 [cs.LG] doi:10.48550/arXiv.2004.00345
- [20]Rikiya Takehi, Jayden Teoh, Alex Zhang, and Omar Khattab. 2026. Sparks of Weight-Space Programming: LLMs can natively read & write neural network weights. https://rikiyaat.github.io/blog/weight-space-programming/. Blog post.
- [21]The Gene Ontology Consortium. 2023. The Gene Ontology Knowledgebase. In Genetics 224, 1 (2023), iyad031. doi:10.1093/genetics/iyad031
- [22]Eric Zelikman, Eliana Lorch, Lester Mackey, and Adam Tauman Kalai. 2024. Self-Taught Optimizer (STOP): Recursively Self-Improving Code Generation. In Conference on Language Modeling. https://arxiv.org/abs/2310.02304

