Hugging Face & BigCode · 2026-07-23 · major
The Stack v3 — 5T tokens of code across 224M GitHub repos, open license
The Stack v3 is Hugging Face and BigCode's new open code corpus for pretraining. The training split holds 4.9T deduplicated, filtered tokens across 15.9 TB; the full corpus covers 224M GitHub repos.

A fresh 5-trillion-token, 770-language open code corpus that resets the pretraining baseline for code LLMs.
Key specs
| Training tokens | 4.9T |
|---|---|
| Training size | 15.9 TB |
| Repositories | 224M |
| Languages | 770 |
Quick facts
| Maker | Hugging Face & BigCode |
|---|---|
| Training split | 15.9 TB, 4.9T tokens, 173M examples |
| Full corpus | 114 TB, ~5T tokens, 224M repos, 44B files |
| Languages | 770 programming + markup |
| Source | GitHub crawl completed August 2025 |
| License | ODC-BY v1.0 (per-file licenses preserved) |
| Availability | stack-v3-train on Hugging Face; stack-v3-full via HF Storage Bucket |
What is it?
The Stack v3 is the third generation of Hugging Face and BigCode's public code dataset for training code models. Its filtered training split holds 4.9T tokens across 15.9 TB and 173 million examples; the raw corpus behind it spans 224 million GitHub repositories, 43.9 billion files, and 114 TB.
How does it work?
The BigCode team re-crawled GitHub at each repo's latest default-branch commit through August 2025, inlined decoded UTF-8 source text into the rows, then near-deduplicated with MinHash, filtered restrictive licenses, and redacted PII to produce stack-v3-train. Rebuilding also surfaced a v2 tokenization bug that had over-deduplicated the older corpus, so v3 keeps roughly two years more code plus tokens v2 had wrongly dropped.
Why does it matter?
The Stack v3 gives labs training open code LLMs a current, license-clean starting point — two years newer than v2 and self-contained (no more re-fetching source from GitHub). At 5T tokens across 770 languages under ODC-BY, it sits directly upstream of the next generation of open StarCoder-style models and the coding tools built on them.
Who is it for?
code-LLM pretrainers, dataset researchers, tool builders
Frequently asked questions
- How is The Stack v3 different from The Stack v2?
- The Stack v3 re-crawls GitHub through August 2025 (v2 stopped in 2023), covering 224 million repos and 44 billion files. Source text is inlined instead of stored as pointers, and the team fixed a v2 MinHash shingle bug that had over-deduplicated the corpus — v3 keeps roughly 5T tokens after filtering.
- What is filtered out of stack-v3-train?
- The training split of The Stack v3 removes restrictively-licensed code, near-duplicates, and personally-identifiable information (PII), and keeps only the default branch of each repo — no git history. Non-code binary files are dropped; contents are stored inline as decoded UTF-8 so consumers do not need to re-fetch from GitHub.
- How do I remove my code from The Stack v3?
- The BigCode team hosts an 'Am I in The Stack?' Hugging Face Space so authors can check inclusion by GitHub username. Individual files stay under their original licenses, which the ODC-BY v1.0 dataset license requires downstream users to respect.
- Can I stream the dataset instead of downloading 15.9 TB?
- Yes. The Stack v3's training split is Parquet with Snappy compression across 1,023 partitions, so `datasets.load_dataset('HuggingFaceCode/stack-v3-train', streaming=True)` works without a full download. The larger 114 TB stack-v3-full lives in an HF Storage Bucket with cluster IDs so you can rebuild your own dedup.
Try it
https://huggingface.co/datasets/HuggingFaceCode/stack-v3-train