Treating Hyperparameters as Interventions: Task-Invariant Representation Learning for Transferable HPO

Mengyang Li, Ou WuNeurIPS 2026

TL;DR

Hyperparameter tuning is usually treated like fumbling in the dark with a black-box optimizer, making knowledge hard to transfer from one task to the next. This paper flips the script: by treating hyperparameters as controlled interventions, the authors train a model to look at the first hundred steps of training and extract a pure, configuration-invariant "fingerprint" of the underlying task. Once you have that task fingerprint, finding the best hyperparameters becomes a fast, virtually free lookup against a learned surrogate—slashing search times on everything from classical benchmarks to Llama-3-8B fine-tuning.

What Problem Does This Paper Address?

When you train a neural network, the training curves you observe—losses dropping, gradients bouncing—are a messy entanglement of two things: the intrinsic nature of the task itself (like loss landscape curvature or gradient noise) and the specific hyperparameter knobs ($\lambda$, like learning rate or weight decay) you happened to turn.

Standard hyperparameter optimization (HPO) methods usually fuse these together. Because they treat $\lambda$ as an unknown variable to probe rather than a deliberate intervention, transferring tuning recipes across tasks is notoriously brittle. Existing low-fidelity and meta-HPO methods look at early learning curves to speed things up, but because those curves still mix task properties with hyperparameter effects, cross-task generalization suffers. How do you cleanly separate what the task is from what the hyperparameters did to it, without relying on untestable causal assumptions?

Methods

The authors introduce CA-HPO (Configuration-invariAnt HPO), which reframes task representation as a constrained optimization problem rather than trying to recover true latent variables via strict causal identifiability.

Figure 2: CA-HPO architecture. The encoder maps a short training trajectory X(T ) to a representation ˆu that is regularized to be invariant across hyperparameter configurations for the same task (Linv). The predictor estimates performance for any candidate λ given ˆu; the generator is an auxiliary information-sufficiency regularizer used only during meta-training.

Here is how the machinery works:

  • Input Dynamics: Instead of just watching loss, the model records 5 optimization statistics over a tiny prefix of $T=100$ steps: training loss, gradient norm, gradient variance, parameter norm, and effective step size.
  • Configuration-Invariant Encoder: An iTransformer reads these 5 time series (attending across the 5 statistics rather than time steps) to output a task vector $\hat{u}$. Crucially, during offline meta-training, a penalty ($\mathcal{L}_{\text{inv}}$) forces the encoder to output the exact same vector for two runs on the same task, even if they used wildly different hyperparameters.
  • Counterfactual Predictor & Auxiliary Generator: A simple MLP takes the invariant task vector $\hat{u}$ and any candidate $\lambda$ to predict final validation performance. During meta-training, an auxiliary generator reconstructs the training trajectory from $(\hat{u}, \lambda)$ so the encoder doesn't accidentally throw away vital task signal just to satisfy invariance.
  • Micro-Sensing Inference: On a brand-new task, the encoder is frozen. CA-HPO runs $k_0 = 9$ ultra-short probes ($100$ steps each—less than 10% of one full run) to average out a stable task fingerprint $\hat{u}_t$. It then uses gradient ascent on the MLP predictor to find the best $\lambda$, guarded by a local trust-region check that falls back to standard Bayesian optimization if a proposed configuration strays too far from observed territory.

Datasets

No new benchmarks are introduced; the authors evaluate on two established tracks:

  • Foundation Model Track (Llama-3-8B LoRA fine-tuning): Meta-trained offline on instruction corpora (Alpaca, Dolly-15k, OpenAssistant) and evaluated online on 4 reasoning benchmarks: GSM8K, PubMedQA, ARC-Challenge, and a 2,000-sample MMLU subset.
  • Classical Benchmarks (12 tasks): Vision with ResNet-18 (MNIST, F-MNIST, CIFAR-10, CIFAR-100, SVHN), NLP with BERT-base (AG News, SST-2, IMDB, TREC), and tabular regression with MLPs (Boston Housing, California Housing, Diabetes). They also include a synthetic quadratic task with known ground-truth invariants and a CIFAR-10-to-ImageNet stress test.

Key Insights and Ideas

  • Probing alone isn't the magic—invariance is: You might suspect CA-HPO wins simply because peeking at early gradient norms is informative. Not so. Feeding the exact same early-dynamics probes to state-of-the-art Bayesian optimization (HEBO) yields a $3.5\times$ speedup, and CA-HPO without the invariance penalty drops to $2.6\times$. Enforcing within-task invariance jumps the speedup to $5.7\times$.
  • Rock-solid representations across extreme knobs: Because of the invariance penalty, the learned task vector barely budges even as you sweep the learning rate across four orders of magnitude ($10^{-5}$ to $10^{-1}$).
