Code · Safety

The Larger They Are, the Harder They Fail

First page
The Larger They Are, the Harder They Fail
Paper summary

Reveals inverse-scaling failures in LLM code generation.

Ask this paper

Key points
01

Function-name swap test: Swaps default Python function names and observes that larger LLMs fail harder to adapt - they prefer memorized patterns.

02

Inverse scaling: Counter to the usual "bigger is better" narrative, larger models prefer incorrect memorized continuations more strongly than smaller ones.

03

Memorization vs. reasoning: Highlights the tension between memorization (which helps on training data) and reasoning (which helps on novel data).

04

Safety implications: Important for safety/robustness - bigger models may be more brittle in adversarial or out-of-distribution settings.

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.

Every Monday
Get next week’s papers.
Subscribe on Substack