Source-linked AI summary
Predicting the Performance of Foundation Models via Agreement-on-the-Line
Rahul Saxena, Taeyoun Kim, Aman Mehra, Christina Baek, Zico Kolter, Aditi Raghunathan
TL;DR
Estimating foundation-model OOD performance without labels is important but difficult because light finetuning may not create the ensemble diversity required by agreement-on-the-line. The paper studies ensemble-construction choices and shows that careful diversity, especially random head initialization, enables accurate OOD prediction across foundation-model tasks and modalities.
Problem
OOD performance estimation for foundation models is difficult when shifted-distribution labels are scarce, and light finetuning may yield insufficient ensemble diversity for AGL.
Source: §1 · pp. 1, 3Method
The paper evaluates AGL using ensembles formed by random head initialization, data ordering, data subsetting, or different pretrained foundation models across tasks and modalities.
Source: §1 · p. 3, §2.1 · p. 3Results
Random head initialization reliably induces AGL across vision and language benchmarks, while diverse base-model ensembles can also exhibit AGL; estimation surpasses baselines by up to 20% mean absolute percentage error.
Source: §1 · p. 3Takeaways & Limitations
Careful construction of diverse finetuned ensembles enables AGL-based prediction of foundation-model OOD performance across classification and question-answering settings.
Source: §3.3 · p. 7, §7 · p. 10AGL is not guaranteed for every distribution shift, so deployers should use additional metrics rather than relying on AGL alone.
Source: §6 · p. 10
Abstract
from arXiv · showhide
Estimating the out-of-distribution performance in regimes where labels are scarce is critical to safely deploy foundation models. Recently, it was shown that ensembles of neural networks observe the phenomena "agreement-on-the-line", which can be leveraged to reliably predict OOD performance without labels. However, in contrast to classical neural networks that are trained on in-distribution data from scratch for numerous epochs, foundation models undergo minimal finetuning from heavily pretrained weights, which may reduce the ensemble diversity needed to observe agreement-on-the-line. In our work, we demonstrate that when lightly finetuning multiple runs from a single foundation model, the choice of randomness during training (linear head initialization, data ordering, and data subsetting) can lead to drastically different levels of agreement-on-the-line in the resulting ensemble. Surprisingly, only random head initialization is able to reliably induce agreement-on-the-line in finetuned foundation models across vision and language benchmarks. Second, we demonstrate that ensembles of multiple foundation models pretrained on different datasets but finetuned on the same task can also show agreement-on-the-line. In total, by careful construction of a diverse ensemble, we can utilize agreement-on-the-line-based methods to predict the OOD performance of foundation models with high precision.
1 Introduction
Foundation models are useful under distribution shift, but estimating their OOD performance without labels remains difficult. This work studies how to construct finetuned-model ensembles that reliably exhibit agreement-on-the-line for OOD prediction.
Motivation
- Foundation models are increasingly deployed under distribution shift, while their OOD degradation can vary substantially from finetuning-distribution performance.The motivation spans applications including clinical decision-making across hospitals and robot navigation through unseen terrains.Source: §1 · p. 1
- AGL is difficult to guarantee after light finetuning because models remain close to pretrained weights and may produce highly correlated OOD predictions.Matching ID–OOD trends require models to disagree more on OOD data than on ID data, which depends on sufficiently decorrelated errors.Source: §1 · p. 3
Contributions
- Random head initialization consistently induces agreement-on-the-line in finetuned foundation models across vision and language benchmarks.The study covers linear probing and full finetuning, whereas data ordering and data subsetting do not reliably provide sufficient OOD diversity.Source: §1 · p. 3
- Finetuned models from different base foundation models can also support AGL-based performance estimation, with language models showing both AGL and ACL across question-answering and text-classification tasks.Different base models may differ in pretraining datasets, architectures, and training regimens, yet the language-task ensembles retain the relevant linear trends.Source: §1 · p. 3
- AGL-based estimation predicts finetuned foundation-model OOD performance across tasks, modalities, and training procedures, outperforming baselines by up to 20% mean absolute percentage error.The evaluated settings include classification and question answering, vision and language, and linear probing and full finetuning.Source: §1 · p. 3
2 Background and related work
The paper adapts agreement-on-the-line to estimate OOD performance from unlabeled shifted data and model agreements. It formalizes the finetuning setup, contrasts AGL with existing estimation approaches, and specifies the linear relationships underlying the method.
Setup
- The setup covers foundation models mapping inputs to discrete outputs, including GPT2, OPT, Llama2, BERT, and CLIP, evaluated with accuracy, exact match, and macro-F1.OOD estimation assumes labeled ID validation data and unlabeled samples from a related but different OOD distribution.Source: §2.1 · pp. 3–4
- Linear probing freezes the foundation-model backbone and trains a randomly initialized linear or span-prediction head, whereas full finetuning updates the backbone and head with a small learning rate.LoRA is treated as conceptually equivalent to full finetuning for the study’s empirical comparisons.Source: §2.1 · pp. 3–4
Related work
- Existing OOD estimators include confidence calibration, auxiliary-task approaches, and reference ensembles, while AGL uses generic finetuning and requires at least three models.Reference-ensemble methods have higher computational cost, whereas auxiliary-task approaches can overfit particular datasets or modalities.Source: §2.2 · p. 4
Accuracy and agreement on the line
- AGL estimates OOD performance by fitting the ID–OOD agreement relationship on unlabeled data and applying its slope and bias to ID validation performance.Agreement requires model predictions on unlabeled data, avoiding the OOD ground-truth labels needed to fit ID–OOD accuracy directly.Source: §2.3 · pp. 4–5
- AGL links strong linear ID–OOD accuracy and agreement trends, requiring their slopes and intercepts to match when the coupled phenomenon holds.The method uses a collection of models and can estimate each model’s OOD accuracy from ID accuracy, ID agreement, and OOD agreement.Source: §2.3 · p. 5
3 Predicting OOD performance: single base foundation model
For a single base foundation model, random head initialization reliably produces agreement-on-the-line across vision and language tasks, whereas data ordering and subsetting do not. This behavior supports accurate OOD estimation when the ensemble has the required diversity.
Experimental design
- The study varies random heads, data ordering, and independently sampled data subsets while changing training epochs to obtain ensembles spanning different in-distribution performance levels.The diversity sources are perturbed one at a time, and epoch-induced randomness does not change the observations.Source: §3 · p. 5
Evaluation
- The benchmarks cover corruptions, replication, style, geographical, temporal, and interlaboratory shifts, including iWildCam-WILDS and Camelyon17-WILDS as negative ACL conditions.Camelyon17-WILDS shows neither ACL nor AGL in the cited figure.Source: §3.1 · p. 6, Figure 2 · p. 6
Results
- Random head initialization is the only tested diversity source that reliably induces AGL across CLIP vision and language-model ensembles.Data ordering and data subsetting instead produce agreement trends closer to the diagonal y = x line.Source: §3.1 · p. 6, §3.2 · pp. 6–7
Vision results
- Across vision benchmarks, CLIP linear-probe ensembles show ACL and agreement correlations, but matching agreement and accuracy slopes and biases occur only with diverse initialization.The same pattern extends to fully finetuned CLIP models.Source: §3.1 · p. 6, Figure 2 · p. 6
Language results
- Across text classification and extractive question-answering, full-finetuned LLM ensembles show AGL with randomly initialized linear or span heads, but not with data ordering or subsetting.The evaluated metrics are accuracy for text classification and F1 for question-answering.Source: §3.2 · pp. 6–7
Implications
- These findings differ from [2] because lightly finetuned or linearly probed foundation models require a particular diversity source, unlike heavily trained networks where AGL is more robust to that choice.The comparison concerns models trained from scratch for tens to hundreds of epochs versus lightly adapted foundation models.Source: §3.3 · pp. 7–8
4 Predicting OOD performance: multiple foundation models
Finetuned models from different foundation-model bases can form ensembles that exhibit agreement-on-the-line. In language tasks, these models follow shared accuracy and agreement trends despite differing pretraining corpora and architectures.
Model collection
- The evaluated language models span OPT, GPT-2, GPT-Neo, Llama2, Alpaca, and Vicuna, trained or adapted using different pretrained text corpora and finetuning procedures.OPT and GPT models are fully finetuned, while Llama, Alpaca, and Vicuna use LoRA finetuning.Source: §4 · p. 8
Accuracy trends
- Models pretrained on different text corpora produce finetuned language models lying on the same linear accuracy trend, unlike the differing robustness trends reported for vision foundation models.The authors suspect greater homogeneity among the language-model pretraining datasets in this study.Source: §4.1 · p. 8, §4 · p. 8
Results
- Ensembles combining Llama, GPT, and OPT models exhibit AGL for question-answering F1 and text-classification accuracy across the evaluated shifts.The shifts include SQuAD to SQuAD-Shifts and MNLI-Matched to MNLI-Mismatched and SNLI.Source: §4.1 · pp. 8–9
Agreement trends
- Pairwise ID-versus-OOD agreement is strongly correlated, with slope and intercept closely matching accuracy, including pairs drawn from different base models.This occurs without special regularization for ensemble diversity and also holds for generative question-answering tasks.Source: §4.1 · p. 9
5 Estimating OOD Accuracy using AGL in Diverse Ensembles
The paper evaluates AGL-based ALine estimators against confidence and naive-agreement baselines for predicting OOD performance from diverse ensembles. After filtering shifts with weak agreement fits, ALine provides precise estimates and outperforms the alternatives.
Baselines
Metric scope
- For question-answering, AGL predicts accuracy, F1, and exact-match, whereas confidence baselines are compared using exact-match because they lack an easy analogous formulation for F1.Extractive question-answering is treated as a joint prediction of answer-span start and end indices.Source: §5 · p. 9
Results
- Across high-R2 shifts, ALine-S and ALine-D provide precise OOD performance estimates in finetuned foundation models and surpass other baselines by a large margin.The methods remain effective when the agreement line is substantially off y = x.Source: §5 · p. 9
Evaluation condition
- ALine-S and ALine-D are evaluated only on datasets whose agreement fit has R2 > 0.95, excluding specified low-correlation shifts from the main evaluation.The excluded cases include iWildCam-WILDS, Camelyon-WILDS, and selected CIFAR10C, CIFAR100C, and ImageNetC corruptions.Source: §5 · p. 9
6 Limitations
AGL can estimate OOD performance only under specific conditions and should not be treated as a universal signal. The study also leaves important task coverage and theoretical questions unresolved.
- AGL is not guaranteed across all distribution shifts, so deployers should monitor additional performance metrics.Source: §6 · p. 10
- Zero-shot evaluation of different pretrained checkpoints does not reliably support AGL-based performance prediction.Source: §6 · p. 10
- The study covers classification and question-answering but leaves long-form generation for future work.Source: §6 · p. 10
- The paper provides no theoretical guarantees for its empirical findings.Source: §6 · p. 10
7 Conclusion
The paper extends AGL-based OOD performance estimation to foundation models by carefully tuning ensemble diversity. Random linear-head initialization is especially important, and language models show a shared accuracy line across the evaluated models.
- AGL-based OOD prediction extends beyond from-scratch neural networks to foundation models across classification, question-answering, vision, and language tasks.The method applies to both linear probing and full finetuning.Source: §7 · p. 10
- Randomness in specific optimization choices, especially linear-head initialization, is crucial for observing AGL during foundation-model finetuning.The paper emphasizes that ensemble diversity must be tuned carefully because lightly finetuned models may otherwise lack the needed diversity.Source: §7 · p. 10
- Linear models can exhibit AGL in CLIP representation space, indicating that the phenomenon is not limited to neural networks.Source: §7 · p. 10
- All evaluated language models, including OPT, GPT2, GPT2-Neo, Alpaca, Llama, and Vicuna, lie on the same accuracy line.Source: §7 · p. 10
A Appendix
The appendix includes additional experiments on how diversity sources affect extractive question answering.
- Additional experiments examine the effect of diversity sources for extractive question answering.Source: A Appendix · p. 15
A.1.1 AGL-Based Estimation Methods: ALine-S/D
ALine-S and ALine-D estimate OOD performance from agreement relationships, using ID performance and unlabeled agreement data. ALine-S fits a shared transformation, while ALine-D solves a pairwise linear system.
- ALine-S and ALine-D use agreement-based linear relationships to estimate OOD performance without directly fitting ID-to-OOD accuracy from labeled OOD data.The methods transfer a linear relation inferred from agreements to OOD performance estimation.Source: §A.1.1 · p. 16
- AGL states that ID-versus-OOD accuracy and agreement have matching slopes and biases when their corresponding linear correlations hold.Source: §A.1.1 · p. 16
ALine-S
- ALine-S estimates the accuracy slope and bias by fitting the agreement line, then uses them to transform ID performance into OOD estimates.Source: §A.1.1 · p. 16
ALine-D
- ALine-D treats the OOD accuracies as unknowns, constructs equations from model pairs, and solves the approximate system by least squares.Source: §A.1.1 · p. 16
A.1.2 Temperature Scaling for Confidence-Based Estimation Methods
The paper temperature-scales confidence-based baselines on in-distribution validation data before comparing their OOD estimates with ALine.
- The study compares ALine with ATC, AC, and Doc-Feat, noting that these baselines perform better after in-distribution temperature scaling.Source: §A.1.2 · p. 17
- Confidence-based classification baselines optimize a separate temperature for each model using in-distribution validation cross-entropy.Source: §A.1.2 · p. 17
- For extractive question answering, start and end logits receive separate temperatures optimized with validation cross-entropy.Source: §A.1.2 · p. 17
- Exact match treats question answering as classification over start–end index pairs, enabling classification confidence methods with pair confidence σ(s(x))_i · σ(e(x))_j.Source: §A.1.2 · p. 17
A.1.3 Comparison to ProjNorm
The comparison evaluates ALine against ProjNorm and other baselines while examining when diverse foundation-model ensembles exhibit reliable agreement-on-the-line behavior. Across vision and language settings, random head initialization consistently provides the strongest AGL behavior, whereas weak agreement correlations limit reliability.
A.1.3 Comparison to ProjNorm
- ALine-D estimates correlate more strongly with OOD performance than ProjNorm, which supplies only a correlated score rather than an OOD-performance estimate.Source: §A.1.3 · p. 17, Table 4 · p. 17
A.1.4 Failure Datasets with Low Linear Correlation
- Datasets with ID–OOD agreement correlation ≤0.95 are excluded from baseline comparisons because AGL-based estimates are not guaranteed reliable when agreement correlation is weak.Source: §A.1.4 · p. 18
- For excluded datasets, ATC is generally significantly better when AGL-based methods are unreliable.Source: §A.1.4 · p. 18
Diversity-source experiments
- For heavily trained ResNet18 models trained from scratch, AGL can appear irrespective of the diversity source, unlike lightly finetuned foundation-model ensembles.Source: §A.3.4 · p. 27
- Across CLIP, GPT2, OPT, BERT, and multiple distribution shifts, random head initialization yields the strongest AGL behavior and smallest or aligned ALine errors.Source: §A.3.1 · p. 21, §A.3.3 · p. 26, §A.4.1 · p. 30
- The same AGL pattern persists across full finetuning and parameter-efficient methods, while data ordering or subsetting generally does not reproduce it in the reported CLIP and GPT2 experiments.Source: §A.3.1 · p. 21, §A.3.3 · p. 26, §A.8 · p. 47
Related papers
This paper cites
- BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding2018
- Language Models are Few-Shot Learners2020
- Learning Transferable Visual Models From Natural Language Supervision2021
- An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale2020
- GLUE: A Multi-Task Benchmark and Analysis Platform for Natural Language Understanding2018
- Bootstrap your own latent: A new approach to self-supervised Learning2020