SemCoder: Training Code Language Models with Comprehensive Semantics Reasoning
Yangruibo Ding, Jinjun Peng, Marcus J. Min, Gail Kaiser, Junfeng Yang,, Baishakhi Ray

TL;DR
This paper introduces SemCoder, a 6.7B parameter code language model trained with monologue reasoning to understand comprehensive code semantics, significantly improving performance on code generation and reasoning tasks.
Contribution
We propose a novel monologue reasoning training strategy for Code LLMs, enabling deeper semantic understanding and improved performance on complex coding tasks.
Findings
SemCoder achieves 79.3% on HumanEval, surpassing GPT-3.5-turbo.
It demonstrates effective reasoning about code semantics and execution effects.
Monologue reasoning enhances the integration of multiple semantic dimensions.
Abstract
Code Large Language Models (Code LLMs) have excelled at tasks like code completion but often miss deeper semantics such as execution effects and dynamic states. This paper aims to bridge the gap between Code LLMs' reliance on static text data and the need for semantic understanding for complex tasks like debugging and program repair. We introduce a novel strategy, monologue reasoning, to train Code LLMs to reason comprehensive semantics, encompassing high-level functional descriptions, local execution effects of individual statements, and overall input/output behavior, thereby linking static code text with dynamic execution states. We begin by collecting PyX, a clean Python corpus of fully executable code samples with functional descriptions and test cases. We propose training Code LLMs not only to write code but also to understand code semantics by reasoning about key properties,…
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.
Code & Models
Videos
Taxonomy
TopicsNatural Language Processing Techniques · Semantic Web and Ontologies · Service-Oriented Architecture and Web Services
MethodsRefunds@Expedia|||How do I get a full refund from Expedia? · 15 Ways to Contact How can i speak to someone at Delta Airlines · Linear Layer · Adam · Cosine Annealing · Attention Is All You Need · Residual Connection · Multi-Head Attention · Dropout · Dense Connections
