betaFeedback

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 θ0\theta_0, editor EI\mathcal{E}_I, and accumulated support St={(gi,xi,yi)}S_t = \{(g_i, x_i, y_i)\} recording identities, inputs, and measured outcomes,

Δt=EI(θ0,St),θt=θ0+Δt,At+1=D(fθt),(1)\Delta_t = \mathcal{E}_I(\theta_0, S_t), \qquad\theta_t = \theta_0 + \Delta_t, \qquad A_{t+1} = D(f_{\theta_t}), \tag*{(1)}

where DD applies the remaining candidates, budget, and decision rule; Δt,j=0\Delta_{t,j}=0 outside II. Updates are constructed on support-training records, selected on support-validation records, then reconstructed on all support. No qualifying improvement gives Δt=0\Delta_t=0. Each update starts from θ0\theta_0, 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 hϕ(xg)∈R128h_\phi(x_g) \in\mathbb{R}^{128}. 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

fθ(g)=sy(w⊤hϕ(g)+b)+μy.(2)f_\theta(g) = s_y(w^\top h_\phi(g) + b) + \mu_y. \tag*{(2)}

Only the 128 entries of ww are editable. The encoder, bias, input transform, original 25-label output scaler (μy,sy)(\mu_y, s_y), 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 pi=(fθ(gi)−μy)/syp_i = (f_\theta(g_i)-\mu_y)/s_y and y~i=(yi−μy)/sy\tilde{y}_i = (y_i-\mu_y)/s_y. Let aij=∣y~i−y~j∣a_{ij}=|\tilde{y}_i-\tilde{y}_j| and sij=sgn⁡(y~i−y~j)s_{ij}=\operatorname{sgn}(\tilde{y}_i-\tilde{y}_j). The pair-support loss is

L(p,y~)=∑i<jaijlog⁡{1+exp⁡[−sij(pi−pj)]}∑i<jaij.(3)\mathcal{L}(p,\tilde{y}) = \frac{\sum_{i<j} a_{ij}\log\{1+\exp[-s_{ij}(p_i-p_j)]\}}{\sum_{i<j} a_{ij}}. \tag*{(3)}

The logistic comparison follows learning-to-rank formulations [4]. We cache hih_i and probe each connection by halving wjw_j, which changes standardized predictions by exactly −0.5wjhij-0.5w_j h_{ij}. Its diagnostic gain is the resulting decrease in L\mathcal{L}. The top positive gains above 10−1210^{-12} determine at most kk coordinates SkS_k for six update settings: k∈{4,8,16}k \in\{4,8,16\} and α∈{0.25,0.5}\alpha\in\{0.25,0.5\},

wj′=wj(1−α1[j∈Sk]).(4)w'_j = w_j(1-\alpha\mathbf{1}[j \in S_k]). \tag*{(4)}

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: δf(g)=∑jδwjhj(xg)\delta f(g) = \sum_j \delta w_j h_j(x_g), 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 y~i\tilde{y}_i and original prediction p0ip_{0i}, define residuals ri=y~i−p0ir_i = \tilde{y}_i - p_{0i}. Ridge [10] adds δw=(XcTXc+λI)−1XcTrc\delta w = (X_c^{\mathsf{T}}X_c + \lambda I)^{-1}X_c^{\mathsf{T}}r_c and δb=rˉ−xˉTδw\delta b = \bar{r} - \bar{x}^{\mathsf{T}}\delta w, where centering uses the fitting support, λ=mγ\lambda= m\gamma, and γ∈{0.1,1,10,100}\gamma\in\{0.1, 1, 10, 100\}. XGBoost [5] retains all 300 tree structures and revises each supported prediction leaf by vℓ′=vℓ+α∑i∈ℓri/[300(nℓ+5)]v'_\ell= v_\ell+ \alpha\sum_{i \in\ell} r_i/[300(n_\ell+ 5)], with α∈{0.1,0.25,0.5}\alpha\in\{0.1, 0.25, 0.5\}. Here mm is the support size; nℓn_\ell counts support records reaching leaf ℓ\ell. 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 n=25n = 25 models. Feedback is the 75 genes in the corresponding n=100n = 100 training set but outside the initial 25; query genes are excluded from both. All six arms share the query pool. The existing n=100n = 100 reference and initial models were each fitted for 1600 updates; editing maintains the n=25n = 25 model using the additional measurements.

For budget B=20,50B = 20, 50, let drd_r be 1/log⁡2(r+1)1/\log_2(r + 1) normalized over all BB positions. We report

UB=∑r=1Bdryπr,BUB=UB−yˉUBoracle−yˉ.(5)U_B = \sum_{r=1}^{B} d_r y_{\pi_r}, \qquad\mathrm{BU}_B = \frac{U_B - \bar{y}}{U_B^{\mathrm{oracle}} - \bar{y}}. \tag*{(5)}

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.

EndpointBBOrig.Rand.EditedFull
HepG2 growth200.52390.52700.54190.6254
HepG2 growth500.52080.53090.54210.6025
Jurkat growth200.52230.52700.53440.5993
Jurkat growth500.51750.53040.53550.6038
HL60 proliferation200.22510.22390.22540.2201
HL60 proliferation500.25230.25900.26650.2632
HL60 migration20−0.0171−0.0246−0.01470.0832
HL60 migration500.01030.00510.00870.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 k=16k = 16, α=0.5\alpha= 0.5: 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 θ0\theta_0 but do not reenter StS_t. Each patch is reconstructed from θ0\theta_0, with a validation guard at B=min⁡(5,nvalidation−1)B = \min(5, n_{\mathrm{validation}} - 1).

For acquired set AKA_K from candidate pool CC, discovery is DK=(∑g∈AKyg−KyˉC)/(∑g∈Top⁡K(C)yg−KyˉC)D_K = (\sum_{g\in A_K} y_g - K\bar{y}_C)/(\sum_{g\in\operatorname{Top}_K(C)} y_g - K\bar{y}_C). Its oracle normalization changes with KK, 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 D100D_{100} 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 ΔD100\Delta D_{100}; diamonds are means. HuH7 has an expanded scale. (d,e) All paired gene-fold scores for D100D_{100} 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.

TaskOriginalPermutedEditedΔ\DeltaPos.
LC30.17570.18940.2091+0.03344/5
NBR10.16710.17350.1878+0.02074/5
HuH70.00380.00730.0185+0.01473/5

Table 2. Sequential discovery: mean D100D_{100} from the same initial models. Δ\Delta: 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.

ModelOrig.EditedAff.FullΔ\DeltaBU@20
Ridge/H0.30230.27200.28440.2705+0.1086
Ridge/J0.32390.28170.31100.2852+0.0586
XGB/H0.32180.31400.31880.2807+0.0069
XGB/J0.33460.32580.31830.2957+0.0013

Table 3. All coefficient/leaf settings: original-unit MSE and edited-minus-original Δ\Delta; 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. [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. [2]Broad DepMap. 2024. DepMap 24Q4 Public. Figshare+, dataset, version 1. doi:10.25452/figshare.plus.27993248.v1DOI
  3. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [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. [21]The Gene Ontology Consortium. 2023. The Gene Ontology Knowledgebase. In Genetics 224, 1 (2023), iyad031. doi:10.1093/genetics/iyad031
  22. [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

Paper details

vlnc:W_ewpsztc3
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 17

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

Not recorded for this paper

View statement
Looking for related papers…
Contents