LCA-on-the-Line: Benchmarking Out of Distribution Generalization with Class Taxonomies

Jia Shi, Gautam Rajendrakumar Gare, Jinjin Tian, Siqi Chai, Zhiqiu Lin, Arun Balajee Vasudevan, Di Feng, Francesco Ferroni, Shu Kong

Predicting how well a machine learning model will perform on unseen, real-world data—known as Out-of-Distribution (OOD) generalization—is a fundamental challenge. Traditionally, researchers have relied on In-Distribution (ID) accuracy as a proxy for real-world robustness. This reliance stems from the "Accuracy-on-the-Line" phenomenon, which observes that for a specific model family, OOD accuracy correlates linearly with ID accuracy.

However, this relationship breaks down when comparing fundamentally different architectures, specifically standard Vision Models (VMs) like ResNet and Vision-Language Models (VLMs) like CLIP. VLMs, trained on massive internet datasets, often exhibit lower accuracy on standard ID benchmarks like ImageNet compared to specialized VMs. Yet, they consistently perform significantly better on shifted OOD datasets, such as sketches or adversarial images. This "effective robustness" gap makes it difficult to predict which models will truly hold up in the wild without having the OOD data on hand to test them.

The LCA-on-the-Line Framework

To address this predictive gap, researchers introduce the Lowest Common Ancestor (LCA)-on-the-Line framework. Instead of relying on a binary "right or wrong" Top-1 accuracy metric, this approach utilizes LCA distance to measure the severity of a model's mistake based on a predefined class hierarchy, such as WordNet.

The intuition is simple: not all mistakes are created equal. If a model misclassifies an "Ostrich" as a "Flamingo," it has likely captured useful, transferable semantic features (like a long neck and long legs). Conversely, misclassifying an "Ostrich" as a "Jaguar" simply because both appeared on a grassy background suggests the model is relying on spurious correlations. LCA distance quantifies this by measuring the hierarchical distance between the true label and the predicted label.

By plotting ID LCA distance against OOD Top-1 accuracy, the authors discovered a unified linear trend that seamlessly encompasses both VMs and VLMs.

Comparison of ID Accuracy vs. LCA Distance as predictors for OOD Accuracy

As shown above, while standard ID accuracy yields two divergent trend lines for VMs and VLMs, the ID LCA distance collapses them into a single, predictable correlation. This unified metric reveals that VLMs generalize better not because they are more accurate on standard benchmarks, but because their errors are semantically closer to the truth.

Experimental Setup and Key Results

The study evaluated a comprehensive suite of 75 models (36 VMs and 39 VLMs). ImageNet served as the ID dataset, while OOD performance was tested across five severe natural distribution shifts: ImageNet-v2, ImageNet-Sketch, ImageNet-R (Rendition), ImageNet-A (Adversarial), and ObjectNet.

Key findings from the experiments include:

  • Strong Unified Correlation: ID LCA distance demonstrated a robust linear correlation ($R^2 > 0.7$ and Pearson correlation $> 0.8$) with OOD performance across almost all shifted datasets, successfully unifying VMs and VLMs.
  • Superior Error Prediction: When tested against other OOD predictors like "Agreement-on-the-line" or "Average Confidence," ID LCA distance achieved the lowest Mean Absolute Error (MAE) in predicting OOD success.
  • Robustness to Taxonomy: A perfect, human-curated taxonomy is not strictly necessary. The authors developed a method to construct "latent hierarchies" by clustering image features using $K$-means. They proved that as long as the generated hierarchy captures some level of feature proximity, the LCA correlation holds.
  • Performance Boosting: The framework isn't just for evaluation; it can improve models. Aligning VLMs with taxonomies via prompt engineering—such as including the full hierarchical path in the text prompt (e.g., "A, which is a type of B, which is a type of C")—significantly improved zero-shot accuracy and reduced test-time cross-entropy across OOD benchmarks.

Limitations and Future Directions

While highly effective for severe distribution shifts, the LCA distance metric has limitations. It is less effective for datasets that are visually very similar to the ID data (such as ImageNet-v2), where standard Top-1 accuracy remains a more reliable predictor. Furthermore, the metric's discriminative power weakens on datasets with a very small number of classes (like CIFAR), as the resulting hierarchy is too shallow to provide meaningful distance measurements.

Future research will focus on providing a more rigorous theoretical justification for the "LCA-on-the-Line" phenomenon. Additionally, exploring "causal discovery" to build more accurate class graphs that reflect the underlying variables of the data generation process could further refine this promising approach to benchmarking model generalization.

Summary updated

BibTeX
@inproceedings{shi2024lca,
  author = {Jia Shi and Gautam Rajendrakumar Gare and Jinjin Tian and Siqi Chai and Zhiqiu Lin and Arun Balajee Vasudevan and Di Feng and Francesco Ferroni and Shu Kong},
  title = {{LCA-on-the-Line: Benchmarking Out of Distribution Generalization with Class Taxonomies}},
  booktitle = {International Conference on Machine Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=HPXRzM9BYZ},
}
Figure