
Halting-time and solver-step heatmaps for the two-dimensional concentric-annuli task.
Adaptive Integration Time (AIT) allows Neural Ordinary Differential Equations (NODEs) to decide dynamically on how long to integrate for each input. It is posed as a continuous-time analog of Adaptive Computation Time (ACT) (Graves, 2016). AIT-NODEs learn a halting unit that accumulates a halting rate over time, and the solver stops when the accumulated value reaches one. This allows the model to adaptively allocate computation based on the complexity of each input.
The idea¶
A Neural ODE evolves a state using a learned vector field:
And then defines its output as the state at a fixed time :
AIT adds a halting unit . Its output is a positive halting rate, which is accumulated in a scalar state :
The solver stops at the first time for which the accumulated value reaches one:
In code, the event function is simply . This lets an ODE solver locate the stopping point during integration. This can be seen as a continuous time analog of Adaptive Computation Time (Graves, 2016) for Neural ODEs and uses differentiable ODE event handling and event handling per-se (Chen et al., 2021; Shampine and Thompson, 2000).
AIT-NODE¶
The repository’s AITNeuralODE augments the state with the accumulator and a mean-field readout:
Because accumulates to one, we can think of our halting unit as a probability density over time. The mean-field readout is the expected state under that density:
The implementation follows this construction directly:
def _vector_field(self, t, state, args):
x, A, xbar = state
hx = jnp.reshape(self.h(t, x, args), ())
dxbar = hx * x if self.readout is Readout.MEANFIELD else jnp.zeros_like(x)
return (self.f(t, x, args), hx, dxbar)The model can also return the endpoint . The repository defaults to the mean-field readout, while the baseline NeuralODE integrates to a fixed .
Neural ODEs make the connection between depth and integration time explicit (Chen et al., 2019). AIT keeps that continuous-depth view but makes the effective depth depend on the whole state trajectory.
Encouraging less computation¶
AIT adds a ponder penalty to the task loss:
where is the task loss and is the mean halting time for a batch. The training code mirrors the equation:
task = self.task_loss_fn(out, y)
ponder = self.lam * T.mean()
return task + ponder, (task, ponder)The task loss still determines whether the output is useful. The coefficient controls how strongly training prefers shorter integration.
Because is monotone, it will eventually reach one, but we can limit the maximum integration time to by defining the halting unit as
A positive bias in also encourages faster halting.
See the code and experiments¶
You can find the code and reproduce the experiments in the AIT-NODE repository.
References¶
Chen, R. T. Q., Rubanova, Y., Bettencourt, J., and Duvenaud, D. (2019). Neural Ordinary Differential Equations. https://
arxiv .org /abs /1806 .07366 Graves, A. (2017). Adaptive Computation Time for Recurrent Neural Networks. https://
arxiv .org /abs /1603 .08983 Chen, R. T. Q., Amos, B., and Nickel, M. (2021). Learning Neural Event Functions for Ordinary Differential Equations. https://
arxiv .org /abs /2011 .03902 Shampine, L. F., and Thompson, S. (2000). “Event location for ordinary differential equations.” Computers & Mathematics with Applications, 39(5), 43-54. https://
www .sciencedirect .com /science /article /pii /S0898122100000456
Cite this work¶
If you found this useful, please cite as:
@misc{grassoramos2026ait,
title = {Adaptive Integration Time for Neural ODEs},
author = {Grasso Ramos, Lucas},
year = {2026},
month = aug,
url = {https://github.com/LucasGrasso/AIT}
}