Counterfactual Test-Time Augmentation for Shortcut Removal in Language Models

Katie Matton, Rosalind W. Picard, John Guttag, Maggie Makar
10/24/2026
cs.LGcs.AIcs.CL

No confident code implementation found for this paper.

Abstract

Large language models (LLMs) can exploit shortcuts, i.e., correlations present in training data that may not hold at test time. This can lead to poor predictions when correlations shift.

Show full abstract

Most existing solutions for removing shortcuts operate at training time, requiring labeled training data, model weight access, and significant computational resources. Here, we study the problem of test-time shortcut removal. We propose a family of counterfactual test-time augmentation (CTTA) methods: given an example, each method uses an auxiliary model to generate counterfactual edits in which the shortcut value is changed, and then takes a weighted average of the LLM's predictions across these edits. We prove that the optimal shortcut-invariant predictor is a member of this CTTA family, and we characterize its weights. The weights depend on the training distribution, and therefore are, in general, not identifiable from the trained model and unlabeled test data. However, we present assumptions under which the weights can be obtained using the token probabilities of the trained LLM, and propose tests to detect violations of these assumptions. We use these tests to develop Select-CTTA, an aggregate method that selects among CTTA methods. Empirically, we find that Select-CTTA outperforms test-time baselines and approaches the performance of models fine-tuned on shortcut-balanced data.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{matton2026counterfactual,
  title  = {Counterfactual Test-Time Augmentation for Shortcut Removal in Language Models},
  author = {Katie Matton and Rosalind W. Picard and John Guttag and Maggie Makar},
  year   = {2026},
  eprint = {2610.33904},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.33904v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2610.33904.svg)](https://codeofpaper.com/paper/2610.33904)

Discussion