Deep Learning Framework Testing via Heuristic Guidance Based on Multiple Model Measurements

Yinglong Zou, Juan Zhai, Chunrong Fang, Yanzhou Mu, Jiawei Liu, Zhenyu ChenarXiv 2025 · DOI

Abstract

Deep learning (DL) frameworks like TensorFlow and PyTorch serve as the foundation for modern AI applications. Ensuring their reliability is paramount, yet current automated testing tools often suffer from "fuzzer bloat"—generating excessively large models that are inefficient at discovering bugs. This paper introduces DLMMM, a testing framework that uses a multi-objective heuristic to dynamically balance bug detection effectiveness, operator combination variety, and execution time. By fusing these metrics, DLMMM discovered 19 new crashes and 175 numerical bugs across major frameworks, significantly outperforming existing baselines in both efficiency and structural diversity.

Introduction: The Limitations of Single-Metric Testing

Automated testing of DL frameworks typically involves differential testing, where randomly generated models are executed across different frameworks to identify inconsistencies. However, existing generators often adopt a greedy approach, maximizing a single metric like operator coverage. This leads to three primary issues:

  1. Structural Blindness: Tools fail to quantify the variety of operator combinations in complex branching data flows.
  2. Execution Inefficiency: Blindly stacking operators creates massive models that consume excessive time, reducing the total number of test cases.
  3. Diminishing Returns: Since a single execution usually only triggers one bug, massive models are less efficient than a high volume of diverse, smaller models.

Methodology: The DLMMM Framework

DLMMM shifts the paradigm from single-metric optimization to a holistic, multi-objective approach.

DAG-Based Variety Metric

Rather than treating models as linear sequences, DLMMM represents them as Directed Acyclic Graphs (DAGs). It calculates a variety_degree by analyzing unique subgraphs of depth 2, providing a more granular measure of structural diversity.

Multi-Metric Fusion via CRITIC

To manage competing objectives, DLMMM employs the CRITIC (Criteria Importance Through Intercriteria Correlation) method. This objective weighting technique fuses bug detection effectiveness, operator variety, and execution time into a single "fitness" score used to guide model generation.

Double-Level Heuristic Mutation

Models are evolved from scratch using tournament selection based on fitness scores. Mutations involve probabilistically replacing edges in the DAG, with probabilities updated dynamically based on the mutation's impact on the fused fitness score.

Key Insights: Complexity vs. Efficiency

A core finding of this research is the non-linear relationship between model complexity and bug-finding efficiency. While increased operator variety can improve the likelihood of triggering a bug, it often comes at a disproportionate cost in execution time.

Comparison of testing efficiency between smaller and larger models, highlighting the significantly lower time-per-bug for smaller architectures.

As shown in the experimental data, larger models may find slightly more bugs in total but require significantly more time per bug discovered. DLMMM leverages this insight by penalizing long execution times, favoring a higher throughput of smaller, structurally diverse models.

Experimental Results

The authors evaluated DLMMM against state-of-the-art baselines, including LEMON, Muffin, COMET, and Gandalf, using standard datasets like MNIST and ImageNet.

Bug Discovery and Diversity

DLMMM identified 19 new crashes (16 confirmed) and 175 numerical inconsistencies. It achieved a 250.13% improvement in operator variety compared to the best baseline.

Correlation between operator variety, performance, and execution time across baseline testing frameworks, justifying the need for multi-metric guidance.

Efficiency and Throughput

Despite its focus on variety, DLMMM maintained an average execution time of 3.5 seconds per model. This efficiency ensures that the testing loop remains fast and exploratory, avoiding the "Frankenstein" models that plague other fuzzers.

Conclusion

DLMMM demonstrates that holistic guidance—balancing variety, performance, and time—is superior to single-metric optimization for DL framework testing. Future work will focus on optimizing input generation and adapting variety metrics for the era of Large Language Models (LLMs), where testing must account for complex, pre-encapsulated blocks like Transformers.

Summary updated

BibTeX
@misc{zou2025deep,
  author = {Yinglong Zou and Juan Zhai and Chunrong Fang and Yanzhou Mu and Jiawei Liu and Zhenyu Chen},
  title = {{Deep Learning Framework Testing via Heuristic Guidance Based on Multiple Model Measurements}},
  year = {2025},
  eprint = {2507.15181},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2507.15181},
}
Figure