Balancing Validity and Vulnerability: Knowledge-Driven Seed Generation via LLMs for Deep Learning Library Fuzzing
Source abstract
Abstract
Fuzzing deep learning (DL) libraries is essential for uncovering security vulnerabilities in AI systems. Existing approaches enhance large language models (LLMs) with external knowledge such as bug reports to improve the quality of generated seeds. However, most approaches still rely on static strategies or single knowledge sources, limiting their ability to produce syntactically valid inputs that also expose deeper bugs. To address this challenge, we propose an adaptive seed generation approach that models knowledge-guided prompt selection as a multi-armed bandit problem. Our method first constructs two knowledge bases from API documentation and bug reports, then dynamically selects and refines prompt strategies based on real-time feedback. These strategies are tailored to the knowledge types in the respective bases. We design a multi-dimensional reward function to evaluate each batch of generated seeds by measuring their error-triggering potential and behavioral diversity, enabling a balanced exploration of both syntactically valid and bug-triggering test cases. Our experiments on three DL libraries, PaddlePaddle, MindSpore, and OneFlow, identify 17 previously unknown crash bugs, demonstrating the effectiveness and generalizability of the proposed approach.
Source: crossref · Quality: baseline
Research context
OpenAlex topics: Software Testing and Debugging Techniques · Software Engineering Research · Software Reliability and Analysis Research
SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.
Affiliations
College of Electronic Engineering, National University of Defense Technology, Hefei 230031, China
Anhui Province Key Laboratory of Cyberspace Security Situation Awareness and Evaluation, Hefei 230031, China
Funding
the Program of the National Natural Science Foundation of China
References (34)
Show source-provided references
1. Research progress on the application of deep learning in fingerprint recognition10.1016/j.patcog.2025.112216 ↗
2. Mienye, I.D., and Swart, T.G. (2024). A Comprehensive Review of Deep Learning: Architectures, Recent Advances, and Applications. Information, 15.10.3390/info15120755 ↗
3. Wang, Y., He, J., Fan, L., Li, H., Chen, Y., and Zhang, Z. (2024, January 16–22). Driving Into the Future: Multiview Visual Forecasting and Planning with World Model for Autonomous Driving. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, CVPR 2024, Seattle, WA, USA.10.1109/CVPR52733.2024.01397 ↗
4. Facial Expression Recognition in Classrooms: Ethical Considerations and Proposed Guidelines for Affect Detection in Educational Settings10.1109/TAFFC.2023.3275624 ↗
5. Joint Intent Detection Model for Task-oriented Human-Computer Dialogue System using Asynchronous Training10.1145/3558096 ↗
6. Evaluating Spectrum-Based Fault Localization on Deep Learning Libraries10.1109/TSE.2025.3552622 ↗
7. Practical Accuracy Estimation for Efficient Deep Neural Network Testing10.1145/3394112 ↗
8. Just, R., and Fraser, G. (2023, January 17–21). Large Language Models Are Zero-Shot Fuzzers: Fuzzing Deep-Learning Libraries via Large Language Models. Proceedings of the 32nd ACM SIGSOFT International Symposium on Software Testing and Analysis, ISSTA 2023, Seattle, WA, USA.
9. Deng, Y., Xia, C.S., Yang, C., Zhang, S.D., Yang, S., and Zhang, L. (2024, January 14–20). Large Language Models are Edge-Case Generators: Crafting Unusual Programs for Fuzzing Deep Learning Libraries. Proceedings of the 46th IEEE/ACM International Conference on Software Engineering, ICSE 2024, Lisbon, Portugal.10.1145/3597503.3623343 ↗
10. Fuzzing: Challenges and Reflections10.1109/MS.2020.3016773 ↗
11. Shiri Harzevili, N., Wei, M., Mohajer, M.M., Pham, V.H., and Wang, S. (ACM Trans. Softw. Eng. Methodol., 2025). Evaluating API-Level Deep Learning Fuzzers: A Comprehensive Benchmarking Study, ACM Trans. Softw. Eng. Methodol., Just Accepted.10.1145/3729533 ↗
12. Wei, A., Deng, Y., Yang, C., and Zhang, L. (2022, January 25–27). Free Lunch for Testing: Fuzzing Deep-Learning Libraries from Open Source. Proceedings of the 44th IEEE/ACM 44th International Conference on Software Engineering, ICSE 2022, Pittsburgh, PA, USA.10.1145/3510003.3510041 ↗
13. Roychoudhury, A., Cadar, C., and Kim, M. (2022, January 14–18). Fuzzing deep-learning libraries via automated relational API inference. Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering, ESEC/FSE 2022, Singapore, Singapore.
14. Language models are unsupervised multitask learners
15. d’Amorim, M. (2024, January 15–19). When Fuzzing Meets LLMs: Challenges and Opportunities. Proceedings of the Companion Proceedings of the 32nd ACM International Conference on the Foundations of Software Engineering, FSE 2024, Porto de Galinhas, Brazil.
16. Meng, R., Mirchev, M., Böhme, M., and Roychoudhury, A. (March, January 26). Large Language Model guided Protocol Fuzzing. Proceedings of the 31st Annual Network and Distributed System Security Symposium, NDSS 2024, San Diego, CA, USA.10.14722/ndss.2024.24556 ↗
17. Xia, C.S., Paltenghi, M., Tian, J.L., Pradel, M., and Zhang, L. (2024, January 14–20). Fuzz4All: Universal Fuzzing with Large Language Models. Proceedings of the 46th IEEE/ACM International Conference on Software Engineering, ICSE 2024, Lisbon, Portugal.10.1145/3597503.3639121 ↗
18. Li, Z., Wu, J., Ling, X., Luo, T., Rui, Z., and Wu, Y. (2024). The Seeds of the FUTURE Sprout from History: Fuzzing for Unveiling Vulnerabilities in Prospective Deep-Learning Libraries. CoRR, abs/2412.01317.
19. Yuan, J., Li, X., Cheng, C., Liu, J., Guo, R., Cai, S., Yao, C., Yang, F., Yi, X., and Wu, C. (2021). Oneflow: Redesign the distributed deep learning framework from scratch. arXiv.
20. Bi, R., Xu, T., Xu, M., and Chen, E. (2022, January 18–20). PaddlePaddle: A Production-Oriented Deep Learning Platform Facilitating the Competency of Enterprises. Proceedings of the 24th IEEE Int Conf on High Performance Computing & Communications; 8th Int Conf on Data Science & Systems; 20th Int Conf on Smart City; 8th Int Conf on Dependability in Sensor, Cloud & Big Data Systems & Application, HPCC/DSS/SmartCity/DependSys 2022, Hainan, China.10.1109/HPCC-DSS-SmartCity-DependSys57074.2022.00046 ↗
21. Tong, Z., Du, N., Song, X., and Wang, X. (2021, January 19–22). Study on MindSpore Deep Learning Framework. Proceedings of the 17th International Conference on Computational Intelligence and Security CIS 2021, Chengdu, China.10.1109/CIS54983.2021.00046 ↗
22. Zhang, X., Jiang, W., Shen, C., Li, Q., Wang, Q., Lin, C., and Guan, X. (2024). A Survey of Deep Learning Library Testing Methods. CoRR, abs/2404.17871.
23. Gao, Y., Xiong, Y., Gao, X., Jia, K., Pan, J., Bi, Y., Dai, Y., Sun, J., Guo, Q., and Wang, M. (2023). Retrieval-Augmented Generation for Large Language Models: A Survey. CoRR, abs/2312.10997.
24. Wooldridge, M.J., Dy, J.G., and Natarajan, S. (, January 20–27). Benchmarking Large Language Models in Retrieval-Augmented Generation. Proceedings of the Thirty-Eighth AAAI Conference on Artificial Intelligence, AAAI 2024, Thirty-Sixth Conference on Innovative Applications of Artificial Intelligence, IAAI 2024, Fourteenth Symposium on Educational Advances in Artificial Intelligence, EAAI 2014, Vancouver, BC, Canada.
25. Sheng, Z., Wu, F., Zuo, X., Li, C., Qiao, Y., and Lei, H. (2024, January 22–24). Research on the LLM-Driven Vulnerability Detection System Using LProtector. Proceedings of the 2024 IEEE 4th International Conference on Data Science and Computer Application (ICDSCA), Dalian, China.10.1109/ICDSCA63855.2024.10859408 ↗
26. Du, X., Zheng, G., Wang, K., Feng, J., Deng, W., Liu, M., Chen, B., Peng, X., Ma, T., and Lou, Y. (2024). Vul-RAG: Enhancing LLM-based Vulnerability Detection via Knowledge-level RAG. CoRR, abs/2406.11147.
27. Yoon, M.J., Yoo, S.M., Park, J.H., and Park, K.W. (2024, January 11–13). Toward a Synergistic Vulnerability Analysis Enhanced with a Multi-Level RAG Model. Proceedings of the 2024 International Conference on AI x Data and Knowledge Engineering (AIxDKE), Tokyo, Japan.10.1109/AIxDKE63520.2024.00033 ↗
28. Christakis, M., and Pradel, M. (2024, January 16–20). Large Language Models Can Connect the Dots: Exploring Model Optimization Bugs with Domain Knowledge-Aware Prompts. Proceedings of the 33rd ACM SIGSOFT International Symposium on Software Testing and Analysis, ISSTA 2024, Vienna, Austria.
29. Efficient and Robust Approximate Nearest Neighbor Search Using Hierarchical Navigable Small World Graphs10.1109/TPAMI.2018.2889473 ↗
30. Oh, A., Naumann, T., Globerson, A., Saenko, K., Hardt, M., and Levine, S. (2023, January 10–16). Non-Asymptotic Analysis of a UCB-based Top Two Algorithm. Proceedings of the Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA.
31. Liu, A., Feng, B., Xue, B., Wang, B., Wu, B., Lu, C., Zhao, C., Deng, C., Zhang, C., and Ruan, C. (2024). DeepSeek-V3 Technical Report. arXiv.
32. Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., and Antiga, L. (2019). PyTorch: An Imperative Style, High-Performance Deep Learning Library. Advances in Neural Information Processing Systems 32, Curran Associates, Inc.
33. Abadi, M., Agarwal, A., Barham, P., Brevdo, E., Chen, Z., Citro, C., Corrado, G.S., Davis, A., Dean, J., and Devin, M. (2025, September 24). TensorFlow: Large-Scale Machine Learning on Heterogeneous Systems. Available online: https://www.tensorflow.org/.
34. DeepSeek-AI (2025). DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning. arXiv.