TY - JOUR
T1 - Repairing DNN Numerical Defects with Semantic-Driven Knowledge Graph Retrieval
AU - Liu, Jingyu
AU - Zhou, Qidi
AU - Ai, Jun
AU - Shi, Tao
N1 - Publisher Copyright:
© 2026 by the authors.
PY - 2026/2
Y1 - 2026/2
N2 - 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.
AB - 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.
KW - deep neural networks
KW - numerical defect repair
KW - retrieval-augmented generation
KW - semantic concept formalization
UR - https://www.scopus.com/pages/publications/105031489068
U2 - 10.3390/app16042124
DO - 10.3390/app16042124
M3 - 文章
AN - SCOPUS:105031489068
SN - 2076-3417
VL - 16
JO - Applied Sciences (Switzerland)
JF - Applied Sciences (Switzerland)
IS - 4
M1 - 2124
ER -