GUARD: Dual-Agent based Backdoor Defense on Chain-of-Thought in Neural Code Generation

With the widespread application of large language models in code generation, recent studies demonstrate that employing additional Chain-of-Thought generation models can significantly enhance code generation performance by providing explicit reasoning steps.However, as external components, CoT models are particularly vulnerable to backdoor attacks, which existing defense mechanisms often fail to detect effectively.To address this challenge, we propose GUARD, a novel dualagent defense framework specifically designed to counter CoT backdoor attacks in neural code generation.GUARD integrates two core components: GUARD-Judge, which identifies suspicious CoT steps and potential triggers through comprehensive analysis, and GUARD-Repair, which employs a retrieval-augmented generation approach to regenerate secure CoT steps for identified anomalies.Experimental results show that GUARD effectively mitigates attacks while maintaining generation quality, advancing secure code generation systems.

Authors

Institutions

Publication Details

Journal
Proceedings/Proceedings of the ... International Conference on Software Engineering and Knowledge Engineering
Published
2025-09-29
DOI
https://doi.org/10.18293/seke2025-018
Primary Topic
Advanced Malware Detection Techniques
Type
article
Field-Weighted Citation Impact
0.00

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

GUARD: Dual-Agent based Backdoor Defense on Chain-of-Thought in Neural Code Generation

Tian Zhang, Naizhu Jin, Zhong Li, Qingkai Zeng
Proceedings/Proceedings of the ... International Conference on Software Engineering and Knowledge Engineering
Advanced Malware Detection Techniques
article

GUARD: Dual-Agent based Backdoor Defense on Chain-of-Thought in Neural Code Generation

Tian Zhang, Naizhu Jin, Zhong Li, Qingkai Zeng
article en

Abstract

With the widespread application of large language models in code generation, recent studies demonstrate that employing additional Chain-of-Thought generation models can significantly enhance code generation performance by providing explicit reasoning steps.However, as external components, CoT models are particularly vulnerable to backdoor attacks, which existing defense mechanisms often fail to detect effectively.To address this challenge, we propose GUARD, a novel dualagent defense framework specifically designed to counter CoT backdoor attacks in neural code generation.GUARD integrates two core components: GUARD-Judge, which identifies suspicious CoT steps and potential triggers through comprehensive analysis, and GUARD-Repair, which employs a retrieval-augmented generation approach to regenerate secure CoT steps for identified anomalies.Experimental results show that GUARD effectively mitigates attacks while maintaining generation quality, advancing secure code generation systems.

Proceedings/Proceedings of the ... International Conference on Software Engineering and Knowledge EngineeringVol. 2025
Nanjing University (CN)
Government of Jiangsu Province, Natural Science Foundation of Jiangsu Province
Openalex Percentile: Top 63%
Advanced Malware Detection Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.