Public Repositories: Top Contributor to Redundant AI Comments
Vast, uncurated public code repositories, such as those on GitHub, are a primary source of training data for AI code generation models, inadvertently imprinting common human practices of redundant or low-quality comments onto AI outputs.
The top 3
- Top 3 Redundant Comment Types AI Replicates from Public Repos: AI models frequently replicate self-evident code descriptions (e.g., `i++` commented as "increment i by 1"), outdated explanations, and generic, vague boilerplate comments from public codebases, which add noise rather than value.
- Public Repos' Scale Degrades AI Code Comment Quality: The vast, uncurated nature of public repositories, where nearly 5% of functions may contain quality issues, leads AI models to generate significantly more low-quality code and comments (e.g., 5.85% vs. 2.16% when trained on cleaned data) compared to more controlled datasets.
- Key Public Repo Sources for AI's Over-Commenting Habit: AI's tendency for redundant comments significantly originates from training data found in public repositories, including beginner tutorials, unmaintained projects with obsolete comments, and hastily committed personal projects lacking rigorous review.
Sources
Open the full topic