NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Adaptive Granularity for Mentally Simulating Gene Circuits

Large language models can already draft genetic circuits — structured DNA programs that, when delivered into a tumor by a virus, turn the tumor's own cells into factories that secrete antibodies or immune recruiters (so-called localized gene therapy). What they cannot do is run those programs in their heads. Work on code understanding shows a sharp gap between writing code and mentally executing it: models that produce correct patches fail simple questions about what a program will output (NoFunEval), and accuracy on real-world execution questions collapses from roughly 50% to 20% in Python when the model must trace three statements instead of one (CodeSense). The obvious fix — trace everything one tiny step at a time — makes things worse, not better, because every intermediate prediction is a chance to hallucinate, and these errors compound. Theory and empirics agree that there is a sweet spot: an inverted-U curve in accuracy versus how finely you decompose a task, with an optimal branching degree $m^* = e^{d/2}$ where $d$ is the task's intrinsic dimension (How does Chain of Thought decompose complex tasks?).

This proposal asks a question nobody has asked: for biological circuits, that sweet spot is not fixed — it moves with the physics. When a virus replicates inside a cell, gene copy numbers climb until the cell's transcription and translation machinery saturates, and in that saturated regime the dynamics are simple even though the numbers are large; near switching thresholds the opposite holds. A human-designed proof of this already exists: bin-dependent models, which lump cells into copy-number bins and treat each bin with different kinetics, fit flow-cytometry data up to twice as accurately as standard smooth ODE models with only one extra parameter (Modeling Genetic Circuit Behavior in Transiently Transfected Mammalian Cells). Binning is a hand-built, static granularity choice. Our claim is that a language model can learn to choose its simulation granularity adaptively — coarse where the dynamics are boring, fine where errors would compound — and that this adaptivity, not any fixed level of decomposition, is what closes the mental-simulation gap for gene circuit design.

Core Claim

The core claim has three parts, each testable against the material above. First, when a language model mentally executes the dynamics of a therapeutic genetic circuit (a promoter driving payload secretion inside a replicating viral vector, as in the oncolytic adenoviruses carrying anti-VEGF fragments and PD-L1 silencing constructs of RCAd-LTH-shPD-L1 and OAd-B7H3-BiTE), its prediction accuracy as a function of trace granularity follows the same inverted-U seen in software tracing. Second, the optimum shifts with the saturation regime: the best chunk size in a saturated, high-copy-number phase is coarser than the best chunk size near a threshold crossing. Third, a model trained to emit both the next chunk size and the state after that chunk — conditioned on its own running estimate of which regime it is in — beats every fixed granularity, including the oracle best fixed one, on forward simulation and, more importantly, on inverse design (given a desired therapeutic trajectory, recover the circuit), which is the operation gene therapy design actually needs and the one where models are weakest, since reverse execution is far harder than forward prediction everywhere it has been measured (~12% accuracy for the best model on small functions in CodeSense; 75.0% versus 81.9% for GPT-4 with chain-of-thought on input versus output prediction in CRUXEval).

The closest existing work is GenCircuit-RL, which trains models to design genetic circuits with a five-level hierarchical verification reward (syntax, SBOL validity, structural assembly, ontology annotation, static truth-table logic). It differs from us in exactly the two ways that matter: its verification is purely static — it explicitly omits quantitative dynamic simulation such as kinetic rates and transcriptional saturation — and its hierarchy is a fixed, hand-set granularity. We extend that hierarchy with a dynamic sixth level and make the granularity of the simulation trace itself the learned decision. The bin-dependent modeling work of Modeling Genetic Circuit Behavior in Transiently Transfected Mammalian Cells supplies the other half of our method in spirit: it proves regime-dependent coarse-graining works, but it is classical ODE fitting with a human-chosen partition, no language model, no learned policy, and no connection to the error-accumulation theory of decomposition.

Research Program

