THE ILLUSION OF LATENT GENERALIZATION: BI- DIRECTIONALITY AND THE REVERSAL CURSE

Julian Coda-Forno, Jane X Wang, Arslan Chaudhry

TL;DR

This paper investigates why large language models (LLMs) struggle to recall facts in reverse order (the "reversal curse") and how different training objectives fix this. They find that while bidirectional training methods like MLM can solve the problem behaviorally, they don't necessarily lead to a unified, direction-agnostic understanding of facts. Instead, models seem to store forward and reverse information as separate entries, with distinct organizational strategies depending on the training method.

What Problem Does This Paper Address?

Large Language Models (LLMs) are remarkably good at using information provided "in-context" – meaning, within the prompt itself. However, they often exhibit a surprising brittleness when it comes to applying knowledge learned during their pre-training phase. This phenomenon is termed the "latent generalization problem." A clear symptom of this problem is the "reversal curse," where a model trained on a fact presented in one direction (e.g., "A is greater than B") fails to retrieve the logically equivalent fact in the reverse direction (e.g., "B is less than A").

Previous research has shown that using training objectives that incorporate bidirectional supervision can mitigate this reversal curse. These methods include explicit bidirectional attention or masking-based reconstruction techniques for decoder-only models. However, it remains unclear how these objectives achieve this fix. Do they create a single, unified representation of a fact that can be accessed from any direction, or do they simply learn a separate "memory slot" for the reversed information? This paper aims to shed light on this mechanistic question.

Methods

The authors compare two primary approaches to fixing the reversal curse:

  • Masked Language Modeling (MLM): This is a standard objective for encoder-style models (like BERT) where tokens in the input sequence are randomly masked, and the model is trained to predict these masked tokens using bidirectional context.
  • Masked Fine-Tuning (NTP+Masking): This approach is applied to decoder-only models (like GPT-style models). It involves presenting a masked version of a passage in the context before the unmasked passage, and the model is trained to predict the unmasked continuation. This implicitly encourages bidirectional reasoning.

They also include a baseline Next-Token Prediction (NTP) objective (standard for autoregressive models) which is expected to fail on the reversal task.

To understand how these objectives work, the researchers employ two main analysis techniques:

  1. Ablation Studies: They systematically remove specific components from the training process (e.g., preventing the model from ever predicting the "source" entity) to see which elements are crucial for solving the reversal curse.
  2. Representation Analysis: They examine the internal representations learned by the models. This includes:
  3. Representational Distance: Measuring the cosine distance between the internal states of representations for forward and reverse facts to see if they are clustered together or far apart.
  4. Linear Probing: Training simple linear classifiers on difference vectors between fact representations to determine if there's a consistent, linear "transformation" for reversal or if reversals are indistinguishable from other types of memory access.

Datasets

The study uses four distinct datasets, designed to range from synthetic to semantic structures and importantly, are novel and not contaminated from pre-training:

  • Simple Reversal: A synthetic dataset specifically designed for minimal training from scratch, featuring 1,000 entities and 20 relations.
  • Nonsense Entities: A dataset using synthetic nonsense words to test structural learning without semantic leakage.
  • Fictional Celebrity: A dataset of fictional celebrity names and their descriptions.
  • Semantic Structure: A benchmark employing a relational hierarchy with nonsense terms to test deductive inference.

Key Insights and Ideas

  • Source Prediction is Crucial: The reversal curse is fundamentally tied to the model's ability to predict the "source" entity given the relation and the "target" entity. If the training objective never forces the model to predict the source, reversal accuracy plummets to zero.
  • No Unified "Fact" Representation: Despite fixing the reversal curse, the internal representations don't show evidence of a single, direction-agnostic concept for a fact. Instead, the forward and reverse directions of a fact remain relatively distant in the model's internal space.
  • "Two-Slot" Storage: The successful models appear to store forward and reverse information as distinct entries, rather than collapsing them into one. This is analogous to having separate memory slots for "A > B" and "B < A".
  • Different Organizational Geometries: While both MLM and NTP+Masking use this "two-slot" approach, they organize these slots differently. MLM tends to group facts with the same subject together more strongly, while NTP+Masking's organization is less structured and can make reversals appear as indistinguishable as unrelated facts.
  • The "Prediction Bias": A severe limitation identified is that tokens not explicitly targeted by the loss function, even if attended to, are not learned as generatable outputs. This suggests that information encoded only through attention without a corresponding gradient update is effectively "invisible" for generation.

Key Results

  • Behavioral Fix: Both MLM and NTP+Masking achieve near-perfect reversal accuracy (often >99%) on the Simple Reversal benchmark, compared to near 0% for standard NTP. Similar improvements are seen across other datasets.
  • Ablation I: Removing the requirement for the model to predict the source entity (by never masking it) causes reversal accuracy to drop to 0% across all datasets.
  • Masking Sweep: For NTP+Masking, masking the source entity is nearly sufficient to achieve high reversal accuracy. For MLM, masking the source alone is not enough; masking both the source and the target is required for reliable success.
  • Representational Distance: Figure 3 shows that the cosine distance between representations of forward and reverse facts remains significant across transformer layers for both MLM and NTP+Masking, indicating they are not collapsed into a single representation.
  • Linear Probing: Figure 4 reveals that for NTP+Masking, reversal difference vectors are indistinguishable from unrelated facts. For MLM, they are primarily indistinguishable from same-source facts, suggesting a subject-centric organization.
  • Ablation II (Syntax Probe): Models correctly distinguish between correct and incorrect syntactic frames for relations, indicating representations haven't collapsed into a simple bag-of-entities. Accuracy remains 0% on probes designed to test this collapse.
  • Ablation III (Prediction Bias): A model trained only on forward sequences ("A > B") fails to predict "B" when asked to complete "A > [MASK]", even though "B" was attended to. This highlights a severe prediction bias.

Limitations and Future Work

  • "Illusion" of Generalization: The authors caution that fixing the reversal curse via objective-level changes might create an "illusion" of latent generalization. While behaviorally improved, it doesn't necessarily imply a deep, unified understanding.
  • Separate Entries vs. Unified Concept: The findings suggest separate memory entries rather than a unified concept. Future work could explore architectures or objectives that explicitly enforce a linkage between forward and reverse directions (e.g., shared keys, explicit transforms, consistency constraints) rather than just learning a second, independently indexed entry.
  • Prediction Bias: The identified "prediction bias" is a significant limitation for current architectures. Information encoded solely via attention without gradient updates is effectively lost for generation. This has implications for training pipelines that only compute loss on answer tokens. Future work could investigate how to overcome this bias.

Summary updated

BibTeX
@inproceedings{codaforno2026illusion,
  author = {Julian Coda-Forno and Jane X Wang and Arslan Chaudhry},
  title = {{THE ILLUSION OF LATENT GENERALIZATION: BI- DIRECTIONALITY AND THE REVERSAL CURSE}},
  booktitle = {Re-Align @ ICLR},
  year = {2026},
  url = {https://openreview.net/forum?id=dHbSEPIFiz},
}
Figure