Code

StarCoder 2

Paper preview
StarCoder 2
Paper summary

BigCode releases StarCoder 2, an open family of code LLMs at 3B, 7B, and 15B parameters trained on The Stack v2, a much larger and cleaner code corpus than the original StarCoder.

Ask this paper

Key points
01

Multi-org collaboration: ServiceNow trains the 3B, Hugging Face the 7B, and NVIDIA the 15B, with a shared data pipeline and recipe.

02

Training setup: 15B variant is trained on 4T+ tokens across 600+ programming languages with a 16K-token context window, grouped-query attention, and a fill-in-the-middle objective.

03

Benchmark punch above its weight: StarCoder2-15B matches 33B+ models on many code completion, reasoning, and PAL-augmented math tasks, while the 3B matches the original 15B StarCoder.

04

The Stack v2: Released alongside the models is a 67.5TB code dataset derived from Software Heritage, significantly improving on The Stack v1 in both scale and provenance.

Abstract

The BigCode project, an open-scientific collaboration focused on the responsible development of Large Language Models for Code (Code LLMs), introduces StarCoder2. In partnership with Software Heritage (SWH), we build The Stack v2 on top of the digital commons of their source code archive. Alongside the SWH repositories spanning 619 programming languages, we carefully select other high-quality data sources, such as GitHub pull requests, Kaggle notebooks, and code documentation. This results in a training set that is 4x larger than the first StarCoder dataset. We train StarCoder2 models with 3B, 7B, and 15B parameters on 3.3 to 4.3 trillion tokens and thoroughly evaluate them on a comprehensive set of Code LLM benchmarks. We find that our small model, StarCoder2-3B, outperforms other Code LLMs of similar size on most benchmarks, and also outperforms StarCoderBase-15B. Our large model, StarCoder2- 15B, significantly outperforms other models of comparable size. In addition, it matches or outperforms CodeLlama-34B, a model more than twice its size. Although DeepSeekCoder- 33B is the best-performing model at code completion for high-resource languages, we find that StarCoder2-15B outperforms it on math and code reasoning benchmarks, as well as several low-resource languages. We make the model weights available under an OpenRAIL license and ensure full transparency regarding the training data by releasing the SoftWare Heritage persistent IDentifiers (SWHIDs) of the source code data.

Every Monday
Get next week’s papers.
Subscribe on Substack