Counterfactual reasoning: an analysis of in-context emergence
- URL: http://arxiv.org/abs/2506.05188v1
- Date: Thu, 05 Jun 2025 16:02:07 GMT
- Title: Counterfactual reasoning: an analysis of in-context emergence
- Authors: Moritz Miller, Bernhard Schölkopf, Siyuan Guo,
- Abstract summary: Large-scale neural language models (LMs) exhibit remarkable performance in in-context learning.<n>This work studies in-context counterfactual reasoning in language models, that is, to predict the consequences of changes under hypothetical scenarios.
- Score: 49.58529868457226
- License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
- Abstract: Large-scale neural language models (LMs) exhibit remarkable performance in in-context learning: the ability to learn and reason the input context on the fly without parameter update. This work studies in-context counterfactual reasoning in language models, that is, to predict the consequences of changes under hypothetical scenarios. We focus on studying a well-defined synthetic setup: a linear regression task that requires noise abduction, where accurate prediction is based on inferring and copying the contextual noise from factual observations. We show that language models are capable of counterfactual reasoning in this controlled setup and provide insights that counterfactual reasoning for a broad class of functions can be reduced to a transformation on in-context observations; we find self-attention, model depth, and data diversity in pre-training drive performance in Transformers. More interestingly, our findings extend beyond regression tasks and show that Transformers can perform noise abduction on sequential data, providing preliminary evidence on the potential for counterfactual story generation. Our code is available under https://github.com/moXmiller/counterfactual-reasoning.git .
Related papers
- Context-Informed Grounding Supervision [102.11698329887226]
Context-INformed Grounding Supervision (CINGS) is a post-training supervision in which the model is trained with relevant context prepended to the response.<n>Our experiments demonstrate that models trained with CINGS exhibit stronger grounding in both textual and visual domains.
arXiv Detail & Related papers (2025-06-18T14:13:56Z) - In-Context Learning (and Unlearning) of Length Biases [19.740652268957522]
We show that models learn length biases in the context window for their predictions.<n>We further empirically analyze the factors that modulate the level of bias exhibited by the model.<n>This reveals the power of in-context learning in debiasing model prediction behaviors without the need for costly parameter updates.
arXiv Detail & Related papers (2025-02-10T16:43:32Z) - Spin glass model of in-context learning [2.285821277711785]
We study a transformer with linear attention and map this structure to a spin glass model with real-valued spins.<n>Our theory reveals that for single-instance learning, increasing the task diversity leads to the emergence of in-context learning.<n>The proposed analytically tractable model thus offers a promising avenue for thinking about how to interpret many intriguing but puzzling properties of large language models.
arXiv Detail & Related papers (2024-08-05T07:54:01Z) - Probabilistic Transformer: A Probabilistic Dependency Model for
Contextual Word Representation [52.270712965271656]
We propose a new model of contextual word representation, not from a neural perspective, but from a purely syntactic and probabilistic perspective.
We find that the graph of our model resembles transformers, with correspondences between dependencies and self-attention.
Experiments show that our model performs competitively to transformers on small to medium sized datasets.
arXiv Detail & Related papers (2023-11-26T06:56:02Z) - In-Context Learning through the Bayesian Prism [16.058624485018207]
In-context learning (ICL) is one of the surprising and useful features of large language models.
In this paper we empirically examine how far this Bayesian perspective can help us understand ICL.
arXiv Detail & Related papers (2023-06-08T02:38:23Z) - Inverse Dynamics Pretraining Learns Good Representations for Multitask
Imitation [66.86987509942607]
We evaluate how such a paradigm should be done in imitation learning.
We consider a setting where the pretraining corpus consists of multitask demonstrations.
We argue that inverse dynamics modeling is well-suited to this setting.
arXiv Detail & Related papers (2023-05-26T14:40:46Z) - Attention-likelihood relationship in transformers [2.8304391396200064]
We analyze how large language models (LLMs) represent out-of-context words, investigating their reliance on the given context to capture their semantics.
Our likelihood-guided text perturbations reveal a correlation between token likelihood and attention values in transformer-based language models.
arXiv Detail & Related papers (2023-03-15T00:23:49Z) - On the Effect of Pre-training for Transformer in Different Modality on
Offline Reinforcement Learning [0.0]
We investigate how pre-training on data of different modalities, such as language and vision, affects fine-tuning of Transformer-based models to Mujoco offline reinforcement learning tasks.
arXiv Detail & Related papers (2022-11-17T13:34:08Z) - Recoding latent sentence representations -- Dynamic gradient-based
activation modification in RNNs [0.0]
In RNNs, encoding information in a suboptimal way can impact the quality of representations based on later elements in the sequence.
I propose an augmentation to standard RNNs in form of a gradient-based correction mechanism.
I conduct different experiments in the context of language modeling, where the impact of using such a mechanism is examined in detail.
arXiv Detail & Related papers (2021-01-03T17:54:17Z) - Back to the Future: Unsupervised Backprop-based Decoding for
Counterfactual and Abductive Commonsense Reasoning [79.48769764508006]
generative language models (LMs) can be trained to condition only on the past context or to perform narrowly scoped text-infilling.
We propose DeLorean, a new unsupervised decoding algorithm that can flexibly incorporate both the past and future contexts.
We demonstrate that our approach is general and applicable to two nonmonotonic reasoning tasks: abductive text generation and counterfactual story revision.
arXiv Detail & Related papers (2020-10-12T17:58:43Z) - Leap-Of-Thought: Teaching Pre-Trained Models to Systematically Reason
Over Implicit Knowledge [96.92252296244233]
Large pre-trained language models (LMs) acquire some reasoning capacity, but this ability is difficult to control.
We show that LMs can be trained to reliably perform systematic reasoning combining both implicit, pre-trained knowledge and explicit natural language statements.
Our work paves a path towards open-domain systems that constantly improve by interacting with users who can instantly correct a model by adding simple natural language statements.
arXiv Detail & Related papers (2020-06-11T17:02:20Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.