Towards an Optimal Control Foundation of Early Exits – Turnpikes and ResNets

Jens Püttschneider, Simon Heilig, Asja Fischer, Timm FaulwasserNeurIPS 2026

TL;DR

Deep neural networks often waste compute on easy inputs—and sometimes even second-guess right answers into wrong ones, a quirk known as "overthinking." By viewing early-exit ResNets through the lens of optimal control theory, this paper proves that jointly training intermediate exits creates a mathematical "turnpike": a fast lane where representations rapidly hit peak performance in a fixed number of layers, regardless of how deep the overall network is. This finally gives us a rigorous foundation for why early-exiting works and why standard confidence thresholds know just when to pull over.

What Problem Does This Paper Address?

Imagine grading a multiple-choice test where you instantly know the answer on step two, yet you force yourself to write ten pages of scratch work—eventually talking yourself out of the right answer. Deep networks do this all the time. Pushing an easy image through 100 layers wastes energy and risks degrading an already-correct prediction ("overthinking").

To fix this, practitioners attach intermediate classifiers ("early exits") along the network's depth, allowing confident predictions to bail out early. Standard practice trains the main network and all these exits jointly by minimizing a weighted sum of their losses. Empirically, it works wonders. Theoretically? It has been a black box. Previous analyses either relied on unrealistic assumptions (like strong convexity) or looked only at isolated, layer-by-layer training. Nobody had formally explained why joint training naturally molds hidden layers into great early classifiers, or why simple exit rules (like checking softmax entropy) reliably prevent overthinking.

Methods

The authors bridge deep learning and optimal control theory—the math of steering dynamic systems (like rockets) over time.

Here is the translation:

  • Standard ResNet as a Dynamic System: Each residual block is a discrete time step ($k$), the hidden representation is the system's "state" ($x_k$), and the trainable weights act as "control inputs" ($w_k$) steering the data toward a target classification.
  • Joint Training as an Optimal Control Problem (OCP): The final layer's loss is the terminal cost, while the weighted intermediate early-exit losses act as a stage cost—penalizing the system at each step along its trajectory.
Equivalence between Optimal Control Problems and Early-Exit Joint Training

In optimal control, minimizing stage costs over a long horizon triggers the turnpike phenomenon. Just as the fastest drive between two cities involves getting onto a high-speed highway (the turnpike) as quickly as possible, cruising for most of the trip, and exiting only at the end, optimal system trajectories cluster around an ideal steady state for the vast majority of steps, independent of total trip length.

Figure 2: Example of optimal trajectories of the OCP (2) for varying horizons N = 5, 10, . . . , 40. The red dashed lines indicate the turnpike (xω

Because cross-entropy loss pushes logits toward infinity rather than a finite steady state, the authors formulate a novel loss turnpike notion, extending it to accuracy and standard confidence metrics (entropy and max-softmax probability). They also design a clever parameter-sharing exit architecture where intermediate states simply fast-forward through the remaining skip connections to the final output head, adding almost zero parameter overhead.

Datasets

The authors evaluate their theoretical predictions on standard image classification benchmarks: CIFAR-10, CIFAR-100, and TinyImageNet. No new datasets are introduced.

Key Insights and Ideas

  • Depth-Independent Convergence: Because of the turnpike property, the number of layers needed to reach a target training loss or accuracy is bounded from above independently of total network depth. Whether your ResNet has 18, 36, or 54 blocks, representations hit the "highway" at roughly the same early layer.
  • Why Confidence Thresholds Work: If loss hits a turnpike, softmax probabilities quickly hug the true one-hot labels. Consequently, uncertainty metrics (entropy and max-probability) also exhibit turnpikes, theoretically guaranteeing that a threshold exists to exit samples early and classify them correctly.
  • The Anatomy of Test-Time Overthinking: On test data, accuracy plateaus nicely, but average test loss hooks upward in deeper layers. Why? While correctly classified test samples cruise near zero loss, misclassified samples also get sucked onto a turnpike—becoming increasingly, stubbornly overconfident in the wrong class!
  • Eliminating the "Leaving Arc": Classical turnpikes swerve away from the highway right at the end (a "leaving arc"). Using skip-connection parameter sharing, the authors prove this swerve is bounded by training suboptimality—meaning well-trained ResNets don't degrade at the final layer.

Key Results

Testing ResNets with $N \in \{18, 36, 54\}$ residual blocks (attaching exits every block or every 6th block):

  • Identical Early Trajectories: Across all network depths on CIFAR-10, training losses plummet along nearly identical curves, hitting near-100% training accuracy within at most 30 residual blocks (~7% generalization gap on test accuracy).
Figure 1: Illustration of a ResNet with early-exits (EE), the joint training formulation induces the turnpike phenomenon from optimal control, which implies that early-exiting ResNets of different depths have similar trajectories of the early-exit losses along the network depth.
  • Depth-Invariant Inference: When sweeping exit confidence thresholds during inference, early-exit accuracy curves are virtually indistinguishable across 18-, 36-, and 54-block backbones.
  • Verifying the Math: Theory predicts the number of "non-turnpike" (high-loss) layers scales inversely with the intermediate loss weight $\gamma$ as $A/\gamma + B$. Empirical curve fitting on a 54-block ResNet confirms this exact $1/\gamma$ relationship ($R^2 \in [0.627, 0.916]$, peaking at $0.916$ for loss threshold $\varepsilon = 0.3$), remaining stable for $\gamma \ge 0.2$ and spiking only as $\gamma \to 0$.

Limitations and Future Work

  • Training vs. Generalization: The mathematical proofs strictly guarantee turnpikes on training data; bridging optimal control with statistical learning theory to prove test-time generalization bounds remains open.
  • Architectural Scope: Formal verification of the exponential loss-decay assumption currently relies on fully connected ReLU ResNets, and gating-based dynamic routing networks don't fit this framework. Future work aims to extend these guarantees to Vision Transformers, Large Language Models, and non-residual architectures like VGG.

Summary updated

Abstract

The feed-forward propagation through neural networks is crucial for training and inference. To trade off efficiency and accuracy, it has been proposed to consider intermediate outputs of hidden states as data-dependent regularization during training and, ultimately, as early-exits during inference. In this work, we analyze the joint optimization of loss functions computed for the output layer and intermediate layers using optimal control theory. We prove that ResNets trained in this joint fashion exhibit the so-called turnpike phenomenon, this implies that the number of layers required to reach a prescribed loss level is bounded from above independently of the overall network depth. This induces a similarity property across the internal representations of early-exiting networks of varying depths. We connect the turnpike to the overthinking phenomenon, and provide theoretical insights of the success of early-exit criteria derived from softmax probabilities, specifically entropy and max-probability. In a range of experiments, we demonstrate the existence and effect of turnpikes and the resulting similarity in the early-exit performance for ResNets of varying depths.
BibTeX
@inproceedings{puttschneider2026towards,
  author = {Jens Püttschneider and Simon Heilig and Asja Fischer and Timm Faulwasser},
  title = {{Towards an Optimal Control Foundation of Early Exits – Turnpikes and ResNets}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=anDvnfg9Dj},
}
Figure