Neural networks often involve critical behavioral trade-offs set during design time via hyperparameters—such as reward weights in reinforcement learning or target quantiles in regression. However, once a model is deployed, user preferences or environmental conditions can evolve. Traditionally, adjusting these trade-offs requires retraining the model from scratch, which is computationally expensive.
To solve this, researchers have introduced Hyperparameter Trajectory Inference (HTI). HTI learns how a neural network's output distribution changes with its hyperparameters, allowing developers to build a surrogate model that can accurately predict network outputs for any hyperparameter setting from just a few observed examples.
The Challenge of Interpolation
While simple interpolation between models might seem like an easy fix, neural network output distributions often live on complex, non-Euclidean manifolds. Standard interpolation methods (like linear blending or basic flow matching) typically produce "infeasible" outputs that do not resemble real, trained network outputs. They fail to respect the underlying geometry of the data.
Conditional Lagrangian Optimal Transport
To overcome this, the authors propose a framework based on Conditional Lagrangian Optimal Transport (CLOT). Instead of assuming straight-line paths between hyperparameter settings, they treat the hyperparameter ($\lambda$) as a "time" variable and learn a Lagrangian function that defines the "physics" of the hyperparameter space.
This learned physics model consists of two main components:
- Kinetic Energy ($\mathcal{K}$): Uses a learned neural metric to capture the underlying geometry of the data manifold, ensuring paths follow the "natural" curves of the distribution.
- Potential Energy ($\mathcal{U}$): Estimated via kernel density to bias trajectories toward dense regions of the data space. This enforces the manifold hypothesis, preventing the model from generating unrealistic, out-of-distribution samples.
By jointly optimizing the metric, the potential, and the optimal transport maps using a min-max procedure, the model finds the "path of least resistance" between distributions. To ensure fast inference during deployment, the authors use neural approximators for the transport maps and cubic splines for the geodesic paths.
Key Insights and Results
The method was evaluated across diverse domains, including synthetic benchmarks (Semicircles), reinforcement learning (Cancer Therapy, Reacher), and real-world time-series forecasting (ETTm2).
- Physics-Informed Robustness: By using Lagrangian mechanics, the model is significantly more robust than standard flow matching, especially when data is sparse. The method maintains high performance even when only 2 or 3 "anchor" models are provided.
- Crucial Manifold Bias: Incorporating the potential energy term significantly improves the feasibility of the generated samples by favoring dense regions.
- High-Dimensional Scaling: Unlike previous work limited to 2D, this approach introduces an expressive neural metric representation (using eigendecomposition and Givens rotations) that scales to higher-dimensional output spaces.
- Massive Efficiency Gains: Training a few anchor models plus the HTI surrogate is vastly faster than training a full suite of models to find a Pareto frontier. In a Cancer RL task, it reduced GPU time from 38 hours to just 11 hours, while drastically outperforming standard Conditional Flow Matching and direct regression baselines.
Limitations and Future Directions
Currently, the framework is optimized for varying a single continuous hyperparameter. Extending this to multiple, interacting hyperparameters (e.g., learning rate and weight decay simultaneously) or adapting it for discrete choices (like network depth) remains an open challenge. Additionally, if the relationship between a hyperparameter and the output is chaotic or discontinuous, trajectory-based inference methods will naturally struggle.
Despite these limitations, HTI represents a significant step forward in making deployed neural networks more flexible and adaptable without the prohibitive costs of retraining.
Summary updated