ChatPaper.aiChatPaper

LLM에서의 코드 유도 추론에 관하여

On Code-Induced Reasoning in LLMs

September 25, 2025
저자: Abdul Waheed, Zhen Wu, Carolyn Rosé, Daphne Ippolito
cs.AI

초록

코드 데이터가 대형 언어 모델(LLM)의 추론 능력을 향상시킨다는 것이 입증되었지만, 코드의 어떤 측면이 가장 큰 영향을 미치는지는 여전히 명확하지 않습니다. 우리는 이 질문을 체계적이고 데이터 중심의 프레임워크를 통해 조사합니다. 우리는 10가지 프로그래밍 언어로 구성된 병렬 명령어 데이터셋을 구축하고, 코드의 구조적 또는 의미적 속성을 선택적으로 방해하는 제어된 변형을 적용합니다. 그런 다음 5개 모델 패밀리와 8가지 규모의 LLM을 각 변형에 대해 미세 조정하고, 자연어, 수학, 코드 작업에서의 성능을 평가합니다. 3,331개의 실험을 통해 우리는 LLM이 특히 수학 및 코드 작업에서 의미적 변형보다 구조적 변형에 더 취약하다는 것을 보여줍니다. 의사코드와 플로우차트와 같은 적절한 추상화는 코드만큼 효과적일 수 있으며, 원래 구문을 따르지 않고 동일한 정보를 더 적은 토큰으로 인코딩하면 종종 성능을 유지하거나 심지어 향상시킬 수 있습니다. 놀랍게도, 표면적 규칙성이 유지되는 경우 오류가 있는 코드도 여전히 경쟁력을 유지할 수 있습니다. 마지막으로, 구문 스타일도 작업별 이득을 형성하며, Python은 자연어 추론에 유리하고 Java 및 Rust와 같은 저수준 언어는 수학에 유리합니다. 우리의 체계적인 프레임워크를 통해 코드의 다양한 속성이 추론에 어떻게 영향을 미치는지 통찰을 제공하고, LLM의 추론 능력을 향상시키기 위한 훈련 데이터 설계에 정보를 제공하고자 합니다.
English
Code data has been shown to enhance the reasoning capabilities of large language models (LLMs), but it remains unclear which aspects of code are most responsible. We investigate this question with a systematic, data-centric framework. We construct parallel instruction datasets in ten programming languages and apply controlled perturbations that selectively disrupt structural or semantic properties of code. We then finetune LLMs from five model families and eight scales on each variant and evaluate their performance on natural language, math, and code tasks. Across 3,331 experiments, our results show that LLMs are more vulnerable to structural perturbations than semantic ones, particularly on math and code tasks. Appropriate abstractions like pseudocode and flowcharts can be as effective as code, while encoding the same information with fewer tokens without adhering to original syntax can often retain or even improve performance. Remarkably, even corrupted code with misleading signals remains competitive when surface-level regularities persist. Finally, syntactic styles also shape task-specific gains with Python favoring natural language reasoning and lower-level languages such as Java and Rust favoring math. Through our systematic framework, we aim to provide insight into how different properties of code influence reasoning and inform the design of training data for enhancing LLM reasoning capabilities.
PDF22October 8, 2025