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

Antonio Valerio Miceli Barone, Fazl Barez, Shay B. Cohen, Ioannis Konstas


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.
Anthology ID:
2023.findings-acl.19
Volume:
Findings of the Association for Computational Linguistics: ACL 2023
Month:
July
Year:
2023
Address:
Toronto, Canada
Editors:
Anna Rogers, Jordan Boyd-Graber, Naoaki Okazaki
Venue:
Findings
SIG:
Publisher:
Association for Computational Linguistics
Note:
Pages:
272–292
Language:
URL:
https://aclanthology.org/2023.findings-acl.19
DOI:
10.18653/v1/2023.findings-acl.19
Bibkey:
Cite (ACL):
Antonio Valerio Miceli Barone, Fazl Barez, Shay B. Cohen, and Ioannis Konstas. 2023. The Larger they are, the Harder they Fail: Language Models do not Recognize Identifier Swaps in Python. In Findings of the Association for Computational Linguistics: ACL 2023, pages 272–292, Toronto, Canada. Association for Computational Linguistics.
Cite (Informal):
The Larger they are, the Harder they Fail: Language Models do not Recognize Identifier Swaps in Python (Miceli Barone et al., Findings 2023)
Copy Citation:
PDF:
https://aclanthology.org/2023.findings-acl.19.pdf
Video:
 https://aclanthology.org/2023.findings-acl.19.mp4