Manuscript Offprint
arXiv:2610.26959Dynamic System Inspired Continuous Large Language Model for AI4Science Tasks
Abstract
Scientific foundation models increasingly operate on continuous phenomena, yet still use discrete residual computation. We ask whether pretrained residual transformations can support additional latent computation without expanding the backbone. To test this possibility, we introduce Continuum-LM, which reuses these transformations as dynamical operators in a continuous-depth language model. Its hidden states evolve through an ordinary differential equation evaluated by higher-order numerical integration, with solver order and step size controlling computation. Across eight scientific tasks, Continuum-LM trains stably and improves mean exact-match accuracy by 7.77 and 10.96 percentage points over discrete counterparts at the 0.6B and 1.7B scales, respectively. At 0.6B, it also outperforms an Ouro-style recurrent control under matched parameter and residual-function evaluation budgets. Together, these results support extensible computational depth through parameter reuse, identifying continuous hidden-state evolution as a practical design dimension for scientific language models beyond parameter scaling.
Keywords: Large Language Model, AI4Science, Continuous Dynamics, parameter-efficient fine-tuning
1 Introduction
Artificial intelligence is increasingly used to model, predict and design scientific systems, with foundation models contributing to molecular and protein modelling, materials science, biomedical reasoning and scientific problem-solving . Large language models (LLMs) provide a common backbone for these tasks through domain-specific pretraining or supervised fine-tuning . Although these approaches have broadened the scope of scientific foundation models, they have largely expanded training data, domain knowledge and parameter count while retaining the fixed-depth architecture of general-purpose LLMs.
Across these scientific tasks, predictions must satisfy numerical, symbolic or structural constraints despite scarce labels and differences between training and deployment systems . Meeting these demands depends not only on the scientific information encoded in a model, but also on how its internal representations are transformed during computation. This motivates an architectural question that has received comparatively limited attention in scientific foundation models: must hidden-state evolution follow a fixed sequence of residual updates, or can computation be controlled through integration depth and numerical resolution?
This question can be formulated through the residual update
where is the hidden state entering residual sublayer j and is its residual transformation [12, 13]. Under an appropriate parameterization, this update can be interpreted as a numerical discretization of continuous-depth dynamics [14–17]. Rather than implying that discrete networks are intrinsically inaccurate or must mirror physical continuity, this interpretation makes solver order and integration resolution explicit choices for regulating numerical approximation and computational cost within each branch.
Applying this interpretation to pretrained LLMs introduces two requirements. First, conversion must reuse existing parameters and support stable optimization rather than require training from scratch. Second, its organization of additional function evaluations must be compared with another form of repeated computation at the same parameter scale. The challenge is therefore to adapt an already capable discrete model's computation while retaining its pretrained initialization.
To investigate this possibility, we introduce CONTINUUM-LM, which parameterizes hidden-state evolution as an autonomous ordinary differential equation (ODE),
whose update function inherits parameters from a discrete checkpoint and is evaluated by numerical integration (Fig. 1). Continuous-depth base training first adapts these parameters to the modified computation. Low-rank adaptation (LoRA) then specializes the converted model to scientific tasks while keeping the backbone frozen [18].
The two stages thus separate adaptation of pretrained computation from downstream scientific specialization.
We evaluate this framework through parameter-scale suitability, optimization and scientific task adaptation. Layer-wise sweeps identify minimum-loss coefficients near the original pretrained scale, while solver comparisons reveal integration-dependent training dynamics (Fig. 4a–c). After downstream adaptation, CONTINUUM-LM improves mean exact-match accuracy by 77.2% and 82.0% over corresponding discrete baselines at 0.6B and 1.7B, respectively; the 1.7B model approaches Qwen3-8B (Fig. 2). To compare alternative organizations of repeated computation, we also evaluate a matched recurrent control at 0.6B (Fig. 3e).
Together, these results identify continuous depth as a practical architectural variable rather than an analogy for a uniquely defined reasoning trajectory. By linking parameter reuse to numerical integration and downstream adaptation, they suggest that scientific language models can benefit from changes to how pretrained representations are computed, alongside changes in data, parameters and fine-tuning.
2.1 Pretrained residual LLMs admit direct continuous-depth conversion
To implement this continuous-depth view, we first transferred pretrained residual computation without reinitializing or reshaping the weights. For the branch in Eq. 1, we define the local system
Under this formulation, the original update is a unit-step Euler approximation, whereas higher-order integration evaluates the inherited transformation at intermediate states [16, 19]. The numerical update can therefore change without adding backbone parameters. We examine a two-stage second-order Runge–Kutta method (RK2) and a four-stage fourth-order method (RK4), varying both numerical order and integration resolution.
This local construction is applied independently to the attention and feed-forward residual sublayers (Fig. 1a–d). Their pretrained parameters define the respective vector fields, while the tokenizer, embeddings, normalization structure, positional encoding and output head retain their original forms. A discrete checkpoint can therefore initialize the converted model without reinitialization or format changes. The conversion itself supplies a valid initialization before any gradient-based adaptation. Subsequent continuous-depth base training adapts these inherited parameters to the numerical update. Backbone parameter count remains unchanged, whereas function evaluations and computational cost depend on the solver.
By retaining the pretrained initialization and high-level structure while changing the numerical update, this construction makes within-block computation an explicit architectural intervention. It allows multi-stage residual evaluation to be compared with the original single-stage update without increasing parameter count, rather than assuming access to a unique underlying reasoning trajectory. Solver order and evaluation count can consequently be varied independently of model parameter count.
We assessed the inherited parameter scale using Qwen3-0.6B and Qwen3-1.7B [20]. For each layer–branch configuration, we rescaled the selected layer’s pretrained parameters, kept all others unchanged, and measured teacher-forced next-token cross-entropy on 1,000 sampled training examples. Minimum-loss coefficients clustered near across most attention and feed-forward configurations (Fig. 4a), supporting the original parameter scale as an initialization for continued training.
Starting from these checkpoints, all evaluated RK2 and RK4 configurations showed an overall loss reduction during 20,000-step solver ablations (Fig. 4b,c). The main models use a separate 100,000-step continued-pretraining budget. This distinction separates the diagnostic training curves from the checkpoints used for downstream evaluation. We then apply task-specific LoRA fine-tuning while freezing the converted backbone (Fig. 1e,f) [18]. The resulting protocol evaluates the same continuous-depth base model across scientific domains without independently retraining its full backbone for each task.
2.2 Continuous-depth models improve performance across eight scientific tasks
To evaluate this adaptation protocol across scientific domains, we used eight tasks spanning four families. This coverage assesses the converted backbone beyond a single benchmark or data modality. Molecular tasks comprise reagent prediction, forward reaction prediction, retrosynthesis and property prediction [21–24]; protein tasks comprise catalytic activity and domain/motif prediction [25–28]. The remaining tasks are chemical–disease relation extraction [29, 30] and materials text-to-structure generation [31–33]. At each scale, the continuous model starts from the corresponding Qwen3 checkpoint. Downstream comparisons share task data, LoRA rank, optimization schedules and evaluation procedures; scores average three independent LoRA runs from each fixed base checkpoint.
Under this protocol, CONTINUUM-LM outperformed its parameter-matched Qwen3 counterpart on all eight tasks at both scales (Fig. 2a). Forward reaction accuracy increased from 17.13% to 37.04% at 0.6B and from 29.11% to 54.70% at 1.7B, gains of 19.91 and 25.59 percentage points. At 0.6B, text-to-structure accuracy rose from 3.36% to 22.08%, a gain of 18.72 points. Improvements also occurred in retrosynthesis, catalytic activity and chemical–disease interaction extraction. Across the complete benchmark suite, gains ranged from 0.154 points for 0.6B property prediction to 35.35 points for 1.7B retrosynthesis. Thus, the gains spanned the task suite, with the largest absolute improvements in structured scientific outputs.
To relate these task-level gains to model size, we computed the unweighted mean exact-match accuracy across the eight tasks (Fig. 2b). CONTINUUM-LM-0.6B achieved 17.83%, compared with 10.06% for Qwen3-0.6B, 13.37% for Qwen3-1.7B and 20.21% for Qwen3-4B. At 1.7B, CONTINUUM-LM reached 24.33%, exceeding Qwen3-4B by 4.12 percentage points and approaching Qwen3-8B (26.12%) within 1.79 points. These comparisons show that the parameter-performance advantage extends beyond same-scale baselines: the continuous 0.6B and 1.7B models also outperform the larger discrete 1.7B and 4B models, respectively.
We next examined whether the improvements extended beyond a single definition of task success. The radar analysis covers 40 task-metric combinations, with five metrics per task and min-max scaling across the displayed models (Fig. 2c). These radial values describe relative performance within each metric, rather than replacing the raw task scores used in the aggregate comparison. Molecular gains extend to fingerprint similarity as well as exact matching, while protein improvements persist under class-sensitive and span-level criteria. Text-to-structure generation remains competitive in schema validity, field-level F1 and numerical-tolerance accuracy. These complementary measures support broader output-quality improvements, although their magnitude varies by task and metric.
To examine the role of downstream adaptation, we compared each base model before and after LoRA fine-tuning (Fig. 2d). Both discrete and continuous checkpoints initially achieved near-zero aggregate exact match. With matched trainable parameter counts and optimization settings, their post-LoRA scores reached 10.06% versus 17.83% at 0.6B and 13.37% versus 24.33% at 1.7B, respectively. The observed differences therefore concern how the two types of base checkpoint respond to the same task-specific training procedure. The continuous-dynamics base models support stronger downstream solutions under the same parameter-efficient adaptation protocol.
Because continuous-depth conversion adds repeated function evaluations, we also compared CONTINUUM-LM-0.6B with Qwen3-0.6B-Ouro, an Ouro-style recurrent control (Fig. 3e). Both share the pretrained Qwen3 checkpoint, base-training corpus and downstream configuration, with four evaluations per original attention or feedforward residual branch. Matching these conditions compares two different ways to use repeated evaluations of pretrained transformations. Across three LoRA runs from each fixed base checkpoint, mean accuracy was 17.83% for CONTINUUM-LM and 12.04% for the control, a 5.79-percentage-point difference; CONTINUUM-LM was higher on six tasks. This comparison supports its organization of within-block computation over the evaluated recurrent alternative at matched parameter and branch-evaluation budgets.
2.3 Inference-compute trade-offs and recurrent-control comparisons
The recurrent comparison controls the number of residual evaluations; we next examined the inference cost associated with those evaluations. One branch-level function evaluation (NFE) is one call to an attention or feed-forward residual transformation. The discrete model uses one call per branch, one-step RK2 uses two, and one-step RK4 and two-step midpoint RK2 each use four (Fig. 3a). The default configuration therefore quadruples branch evaluations without changing the backbone. Because the two branch types have different costs, these counts must be complemented by FLOP estimates.
We estimated inference FLOPs per example using 1,024 input tokens, 1,024 output tokens, batch size one and key-value caching. Using a parameter-based forward-pass approximation motivated by the leading-order Transformer compute estimate [34], we calculate
where P is the nominal parameter count in individual parameters, , and is the number of evaluations per residual branch: one for the discrete model and four for the default two-step midpoint RK2 configuration. The NFE multiplier is applied at the model level as a leading-order approximation, rather than through an operator-by-operator count. Costs are divided by to obtain TFLOPs per example. These estimates use common sequence lengths across tasks, while performance is the unweighted mean exact-match accuracy over the eight benchmarks.
Under this protocol, CONTINUUM-LM-0.6B achieved 17.83% accuracy at 9.83 TFLOPs, compared with 13.37% at 6.96 TFLOPs for Qwen3-1.7B (Fig. 3b). The gain of 4.46 percentage points requires 41.2% more computation. Compared instead with Qwen3-4B (20.21% at 16.38 TFLOPs), the same model uses 40.0% less computation with a 2.38-point accuracy gap. It therefore occupies an intermediate operating point rather than dominating either baseline in both accuracy and estimated computation.
A similar trade-off appears at 1.7B: CONTINUUM-LM achieved 24.33% at 27.85 TFLOPs, compared with 26.12% at 32.77 TFLOPs for Qwen3-8B. It used approximately 15.0% less inference computation with a 1.79-percentage-point accuracy gap, recovering 86% of the performance difference between Qwen3-1.7B and Qwen3-8B. The continuous model thus approaches the larger model's mean performance while using fewer parameters and less estimated inference computation. Together, these operating points show competitive compute-performance trade-offs for smaller continuous models, without implying superiority at every computation budget.
To resolve these aggregate comparisons by task, we divided each task's percentage accuracy by estimated inference TFLOPs (Fig. 3c). CONTINUUM-LM-0.6B exceeded Qwen3-1.7B on reagent prediction, catalytic activity and chemical-disease relation extraction. At 1.7B, CONTINUUM-LM exceeded Qwen3-8B on five tasks, most clearly in retrosynthesis and chemical-disease relation extraction; catalytic activity was nearly matched. The heatmaps thus reveal task-level differences within the aggregate compute-performance pattern.
Whereas these comparisons describe individual operating points, we also compared the return from additional inference computation relative to a shared starting model (Fig. 3d). For score and cost changes from to , we define
where S is mean exact-match accuracy expressed as a percentage and C is estimated inference cost in TFLOPs. This measures an intervention relative to its discrete source, rather than dividing its final score by total compute. Starting from Qwen3-0.6B, conversion yielded 1.05 percentage points per additional TFLOP, compared with 0.73 for scaling to Qwen3-1.7B. From Qwen3-1.7B, the corresponding returns were 0.52 for conversion and 0.49 for scaling to Qwen3-8B. Conversion provided the larger marginal return along these two paths, most clearly at 0.6B.
These comparisons characterize parameter-performance and inference-compute trade-offs under the standardized sequence-length protocol, with cost expressed as estimated FLOPs. We next turn from these operating points to the design choices governing conversion and adaptation.
2.4 Ablations identify the design factors underlying Continuum-LM
The ablations examine four design factors: the inherited parameter scale, optimization after conversion, numerical integration and downstream LoRA capacity. We consider initialization and base training before turning to downstream adapter capacity, following the conversion and adaptation pipeline. These diagnostics characterize the conditions under which the framework is effective.
Pretrained parameter scales remain suitable after conversion
We first tested whether the original parameter scale remains suitable after RK2 conversion. For each layer–branch configuration in Qwen3-0.6B and Qwen3-1.7B, we rescaled only the selected layer's parameters as , leaving all other parameters unchanged; retains the pretrained values. Teacher-forced language-modelling loss was measured on 1,000 sampled training examples using the reference prefix at each position, without gradient-based parameter updates. Across most attention and feedforward configurations, the minimum-loss coefficient remained near unity (Fig. 4a). Thus, retaining the inherited parameter scale generally yielded lower prediction loss than substantial rescaling, supporting its use for initialization.
Integration schemes shape base-training dynamics under a common pretrained initialization
Starting from the same pretrained Qwen3 checkpoint at each scale, we then compared one-step RK2, one-step RK4 and two-step midpoint RK2 over 20,000 optimization steps with common data and optimizer settings (Fig. 4b,c). Although loss decreased for all configurations, their trajectories differed. At 0.6B, the curves largely overlapped after the initial decrease; at 1.7B, two-step RK2 reached a lower-loss regime earlier in the middle of training. The differences narrowed later, but two-step RK2 attained the lowest reported endpoint loss at both scales. These endpoints belong to the solver ablations, not the separate 100,000-step main training, and show that the numerical update influences optimization under a common initialization.
Integration configurations exhibit different compute-loss scaling behaviour
To relate these training dynamics to computation, we analysed the 1.7B one-step RK2 and two-step midpoint RK2 ablation runs. For each solver configuration q, we fitted next-token cross-entropy measured on the official WikiText-103 test split to
(6) where denotes cumulative training compute. The asymptotic loss , coefficient and exponent were jointly estimated separately for each configuration. Figure 4d plots excess test loss , abbreviated as .
Both configurations followed a power-law trend over the measured range. One-step and two-step RK2 yielded exponents of 0.595 and 0.630, with and 0.997, respectively. The larger exponent for two-step RK2 indicates a steeper decline in fitted excess test loss as compute increases. These exponents complement the step-based training curves by describing how each configuration's excess loss changes on the compute axis. Together, the two analyses support the selected solver within the evaluated regime. Both RK2 configurations remain second-order methods.
Moderate LoRA rank provides an effective adaptation setting
After examining base training, we assessed downstream adapter capacity on retrosynthesis, catalytic activity prediction, chemical–disease relation extraction and text-to-structure generation (Fig. 4e). Increasing LoRA rank from 8 to 16 improved retrosynthesis, chemical–disease relation extraction and text-to-structure generation at both model scales, whereas catalytic activity prediction declined.
Increasing rank further to 32 produced mixed responses. At 0.6B, retrosynthesis and catalytic activity improved, while chemical–disease relation extraction and text-to-structure generation declined. At 1.7B, only catalytic activity improved; chemical–disease relation extraction was unchanged and the other tasks declined. Larger adapters therefore did not yield uniformly better results. We retain r = 16 as a moderate-capacity default that balances the evaluated tasks without doubling adapter rank.
Together, these diagnostics support pretrained-scale initialization, two-step midpoint RK2 and moderate-rank LoRA as the selected configuration. Having characterized these design choices, we next examine the output-level changes accompanying the downstream gains.
2.5 Continuum-LM assigns larger margins to reference scientific tokens
To characterize reference-token preference, we computed the teacher-forced margin for prompt x, reference answer and answer position t:
where is the logit for vocabulary token under the reference prefix. A positive margin places the reference token first; a larger positive margin indicates greater separation from its strongest competitor. The maximum excludes the reference token, so the competitor is not assumed to be the second-ranked token when the reference is not ranked first. This measures conditional token preference rather than calibrated confidence.
We compared Qwen3 and CONTINUUM-LM on identical prompt–answer examples and reference prefixes at both scales. Figure 5 summarizes the distributions separately for each of the eight tasks, with dashed vertical lines marking their mean margins.
At 0.6B, the distributions overlapped substantially on most tasks, yet CONTINUUM-LM had higher mean margins on all eight. Separation was most apparent in text-to-structure generation, with additional rightward shifts in forward reaction prediction and domain/motif prediction; mean differences were smaller on the remaining tasks.
At 1.7B, higher mean margins again occurred on all eight tasks, with clearer separation across a broader range of tasks. Pronounced shifts appeared in forward reaction prediction, retrosynthesis, property prediction, catalytic activity prediction and domain/motif prediction.
Whereas exact-match accuracy evaluates freely generated answers, these margins measure reference-token preference under teacher forcing. Their agreement in direction shows that improved final-answer accuracy accompanies stronger average preference for reference-answer tokens across heterogeneous scientific tasks, providing an output-level complement to the benchmark results.
3 Discussion
Our results identify the organization of computation across model depth as a design dimension for scientific foundation models. CONTINUUM-LM retains the pretrained Transformer block structure but replaces each attention and feed-forward branch's single update with a numerically integrated continuous-depth transformation. Its improvements across eight AI4Science tasks suggest that adapting pretrained representations involves not only scale, data or fine-tuning objectives, but also how transformations are computed within each block.
First, additional within-block computation complements parameter scaling. CONTINUUM-LM outperforms its parameter-matched Qwen3 counterpart at both scales; at 1.7B, it matches or exceeds Qwen3-4B on seven tasks and exceeds Qwen3-8B on three. It also approaches the latter's aggregate accuracy with approximately 15% less estimated inference computation. These comparisons illustrate why additional solver evaluations are part of the design rather than incidental overhead: they reuse existing parameters to recover part of the performance otherwise obtained by increasing model size.
Second, the recurrent control shows why the organization of repeated computation matters. With the same Qwen3-0.6B initialization, base-training corpus and downstream configuration, CONTINUUM-LM exceeded the Ouro-style control by 5.79 percentage points on average and performed better on six tasks. This supports the integration-based architecture over the evaluated recurrent alternative and makes computation structure, rather than parameter count alone, an explicit design choice.
Third, parameter inheritance makes this adaptation practical. The layer-wise diagnostic identified minimum-loss scales near the original pretrained values for most attention and feed-forward configurations. This supports retaining the inherited scale at initialization, while continued pretraining adapts the parameters to numerical integration. The framework can therefore build on an existing language model rather than learn the backbone from scratch.
Fourth, both numerical integration and adapter capacity shape adaptation. Two-step RK2 attained the lowest reported loss at the end of the 20,000-step solver ablations at both model scales. At 1.7B, it also showed a steeper fitted excess WikiText-103 test-loss decline than one-step RK2. Because both methods are second order, this comparison concerns integration resolution rather than higher formal order. Likewise, increasing LoRA rank from 8 to 16 improved three of four tasks at both scales, whereas rank 32 produced task-dependent gains and losses. These findings support two-step midpoint RK2 with rank-16 LoRA as a practical configuration, without treating maximum solver order or adapter capacity as automatically preferable.
Finally, higher reference-token margins complement the sequence-level gains. Under identical reference prefixes, CONTINUUM-LM assigns stronger average preference to reference tokens, with clearer distributional separation across more tasks at 1.7B. Together with exact-match accuracy on freely generated answers, this indicates improvements in both conditional token preference and final-answer correctness, connecting the architectural changes to observable output behaviour.
Several limitations define the scope of these conclusions. The experiments cover Qwen3-derived models at two scales and a block-wise RK implementation; other model families, attention mechanisms and adaptive solvers remain to be examined. Broader generalization also requires additional data sources and scientifically meaningful distribution shifts, including molecular-scaffold and protein-family splits. Finally, reference-based metrics may miss valid alternative scientific outputs, while teacher-forced margins do not capture free-running error propagation. Evaluations that accommodate alternative answers and prospective scientific validation would further establish practical scope.
Overall, CONTINUUM-LM shows that pretrained language models can be adapted by reorganizing hidden-state computation. Combining pretrained parameter reuse, structured within-block integration and task-specific LoRA offers a complementary route to parameter scaling. Treating hidden-state propagation as an explicit design variable therefore provides a practical direction for more capable and parameter-efficient scientific foundation models.
4 Methods
4.1 Block-wise continuous-depth conversion
We initialize our models from pretrained decoder-only language models in the Qwen3 family [20]. We use j to index residual sublayers and to index Transformer blocks, each of which contains an attention and a feed-forward residual sublayer. Let denote the hidden representation entering residual sublayer j. In the original model, the sublayer applies
where denotes either the self-attention or feed-forward residual branch, including the corresponding pre-normalization operation [12, 13].
We replace each discrete residual update with the numerical solution of a local initial-value problem. For a residual sublayer with parameters , the hidden representation is defined over a normalized local depth coordinate as
The output of the numerical solver at t = 1 replaces the original residual endpoint.
Each converted sublayer inherits the parameters of the corresponding pretrained residual branch. The tokenizer, token embeddings, positional encoding, normalization operators and language-model head are unchanged. The conversion therefore preserves the representation dimension and parameter initialization while changing the computation used to propagate representations through each residual sublayer.
Importantly, Equation 9 defines a separate local dynamical system for each attention and feed-forward sublayer. Parameters are shared across numerical stages within a sublayer but not across Transformer blocks. The resulting architecture is therefore piecewise continuous in depth and should not be interpreted as a single globally parameter-shared neural ordinary differential equation.
4.2 Numerical integration of hidden-state dynamics
We convert the self-attention and feed-forward residual branches separately and apply the corresponding numerical updates sequentially within each Transformer block. We evaluate three fixed-step solvers: one-step midpoint RK2, one-step classical RK4 and two-step midpoint RK2. Unless otherwise stated, CONTINUUM-LM uses two-step midpoint RK2, adopted on the basis of the continued-pretraining solver comparisons described below.
For a generic residual branch with parameters , the dynamics are autonomous: does not receive the continuous-depth coordinate t as an explicit input. The model uses neither time embeddings nor depth-conditioned parameters. The coordinate t specifies only the integration interval and numerical step size.
For two-step midpoint RK2, the interval is divided into two uniform steps of size . Starting from , step is evaluated as
The numerical endpoint is
All four function evaluations use the same pretrained parameters, but each evaluation recomputes the normalization and residual-branch outputs from its stage-specific hidden representation.
For Transformer block , we define
(14) and
Let denote the endpoint obtained by integrating the update function from the initial state over using two midpoint-RK2 steps of size . Given block input , the self-attention branch is integrated first:
followed by the feed-forward branch:
Here, is the hidden state after attention integration, and is the final block output.
The attention vector field includes the complete self-attention residual branch, comprising the query, key, value and output projections. These projections are recomputed at every RK stage using the stage-specific hidden representation. The causal mask and sequence-position indices are held fixed across stages, and the backbone positional encoding is applied using the original token positions. The feed-forward vector field analogously contains the complete gated MLP residual branch.
This computation uses repeated evaluations of the same residual function at intermediate states within a normalized local interval, rather than introducing independently parameterized copies of the branch. Two-step midpoint RK2 uses four function evaluations per converted residual branch, whereas one-step RK2 uses two, one-step RK4 uses four and the original discrete residual branch uses one. We report parameter counts, residual-function evaluations and estimated FLOPs to characterize the computational requirements of the evaluated models.
Unless otherwise stated, solver comparisons use the same source checkpoint, training examples, token order, optimizer settings and downstream adaptation protocol. This design controls for differences in initialization and data exposure, while compute-normalized analyses separately account for the different numbers of function evaluations.
4.3 Layer-wise scale-sweep diagnostic
We use a layer-wise scale sweep to assess whether the original pretrained parameter scale remains suitable after RK2-based continuous-depth conversion. The diagnostic is performed on Qwen3-0.6B and Qwen3-1.7B, examining attention and feed-forward residual branches across layers.
For each source checkpoint and layer–branch configuration , where denotes the attention or feed-forward branch, respectively, we apply RK2-based conversion and uniformly rescale the pretrained parameters under examination:
Here, denotes the pretrained parameter tensors of the selected Transformer block . Only this block is rescaled by ; all parameters outside it remain at their original pretrained values. The coefficient preserves the selected block's pretrained parameter values. Each layer–branch configuration and scaling coefficient is evaluated independently from the original parameter values, without accumulating scaling across coefficients or blocks. No gradient-based parameter updates are performed during the sweep.
We evaluate each configuration on 1,000 examples randomly sampled from the training corpus using seed 42. Evaluation uses teacher forcing: the model receives the reference prefix and predicts the next token in the original text. We compute next-token cross-entropy over all valid target-token positions in the sampled texts, excluding padding tokens. The loss is averaged over the total number of valid target tokens across the 1,000 examples.
Let denote the resulting model configuration. For each layer and branch type, we record the coefficient minimizing the teacher-forced language-modelling loss:
where denotes the sampled training examples, denotes the teacher-forced next-token cross-entropy loss, and is the grid of scaling coefficients evaluated during the sweep.
Figure 4a shows the loss across coefficients for each layer and branch type and marks the corresponding minimum-loss coefficient. Concentration of the optima near c = 1 supports retaining the original pretrained parameter scale when initializing continuous-depth base training.
4.4 Continued pretraining after conversion
Following conversion, we continue pretraining to adapt the inherited parameters to the modified numerical computation. The main models are initialized from Qwen3-0.6B and Qwen3-1.7B, respectively, and both use two-step midpoint RK2. At both scales, continued pretraining uses the same sampled SlimPajama-627B corpus. We retain the original Qwen3 tokenizer and pack documents into sequences of 4,096 tokens. Documents are packed without inserting additional end-of-document tokens, and attention is restricted within document boundaries. Padding tokens are excluded from the count of actual training tokens.
Training is conducted on six NVIDIA A100 GPUs using DeepSpeed ZeRO-2 [35]. All model parameters are optimized with AdamW using a peak learning rate of , , and weight decay 0.01 [36]. The learning rate is warmed up for 1,000 optimization steps and subsequently follows a cosine decay schedule. Training uses BF16 arithmetic and a global batch size of 48 sequences. We train for 100,000 optimization steps, corresponding to a nominal budget of token positions, or approximately 20 billion before excluding padding.
https://www.modelscope.cn/datasets/cerebras/SlimPajama-627B
For solver ablations, we train one-step RK2, one-step RK4 and two-step midpoint RK2 for 20,000 optimization steps at both the 0.6B and 1.7B scales. Within each scale, all configurations are initialized from the same Qwen3 checkpoint and use identical training data, batch sizes and optimizer settings. This ablation budget is separate from the 100,000-step continued-pretraining budget used for the main models. The training curves in Fig. 4b,c show these 20,000-step ablation runs. Comparisons at the same optimization step therefore match training exposure, while the number of residual-function evaluations varies with the solver.
We use the final checkpoint obtained at the end of continued pretraining for downstream LoRA adaptation. Training loss is monitored throughout optimization. At the evaluated checkpoints, we compute next-token cross-entropy on the official test split of WikiText-103 [37].
For the compute-scaling analysis, we use analytically estimated cumulative training FLOPs. Specifically, we estimate cumulative training computation using the parameter-token approximation [34], where P is the nominal model parameter count and D is the cumulative number of training token presentations. To account for repeated residual evaluations, we use the NFE-adjusted approximation
where is the number of function evaluations per residual branch: two for one-step RK2 and four for either one-step RK4 or two-step midpoint RK2. The NFE multiplier is applied at the model level as a leading-order approximation, rather than through an operator-by-operator FLOP count. The WikiText-103 test losses recorded at the evaluated checkpoints are fitted separately for each solver configuration to Eq. 6. The asymptotic loss , scaling coefficient and exponent are jointly estimated rather than fixing in advance. We report the fitted exponents and coefficients of determination, . The plotted quantity denotes test loss minus the asymptotic loss fitted for that configuration.
4.5 AI4Science tasks and datasets
We evaluate the models on eight scientific prediction tasks grouped into four families. The molecule-oriented family comprises reagent prediction, forward reaction prediction, retrosynthesis and molecular property prediction [21–24]. The protein-oriented family comprises catalytic-activity prediction and protein domain or motif prediction [25–28]. The biomolecular-text family contains chemical–disease relation extraction [29, 30]. The materials-science family contains text-to-structure generation [31–33].
Seven tasks are derived from Mol-Instructions: reagent prediction, forward reaction prediction, retrosynthesis, property prediction, catalytic-activity prediction, domain or motif prediction, and chemical–disease relation extraction [38]. Mol-Instructions is a diverse biomolecular instruction dataset spanning molecule-oriented, protein-oriented and biomolecular-text tasks. For materials text-to-structure generation, we use the public text2struc_dataqa dataset hosted on Hugging Face.
https://huggingface.co/datasets/vbv373/text2struc_dataqa
The data are divided into training, validation and test partitions in a ratio of 48:1:1. The same task partitions are used across all compared models. The eight tasks cover molecular strings, numerical targets, protein labels or spans, biomedical relation triples and structured materials outputs. This diversity provides a common setting for evaluating adaptation across heterogeneous scientific task formats.
4.6 Primary and task-specific evaluation metrics
The primary endpoint in Figure 2a is task-level exact-match accuracy. Predictions are normalized using task-specific deterministic procedures defined before evaluation. These procedures include molecular canonicalization, whitespace and case normalization for constrained textual labels, and schema normalization for structured outputs. The normalization and failure-handling rules are applied identically to all models.
For Figure 2b, we compute the unweighted macro-average
where is the exact-match accuracy for task j. This statistic gives each task equal weight irrespective of dataset size and is reported together with the eight individual scores.
We additionally report five task-specific metrics per task for the radar analysis in Figure 2c. For reagent prediction, these are molecular validity, reagent-set exact match, reagent-level F1, Morgan-fingerprint Tanimoto similarity and MACCS-fingerprint Tanimoto similarity [39–41]. Forward reaction prediction uses molecular validity, product exact match, normalized Levenshtein similarity, Morgan-fingerprint similarity and MACCS-fingerprint similarity [42]. Retrosynthesis uses molecular validity, reactant-set exact match, reactant-level F1, Morgan-fingerprint similarity and MACCS-fingerprint similarity. Molecular strings are canonicalized before comparison, and invalid predictions receive a score of zero for chemistry-dependent metrics.
Property prediction is evaluated using MAE, RMSE, Pearson correlation, Spearman correlation and . MAE and RMSE are converted into positive scores for radar visualization, so that lower prediction errors correspond to higher plotted values.
Catalytic-activity prediction is evaluated using balanced accuracy, macro-F1, AUROC, area under the precision-recall curve and Matthews correlation coefficient [43, 44]. Metrics with range , including correlation coefficients and Matthews correlation coefficient, are mapped to for visualization using .
Domain or motif prediction uses token-level F1, segment-level F1, boundary intersection-over-union, macro-F1 and exact span match. Chemical-disease relation extraction uses entity-pair F1, relation-level F1, triple-level exact F1, macro-F1 and triple recall. Text-to-structure generation uses schema validity, exact structure match, field-level F1, numerical-tolerance accuracy and constraint validity. Radar values are normalized to and oriented so that higher values indicate better performance. The radar plots summarize complementary aspects of scientific output quality within each task. For radar visualization, each metric is oriented so that higher values indicate better performance and then min-max scaled across the models displayed in the corresponding task panel. Models omitted from the panel do not contribute to the scaling bounds. Axis annotations indicate the metric ranges before radial scaling.
4.7 LoRA supervised fine-tuning
After continued pretraining, models are adapted separately to each downstream task using low-rank adaptation (LoRA) [18]. The final continued-pretraining checkpoint is used to initialize downstream adaptation. LoRA adapters are inserted into the query, key, value and output projections of self-attention and the up, gate and down projections of the feed-forward branch. The pretrained backbone weights are kept fixed while the low-rank adapters are optimized on task-specific instruction data.
For the main Mol-Instructions experiments, LoRA rank is and the scaling parameter is . Optimization uses AdamW with a learning rate of and zero weight decay. Training is conducted on six GPUs with DeepSpeed ZeRO-2, BF16 arithmetic, a global batch size of 192 sequences and a maximum context length of 1,024 tokens. We use cosine learning-rate decay, a warmup ratio of 3% and train for 20 epochs.
Each task uses identical prompts, target serialization and loss masking across models. At inference, the models use deterministic greedy decoding. Prompt formatting, post-processing and evaluation code are shared across models. Continuous and discrete models are adapted using the same task data and optimization settings.
We evaluate LoRA ranks 8, 16 and 32 on four representative AI4Science tasks: retrosynthesis, catalytic activity prediction, chemical–disease relation extraction and text-to-structure generation. The comparisons are performed for both CONTINUUM-LM-0.6B and CONTINUUM-LM-1.7B to assess the sensitivity of downstream performance to adapter capacity. The rank-16 setting is the default used in the main benchmark experiments, and its task-level results are reused in the rank-ablation comparison.
4.8 Ground-truth-token margin analysis
We characterize output-level changes using ground-truth-token logit margins on held-out test examples. Given prompt and reference answer of length , the model is conditioned at answer position on the prompt and the reference prefix . The analysis therefore uses teacher forcing with identical reference prefixes for the compared models.
Let denote the pre-softmax logit for vocabulary item v at answer position t. We define the ground-truth-token margin as
A positive margin indicates that the reference token receives a larger logit than every competing token; a larger value indicates greater separation from the strongest competing token.
Margins are computed only at non-padding answer positions and are summarized separately for each task and model scale. We compare Qwen3 and CONTINUUM-LM at the 0.6B and 1.7B scales using the same prompt–answer examples. Density curves show the margin distributions, and dashed vertical lines indicate the corresponding means. This output-level analysis measures preference for reference scientific answers under teacher forcing and complements the sequence-level exact-match evaluation of freely generated answers.
4.9 Baselines and comparison protocol
The baseline set includes Qwen3 models with 0.6B, 1.7B, 4B and 8B parameters [20], together with Ouro-1.4B [45]. We additionally construct Qwen3-0.6B-Ouro, an Ouro-style recurrent control initialized from the same Qwen3-0.6B checkpoint as CONTINUUM-LM-0.6B. The looped control uses the same base-training corpus and downstream adaptation configuration as the continuous model. Both the recurrent control and CONTINUUM-LM-0.6B use four evaluations of each original attention and feed-forward residual function, matching the branch-level function-evaluation budget.
We distinguish three comparison types:
-
Same-scale comparison: CONTINUUM-LM versus Qwen3 models at the same parameter scale under a common downstream LoRA adaptation protocol;
-
Recurrent-control comparison: CONTINUUM-LM-0.6B versus Qwen3-0.6B-Ouro under a common pretrained initialization, base-training corpus and downstream adaptation configuration;
-
Resource comparison: predictive performance compared across model parameter scales and estimated inference FLOPs under the standardized evaluation protocol.
The same-scale comparisons evaluate adaptation at a fixed model scale. The recurrent control compares alternative organizations of repeated computation, while larger Qwen3 models and Ouro-1.4B provide reference points for the parameter-performance and compute-performance comparisons.
All internally adapted models use the same task splits, prompts, decoding settings and evaluation scripts. Parameter counts and estimated inference FLOPs are used to characterize the corresponding resource-performance trade-offs.
4.10 Ablation design
The ablation experiments are designed to distinguish four possible sources of performance differences. First, the layer-wise scale sweep evaluates the suitability of the inherited parameter scale after RK2 conversion using teacher-forced language-modelling loss on 1,000 randomly sampled training examples. Second, solver ablations compare one-step RK2, one-step RK4 and two-step RK2 under both token-matched and compute-aware settings. Third, the Qwen3-0.6B-Ouro control compares continuous-depth integration with an Ouro-style recurrent alternative under a common pretrained initialization, base-training corpus and downstream adaptation configuration. Fourth, LoRA-rank ablations test sensitivity to downstream adapter capacity.
These experiments characterize pretrained parameter-scale suitability, solver-dependent optimization, compute-loss scaling, recurrent computation and downstream adaptation capacity.
4.11 Statistical analysis and reproducibility
Main downstream benchmark results and the recurrent-control comparison are averaged over three independent LoRA fine-tuning runs. For each model, the base checkpoint is held fixed across these runs, while the LoRA fine-tuning seed is varied under the same task splits, data and optimization settings. The repetitions are performed only at the downstream adaptation stage and do not involve retraining the base model.
Task-level results are reported separately, and the aggregate benchmark score is the unweighted mean exact-match accuracy across the eight tasks. Aggregate scores are computed within each run before averaging across runs. Model comparisons use the same test examples, prompt templates and evaluation procedures. Task-specific metric values are mapped to for radar visualization, with all axes oriented so that higher values indicate better performance. The aggregate benchmark score is computed from the original exact-match accuracies, not from the normalized radar values.
Code, configuration files and evaluation scripts will be released upon acceptance to support reproduction of model conversion, continued pretraining, downstream adaptation and evaluation. The release will include training configurations, preprocessing scripts, prompt templates and evaluation code used for the reported figures and benchmark comparisons.
5 Data availability
The datasets analysed in this study are publicly available. The molecule-oriented, protein-oriented and biomolecular-text tasks are derived from the Mol-Instructions dataset hosted on Hugging Face at https://huggingface.co/datasets/zjunlp/Mol-Instructions. Mol-Instructions is distributed under the CC BY 4.0 license. The materials text-to-structure task is based on the public dataset hosted on Hugging Face at https://huggingface.co/datasets/vbv373/text2struc_dataqa. No internal or proprietary datasets were used in this study. The processed evaluation files, task splits and benchmark metadata used to reproduce the reported results will be released together with the code upon acceptance.
6 Code availability
Code for model conversion, continuous base training, downstream LoRA fine-tuning, evaluation, metric computation and figure generation will be released upon acceptance. The release will include configuration files and scripts sufficient to reproduce the main benchmark results, parameter-performance analysis, mechanistic validation, ablation studies and interpretability analysis reported in this paper.
7 Acknowledgements
This work was supported by the National Natural Science Foundation of China (Grant No. 62441617); the Postdoctoral Fellowship Program and the China Postdoctoral Science Foundation (Grant Nos. 2024M764093 and BX20250485); the Beijing Natural Science Foundation (Grant No. 4254100); and the Beijing Advanced Innovation Center for Future Blockchain and Privacy Computing.
8 Author contributions
Zhaoxin Fan led the project, supervised the research, secured the research resources, and participated in revising the manuscript. Zheng Zhu provided part of the computational resources. Yuqing Ma independently verified the data splits, evaluation metrics, and figure inputs, and contributed to the analysis and correction of the issues identified during verification. Faguo Wu substantively reviewed the continuous-depth parameterization, the RK solver design, and the Methods section, and revised the mathematical formulations and method exposition. Zhiming Zheng participated in discussions on the research positioning, scientific significance, and the boundaries of the conclusions, and substantively revised the corresponding discussions. Jian Yang, under Zhaoxin Fan's supervision, designed and performed the study: he developed the continuous-depth parameterization and the RK-based solver, implemented the code, carried out the experiments and analysis, and wrote the initial draft. Wenjun Wu reviewed the experimental design and baseline settings, participated in the interpretation of the results, and contributed to the revision of the manuscript. All authors read and approved the final manuscript.
9 Competing interests
The authors declare no competing interests.
References
[1] Jumper, J. et al. Highly accurate protein structure prediction with alphafold. nature 596, 583–589 (2021).
[2] Abramson, J. et al. Accurate structure prediction of biomolecular interactions with alphafold 3. Nature 630, 493–500 (2024).
[3] Edwards, C. et al. Translation between molecules and natural language. Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing 375–413 (2022).
[4] Gu, Y. et al. Domain-specific language model pretraining for biomedical natural language processing. ACM Transactions on Computing for Healthcare 3, 1–23 (2021).
[5] Bran, A. M. et al. Augmenting large language models with chemistry tools. Nature Machine Intelligence 6, 525–535 (2024).
[6] Beltagy, I., Lo, K. & Cohan, A. Inui, K., Jiang, J., Ng, V. & Wan, X. (eds) SciBERT: A pretrained language model for scientific text. (eds Inui, K., Jiang, J., Ng, V. & Wan, X.) Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), 3615–3620 (Association for Computational Linguistics, Hong Kong, China, 2019). URL https://aclanthology.org/D19-1371/.
[7] Luo, R. et al. Biogpt: generative pre-trained transformer for biomedical text generation and mining. Briefings in bioinformatics 23, bbac409 (2022).
[8] Taylor, R. et al. Galactica: A large language model for science. arXiv preprint arXiv:2211.09085 (2022).
[9] Lei, G. et al. Materials science in the era of large language models: A perspective. Digital Discovery (2024).
[10] Madani, A. et al. Large language models generate functional protein sequences across diverse families. Nature Biotechnology 41, 1099–1106 (2023).
[11] Zhang, D. et al. Chemllm: A chemical large language model. arXiv preprint arXiv:2402.06852 (2024).
[12] Vaswani, A. et al. Attention is all you need. Advances in neural information processing systems 30 (2017).
[13] He, K., Zhang, X., Ren, S. & Sun, J. Deep residual learning for image recognition. Proceedings of the IEEE conference on computer vision and pattern recognition 770–778 (2016).
[14] Weinan, E., Duan, Y., Kong, L. & Guo, M. A proposal on machine learning via dynamical systems. Links 2024, 08–27 (2017).
[15] Haber, E. & Ruthotto, L. Stable architectures for deep neural networks. Inverse problems 34, 014004 (2018).
[16] Chen, R. T. Q., Rubanova, Y., Bettencourt, J. & Duvenaud, D. Neural ordinary differential equations. Advances in Neural Information Processing Systems 31 (2018).
[17] Ruthotto, L. & Haber, E. Deep neural networks motivated by partial differential equations. Journal of Mathematical Imaging and Vision 62, 352–364 (2020).
[18] Hu, E. J. et al. Lora: Low-rank adaptation of large language models. ICLR 1, 3 (2022).
[19] Butcher, J. C. Numerical methods for ordinary differential equations (John Wiley & Sons, 2016).
[20] Yang, A. et al. Qwen3 technical report. arXiv preprint arXiv:2505.09388 (2025).
[21] Andronov, M. et al. Reagent prediction with a molecular transformer improves reaction data quality. Chemical Science 14, 3235–3246 (2023).
[22] Schwaller, P. et al. Molecular transformer: a model for uncertainty-calibrated chemical reaction prediction. ACS central science 5, 1572–1583 (2019).
[23] Yang, Q. et al. Molecular transformer unifies reaction prediction and retrosynthesis across pharma chemical space. Chemical communications 55, 12152–12155 (2019).
[24] Wu, Z. et al. Moleculenet: a benchmark for molecular machine learning. Chemical science 9, 513–530 (2018).
[25] Ryu, J. Y., Kim, H. U. & Lee, S. Y. Deep learning enables high-quality and high-throughput prediction of enzyme commission numbers. Proceedings of the National Academy of Sciences 116, 13996–14001 (2019).
[26] Yu, T. et al. Enzyme function prediction using contrastive learning. Science 379, 1358–1363 (2023).
[27] Mistry, J. et al. Pfam: The protein families database in 2021. Nucleic acids research 49, D412–D419 (2021).
[28] Blum, M. et al. InterPro: The protein sequence classification resource in 2025. Nucleic Acids Research 53, D444–D456 (2025).
[29] Li, J. et al. BioCreative V CDR task corpus: A resource for chemical disease relation extraction. Database 2016, baw068 (2016).
[30] Wei, C.-H. et al. Overview of the BioCreative V chemical disease relation task. Database 2016, baw032 (2016).
[31] Flam-Shepherd, D. & Aspuru-Guzik, A. Language models can generate molecules, materials, and protein binding sites directly in three dimensions as XYZ, CIF, and PDB files. arXiv preprint arXiv:2305.05708 (2023).
[32] Antunes, L. M., Butler, K. T. & Grau-Crespo, R. Crystal structure generation with autoregressive large language modeling. Nature Communications 15 (2024).
[33] Jain, A. et al. Commentary: The Materials Project: A materials genome approach to accelerating materials innovation. APL Materials (2013).
[34] Kaplan, J. et al. Scaling laws for neural language models. arXiv preprint arXiv:2001.08361 (2020).
[35] Rasley, J., Rajbhandari, S., Ruwase, O. & He, Y. Deepspeed: System optimizations enable training deep learning models with over 100 billion parameters. Proceedings of the 26th ACM SIGKDD international conference on knowledge discovery & data mining 3505–3506 (2020).
[36] Loshchilov, I., Hutter, F. et al. Fixing weight decay regularization in adam. arXiv preprint arXiv:1711.05101 5, 5 (2017).
[37] Merity, S., Xiong, C., Bradbury, J. & Socher, R. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843 (2016).
[38] Fang, Y. et al. Mol-instructions: A large-scale biomolecular instruction dataset for large language models. International Conference on Learning Representations 2024, 48221–48251 (2024).
[39] Landrum, G. et al. Rdkit: A software suite for cheminformatics, computational chemistry, and predictive modeling. Greg Landrum 8, 5281 (2013).
[40] Schneider, N., Sayle, R. A. & Landrum, G. A. Get your atoms in order- an open-source implementation of a novel and robust molecular canonicalization algorithm. Journal of chemical information and modeling 55, 2111–2120 (2015).
[41] Durant, J. L., Leland, B. A., Henry, D. R. & Nourse, J. G. Reoptimization of mdl keys for use in drug discovery. Journal of chemical information and computer sciences 42, 1273–1280 (2002).
[42] Yujian, L. & Bo, L. A normalized levenshtein distance metric. IEEE transactions on pattern analysis and machine intelligence 29, 1091–1095 (2007).
[43] Huang, J. & Ling, C. X. Using auc and accuracy in evaluating learning algorithms. IEEE Transactions on knowledge and Data Engineering 17, 299–310 (2005).
[44] Chicco, D. & Jurman, G. The advantages of the matthews correlation coefficient (mcc) over f1 score and accuracy in binary classification evaluation. BMC genomics 21, 6 (2020).
[45] Zhu, R.-J. et al. Scaling latent reasoning via looped language models. arXiv preprint arXiv:2510.25741 (2025).
Coarse Hidden-State Transitions