Three things get built. The first is a benchmark extension, which we call SynBio-Dynamics, layered on top of SynBio-Reason (the ~4,753-circuit suite across six canonical topologies used by GenCircuit-RL). For each circuit we attach a ground-truth dynamic model in the bin-dependent family — copy-number bins, saturated kinetics in high-copy bins, linear expression in low-copy bins — with parameters fit to the flow-cytometry repressor dose-response data (TAL14, TAL21, LmrA) referenced by the bin-dependent paper. Tasks come in two directions. Forward: given a circuit, an initial copy number, and a time, predict the payload concentration or the saturation regime. Inverse: given a target therapeutic window (keep anti-VEGF secretion inside a range, keep PD-L1 knockdown above a threshold across a simulated infection time course), output a circuit, which is then scored by executing it under the ground-truth model. The forward tasks are instantiated at four fixed granularities so we can measure the U-curve directly, mirroring how CodeSense grades block-level, statement-level, property-tracking, and approximation questions.

The second build is the training method. We extend the GenCircuit-RL recipe — Group Relative Policy Optimization over a curriculum that moves from syntax toward functional logic — with a dynamic reward level. At that level, the model produces a simulation as a sequence of segments; for each segment it emits a chosen granularity $g_t$ (whole-phase, regime-level, or step-level) and the predicted state after that segment. The reward is state-prediction accuracy at the chosen granularity minus a cost proportional to total simulated steps:

$$R = \mathbb{1}[\text{final state within tolerance}] - \lambda \sum_t g_t^{-1}$$

where $g_t^{-1}$ counts the elementary steps compressed into segment $t$, so the model is paid for being right and for being economical. This makes the fixed-granularity chain-of-thought results of CRUXEval — where stepwise tracing helps GPT-4 (81.9% on output prediction) but hurts smaller models through cascading intermediate errors — a special case of our policy: a model forced to always pick $g_t = g$ for one fixed $g$.

The third build is the analysis. We map the U-curve empirically for biological dynamics and test the theory of How does Chain of Thought decompose complex tasks? in a domain it explicitly does not cover: that theory is derived for convergent, discrete-answer tasks, and continuous saturation dynamics are neither. If the U-curve flattens or vanishes in the continuous regime, that is itself a finding that constrains how far the $m^* = e^{d/2}$ law travels.

Proposed Experiments

Experiment 1 measures the U-curve. Three model scales are prompted (no training) to simulate forward traces at each of the four fixed granularities on SynBio-Dynamics. We expect accuracy to rise then fall with granularity, with the peak shifting coarser in saturated regimes, and we expect the small-model degradation pattern of CRUXEval to reappear: fine tracing hurts the smallest model most. The honest possibility that no U-curve appears in continuous dynamics is a planned outcome, not a failure — it would falsify the transfer of the granularity law and redirect the training design toward tool use.

Experiment 2 trains the adaptive-granularity policy and compares it against every fixed granularity, an oracle that always picks the globally best fixed granularity, and a random-granularity policy matched on average trace length. The last control is essential: it isolates adaptivity from merely choosing a good average depth. The key derived quantity is the per-segment choice — we predict the model learns something recognizable: coarse segments in saturated phases, fine segments at threshold crossings, i.e., the bin partition rediscovered as a policy, which is a satisfying falsifiable check given that hand-built binning already doubled fitting accuracy in the source domain.

Experiment 3 is the decisive one for the application: inverse design of localized-therapy circuits, scored by ground-truth execution of the generated circuit against the therapeutic window, with held-out biological parts (the held-out-part protocol of GenCircuit-RL). We also measure the reverse-execution asymmetry — the gap between forward and inverse success — and whether adaptive-granularity training narrows it, since reverse execution is the documented weak point of internal simulation in software (~12% for the best model in CodeSense) and the fundamental shape of design problems in gene therapy.

A fourth, cheaper thread probes mechanism: counterfactual mutations of circuit specs (renamed parts, negated regulatory logic) following the protocol of Do Large Code Models Understand Programming Concepts? Counterfactual Analysis for Code Predicates. If adaptive-granularity training builds a real causal model rather than memorized traces, mutation-induced degradation should shrink relative to fixed-granularity training.

Baselines

