AI Research
Pre-training Mutants More Faithfully Model Real Bugs Than Post-training Approaches in Deep Learning
A first-of-its-kind empirical study finds that mutations applied during model development outperform those added after training at capturing how real faults behave.
Software testers often use artificially injected "mutants"—deliberate code changes—to validate testing strategies. The assumption underlying this practice is that mutants behave enough like genuine faults to be meaningful proxies. While this idea has been studied in traditional software, its validity in deep learning contexts has remained largely unexplored.
The Challenge#
In deep learning systems, mutants can be introduced at two different stages: before training (pre-training) or after a model has been fully developed (post-training). The question of which approach more closely mirrors how real-world bugs actually manifest has never been systematically examined. This gap in knowledge makes it difficult for researchers and practitioners to know whether their mutation-based testing strategies are genuinely effective.
A New Framework for Measuring Realism#
Researchers created a statistical evaluation system with two key measures: coupling strength (how closely mutants relate to actual faults) and behavioral similarity (whether mutants break systems in the same way real bugs do). They tested this framework against four established bug datasets—CleanML, DeepFD, DeepLocalize, and defect4ML—using state-of-the-art mutation tools for both approaches.
Key Findings#
The analysis revealed that pre-training mutants substantially outperform their post-training counterparts on both realism metrics. Mutants created during model development exhibited stronger connections to actual faults and behaved more like genuine errors when introduced. This advantage held consistently across different types of individual mutation operators, providing a ranked view of which operators are most realistic within each category.
The Trade-off#
Despite the clear realism advantage, the study highlights a practical obstacle: creating pre-training mutants demands significantly more computational resources than post-training approaches. This cost-benefit tension suggests an urgent need for improved post-training mutation operators that could match or exceed pre-training realism without the added expense.