Coarse Discrete Transitions
Residual Update (Discrete)
Reference Path
Refined Transition
Coarse Transition
Reference hidden state
Deviation
Hidden State
b
Refined Continuous Hidden-State Transitions

Progressive state evolution
Refined continuous transitions
High-order quadrature
Runge-Kutta (e.g. RK4)
1
Continuous-Dynamic Base Training
2
Transfer to AI4Sci Tasks
C Discrete Dynamic Pretrained Model
d

Open-Domain Knowledge
two step RK2 Modeling
e
Continuous Dynamic Pretrained Model
f
Science Knowledge
7 Projectors
LoRA Training
Pretrained Weights
Fig. 1 Continuous-depth conversion of pretrained language models. a, A standard residual network propagates hidden representations through discrete layer-wise updates. The smooth curve is an illustrative continuous-depth path rather than an assumed ground-truth trajectory; coarse discretization can produce local endpoint discrepancies that accumulate with depth. b, Numerical solvers evaluate the learned update function at intermediate hidden states within the same normalized depth interval. Higher-order quadrature and Runge–Kutta (RK) methods are shown schematically as representative integration strategies. c, Starting from a pretrained discrete language model, we replace each residual update with a local continuous-depth initial-value problem initialized from the corresponding pretrained parameters, followed by continued pretraining to adapt the model to the converted computation. d, Within each Transformer block, the self-attention and feed-forward network (FFN) residual branches are converted separately and integrated sequentially using the default two-step midpoint RK2 solver. Solver stages share the parameters of the corresponding pretrained branch but recompute its normalization and transformation at each stage-specific hidden state. e, The converted model is subsequently adapted to eight AI4Science tasks using low-rank adaptation (LoRA). f, LoRA adapters are inserted into the query, key, value and output projections of self-attention and the up, gate and down projections of the FFN, while the continuous-depth backbone is frozen.

