Tailoring: encoding inductive biases by optimizing unsupervised objectives at prediction time

Ferran Alet, Maria Bauzá, Kenji Kawaguchi, Nurullah Giray Kuru, Tomás Lozano-Pérez, Leslie Pack Kaelbling

Introduction

Machine learning models often rely on auxiliary losses to learn useful inductive biases, such as physical conservation laws or feature smoothness. However, these auxiliary losses are typically only minimized during training. This creates two major problems:

  1. The Generalization Gap: Because the auxiliary loss is only enforced on the training data, there is no guarantee the model will satisfy the inductive bias for unseen test queries.
  2. Proxy Objectives: By adding an auxiliary term to the training loss, the model is forced to optimize a blended proxy objective rather than strictly the supervised task loss we actually care about.

This paper introduces "tailoring," a method to enforce inductive biases by fine-tuning a model on an unsupervised auxiliary loss at prediction time for each specific query. To maximize this benefit, the authors propose "meta-tailoring," a meta-learning approach that trains the model to perform optimally on its main task after this query-specific adaptation.

Methods: Tailoring and Meta-Tailoring

To solve the issues of generalization gaps and proxy objectives, the authors propose moving the optimization of the unsupervised auxiliary loss into the prediction phase.

Comparison of learning paradigms
  • Tailoring: Inspired by transductive learning, the model adapts to each new, unlabeled query at prediction time. Before making a prediction, the model takes a few gradient steps to minimize an unsupervised auxiliary loss (e.g., energy conservation) specifically for that input.
  • Meta-tailoring: To teach the model how to best utilize this test-time adaptation, the authors use a nested optimization strategy similar to MAML (Model-Agnostic Meta-Learning). In the inner loop, the model adapts to a query using the unsupervised tailoring loss. In the outer loop, the base model weights are updated to minimize the supervised task loss using the adapted weights.
  • CNGRAD: Adapting an entire network per query is computationally heavy and difficult to batch on GPUs. To make this practical, the authors introduce CNGRAD. It adds Conditional Normalization (CN) layers—simple element-wise affine transformations (scaling and shifting)—and only updates these specific parameters during the inner tailoring loop. This allows efficient, parallelized adaptation across a batch of inputs.

Key Insights

  • Enforce locally, not just globally: Instead of hoping a network perfectly memorizes a rule (like physics laws) across the whole domain, you can simply force it to obey the rule for the specific input it is currently processing.
  • Soft constraints beat hard constraints: In real-world physics (like a real pendulum with friction), strictly enforcing energy conservation degrades performance because energy isn't perfectly conserved. Tailoring allows for soft enforcement by only taking a few gradient steps, adapting to imperfect real-world dynamics better than strict architectural constraints.
  • Efficient expressivity: The authors prove theoretically that adapting just the affine parameters (CN layers)—which make up only about 1% of the network's total parameters—has enough mathematical capacity to minimize a large class of tailoring losses.

Key Results

The authors evaluated their approach across several domains, including a custom 5-body planetary system, a real pendulum dataset, CIFAR-10, and ImageNet.

  • Physics Simulation: On the chaotic 5-body planetary problem, meta-tailoring improved Test MSE by 35% over standard inductive learning.
  • Adversarial Robustness: When used to enforce local smoothness for Randomized Smoothing on ImageNet, meta-tailoring improved the Average Certification Radius (ACR) by 5.1%, 13.8%, and 19.6% across different noise levels ($\sigma=0.25, 0.5, 1.0$).
  • Contrastive Learning: Applying meta-tailoring to a SimCLR model on CIFAR-10 yielded a 0.5% to 0.8% accuracy boost.
Accuracy gains in SimCLR with Meta-tailoring

As shown in the chart above, the performance gain from meta-tailoring in contrastive learning is roughly equivalent to the boost you would get from doubling the amount of labeled training data.

Limitations and Future Work

Tailoring requires the user to explicitly define the unsupervised loss formula, which can be difficult for abstract concepts in raw pixel space (e.g., defining mass conservation directly from images). It also incurs an extra computational cost at prediction time due to the inner optimization loop. Finally, because the model specializes to each query, it extracts more information from the input, which the authors note could potentially raise privacy concerns.

While the authors proved that the CN layers have the capacity to minimize the tailoring loss, they suggest further theoretical exploration to guarantee that gradient descent will reliably find those optimal parameters in practice.

Summary updated

BibTeX
@inproceedings{alet2021tailoring,
  author = {Ferran Alet and Maria Bauzá and Kenji Kawaguchi and Nurullah Giray Kuru and Tomás Lozano-Pérez and Leslie Pack Kaelbling},
  title = {{Tailoring: encoding inductive biases by optimizing unsupervised objectives at prediction time}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=wUX4TGFgH6},
}
Figure