Energy-based Preference Optimization for Test-time Adaptation

Yewon Han, Seoyun Yang, Taesup Kim · DOI

Introduction

Deep learning models often struggle when deployed in real-world environments where data distributions differ from training sets. Test-time Adaptation (TTA) addresses this by updating model parameters on-the-fly using unlabeled test data. However, popular methods like Entropy Minimization (e.g., TENT) frequently lead to overconfident predictions, resulting in high calibration error—a critical issue for safety-sensitive applications. While Energy-Based Models (EBMs) offer a theoretically sound alternative for modeling data distributions, they are traditionally computationally expensive due to iterative sampling requirements.

The EPOTTA Framework

The researchers propose EPOTTA, a novel framework that reformulates TTA as a Direct Preference Optimization (DPO) problem. By reinterpreting the relationship between source and target data through the lens of residual energy, the authors eliminate the need for costly Markov Chain Monte Carlo (MCMC) sampling.

Overview of the EPOTTA framework: adapting a pretrained source model using Direct Preference Optimization (DPO) on online target samples vs. source buffer samples.

The core innovation lies in defining a preference for "target" samples (the shifted data) over "source" samples (a small buffer of original training data). This mathematical alignment allows the model to optimize directly using preference pairs, making the process significantly faster and more stable than previous energy-based approaches.

Key Insights

EPOTTA bridges the gap between physics-inspired energy models and modern alignment techniques used in Large Language Models. Key advantages include:

  • Sampling-Free Optimization: The DPO objective cancels out intractable normalization constants, turning a complex optimization into a straightforward supervised task.
  • Uncertainty-Awareness: The gradient naturally down-weights high-energy (highly uncertain) samples, preventing the model from learning from noise or extreme outliers.
  • Calibration Preservation: Unlike entropy-based methods that collapse probabilities toward extremes, EPOTTA maintains a well-calibrated distribution, ensuring the model "knows what it doesn't know."

Experimental Results

The framework was evaluated on standard robustness benchmarks, including CIFAR10-C, CIFAR100-C, and TinyImageNet-C, across 15 different corruption types.

Comparison of EPOTTA (Ours) against baseline methods across computational efficiency (GFLOPs), calibration (ECE), and accuracy (Acc).

As shown in the radar chart above, EPOTTA achieves a superior balance across all critical dimensions:

  • Accuracy: It matches or exceeds state-of-the-art accuracy, particularly under severe distribution shifts.
  • Calibration: On TinyImageNet-C, EPOTTA achieved an Expected Calibration Error (ECE) of 11.85%, outperforming both TENT and the previous energy-based leader, TEA.
  • Efficiency: EPOTTA is approximately 7x faster than TEA, significantly reducing the computational overhead (34K GFLOPs vs. 213K GFLOPs).

Conclusion

EPOTTA represents a significant step forward in making test-time adaptation both reliable and efficient. By leveraging preference optimization, it avoids the pitfalls of overconfidence while maintaining the speed necessary for real-time deployment. Future work may extend this framework to more complex vision tasks like object detection and segmentation.

Summary updated

BibTeX
@misc{han2025energy,
  author = {Yewon Han and Seoyun Yang and Taesup Kim},
  title = {{Energy-based Preference Optimization for Test-time Adaptation}},
  year = {2025},
  eprint = {2505.19607},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2505.19607},
}
Figure