When LLMs Copy to Think: Uncovering Copy-Guided Attacks in Reasoning LLMs
Yue Li, Xiao Li, Hao Wu, Yue Zhang, Fengyuan Xu, Xiuzhen Cheng, Sheng Zhong

TL;DR
This paper uncovers Copy-Guided Attacks exploiting LLMs' copying tendencies to induce malicious behaviors, revealing vulnerabilities in reasoning LLMs used for code analysis and highlighting the need for defense strategies.
Contribution
It formalizes Copy-Guided Attacks, proposes a gradient-based trigger synthesis method, and empirically demonstrates their effectiveness in manipulating reasoning LLM outputs.
Findings
CGA can induce infinite loops and semantic distortions
Effective in targeted scenarios but challenging to generalize
Highlights critical vulnerabilities in LLM-based code analysis
Abstract
Large Language Models (LLMs) have become integral to automated code analysis, enabling tasks such as vulnerability detection and code comprehension. However, their integration introduces novel attack surfaces. In this paper, we identify and investigate a new class of prompt-based attacks, termed Copy-Guided Attacks (CGA), which exploit the inherent copying tendencies of reasoning-capable LLMs. By injecting carefully crafted triggers into external code snippets, adversaries can induce the model to replicate malicious content during inference. This behavior enables two classes of vulnerabilities: inference length manipulation, where the model generates abnormally short or excessively long reasoning traces; and inference result manipulation, where the model produces misleading or incorrect conclusions. We formalize CGA as an optimization problem and propose a gradient-based approach to…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsArtificial Intelligence in Law · Law, AI, and Intellectual Property · Law, Economics, and Judicial Systems
