Post-Hoc Reversal: Are We Selecting Models Prematurely?

Rishabh Ranjan, Saurabh Garg, Mrigank Raman, Carlos Guestrin, Zachary Chase Lipton

Abstract

Trained models are often composed with post-hoc transforms such as temperature scaling (TS), ensembling and stochastic weight averaging (SWA) to improve performance, robustness, uncertainty estimation, etc. However, such transforms are typically applied only after the base models have already been finalized by standard means. In this paper, we challenge this practice with an extensive empirical study. In particular, we demonstrate a phenomenon that we call post-hoc reversal, where performance trends are reversed after applying post-hoc transforms. This phenomenon is especially prominent in high-noise settings. For example, while base models overfit badly early in training, both ensembling and SWA favor base models trained for more epochs. Post-hoc reversal can also prevent the appearance of double descent and mitigate mismatches between test loss and test error seen in base models. Preliminary analyses suggest that these transforms induce reversal by suppressing the influence of mislabeled examples, exploiting differences in their learning dynamics from those of clean examples. Based on our findings, we propose post-hoc selection, a simple technique whereby post-hoc metrics inform model development decisions such as early stopping, checkpointing, and broader hyperparameter choices. Our experiments span real-world vision, language, tabular and graph datasets. On an LLM instruction tuning dataset, post-hoc selection results in >1.5x MMLU improvement compared to naive selection.

Introduction: The Pitfall of Naive Selection

In standard deep learning workflows, researchers typically train a model, monitor its validation performance, and select the "best" checkpoint (e.g., the one with the lowest validation loss). Only after this selection are "post-hoc transforms" like Stochastic Weight Averaging (SWA), Ensembling, or Temperature Scaling (TS) applied to further boost performance.

This "naive selection" process relies on a hidden assumption: that a better base model necessarily leads to a better transformed model. This paper identifies a fundamental flaw in this assumption: post-hoc reversal. In many scenarios, particularly those with noisy data, models that appear to be overfitting at the base level actually provide a superior foundation for post-hoc transforms. Consequently, standard practices often lead to "premature" early stopping, discarding the checkpoints that would have yielded the best final results.

Methodology: Post-Hoc Selection

To address this, the authors propose post-hoc selection. Instead of choosing a model based on its raw validation score, researchers should evaluate the model after the intended post-hoc transform has been applied.

Post-hoc reversal phenomenon: while the base model (blue) overfits early (t1), the post-hoc transformed model (orange) continues to improve, peaking much later (t2).

The study focuses on three primary transforms:

  • Temperature Scaling (TS): Calibrating prediction confidence.
  • Ensembling: Combining multiple independent training runs.
  • Stochastic Weight Averaging (SWA): Averaging weights along a training trajectory.

By monitoring the performance of these transformed models during validation, practitioners can make better decisions regarding early stopping, checkpointing, and hyperparameter tuning.

Key Insights: Learning Dynamics and Noise

The core mechanism behind post-hoc reversal lies in the differing learning dynamics of clean versus noisy data. Models typically learn generalizable patterns from clean data early in training and only later begin to memorize "spurious" noise. While this memorization degrades the base model's performance (leading to the classic U-shaped loss curve), post-hoc transforms like SWA and ensembling are remarkably effective at filtering out this noise while retaining the underlying general patterns.

This phenomenon also provides a new perspective on "double descent" and "loss-error mismatch." Transforms can flatten the performance peaks associated with double descent and correct for overconfidence, ensuring that training isn't halted prematurely due to misleading validation metrics.

Experimental Results

The authors validated post-hoc selection across a wide range of domains, including vision (CIFAR-N, FMoW), language (Guanaco, Yelp), tabular (Folktables), and graph data (Reddit, Collab).

Post-hoc selection (green) consistently achieves greater reductions in test loss compared to naive selection (red), with the gap widening as label noise increases.

Significant findings include:

  • LLM Tuning: On the Guanaco dataset for LLaMA-2-7B, post-hoc selection achieved a >1.5× improvement in MMLU score over naive selection.
  • Noisy Vision Data: In high-noise settings (CIFAR-10-N "Worst"), post-hoc selection was often twice as effective at reducing test error.
  • Robustness: On satellite imagery (FMoW), post-hoc selection led to a >5-point reduction in out-of-distribution (OOD) test error.

Conclusion and Future Work

Post-hoc reversal is a widespread phenomenon, especially prominent in high-noise regimes. While naive selection is computationally cheaper, it often leaves significant performance on the table. Post-hoc selection offers a simple yet powerful alternative for maximizing the utility of modern deep learning models. Future work remains to develop a more rigorous theoretical framework for these reversals and to explore their implications for scaling laws.

Summary updated

Abstract

Trained models are often composed with post-hoc transforms such as temperature scaling (TS), ensembling and stochastic weight averaging (SWA) to improve performance, robustness, uncertainty estimation, etc. However, such transforms are typically applied only after the base models have already been finalized by standard means. In this paper, we challenge this practice with an extensive empirical study. In particular, we demonstrate a phenomenon that we call post-hoc reversal, where performance trends are reversed after applying post-hoc transforms. This phenomenon is especially prominent in high-noise settings. For example, while base models overfit badly early in training, both ensembling and SWA favor base models trained for more epochs. Post-hoc reversal can also prevent the appearance of double descent and mitigate mismatches between test loss and test error seen in base models. Preliminary analyses suggest that these transforms induce reversal by suppressing the influence of mislabeled examples, exploiting differences in their learning dynamics from those of clean examples. Based on our findings, we propose post-hoc selection, a simple technique whereby post-hoc metrics inform model development decisions such as early stopping, checkpointing, and broader hyperparameter choices. Our experiments span real-world vision, language, tabular and graph datasets. On an LLM instruction tuning dataset, post-hoc selection results in >1.5x MMLU improvement compared to naive selection.
BibTeX
@inproceedings{ranjan2024post,
  author = {Rishabh Ranjan and Saurabh Garg and Mrigank Raman and Carlos Guestrin and Zachary Chase Lipton},
  title = {{Post-Hoc Reversal: Are We Selecting Models Prematurely?}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=3R7Go6WkDm},
}
Figure