Does Confusing Code Confuse LLMs? A Pilot Study on C++
Tim van de Wetering, Lola Solovyeva, Fernando Castor
Abstract
Large language models (LLMs) are increasingly deployed for software maintenance tasks that depend heavily on code comprehension. While atoms of confusion, minimal code patterns empirically shown to impair human program comprehension, are well studied, it remains unclear whether these same patterns affect LLMs, and whether their impact varies across maintenance tasks. We present a pilot study evaluating the impact of atoms of confusion on LLM performance on C++ code drawn from three production libraries, using ChatGPT and GitHub Copilot on three software development tasks: atom injection and removal, output prediction, and code explanation. Our results reveal three preliminary findings: (i) the impact of atoms on LLMs is strongly task-dependent; (ii) atoms requiring reasoning about surrounding code are the most resistant to transformation, while localized syntactic atoms are handled reliably; and (iii) LLMs remove atoms of confusion more reliably than they inject them, suggesting that removal succeeds through pattern matching while injection requires deeper comprehension.
Create a lesson
Related papers
Think Before You Code: A Benchmark for Testing LLMs on Software Engineering Deliberation
Shared title terminology · Ashman Mehra
More Context, Mixed Results: Evaluating LLMs for Identifier Recovery and Code Deobfuscation
Shared title terminology · Simon Queyrut, Valerio Schiavoni, Giuseppe Antonio Di Luna et al.
Choosing Quantized Code LLMs by File Size and Energy per Solved Task
Shared title terminology · Aditi Patodiya
AgentScript-Eval: Benchmarking LLMs and Agents for Code Generation in an Enterprise DSL
Shared title terminology · Dipin Khati, Shubham Mehrotra, Bin Bi et al.
Git History Is a Pangenome: Repetition in Code Training Corpora and What Deduplication Removes, Keeps and Misses
Shared title terminology · Saurabh Chopra
Markdown Is Not a Firewall: four coding agents, one rules file, four boundaries
Shared title terminology · Sandeep Dhuri