Show a model your old code and it writes your old bugs: 32 runs, 0% reuse

A recent experiment by a developer demonstrates how AI models are heavily influenced by the existing code in a repository. By testing four different LLMs against two versions of a codebase—one containing outdated, duplicated components and another with a refactored shared component—the study found that models consistently mimicked the patterns they were shown. When exposed to old, buggy code, the models reproduced specific defects, such as incorrect keyboard handling and hardcoded values, rather than adopting the new, cleaner implementation. Even when models were instructed to use the new shared component, they often invented incorrect API interfaces unless the source code was explicitly provided. The findings suggest that AI-assisted development is highly context-dependent, and that maintaining a clean, well-documented repository is essential to prevent models from propagating legacy technical debt and outdated coding patterns.
This is a summary. Read the full article at the original source:
Dev.toRelated stories
In his recent blog post, Colin Breck addresses the growing trend of using Large Language Models (LLMs) to generate technical content. Breck argues tha…
The creator of the 'Giga Pisar' application, built on Sber's GigaAM speech recognition technology, has summarized the first week following their debut…
This Habr article explores the computer as a fundamental mathematical structure, inviting readers to view computational processes through the lens of…