b
C
d
Fig. 2 Performance across eight AI4Science tasks. a, Exact-match accuracy of CONTINUUM-LM and baseline models across eight tasks spanning four scientific task families. b, Parameter-performance trade-off, measured by mean exact-match accuracy across the eight tasks. Circles indicate supervised fine-tuned (SFT) Qwen3 baselines, the square indicates Ouro-1.4B, and stars indicate CONTINUUM-LM models; the dashed line represents the empirical scaling trend fitted to the Qwen3 SFT results. CONTINUUM-LM-0.6B outperforms Qwen3-1.7B@SFT, whereas CONTINUUM-LM-1.7B outperforms Qwen3-4B@SFT and achieves performance comparable to that of Qwen3-8B@SFT. c, Task-specific evaluation across five complementary metrics per task. Each axis is direction-aligned and min-max scaled across the models displayed in the panel. d, Mean exact-match accuracy before and after LoRA fine-tuning for CONTINUUM-LM and parameter-matched Qwen3 models. Post-LoRA scores are averaged over three independent fine-tuning runs from each fixed base checkpoint.

b
C
d
e
Fig. 3 Inference-compute trade-offs and recurrent-control comparisons. a, Numbers of function evaluations for the attention and feed-forward residual branches within a Transformer block. Each branch is evaluated once in the discrete model, twice with one-step RK2, and four times with either one-step RK4 or two-step midpoint RK2. Stacked bars show the combined attention and feed-forward evaluation counts. b, Mean exact-match accuracy across eight AI4Science tasks versus estimated inference FLOPs. Circles denote Qwen3 baselines, stars denote CONTINUUM-LM models, and the dashed line shows the empirical Qwen3 compute-performance trend. c, Task-level exact-match accuracy per TFLOP. Each cell reports exact-match accuracy expressed as a percentage divided by estimated inference cost in TFLOPs per example. The upper heatmap compares CONTINUUM-LM-0.6B with Qwen3-1.7B; the lower heatmap compares CONTINUUM-LM-1.7B with Qwen3-8B. d, Marginal gain in mean exact-match accuracy per additional TFLOP. Continuous-depth conversion is compared with discrete scaling from 0.6B to 1.7B and from 1.7B to 8B, respectively. e, Task-level comparison of CONTINUUM-LM-0.6B and Qwen3-0.6B-Ouro under a common pretrained initialization, base-training corpus and downstream adaptation configuration, with four function evaluations per residual branch. Bars show mean exact-match accuracy over three LoRA fine-tuning runs from each fixed base checkpoint.
Qwen3-0.6B — Attention

