Papers › The Reversal Curse: LLMs trained on "A is B" fail to learn "B is A"

The Reversal Curse: LLMs trained on "A is B" fail to learn "B is A"

21 Sep 2023arXiv:2309.12288archive 2025-07-28

Lukas Berglund, Meg Tong, Max Kaufmann, Mikita Balesni, Asa Cooper Stickland, Tomasz Korbak, Owain Evans

We expose a surprising failure of generalization in auto-regressive large language models (LLMs). If a model is trained on a sentence of the form "A is B", it will not automatically generalize to the reverse direction "B is A". This is the Reversal Curse. For instance, if a model is trained on "Valentina Tereshkova was the first woman to travel to space", it will not automatically be able to answer the question, "Who was the first woman to travel to space?". Moreover, the likelihood of the correct answer ("Valentina Tershkova") will not be higher than for a random name. Thus, models do not generalize a prevalent pattern in their training set: if "A is B" occurs, "B is A" is more likely to occur. It is worth noting, however, that if "A is B" appears in-context, models can deduce the reverse relationship. We provide evidence for the Reversal Curse by finetuning GPT-3 and Llama-1 on fictitious statements such as "Uriah Hawthorne is the composer of Abyssal Melodies" and showing that they fail to correctly answer "Who composed Abyssal Melodies?". The Reversal Curse is robust across model sizes and model families and is not alleviated by data augmentation. We also evaluate ChatGPT (GPT-3.5 and GPT-4) on questions about real-world celebrities, such as "Who is Tom Cruise's mother? [A: Mary Lee Pfeiffer]" and the reverse "Who is Mary Lee Pfeiffer's son?". GPT-4 correctly answers questions like the former 79% of the time, compared to 33% for the latter. Code available at: https://github.com/lukasberglund/reversal_curse.

PaperPDFCodeCode Syntology ran

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 11 code samples harvested from 1 repository linked to this paper: 9 ran (of which 0 constructed an object rather than computing a result; 9 with no instrument failure: 0 honoured, 0 violated, 9 with no contract checked; 0 where Syntology's instrument failed) · 2 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code; here there are none.

By repository: official repository: 11 samples from 1 repository, 9 ran (9 with no instrument failure; 0 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written on 2026-09-24 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

lukasberglund/reversal_curse officialmentioned in papermentioned on GitHubSyntology: 11 samples, 9 ran (0 instrument-failed) · 2 unverified report
metr/public-tasks mentioned on GitHubpytorchNOASSERTIONSyntology: not harvested report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

11 samples harvested: 9 ran (of which 0 constructed an object rather than computing a result; 9 with no instrument failure: 0 honoured, 0 violated, 9 with no contract checked; 0 where Syntology's instrument failed) · 2 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page has not changed since , the first build that kept a record date for it; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

9ran
2unverified

Licence: 11 of the 11 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from lukasberglund/reversal_curse. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity.

lukasberglund/reversal_curse official repository 11 samples, 9 ran (0 instrument-failed) · 2 unverified
convert_runs_to_df src/wandb_utils.py ran no licence file found · pointer only · 2748d6bfde1f400a · report fixture: signature runs:list/1/MockRun, keys:list/1/str, configs:list/1/str, default_value:int/0/int, include_notes:bool/0/bool, nested_key_delimiter:str/0/str, ignore_tag:str/0/str · returned DataFrame · level recorded 2026-09-24
generate_wandb_substring_filter src/wandb_utils.py ran no licence file found · pointer only · 8893b67058cf5e56 · report fixture: signature filters:dict/0/? · returned dict · level recorded 2026-09-24
get_cost_per_1k_tokens src/models/openai_complete.py ran no licence file found · pointer only · b34d526a98178a10 · report fixture: signature model_name:str/0/str, training:bool/0/bool · returned float · level recorded 2026-09-24
get_openwebtext_path src/dataset.py ran no licence file found · pointer only · aa42dd70be709dc2 · report fixture: signature path:str/0/str, fraction:float/0/float · returned str · level recorded 2026-09-24
get_preprocess_function src/dataset.py ran no licence file found · pointer only · f94438c1b75c62d2 · report fixture: signature tokenizer:callable/0/?, max_length:int/0/int · returned function · level recorded 2026-09-24
load_from_json in 15 papers src/common.py ran no licence file found · pointer only · e01bde09eb15910f · report fixture: signature file_name:str/0/str · returned dict · level recorded 2026-09-24
load_from_jsonl src/common.py ran no licence file found · pointer only · 9ebcde58a78649e8 · report fixture: signature file_name:str/0/str · returned list · level recorded 2026-09-24
load_from_yaml src/common.py ran no licence file found · pointer only · 6fe4b4ebee97037c · report fixture: signature file_name:str/0/str · returned dict · level recorded 2026-09-24
log_after_retry src/models/openai_complete.py ran no licence file found · pointer only · e35d51ba8013184f · report fixture: signature logger:Logger/0/?, level:int/0/int · returned function · level recorded 2026-09-24
load_model in 479 papers src/models/common.py unverified no licence file found · pointer only · c9de75a7c39c5012 · report
load_tokenizer in 66 papers src/models/common.py unverified no licence file found · pointer only · e18553bc097d701c · report

Tasks

Data AugmentationSentence

Results from the paper archive 2025-07-28

No leaderboard rows for this paper in the archive.

Methods

Absolute Position EncodingsAdamAttentionAttention DropoutBPECosine AnnealingDense ConnectionsDropoutGPT-3GPT-4Label SmoothingLayer NormalizationLinear LayerLinear Warmup With Cosine AnnealingMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformerWeight Decayfail

1 archive method tag without a method page not shown.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections