Pre-Training on Software Engineering Texts: Effects on Domain Adaptation and General-Language Understanding
Summary
This study investigates the effectiveness of adapting Language Models (LMs) for Software Engineering (SE) textual artifacts, such as issues and commit messages, by comparing Continual Pre-Training (CPT) against Pre-Training from Scratch (PTS). Researchers utilized a new 18.5B-token SE corpus, compiled from GitHub, Stack Overflow, Jira, and arXiv, and evaluated LMs ranging from 108M to 7.2B parameters. Experiments were conducted under controlled constant-token (3.3B tokens) and compute-matched (\$6.01\times e^{18}$ FLOPS) budgets. The findings indicate that reusing an existing LM via CPT generally outperforms training a domain-native LM from scratch. CPT yielded small, often inconclusive, domain adaptation gains (measured by SELU) while largely preserving general-language understanding (measured by SuperGLUE). Conversely, PTS incurred significant, usually decisive, penalties on both domain adaptation and general-language understanding, becoming competitive only for smaller LMs with token-rich budgets.
Key takeaway
For Machine Learning Engineers adapting LMs for software engineering textual artifacts, you should prioritize continual pre-training (CPT) over training from scratch (PTS). CPT offers modest domain-specific gains while largely retaining general-language understanding, making it a low-risk refinement. Reserve PTS only when no suitable pre-trained checkpoint exists. Always consider both token and compute budgets, and evaluate performance using both SE-specific and general-language benchmarks to avoid misleading conclusions.
Key insights
Continual pre-training on SE text offers modest domain gains with minimal general-language impact, outperforming training from scratch.
Principles
- CPT generally outperforms PTS for SE text adaptation.
- CPT offers modest domain gains, preserving general-language understanding.
- PTS incurs significant penalties on domain and general understanding.
Method
The study compared Continual Pre-Training (CPT) and Pre-Training from Scratch (PTS) on a new 18.5B-token SE corpus (GitHub, Stack Overflow, Jira, arXiv). Experiments controlled for constant-token (3.3B) and compute-matched (\$6.01\times e^{18}$ FLOPS) budgets, evaluating LMs (108M-7.2B params) on SELU and SuperGLUE benchmarks.
In practice
- Default to existing LMs for SE text tasks.
- Consider CPT for weak baselines or code-focused LMs.
- Evaluate on both SE-specific and general-language benchmarks.
Topics
- Language Model Pre-training
- Software Engineering NLP
- Domain Adaptation
- Continual Pre-Training
- Pre-Training from Scratch
- SELU Benchmark
- SuperGLUE Benchmark
Code references
Best for: Research Scientist, AI Engineer, AI Scientist, Machine Learning Engineer, NLP Engineer
Related on AIssential
Editorial summary, takeaway, and curation by AIssential. Original article published by cs.SE updates on arXiv.org.