Towards a Theoretical Understanding of the 'Reversal Curse' via Training Dynamics

Hanlin Zhu, Baihe Huang, Shaolun Zhang, Michael Jordan, Jiantao Jiao, Yuandong Tian, Stuart Russell

Introduction

Large Language Models (LLMs) exhibit a curious logical failure known as the Reversal Curse. While a model might correctly identify that "Olaf Scholz is the Chancellor of Germany," it often fails to answer the inverse: "Who is the Chancellor of Germany?" This paper, presented at NeurIPS 2024 by researchers from UC Berkeley and Meta AI, provides a rigorous theoretical explanation for this phenomenon, attributing it to the fundamental dynamics of auto-regressive training.

The Reversal Curse: A Training Dynamics Perspective

The Reversal Curse occurs when a model trained on a sequence "A is B" fails to infer that "B is A." Previous hypotheses suggested limitations in model capacity or data scarcity. However, this research demonstrates that the curse is an inherent byproduct of Gradient Descent on a Cross-Entropy loss function. Standard training creates a "one-way street" in the model's internal weights, where optimizing for the forward direction does not update the parameters necessary for the reverse.

Theoretical Framework and Methodology

The authors analyze the training dynamics of two architectural archetypes: Bilinear Models and One-Layer Transformers. To isolate the effect, the study utilizes synthetic datasets consisting of three-token sequences (e.g., $A_i \to B_i$). The researchers track the "gradient flow" to observe how specific rows and columns of weight matrices evolve.

Notation for entities and logical relations used in the theoretical analysis.

As defined in the notation above, the study distinguishes between forward ($\to$) and backward ($\leftarrow$) relations, as well as direct and indirect (transitive) logical paths. By analyzing these structures, the authors prove that the weights for token B remain untouched when learning the mapping from A to B.

Key Insights: Why Models Fail to Reverse

The study identifies several critical factors:

  • Weight Asymmetry: Learning "A $\to$ B" updates the weights associated with input token A to predict B. The internal representation becomes a directed vector with no reciprocal path.
  • Loss Function Bias: Cross-Entropy loss is "greedy," focusing solely on the next-token prediction. Since the reverse sequence ("B $\to$ A") is absent during training for a specific fact, the gradient for that direction remains effectively zero.
  • Dynamics vs. Expressivity: The authors argue that while Transformers can represent symmetric facts (expressivity), the standard optimization path (dynamics) fails to reach those configurations.

Empirical Results and Validation

The theoretical predictions were validated using a 24-layer GPT-2 architecture. The results confirmed that while the model achieves near-zero loss on training data, its performance on reversed facts remains at the level of random guessing.

Negative Log Probability over epochs for training (forward) and validation (reversed) sequences.

As shown in the figure above, the "reversal loss" (red) remains high and unstable even as the forward training loss (blue) vanishes. Theorem 3 in the paper formally proves that for an unseen reverse direction, the prediction probability is no better than $1/M$, where $M$ is the vocabulary size.

Conclusion and Future Directions

The "Reversal Curse" highlights a fundamental gap between human-like logical symmetry and the current paradigm of auto-regressive optimization. While In-Context Learning (ICL) can temporarily bridge this gap by using attention mechanisms to link entities in a prompt, the underlying stored weights remain asymmetric. Future research may explore symmetric loss functions or specialized data augmentation to overcome these inherent training biases.

Summary updated

BibTeX
@inproceedings{zhu2024towards,
  author = {Hanlin Zhu and Baihe Huang and Shaolun Zhang and Michael Jordan and Jiantao Jiao and Yuandong Tian and Stuart Russell},
  title = {{Towards a Theoretical Understanding of the 'Reversal Curse' via Training Dynamics}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2024},
  url = {https://openreview.net/forum?id=QoWf3lo6m7},
}
Figure