Understanding Brittleness to Variable Renaming in Decoder-only Code Models
Keep the title, authors and abstract in paper.json
potentialpaper · 2026-11-23 20:28 UTC · 05be63d7f03b ·
.potentialpaper/metadata.json modified
+++ b/.potentialpaper/metadata.json@@ -1,19 +1,5 @@{- "layout": 5,- "identifiers": [- {- "scheme": "openreview",- "value": "QHIRkouCS4"- }- ],- "title": "Understanding Brittleness to Variable Renaming in Decoder-only Code Models",- "authors": [],- "abstract": "Transformer-based code models increasingly support compiler and programming-\nlanguage tasks, including program analysis, performance prediction, and code\ngeneration. Recent work has shown that Transformer-based models for code are\nsensitive to simple semantics-preserving edits such as variable renaming. For example,\na simple variable renaming can induce sizable prediction shifts in these\nmodels. The mechanisms that underlie this brittleness to variable renaming are not\nwell understood, though. In this paper, we aim to investigate such mechanisms.\nIn particular, we investigate where failures arise in the model, which components\nare involved in such failures, and whether the diversity of variable names in the\ntraining set affects the robustness of models to variable renaming. To enable our\ncontrolled experiments, we introduce TINYTRACER, a framework that generates\nsynthetic Python programs and their execution traces under controlled training\nand test distributions. We use this framework to train small decoder-only\nTransformers from scratch to predict execution traces, while varying the diversity of\nvariable names in the training set. We test the robustness of the trained models by\ntaking programs that the models trace correctly and consistently replacing their\nvariable names with other names. In these small scale models trained with low\nvariable-name diversity, the first error in a failed trace most often occurs where\na variable name should end: the model generates another identifier character\n instead of the required delimiter. Increasing variable-name diversity during training\nreduces these termination errors and improves robustness to variable names in this\nsetting. We identify attention heads that attend to delimiters following earlier \noccurrences of a variable name, and find that ablating these heads reduces accuracy\nat name endings, supporting a causal role for these heads in identifying where\n variable names end. Higher training-name diversity is also associated with stronger\nattention to these delimiters. Experiments with another larger-scale decoder-only\nmodel (158M-parameter) trained on real Python code also show improved \nrobustness with increased variable name diversity. Complementary analyses identify a\nshared difficulty in generating unfamiliar names, with errors concentrated at the\ninitial tokens of variable names.",- "year": 2027,- "venue": "ICLR 2027 (under review)",- "source": "openreview",- "license": {- "metadata": "CC0-1.0",- "abstract": "CC0-1.0"- }+ "layout": 6,+ "kind": "paper",+ "key": "fee32d59-a89b-4f4c-b3a9-a016d10c0c43"}
paper.json added
+++ b/paper.json@@ -0,0 +1,9 @@+{+ "title": "Understanding Brittleness to Variable Renaming in Decoder-only Code Models",+ "authors": [],+ "abstract": "Transformer-based code models increasingly support compiler and programming-\nlanguage tasks, including program analysis, performance prediction, and code\ngeneration. Recent work has shown that Transformer-based models for code are\nsensitive to simple semantics-preserving edits such as variable renaming. For example,\na simple variable renaming can induce sizable prediction shifts in these\nmodels. The mechanisms that underlie this brittleness to variable renaming are not\nwell understood, though. In this paper, we aim to investigate such mechanisms.\nIn particular, we investigate where failures arise in the model, which components\nare involved in such failures, and whether the diversity of variable names in the\ntraining set affects the robustness of models to variable renaming. To enable our\ncontrolled experiments, we introduce TINYTRACER, a framework that generates\nsynthetic Python programs and their execution traces under controlled training\nand test distributions. We use this framework to train small decoder-only\nTransformers from scratch to predict execution traces, while varying the diversity of\nvariable names in the training set. We test the robustness of the trained models by\ntaking programs that the models trace correctly and consistently replacing their\nvariable names with other names. In these small scale models trained with low\nvariable-name diversity, the first error in a failed trace most often occurs where\na variable name should end: the model generates another identifier character\n instead of the required delimiter. Increasing variable-name diversity during training\nreduces these termination errors and improves robustness to variable names in this\nsetting. We identify attention heads that attend to delimiters following earlier \noccurrences of a variable name, and find that ablating these heads reduces accuracy\nat name endings, supporting a causal role for these heads in identifying where\n variable names end. Higher training-name diversity is also associated with stronger\nattention to these delimiters. Experiments with another larger-scale decoder-only\nmodel (158M-parameter) trained on real Python code also show improved \nrobustness with increased variable name diversity. Complementary analyses identify a\nshared difficulty in generating unfamiliar names, with errors concentrated at the\ninitial tokens of variable names.",+ "license": {+ "metadata": "CC0-1.0",+ "abstract": "CC0-1.0"+ }+}