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

Antonio Valerio Miceli-Barone, Fazl Barez, Ioannis Konstas, Shay B. Cohen
5/24/2023
cs.CLcs.AI

No official code found. Best implementation: Avmb/inverse_scaling_prize_code_identifier_swap (23 stars, last commit 2023-07-23).

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.

View on arXivView PDF

Code Implementations(1)

Submission to the inverse scaling prize

231Python, Jupyter NotebookNov 2, 20223 years ago

Cite this paper

@article{micelibarone2023larger,
  title  = {The Larger They Are, the Harder They Fail: Language Models do not Recognize Identifier Swaps in Python},
  author = {Antonio Valerio Miceli-Barone and Fazl Barez and Ioannis Konstas and Shay B. Cohen},
  year   = {2023},
  eprint = {2305.15507},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2305.15507v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2305.15507.svg)](https://codeofpaper.com/paper/2305.15507)

Discussion