Abstract
Large Language Models (LLMs) have demonstrated remarkable capabilities in reasoning and knowledge retrieval. However, they suffer from a fundamental limitation known as the "reversal curse": a model that learns "A is B" during training often fails to infer that "B is A." This paper identifies the unidirectional Next-Token Prediction (NTP) objective as the primary driver of this phenomenon. We analyze the structural differences between NTP and bidirectional objectives like Autoregressive Blank Infilling (ABI) and introduce BICO (BIdirectional Causal language model Optimization), a fine-tuning framework that enables causal models to master reversed relationships without retraining from scratch.
Introduction: The Middle-Intelligence Trap
The "Middle-Intelligence Trap" describes a state where AI models possess vast factual knowledge but lack the basic logical symmetry expected of human-like intelligence. A prime example is the inability of state-of-the-art models to reverse simple facts. If a model is trained on the sentence "Mary Lee Pfeiffer’s son is Tom Cruise," it can correctly identify the son of Mary Lee Pfeiffer. Yet, when asked "Who is Tom Cruise’s mother?", the same model may fail entirely. This suggests that the knowledge is stored in a unidirectional manner, inaccessible when the query structure is flipped.
Defining the Reversal Curse
The reversal curse is not a failure of memory but a byproduct of the training objective. Most modern LLMs (e.g., GPT-4, Llama) utilize Next-Token Prediction (NTP). In this regime, the model optimizes the probability $p(B|A)$—predicting the next token $B$ given the preceding sequence $A$. However, this provides no mathematical guarantee for the reverse probability $p(A|B)$. If "Entity A" consistently precedes "Entity B" in the training corpus, the model never learns to associate the description of B back to the identity of A.
Analysis of Training Objectives
To understand why some models are more resilient to this curse, we compared NTP with Autoregressive Blank Infilling (ABI), used by models like GLM. Unlike NTP, which only looks backward, ABI requires the model to fill in masked spans by attending to both preceding and succeeding context. This bidirectional attention naturally forces the model to learn the relationship between entities regardless of their order in the text.
Our findings indicate that models trained with ABI are significantly more capable of handling reversed queries. For instance, while standard Llama models achieved 0% accuracy on reversed name-to-description tasks, GLM-2B (trained with ABI) achieved 88% accuracy.
Mitigation: The BICO Framework
To bridge this gap for existing causal LLMs, we propose BICO (BIdirectional Causal language model Optimization). BICO is a lightweight fine-tuning framework designed to inject bidirectional capabilities into pre-trained causal models through three key modifications:
- Bidirectional Attention Masking: BICO replaces the standard causal mask with a bidirectional one during the fine-tuning phase, allowing tokens to attend to the entire sequence.
- Positional Embedding Adjustment: It modifies Rotary Position Embeddings (RoPE) to ensure that "future" tokens do not appear as out-of-distribution data to the model.
- Denoising with Padding: Instead of introducing new special tokens, BICO repurposes the existing
[PAD]token as a mask, creating a denoising objective that encourages the model to reconstruct missing information from surrounding context.
Experimental Results
We evaluated BICO across several datasets, including fictitious Name-to-Description ($N2D$) pairs, GSM8k math problems, and translation tasks.
- Factual Retrieval: Applying BICO to Llama-7B increased its accuracy on reversed tasks from 0% to 68.33%. Crucially, this was achieved without degrading performance on the original "forward" tasks.
- Reasoning and Translation: BICO provided statistically significant gains in "backward reasoning" for math problems (e.g., finding an initial variable given a final result) and improved reverse translation performance.
- The One-to-Many Challenge: We observed that reversing a description to a name ($\overleftarrow{D2N}$) remains harder than reversing a name to a description. This is likely due to the inherent ambiguity of descriptions, which may apply to multiple entities, unlike unique identifiers like names.
Conclusion and Future Work
The reversal curse is a structural artifact of how we train LLMs, not an inherent limit of their architecture. BICO demonstrates that targeted bidirectional fine-tuning can unlock latent relational knowledge within causal models. Future research should investigate how Reinforcement Learning from Human Feedback (RLHF) might inadvertently reinforce these unidirectional biases and explore more robust methods for handling one-to-many mappings in factual retrieval.
Summary updated