Cited by 14Software Engineering ResearchTopic ModelingNatural Language Processing Techniques

The Larger they are, the Harder they Fail: Language Models do not Recognize Identifier Swaps in Python

Open access
Miceli Barone, Antonio Valerio, Barez, Fazl, Cohen, Shay B., Konstas, Ioannis·2023·Findings of the Association for Computational Linguistics: ACL 2023

Abstract

Large Language Models (LLMs) have successfully been applied to code generation tasks, raising the question of how well these models understand programming.Typical programming languages have invariances and equivariances in their semantics that human programmers intuitively understand and exploit, such as the (near) invariance to the renaming of identifiers.We show that LLMs not only fail to properly generate correct Python code when default function names are swapped, but some of them even become more confident in their incorrect predictions as the model size increases, an instance of the recently discovered phenomenon of Inverse Scaling, which runs contrary to the commonly observed trend of increasing prediction quality with increasing model size.Our findings indicate that, despite their astonishing typical-case performance, LLMs still lack a deep, abstract understanding of the content they manipulate, making them unsuitable for tasks that statistically deviate from their training data, and that mere scaling is not enough to achieve such capability.* Equal contribution. 1 Since model capacity in number of parameters and pretraining dataset size are balanced according to a design law that is fixed for each model family and is intended to empirically maximize the pretraining set likelihood given a compute budget (Kaplan et al., 2020), for the reminder of this paper we will jointly refer to them as "model size".

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Integrity signals

Registry

Crossref · 10.18653/v1/2023.findings-acl.19

Cites

23 of 24 references verified0 citation errors · 1 not checkable

Statistics

Claims the paper makes

The claims and statistics of this paper haven’t been checked yet.

Run the check — free, no account needed. It reads the open-access text and checks the sources it cites.

A few free checks a day · papers already verified open instantly · results are public

Claims other papers make about this one

Each is checked against this paper’s own text: does it say what the citing paper says it does?

  • Given a Python prompt which swaps two builtin functions, large language models prefer the incorrect but statistically common continuation to the correct but unusual one.

    “Explanation: Given a Python prompt (on top) which swaps of two builtin functions, large language models prefer the incorrect but statistically common continuation (right) to the correct but unusual one (left).”

    From Large Language Model Reasoning Failures (2026) · cites this paper as Miceli-Barone et al., 2023

  • GPT-3 and related models are fragile under identifier swaps in programs, suggesting only a shallow understanding of code.

    “Miceli-Barone et al. (2023) show that GPT-3 and related models are fragile under identifier swaps in programs, suggesting only a shallow understanding of code.”

Self-check

Percentages, sums and reported differences re-computed from the paper’s own numbers.

The self-check needs the paper’s full text.

Cites

Flagged first, then by citations

Cited by

Sorted by citations

Authors
Miceli Barone, A. V., Barez, F., Cohen, S. B., & Konstas, I.
Affiliations
  • Heriot-Watt University (GB)
  • University of Edinburgh (GB)
Venue
Findings of the Association for Computational Linguistics: ACL 2023
Published
2023
Pages
272-292
OpenAlex
W4385571985
Cited by
12
References
20
Citations by year
2026: 1 · 2025: 5 · 2024: 2 · 2023: 4
FWCI
3.08
Type
conference paper
Language
en
Open access
Licence
cc-by
Locations
Findings of the Association for Computational Linguistics: ACL (Findings of ACL) (publishedVersion, cc-by)
Funders
  • UK Research and Innovation (EP/V026607/1)
  • University of Birmingham
Topics
  • Physical Sciences › Computer Science › Information Systems › Software Engineering Research
  • Physical Sciences › Computer Science › Artificial Intelligence › Topic Modeling
  • Physical Sciences › Computer Science › Artificial Intelligence › Natural Language Processing Techniques
Keywords
large language models, Python code generation, identifier renaming, equivariance, invariance, model size, program comprehension, overconfidence

About these checks

Registry, retraction, Cites and statistics results are computed, not judged, with one exception: a printed reference that no index lists is read once by a model before it counts as a citation error. Claims are extracted by a model and kept only when their quote appears verbatim in the text; each cited source is then checked, with a model’s help, for whether it says what the claim relies on. Those verdicts can be wrong — read the claim’s quote and the cited source before relying on one.

Statistics and arithmetic are recomputed, not judged.

Confidence bands are shown only for fields calibrated on our annotated test set. None is calibrated yet, so no band is shown.

What counts as a claim ›How we measure confidence ›How we check this ›

Are you an author, or do you see a problem with this page? Request a review