---
title: "Cleaner AI training data, fewer bugs: Sonar’s SonarSweep explained"
url: https://daily.dev/posts/cleaner-ai-training-data-fewer-bugs-sonar-s-sonarsweep-explained-zujbiz53d
source_url: https://thenewstack.io/ai-training-data-quality
type: article
source: "The New Stack"
published: 2026-06-11T12:04:03.406Z
updated: 2026-06-11T12:04:27.616Z
tags: ["security"]
reading_time: 6
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Cleaner AI training data, fewer bugs: Sonar’s SonarSweep explained

**[The New Stack](https://daily.dev/sources/newstack)** · 6 min read · 0 upvotes · 0 comments

## Summary

LLMs trained on public code repositories absorb bugs, insecure patterns, and poor practices alongside good code. Sonar's SonarSweep addresses this by filtering and improving training data through four phases: deep static analysis, synthesis of high-quality examples, automated remediation of flawed patterns, and aggressive curation. Training on swept data produced a 41% reduction in both security vulnerability density and bug density in generated code. Beyond code quality, cleaner training data also reduces token usage in agentic coding sessions — Sonar's research across ~660 Claude Code task runs found roughly 7-8% fewer tokens used in SonarQube-verified codebases with no drop in task completion.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://thenewstack.io/ai-training-data-quality>

## Similar posts on daily.dev

- [Sonar announces new solution to optimize training datasets for coding LLMs](https://daily.dev/posts/sonar-announces-new-solution-to-optimize-training-datasets-for-coding-llms-dgnlzkesm) · SD Times · 0 upvotes · 0 comments
- [Beyond ‘Shift Left’: Improving AI Training Data](https://daily.dev/posts/beyond-shift-left-improving-ai-training-data-hebwp7ld5) · The New Stack · 2 upvotes · 0 comments
- [Most coding agent benchmarks skip large-scale refactoring. Not this one.](https://daily.dev/posts/most-coding-agent-benchmarks-skip-large-scale-refactoring-not-this-one--p55v6sihn) · The New Stack · 0 upvotes · 0 comments

---

Tags: [#security](https://daily.dev/tags/security)

[View this post on daily.dev](https://daily.dev/posts/cleaner-ai-training-data-fewer-bugs-sonar-s-sonarsweep-explained-zujbiz53d)
