Applied Sciences, Vol. 16, Pages 2124: Repairing DNN Numerical Defects with Semantic-Driven Knowledge Graph Retrieval
Applied Sciences doi: 10.3390/app16042124
Authors:
Jingyu Liu
Qidi Zhou
Jun Ai
Tao Shi
Ensuring numerical robustness in deep neural networks (DNNs) is critical, as defects like overflow or NaN can cause silent failures. However, automated repair is challenged by fragmented domain knowledge and the semantic gap for general-purpose large language models (LLMs). This work proposes NCKG, a Numerical–Conceptual Knowledge Graph-based method for retrieval-augmented repair of DNN numerical defects. NCKG introduces a unified semantic formalization that explicitly models DNN execution contexts, numerical defects, mitigation methods, and constraint knowledge, transforming dispersed defect knowledge into a consistent, machine-interpretable representation. Based on this formalization, a multi-view semantic graph index is constructed, enabling a hybrid semantic-driven retrieval mechanism that combines structure-aware graph matching with vector similarity. Retrieved, semantically aligned defect–repair knowledge is then used to guide LLMs in generating context-aware repairs. Experimental results demonstrate that NCKG significantly outperforms standard retrieval baselines and consistently improves the quality and correctness of LLM-generated fixes across different model scales. This work demonstrates that explicit semantic structuring and retrieval of domain knowledge are crucial for enabling reliable, automated numerical defect repair in DNNs.
Source link
Jingyu Liu www.mdpi.com
