Chain-of-Code Collapse
Large Language Models (LLMs) utilized for code generation exhibit a vulnerability termed "Chain-of-Code Collapse" (CoCC), where the models fail to generate correct code when presented with semantically faithful but adversarially structured prompts. By applying transformations such as domain shifting (renaming variables/contexts), adding distracting constraints (irrelevant but plausible rules), or inverting objectives (negation), an attacker can cause the model to produce functionally incorrect…
Evaluated models: Gemini 2.5 Flash Preview, Gemini 2.0 Flash, Claude 3.7 Sonnet+5 more
- Gemini 2.5 Flash Preview
- Gemini 2.0 Flash
- Claude 3.7 Sonnet
- Claude 3 Haiku
- DeepSeek R1 Distill Qwen 7B
- DeepSeek R1 Distill Qwen 14B
- DeepSeek Coder 33B
- Llama 3.1 8B Instruct