Developer Tools

Study: Continual Pre-Training Beats Training from Scratch for SE LMs

⚡CPT gives small domain gains without hurting general language understanding.

Deep Dive

A new arXiv study by Fabian C. Peña and Steffen Herbold investigates how to best adapt language models (LMs) to software engineering (SE) texts, such as issue reports, commit messages, and developer discussions. The researchers compared two approaches: continual pre-training (CPT) from an existing general LM and pre-training from scratch (PTS) on a new SE corpus they created. To ensure fairness, they controlled for token count and compute budget across model families and sizes. They evaluated both domain-specific adaptation using the SELU benchmark and general-language understanding using SuperGLUE.

Results show that reusing an existing LM via CPT dominates training a domain-native one from scratch. CPT yields only small and mostly statistically insignificant gains on domain tasks while leaving general-language understanding essentially intact. In contrast, PTS incurs a large and consistent penalty on both domain and general understanding. The only exception is for very small LMs under a token-rich budget, where PTS becomes competitive. The authors distill these findings into practical guidelines for practitioners and release their corpus and pre-trained models in a replication kit. The paper highlights that the cost of domain adaptation from scratch is rarely justified, encouraging engineers to leverage existing LMs with targeted fine-tuning instead.

Key Points
  • Continual pre-training on SE texts (CPT) yields small domain gains but leaves general understanding unchanged.
  • Pre-training from scratch (PTS) on SE texts pays a large penalty on both domain and general benchmarks.
  • Only small LMs given abundant tokens benefit from PTS; otherwise, reusing an existing LM via CPT is optimal.

Why It Matters

Provides data-backed guidance for adapting LMs to software engineering without sacrificing general performance.

📬 Get the top 10 AI stories daily