Reproduce “Large Language Models and Simple, Stupid Bugs” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Kevin Jesse, Toufique Ahmed, Premkumar T. Devanbu, Emily Morgan

Researchers at UC Davis investigated the tendency of large language models (LLMs) to reproduce "Simple, Stupid Bugs" (SStuBs) and found that LLMs generate these known bugs about twice as often as they produce correct fixes. The study demonstrated that incorporating code comments into LLM prompts can significantly reduce the generation of such bugs, lowering the bug/patch ratio across various models.

Key insights

  • Large Language Models frequently regenerate known Simple, Stupid Bugs (SStuBs) when prompted with relevant code, often at twice the rate of generating correct fixes.
  • LLMs assign similar probability (log-likelihood) scores to both buggy code completions and correct fixes, suggesting they do not inherently distinguish between them based on statistical patterns alone.
  • Adding automatically generated code comments to prompts significantly reduces the bug/patch ratio for LLM-generated code across various models and sizes, indicating comments provide crucial context.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.