Qwen3-1.7B — Attention
Qwen3-0.6B — MLP / FFN
Best loss
Qwen3-1.7B — MLP / FFN
Log10 (Cross-Entropy)
b
Continuum-LM-0.6B Training Dynamic
C
Continuum-LM-1.7B Training Dynamic
d
e
Chem-disease IE
Text2struct
Fig. 4 Ablations of continuous-depth conversion, numerical integration and downstream adaptation. a, Layer-wise parameter-scale sweep for RK2-based conversion of Qwen3-0.6B and Qwen3-1.7B. Attention and feed-forward residual branches are evaluated separately. Colours encode the base-10 logarithm of teacher-forced next-token cross-entropy on 1,000 randomly sampled training examples, and red crosses mark the loss-minimizing coefficient for each layer-branch configuration. Most selected coefficients lie near c = 1, corresponding to the original pretrained parameter scale. b,c, Training-loss trajectories over 20,000 optimization steps for CONTINUUM-LM-0.6B (b) and CONTINUUM-LM-1.7B (c), comparing one-step RK2, one-step RK4 and two-step midpoint RK2 under a common pretrained initialization and training protocol. These solver-ablation runs use a shorter budget than the 100,000-step continued pretraining of the main models. d, Power-law fits of WikiText-103 test loss against estimated cumulative training FLOPs for the 1.7B one-step RK2 and two-step midpoint RK2 ablation runs. The vertical axis shows excess test loss, L - E, where E is the asymptotic loss fitted separately for each configuration. Shading visually distinguishes the fitted trends and does not indicate confidence intervals. e, Task-level exact-match accuracy at LoRA ranks 8, 16 and 32 for CONTINUUM-LM-0.6B (left) and CONTINUUM-LM-1.7B (right). Colours distinguish retrosynthesis, catalytic activity prediction, chemical-disease relation extraction and text-to-structure generation. Increasing rank from 8 to 16 improves three of the four tasks at both model scales, whereas increasing rank further produces task-dependent gains and losses. The rank-16 scores are the corresponding task results used in the main benchmark comparison.

Fig. 5 Token-level logit-margin analysis on AI4Science tasks. Distributions of reference-token logit margins on the AI4Science test sets. Under teacher-forced evaluation, the margin at each answer position is defined as the logit assigned to the reference token minus the largest logit assigned to any alternative vocabulary token. Positive values indicate that the reference token is ranked first, whereas larger values indicate stronger separation from its closest competitor. Dashed vertical lines mark the mean margin of each distribution. Relative to the corresponding Qwen3 baselines, CONTINUUM-LM exhibits higher mean margins across the evaluated tasks, with clearer distributional separation across a broader range of tasks at the 1.7B scale.