atlas

Research map / Large language models / Agents, code and math

SemCoder: Training Code Language Models with Comprehensive Semantics Reasoning

NeurIPS 2024 · Large language models › Agents, code and math · approach: Code generation benchmarks · 13 citations (OpenAlex)

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 SemCoder, a 6.7B Code LLM trained with monologue reasoning (forward/backward verbal execution reasoning) on executable Python data (PyX) and debugging data (PyX-R), matching or beating GPT-3.5-turbo on code generation and execution reasoning.

Problem

Code LLMs trained on static text struggle to reason about execution semantics, which hurts execution prediction, debugging, and self-refinement.

Approach

Train the model to verbalize code semantics (high-level functionality, abstract key properties, and step-by-step operational state changes via forward/backward monologues) using rejection-sampled LLM annotations verified by execution, instead of concrete scratchpad traces.

Key results

Measured effects reported in the paper

What was changedWhereMeasuredEffect
Train DeepSeekCoder 6.7B with comprehensive program semantics using SemCoderDeepSeekCoder 6.7B · CRUXEval-Ipass@1: 39.5 -> 62.5Helped
Train DeepSeekCoder 6.7B with comprehensive program semantics using SemCoderDeepSeekCoder 6.7B · CRUXEval-Opass@1: 41.2 -> 65.1Helped
Train DeepSeekCoder 6.7B with comprehensive program semantics using SemCoderDeepSeekCoder 6.7B · LiveCodeBench-Execpass@1: 36.1 -> 59.7Helped
Use monologue reasoning rather than few-shot prompting (ablation)DeepSeekCoder 6.7B · CRUXEval-Ipass@1: 39.5 -> 61.8Helped
Use monologue reasoning rather than Scratchpad (ablation)DeepSeekCoder 6.7B · CRUXEval-Opass@1: 50.6 -> 63.5Helped
Use monologue reasoning rather than NeXT trace format (ablation)DeepSeekCoder 6.7B · LiveCodeBench-Execpass@1: 32.2 -> 58.5Helped
Use monologue reasoning rather than concise concrete traces (ablation)DeepSeekCoder 6.7B · CRUXEval-Ipass@1: 52.1 -> 61.8Helped
Add extended Evol-instruct and partial CodeContest training dataSemCoder · LiveCodeBench-Litepass@1: 22.4 -> 27.5Helped
Add extended Evol-instruct and partial CodeContest training dataSemCoder · CRUXEval-Opass@1: 65.1 -> 63.9Hurt
Fine-tune on executable PyX instead of OSS-Instruct (ablation)DeepSeekCoder-based model · HumanEvalpass@1: 67.1 -> 70.1Helped
Fine-tune on executable PyX instead of OSS-Instruct (ablation)DeepSeekCoder-based model · MBPPpass@1: 77.5 -> 78.6No clear effect

Surprising findings

Limitations

Experimental setup

Datasets: PyX PyX-R Evol-Instruct CodeContest OSS-Instruct

Benchmarks: HumanEval MBPP LiveCodeBench-Lite CRUXEval LiveCodeBench-Exec EvalPlus

Metrics: pass@1

Baselines: GPT-3.5-Turbo CodeLlama StarCoder2 DeepSeekCoder Magicoder Llama-3.1-Instruct-8B Scratchpad NExT

Builds on: OSS-Instruct DeepSeek-Coder Scratchpad NExT Magicoder

Closest papers by meaning

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.

Open scime draft

Get the next scime Dispatch and a monthly field update

Free. We send a confirmation link first; every email has a one-click unsubscribe. Privacy