The do-nothing reference is zero-shot direct prediction: the untrained model answers state and design questions in one step, no intermediate trace. This is the reference point that the CRUXEval results calibrate us on (direct answering versus chain-of-thought tracing), and it establishes how much of the gap decomposition addresses at all. The strongest existing competitor is the GenCircuit-RL system itself — Group Relative Policy Optimization with the five-level hierarchical verification reward and its four-stage curriculum — run on our extended benchmark with its dynamic level scored only at the end, never trained on. Its reported result, the number to beat, is an improvement of 14–16 percentage points in functional reasoning task success over binary-reward training on SynBio-Reason; our comparison adds the dynamic level it never trained on, and beating it means closing more of the residual forward and inverse error than its hierarchy does at equal training compute and tuning budget. The third baseline is a tool-use loop: the model calls an external numerical ODE solver per segment at a fixed call granularity; this isolates whether internal simulation, rather than decomposition per se, carries the benefit. The fourth is the hand-built bin-dependent ODE model from Modeling Genetic Circuit Behavior in Transiently Transfected Mammalian Cells as a pure-simulation reference on forward tasks, which reported up to twice the accuracy of standard Hill-function fits on the flow-cytometry data. All trained baselines receive the same training set, the same optimization steps, and the same held-out-part evaluation split; the ablation that isolates our ingredient is the random-granularity control of Experiment 2, matched on average trace depth and compute. No reported result exists on Lacuna for zero-shot LLM performance on dynamic gene-circuit simulation, so that number will be established by this work.

Why not just…?

Why not just generate circuits end-to-end with a reasoning model and check them afterwards? The evidence against this is direct: in GenCircuit-RL, models trained with flat binary rewards collapsed to degenerate solutions on de novo design and debugging, and hierarchical verification recovered 14–16 percentage points. Moreover, end-to-end generation with post-hoc checking gives no signal during generation that a circuit will saturate or starve its own promoter, which is exactly the failure mode the bin-dependent paper shows smooth models miss. We include end-to-end generation as a trained baseline rather than argue around it.

Why not just call an external ODE simulator whenever dynamics matter? This is the most serious objection, and we treat it as such: for forward prediction with known parameters, an external solver is likely to win, and our Experiment 2 includes it precisely to concede that cleanly if true. But two things limit it. Tool calls on novel, held-out parts have no parameters to call — the model must estimate kinetics it has never executed, which is an internal-simulation capability, and GenCircuit-RL shows external rule-based tools like Cello do not generalize beyond characterized libraries. And the analytical framework of Designing Algorithms Empowered by Language Models shows that repeated external calls inside a recursive search introduce multiplicative latency and serialization bottlenecks, whereas internal state estimates let a design agent prune bad branches early — which matters for inverse design, the application-relevant task. If the external-solver loop wins on inverse design with held-out parts too, the honest conclusion is that internal simulation only matters for pruning and estimation, and we would report that.

Why not just prompt for maximally fine-grained tracing — every reaction step, one at a time? Every source of evidence says this fails: accuracy falls from ~50% to ~20% going from one to three traced statements in CodeSense; chain-of-thought tracing actively hurts smaller models in CRUXEval; and both Designing Algorithms Empowered by Language Models and the CoT decomposition theory prove the error curve is non-monotone, with intermediate noise compounding exponentially in "Type-B" error-prone nodes. Experiment 1 measures this directly in the biological domain, and the fixed fine-granularity condition of Experiment 2 is the controlled version of the objection.

Why not just use bin-dependent Hill models by hand, as the systems biologists already do? Because the bin partition is static and human-chosen: it works when the regime structure is known in advance, but the whole point of design is discovering circuits whose regime structure is not known. Our method subsumes it — the learned policy should rediscover something like the bin partition as an emergent behavior (Experiment 2 tests this explicitly) — and the bin-dependent model itself serves as our forward-task reference baseline, reported at up to twice the accuracy of standard Hill fits.

Decisive Checks

The proposal stands or falls on three numbers. If the U-curve exists in Experiment 1 and the adaptive policy of Experiment 2 beats the oracle-best fixed granularity by a margin that survives the random-granularity control, the core claim about which ingredient matters is established. If Experiment 3 shows the inverse-design gap to the GenCircuit-RL baseline closing on held-out parts, the connection to localized gene therapy design is real rather than decorative — the generated circuits would be the kind of multi-payload, saturation-prone constructs that RCAd-LTH-shPD-L1 and OAd-B7H3-BiTE build by hand today, with the model now able to anticipate their dynamic failures before a wet lab spends a year finding them. If instead fixed granularity or external solvers match us everywhere, the fallback contribution is the first measurement of the granularity law and the reverse-execution asymmetry in continuous biological dynamics — a negative result that would still tell the field where the mental-simulation barrier actually sits.