Research map / Large language models / Reasoning and chain of thought
CodeCrash: Exposing LLM Fragility to Misleading Natural Language in Code Reasoning
Read the paperCheck your idea against 108,967 papers
AI-extracted summary. Written by AI from the paper's full text. Numbers and claims can be wrong or missing context, so check the paper before you cite or build on it.
Introduces CodeCrash, a stress-test benchmark of 1,279 CRUXEval/LiveCodeBench code-reasoning questions with structural and natural-language misleading perturbations, evaluating 17 LLMs and 3 reasoning models.
Problem
LLM code reasoning (output and input prediction) is unreliable under perturbations, and it is unclear whether models prioritize executable semantics over misleading natural-language cues in code such as comments, print statements, and hints.
Approach
Combines traditional structural perturbations (aggregated PSC-ALL) with NL-embedded misleading comments/prints (MCC, MPS) and plausible misleading hints (MHC) generated by GPT-4o and verified for functional equivalence, and measures PASS@1 degradation in direct, CoT, and large-reasoning-model settings.
Key results
- Across 17 LLMs, models lose on average 23.2% PASS@1 in direct output prediction under perturbations; CoT reduces the average drop to 13.8%.
- Under MHC on LCB, Claude-3.5-Haiku and Sonnet drop over 40%, and LiveCodeBench drops average 33.0% versus 12.4% on CRUXEval.
- LRMs use 2-3x more reasoning tokens under MHC; QwQ-32B produced over 32k tokens in a collapse case with about 12k repeated "Hmm" tokens.
Measured effects reported in the paper
| What was changed | Where | Measured | Effect |
|---|---|---|---|
| Apply PSC-ALL structural perturbations | LLMs in direct inference · CRUX and LCB output prediction | relative PASS@1 degradation: −24.6% | Hurt |
| Add misleading code comments (MCC) | LLMs in direct inference · CRUX and LCB output prediction | relative PASS@1 degradation: −24.3% | Hurt |
| Add misleading print statements (MPS) | LLMs in direct inference · CRUX and LCB output prediction | relative PASS@1 degradation: −23.8% | Hurt |
| Add plausible but incorrect hint comments (MHC) | LLMs in direct inference · CRUX and LCB output prediction | relative PASS@1 degradation: −20.1% | Hurt |
| Use CoT instead of direct inference | LLMs · CRUX and LCB output prediction | relative PASS@1 degradation: −23.2% -> −13.8% | Helped |
| Add misleading code comments | LLMs · CRUX input prediction | relative PASS@1 degradation: +4.1% | Helped |
| Add plausible but incorrect hint comments | LLMs · CRUX input prediction | relative PASS@1 degradation: −20.1% | Hurt |
| Increase reasoning effort from o3-Mini-Low to o3-Mini-High under MHC | o3-Mini · CRUX and LCB output prediction | relative PASS@1 degradation: −11.1% -> −13.4% (CRUX); −19.8% -> −28.4% (LCB) | Hurt |
| Increase MCC injection probability | LLMs and LRMs · Output prediction | relative PASS@1 degradation | Hurt |
| Instruct models to ignore comments | LLMs under MCC and MHC · CRUX and LCB output prediction | PASS@1: DeepSeek-V3 Direct MCC: 39.7 -> 41.8 | No clear effect |
| Refactor code before reasoning | GPT-4o · CRUX and LCB output prediction | PASS@1: PSC-ALL: 46.2 -> 55.3; MCC: 45.7 -> 41.1; MPS: 49.6 -> 54.9 | Mixed |
| Use CoT for LRM reasoning under MHC | o3-Mini · CRUX and LCB output prediction | relative PASS@1 degradation: −11.1% -> −13.4% (CRUX); −19.8% -> −28.4% (LCB) | Hurt |
Surprising findings
- Contextual misleading cues (MCC/MPS) improve input-prediction accuracy because models shortcut around branches, when multiple valid inputs exist.
- Explicitly instructing models to ignore comments only partially helps, and a refactoring agent can degrade performance under MCC.
Limitations
- Experiments use direct inference with limited samples (N=3) due to resource constraints.
- Misleading messages are generated by GPT-4o and manually filtered, so perturbations depend on a single generator.
- Cross-language validation is limited to JavaScript translation on a few models.
Experimental setup
Datasets: CRUXEval LiveCodeBench
Benchmarks: CRUXEval LiveCodeBench
Metrics: PASS@1 relative degradation reasoning token usage
Baselines: GPT-4o-Mini Claude-3.5-Sonnet DeepSeek-V3 Qwen2.5-72B-Instruct o3-mini DeepSeek-R1 QwQ-32B
Builds on: CRUXEval LiveCodeBench CCTEST Chain-of-thought prompting
Closest papers by meaning
- Unveiling the Magic of Code Reasoning through Hypothesis Decomposition and Amendment (ICLR 2025 · similarity 0.92)
- Sample Smart, Not Hard: Correctness-First Decoding for Better Reasoning in LLMs (ICLR 2026 · similarity 0.90)
- DyCodeEval: Dynamic Benchmarking of Reasoning Capabilities in Code Large Language Models Under Data Contamination (ICML 2025 · similarity 0.89)
- RE-IMAGINE: Symbolic Benchmark Synthesis for Reasoning Evaluation (ICML 2025 · similarity 0.89)
- Reasoning-as-Logic-Units: Scaling Test-Time Reasoning in Large Language Models Through Logic Unit Alignment (ICML 2025 · similarity 0.89)
- The Illusion of Thinking: Understanding the Strengths and Limitations of Reasoning Models via the Lens of Problem Complexity (NeurIPS 2025 · similarity 0.89)
Writing a paper in this area? scime draft is a free LaTeX editor with AI included, real-time co-authors and a check of your references and venue rules before you submit. It also imports OpenAI Prism projects.