Figure 4: (a) Representations stay close to the per-task centroid across four orders of magnitude of learning rate; ablating Linv causes substantial drift. (b) Cross-domain transfer from 5 vision tasks to 4 NLP tasks at 2.9× average speedup. (c) Component ablation in terms of additional trials over the full model.
  • The axis of invariance matters: Domain generalization usually forces representations to look the same across tasks. When tested here, cross-task invariance wipes out the exact task-specific signal HPO needs, tanking speedup to $1.7\times$. Keeping representations distinct across tasks—but invariant across $\lambda$ within a task—is the sweet spot.
  • Optimization over identifiability: By defining the target representation simply as the best predictor among task-determined functions in their network class, the authors prove finite-sample and counterfactual error bounds using standard Rademacher complexity—dodging heavy causal representation learning assumptions.

Key Results

  • Llama-3-8B Fine-Tuning: CA-HPO achieves the highest final accuracy at the lowest search cost across all four tasks. On GSM8K, it hits 77.5% accuracy in 3.9 hours (needing only ~6 minutes of micro-sensing plus 5 full evaluations), whereas Random Search reaches 74.2% after 48 hours and HEBO takes ~36 GPU-hours.
Figure 3: Efficiency-performance trade-off on Llama-3-8B LoRA fine-tuning. Each marker is a method’s final accuracy against its search cost; the horizontal axis is search time in hours. On all four tasks CA-HPO (red star) attains the highest mean accuracy at the lowest cost. Error bars show ±1 std over 5 seeds.
  • Classical Benchmarks: Achieves a 5.7$\times$ geometric-mean online speedup over Random Search (winning or tying on 11 of 12 tasks), outperforming HEBO ($2.0\times$), multi-fidelity methods like BOHB/ASHA/LAMDA ($1.5\text{--}2.1\times$), and Quick-Tune ($4.3\times$).
  • Cross-Domain Transfer: Meta-trained purely on 5 vision tasks and evaluated zero-shot on 4 NLP tasks, CA-HPO still delivers a 2.9$\times$ speedup, beating in-domain HEBO ($2.2\times$).
  • True Independence: Statistical permutation tests (HSIC) confirm that the learned encodings do not reject independence from $\lambda$ on 11 of the 12 classical tasks—and on a synthetic setup, a linear probe recovers the true underlying Hessian/noise invariant with $R^2 = 0.93$.

Limitations and Future Work

  • Upfront Meta-Training Cost: Building the offline trajectory corpus and training the modules takes ~488 GPU-hours. On tasks comparable to GSM8K, you have to tune roughly 16 tasks before that upfront investment breaks even against HEBO—making CA-HPO a poor fit for one-off cold starts or tiny search spaces.
  • Early-Step Blindness & Extreme Shift: The method assumes task characteristics reveal themselves in the first $T=100$ steps, which breaks down on tasks with very long learning-rate warmups or shifting curricula. Under extreme simultaneous shifts in task, resolution, and capacity (CIFAR-10 to ImageNet), speedup degrades to $1.3\times$.
  • Future Directions: The authors plan to extend CA-HPO to multi-objective HPO and broaden the intervention space beyond training hyperparameters to include neural architectures and optimizer families.

Summary updated

Abstract

We study transfer hyperparameter optimization (HPO) by treating configurations as controlled interventions and learning task representations from short training trajectories. We propose CA-HPO (Configuration-invariAnt HPO), a transfer HPO framework that learns a task representation that is constrained to be invariant across hyperparameter configurations of the same task and is trained to predict performance. We define the target as the solution of a constrained optimization problem over the encoder and predictor classes rather than as an identified latent variable, so the framework avoids the identifiability assumptions of causal representation learning. We prove three guarantees: the invariance violation of the penalized population minimizer is at most the price of invariance divided by the penalty weight, with recovery of the target in the limit; a task-level finite-sample excess-risk bound; and a counterfactual error bound in which the probe-averaging error scales with the within-task spread that the penalty controls. Once a one-off meta-training corpus is available, CA-HPO attains the highest final accuracy at the lowest search cost on four Llama-3-8B fine-tuning tasks, and on twelve classical benchmarks it achieves a 5.7 times geometric-mean online speedup over random search, against 2.0 times for HEBO and at most 2.1 times for multi-fidelity methods. Under matched probing signal and model capacity, removing the invariance constraint alone reduces this speedup to 2.6 times. The learned representations remain stable across four orders of magnitude of learning rate and recover a known task invariant in a controlled synthetic study, and task-wise HSIC permutation tests do not reject their independence from $\lambda$ on 11 of the 12 classical benchmarks.
BibTeX
@inproceedings{li2026treating,
  author = {Mengyang Li and Ou Wu},
  title = {{Treating Hyperparameters as Interventions: Task-Invariant Representation Learning for Transferable HPO}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=4qFz5DLdjS},
}
Figure