atlas

Research map / Large language models / Language, safety and interpretability

Counterfactual reasoning: an analysis of in-context emergence

NeurIPS 2025 · Large language models › Language, safety and interpretability · approach: Mechanistic analysis of attention and representations · 0 citations (OpenAlex)

Read the paperCheck your idea against 108,967 papers

AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.

Studies in-context counterfactual reasoning in GPT-2-style Transformers and RNNs on a synthetic linear regression SCM requiring noise abduction, with mechanistic analysis (noise abduction heads, linear probes) and a preliminary extension to Lotka-Volterra SDE trajectories.

Problem

Whether language models can perform in-context counterfactual reasoning (noise abduction, intervention, prediction) rather than only observational or interventional prediction, and what architectural and data factors drive it.

Approach

Frames in-context counterfactual reasoning as a transformation on factual in-context observations, extends counterfactual identifiability to exchangeable (latent-theta mixture) data, and trains Transformers from scratch on synthetic sequences to test emergence, depth, attention, data diversity, and mechanistic signatures.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
remove MLP sublayers (use attention-only) (ablation)GPT-2 Transformer · Tanh counterfactual regressionMSE: 0.0132 vs 0.0058Hurt
remove MLP sublayers (use attention-only) (ablation)GPT-2 Transformer · Sigmoid counterfactual regressionMSE: 0.0019 vs 0.0009Hurt
remove MLP sublayers (use attention-only) (ablation)GPT-2 Transformer · Multiplicative-noise counterfactual regressionMSE: 0.0668 vs 0.0364Hurt
replace self-attention with MLP-only layers (ablation)Transformer · Linear counterfactual regressionMSEHurt
increase Transformer depth while keeping 8 attention heads (ablation)Full and attention-only Transformers · Linear counterfactual regressionMSEHelped
increase pre-training data diversity (ablation)Transformer · Linear counterfactual regression, in-distribution and OODMSEHelped
use GPT-2 instead of Elman RNNAutoregressive models · Linear counterfactual regression, contexts over 14 examplesMSEHelped
use GPT-2 instead of LSTM or GRUAutoregressive models · Linear counterfactual regressionMSENo clear effect
use Full GPT-2 instead of recurrent modelsAutoregressive models · Lotka-Volterra SDE, 20 time pointsMSE: ≈ 0.0025 vs over 0.1Helped

Surprising findings

Limitations

Experimental setup

Datasets: synthetic linear regression SCM sequences (theta uniform in [-6,6]^5) Lotka-Volterra SDE trajectories

Benchmarks: synthetic in-context counterfactual regression (held-out sequences) Lotka-Volterra SDE counterfactual continuation

Metrics: mean squared error adjusted R^2 (linear probes) learning efficiency (number of in-context examples)

Baselines: LSTM GRU Elman RNN MLP-Only attention-only (AO) Transformer ordinary least squares estimator

Builds on: induction heads de Finetti theorem Bijective generation mechanisms identifiability (Nasr-Esfahany and Kiciman style GPT-2 AdamW

Closest papers by meaning

Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy