Table of Contents
Fetching ...

The Entropy Enigma: Success and Failure of Entropy Minimization

Ori Press, Ravid Shwartz-Ziv, Yann LeCun, Matthias Bethge

TL;DR

This work analyzes entropy minimization (EM) as a test-time adaptation technique, revealing a biphasic embedding dynamic: an initial phase where test embeddings cluster near training representations and boost accuracy, followed by a collapse phase where embeddings drift away and accuracy degrades. Building on this, the authors introduce Weighted Flips (WF), an unlabeled-data accuracy estimator that links the count and confidence-weighted flips of predictions during EM to a per-dataset accuracy prediction via a learned function f. WF is validated across 23 ImageNet-scale dataset splits and various TTA methods, achieving a mean absolute error of 5.75% and outperforming prior baselines by a substantial margin. The approach is practical, robust across architectures, and extends the understanding of EM from a clustering perspective to a reliable operational tool for evaluating dataset difficulty without labels.

Abstract

Entropy minimization (EM) is frequently used to increase the accuracy of classification models when they're faced with new data at test time. EM is a self-supervised learning method that optimizes classifiers to assign even higher probabilities to their top predicted classes. In this paper, we analyze why EM works when adapting a model for a few steps and why it eventually fails after adapting for many steps. We show that, at first, EM causes the model to embed test images close to training images, thereby increasing model accuracy. After many steps of optimization, EM makes the model embed test images far away from the embeddings of training images, which results in a degradation of accuracy. Building upon our insights, we present a method for solving a practical problem: estimating a model's accuracy on a given arbitrary dataset without having access to its labels. Our method estimates accuracy by looking at how the embeddings of input images change as the model is optimized to minimize entropy. Experiments on 23 challenging datasets show that our method sets the SoTA with a mean absolute error of $5.75\%$, an improvement of $29.62\%$ over the previous SoTA on this task. Our code is available at https://github.com/oripress/EntropyEnigma

The Entropy Enigma: Success and Failure of Entropy Minimization

TL;DR

This work analyzes entropy minimization (EM) as a test-time adaptation technique, revealing a biphasic embedding dynamic: an initial phase where test embeddings cluster near training representations and boost accuracy, followed by a collapse phase where embeddings drift away and accuracy degrades. Building on this, the authors introduce Weighted Flips (WF), an unlabeled-data accuracy estimator that links the count and confidence-weighted flips of predictions during EM to a per-dataset accuracy prediction via a learned function f. WF is validated across 23 ImageNet-scale dataset splits and various TTA methods, achieving a mean absolute error of 5.75% and outperforming prior baselines by a substantial margin. The approach is practical, robust across architectures, and extends the understanding of EM from a clustering perspective to a reliable operational tool for evaluating dataset difficulty without labels.

Abstract

Entropy minimization (EM) is frequently used to increase the accuracy of classification models when they're faced with new data at test time. EM is a self-supervised learning method that optimizes classifiers to assign even higher probabilities to their top predicted classes. In this paper, we analyze why EM works when adapting a model for a few steps and why it eventually fails after adapting for many steps. We show that, at first, EM causes the model to embed test images close to training images, thereby increasing model accuracy. After many steps of optimization, EM makes the model embed test images far away from the embeddings of training images, which results in a degradation of accuracy. Building upon our insights, we present a method for solving a practical problem: estimating a model's accuracy on a given arbitrary dataset without having access to its labels. Our method estimates accuracy by looking at how the embeddings of input images change as the model is optimized to minimize entropy. Experiments on 23 challenging datasets show that our method sets the SoTA with a mean absolute error of , an improvement of over the previous SoTA on this task. Our code is available at https://github.com/oripress/EntropyEnigma
Paper Structure (23 sections, 7 equations, 13 figures, 6 tables)

This paper contains 23 sections, 7 equations, 13 figures, 6 tables.

Figures (13)

  • Figure 1: Understanding the successes and failures of EM through clustering embedding dynamics. After a few iterations of adaptation (left), EM improves the accuracy of pretrained classifiers by embedding the input test data near mean embeddings of classes from the training data, marked by stars. Eventually, after many iterations (right), EM fails, because it embeds input test data far from where training data is embedded. We show the t-SNE embeddings of 16-class-Imagenet geirhos2018generalisation, throughout adaptation to Gaussian Noise 3 hendrycks2019benchmarking.
  • Figure 2: EM remains effective even when initially correctly classified images are excluded. Accuracy gain per iteration on a holdout set, as Tent adapts to its inputs. Surprisingly, the performance gain on the holdout set is high, even when we exclude top-$k$ samples from the training set. When top-$k=0$, no images are excluded.
  • Figure 3: The two-phase clustring paradigm explains EM behavior. Intuitive visualization of EM's phases. In the first phase (success), input test data becomes more clustered, aligning closely with the mean embeddings of corresponding classes from the training data (the colored stars). In the second phase (failure), these clusters diverge from the mean embeddings.
  • Figure 4: Two-phase behavior during the EM adaption predicts accuracy. Differences in Silhouette score, Shift distance, and accuracy for Tent adaptation. Each point corresponds to a test dataset; each dataset appears twice: once in blue, corresponding to phase 1 (success, $\Delta$ Acc $\geq$ 0), and once in orange, corresponding to phase 2 (failure, $\Delta$ Acc $<$ 0). Left: In both phases, and across almost all datasets, the Silhouette score of embeddings increases, corresponding to a better-clustered embedding space. Right: In the first phase, input data embeddings are kept close to training image embeddings, while in the second phase, they drift away, exhibiting large Shift distance changes. The datasets used are IN-C, IN-$\overline{\hbox{C}}$ and IN-3DCC.
  • Figure 5: Label flips are strongly correlated with Silhouette score. Silhouette score at the initial iteration and the total number of label flips at the final iteration are correlated for datasets in IN-C, IN-$\overline{\hbox{C}}$, and IN-3DCC. Both metrics are correlated with accuracy, but measuring label flips is easier and more practical.
  • ...and 8 more figures