DECoR: Boosting Coding LLMs Through Disciplined and Scalable Code Pre-Training Data Comment Rewriting
Haau-Sing Li, Ruizhe Jiang, Yongchi Zhao, Xiaosen Zheng, Man Ho Lam, Hongxin Li, Junhang Cheng, Tianyu Zheng, Jian Yang, Bryan Dai
Abstract
Code large language models (LLMs) are commonly pre-trained on corpora that include code-related natural language (NL) to strengthen text-code alignment. Code comments provide this alignment signal directly within source files, but large-scale code corpora are often sparsely or poorly commented. We propose Disciplined and Efficient Code Pre-Training Data Rewriting (DECoR), a pipeline for enriching comments in code pre-training data. DECoR constructs rewriting supervision from well-documented code and trains a 1.5B-parameter rewriter with reinforcement learning (RL). The reward combines an LLM judge's assessment of the comments with a penalty for edits to the underlying Python. During RL, the rewriter learns to document parameters and return values in structured comments. Applying DECoR to code pre-training corpora produces approximately 52B tokens of comment-enriched data. In from-scratch experiments with 1B and 30B-A3B models, DECoR yields the largest gains on BigCodeBench. On the Stack, the 1B model outperforms both baselines on BigCodeBench at a fixed token budget and at checkpoints near the first four epoch boundaries. The baselines use either the original data or rewrites from a model trained with supervised fine-tuning. Longer rewrites change how often the model sees each file within a token budget, making it difficult to isolate the effects of comment content, length, and repetition. See our GitHub repository for data and code.
Create a lesson
Related papers
Generative Curation Yields Bigger and Better Data for Pretraining LLMs
Shared title terminologycs.CLMichael J. Ryan, William Held, Suhas Kotha et al.
Adaptive Synchronous Text Stream Refinement via Monotonic Latency-Aware Training
Shared title terminologycs.CLKhanh Le, Kiet Anh Hoang, Bao Nguyen et al.
Training-Free Improvement with Translation-Instruction Soft-Token Injection for Indonesian Retrieval Augmented Generation
Shared title terminologycs.CLTjeng Wawan Cenggoro, Ganjar Widiatmansyah, Evan Purnama
Shifted in Training, Recovered at Inference: Recentering Thinking Models in Privileged On-Policy Self-Distillation
Shared title terminologycs.CLRuijie Wang, Bowen Fan, Tarcisio Mendes de Farias et al.
When LLMs Speak for Groups: Demographic Misrepresentation in Synthetic Survey Responses
Shared title terminologycs.CLMartin Lukk, Neemias B. da Silva, Ali Sutani et al.
DataSmith: Synthesizing Multilingual Instruction-Tuning Data with the Help of External Tools
Shared title terminologycs.CLLester James V. Miranda, Anna Korhonen