Mitigating Cognitive Vulnerabilities in Code Generation via Multi-Agent Adversarial Debate
Shuofu Liu, Quanjiang Guo, Xiao Liu, Ying Liu
摘要
Although Large Language Models (LLMs) have demonstrated significant proficiency in code generation, their monolithic and correlation-driven nature renders them susceptible to systematic cognitive biases, deficient counterfactual reasoning, and adversarial manipulation—a characteristic we term cognitive vulnerability. Such vulnerabilities compromise the reliability and security of AI-assisted software development, potentially resulting in code that is not only functionally incorrect but also biased, insecure, and difficult to validate using conventional testing paradigms. While recent multi-agent systems enhance workflow efficiency via task decomposition, they do not fundamentally address these reasoning deficits. This highlights the need for a framework capable of proactively identifying and mitigating the cognitive flaws of an LLM during the reasoning process. To address this challenge, we introduce CodeForge, a multi-agent adversarial reasoning framework that reframes code generation as a cognitive crucible. This process involves a structured debate among three specialized agents—an Optimist, a Pragmatist, and an Adversarial Skeptic—who iteratively cross-examine and refine solution plans. Following convergence, an adversarial verification module systematically generates counterfactual perturbations to stress-test and enhance the final plan. Comprehensive evaluations on the HumanEval and MBPP benchmarks demonstrate that CodeForge significantly outperforms state-of-the-art methods, achieving a pass@1 of 97.3% with GPT-4. Ablation studies confirm the necessity of both the adversarial dialogue and counterfactual verification components. This work represents a shift from passive debugging to proactive cognitive hardening, establishing a pathway toward more trustworthy automated software engineering.
问 Lune
几分钟看清这篇 Paper 的位置,不用再花一下午。
Lune 能读引用它和与它最相关的顶会 Paper,讲清它说了什么、后来怎样、哪里站不住,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
相关 Paper
- Three Heads Are Better Than One: A Multi-perspective Reasoning Framework for Enhanced Vulnerability DetectionXin Peng, Bo Lin, Jing Wang, Xiaoling Li 等FSE 2026 · 1 次引用
- AI-for-Science Low-code Platform with Bayesian Adversarial Multi-Agent FrameworkZihang Zeng, Jiaquan Zhang, Pengze Li, Yuan Qi 等ICLR 2026
- AdverMCTS: Combating Pseudo-Correctness in Code Generation via Adversarial Monte Carlo Tree SearchQingyao Li, Weiwen Liu, Weinan Zhang, Yong Yu 等ICML 2026
- A.S.E: A Repository-Level Benchmark for Evaluating Security in AI-Generated CodeKeke Lian, Wang Bin, Lei Zhang, Libo Chen 等ACL Findings 2026 · 3 次引用
- Cognitive Biases in LLM-Assisted Software DevelopmentXinyi Zhou, Zeinadsadat Saghi, Sadra Sabouri, Rahul Pandita 等ICSE 2026
