atlas

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

Generalization or Hallucination? Understanding Out-of-Context Reasoning in Transformers

NeurIPS 2025 · Large language models › Language, safety and interpretability · approach: Reasoning mechanisms and failure modes · 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.

Shows that out-of-context reasoning drives both generalization and hallucination in LLM knowledge injection, and proves via implicit bias that a factorized one-layer attention model learns OCR while the combined-weight model cannot.

Problem

Why fine-tuning on new facts makes LLMs both generalize to implications and hallucinate incorrect implications, and what mechanism explains this duality.

Approach

Treats generalization and hallucination as one mechanism, out-of-context reasoning (OCR). Shows theoretically that gradient descent on a factorized output-value parameterization implicitly minimizes the nuclear norm of the combined matrix, enabling OCR, whereas the non-factorized matrix minimizes the Frobenius norm and cannot generalize.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Use separate output and value matrices instead of a combined output-value matrix (ablation)One-layer attention-only transformer · Symbolic OCR test settest loss: fails to generalize -> zero test lossHelped
Train on causally related City-Language facts and implicationsFive LLMs fine-tuned on synthetic factual knowledge · City-Languagemean-rankHelped
Train on fictitious or counterfactual fact-implication associationsFive LLMs fine-tuned on synthetic factual knowledge · Hallucination associationsmean-rankMixed
Replace the factorized parameterization with a combined output-value matrix (ablation)One-layer attention-only transformer · Symbolic OCR test settest loss: zero -> fails to generalizeHurt

Surprising findings

Limitations

Experimental setup

Datasets: synthetic fictitious-name fact/implication dataset (City-Language, Country-Code, Profession-Color, Sport-Music, counterf symbolic factual recall sequences

Benchmarks: synthetic OCR factual recall task

Metrics: mean rank of implication train/test cross-entropy loss margin

Baselines: non-factorized one-layer attention model (W_OV)

Builds on: reversal curse factual recall transformers (Nichani et al.) implicit bias of gradient descent on matrix factorization SVM equivalence for homogeneous networks

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