# The Stack v2

- **ID:** 1179
- **Kind:** dataset
- **URL:** https://huggingface.co/datasets/bigcode/the-stack-v2
- **Authors:** bigcode
- **Published:** 2024
- **Source:** huggingface
- **Language:** code
- **Access:** Free metadata after gate; bulk content agreement required
- **License:** other / per-file SPDX; ToU requires original license compliance + SWH LLM principles
- **License family:** Other (auto-classified)
- **Topics:** code pretraining; multilingual source code; Software Heritage
- **Added:** 2026-09-10
- **Verified:** 2026-09-10
- **Page:** https://papers.projxon.ai/entries/1179

## Summary

Open reproducible Code LLM pretraining corpus with license/provenance metadata and developer opt-out

## From the source (fetched 2026-10-03)

- **Repository:** bigcode/the-stack-v2 (Hugging Face)
- **Created:** Feb 26, 2024 (Hugging Face)
- **Last updated:** Aug 3, 2026 (Hugging Face)
- **Downloads (last month):** 6,031 (Hugging Face)
- **Likes:** 638 (Hugging Face)
- **Modalities:** code, text (Hugging Face)
- **Tasks:** text-generation (Hugging Face)
- **Gated:** yes (Hugging Face)

## Dataset profile

- **Scale:** Full 67.5TB / >3B files / 104.2M repos; dedup 32.1TB; train-full ~900B tokens. Hub metadata usedStorage ~427 GB. size_categories unknown.
- **Format:** Parquet metadata per language config (600+); contents fetched via blob_id from s3://softwareheritage/content/
- **Type:** Code corpus / SWHID + metadata (contents on SWH S3)
- **License:** other / per-file SPDX; ToU requires original license compliance + SWH LLM principles
- **Cost:** Free metadata after gate; bulk content agreement required
- **Languages:** 658 langs (card); paper 619. High-resource langs (C, JS, etc.) overrepresented vs niche (Julia, Scala). Natural language in comments mostly English.
- **Modality:** Source code / text. No images.
- **Domain:** code pretraining; multilingual source code; Software Heritage
- **Time period:** SWH graph 2023-09-06; GH Archive to 2023-09-14. Paper 2024-02-29. Hub created 2024-02-26; lastModified 2026-08-03 (v2.2.0 opt-out purge). Discord mid 1478777064818479185 (2026-03-04).
- **Purpose:** Open reproducible Code LLM pretraining corpus with license/provenance metadata and developer opt-out
- **Used for:** StarCoder2 3B/7B/15B (paper). Hub 6.3K downloads / 626 likes at check; paper 160 upvotes.
- **Authors:** BigCode collaboration (Lozhkov, Li, Ben Allal, von Werra, de Vries et al.; ServiceNow/HF/many labs). Source producers: GitHub users with unique repos through 2023-09-06.
- **Bias:** Permissive-license skew; some langs rarely permissive (SQL/Batchfile/TS ~4% vs ~10% avg). Longer files more often permissive. Comment toxicity risk. HTML may not be WCAG-compliant.
- **Text quality:** Exact-dedup + near-dedup (~40% of permissive files were near-dups). Filters: no binary/empty/undecodable; drop >10MB. Vendor/generated flags via go-enry. Train-* variants add heuristics + repo grouping.
- **Sample size:** No official train/test split (near-dup leakage risk). Language configs e.g. Python, Dockerfile, default=all.
- **Long context:** Mixed (file-level; train-* group by repo for full-repo context).
- **Intermediate steps:** Yes (SWH traversal; GH Archive metadata; ScanCode license detect; permissive filter; near-dedup; opt-out removals v2.0.1–v2.2.0).
- **Idea quality:** High
- **Novelty:** High (largest open SWH-backed code dump with governance; still foundational vs newer niche dumps)
- **Text conversion:** Metadata load_dataset works after gated ToU. Bulk contents need SWH/INRIA agreement + AWS credentials. Streaming supported.
- **Collection method:** Download (gated) + optional SWH S3
- **Static:** No (periodic opt-out updates; lastModified 2026-08-03)
- **Processed:** Unknown

## Links

- Dataset: https://huggingface.co/datasets/bigcode/the-stack-v2
- Related: https://arxiv.org/abs/2402.19173
- Related: https://huggingface.co/papers/2402.19173
- Related: https://huggingface.co/datasets/bigcode/the-stack-v2
- Related: https://www.softwareheritage.org/

## Research notes

- Discord data-source-dump mid 1478777064818479185. Cataloged without CuratorBote gated access — public card/API only. Prefer train-full-ids/smol-ids for training-ready filters. Related: the-stack-v2-dedup.

## Related entries

- Related: [GitHub Code 2025](https://papers.projxon.ai/entries/101) (dataset, #101)
- Related: [swallowcode2](https://papers.projxon.ai/entries/154) (dataset, #154)
- Related: [github-top-code](https://papers.projxon.ai/entries/229) (dataset, #229)
- Related: [The Stack v2](https://papers.projxon.ai/entries/232) (dataset, #232)

## Similar entries

- [UltraData-Code (OpenBMB L0–L3 tiered code pretrain: L2 algorithmic + L3 synthesis)](https://papers.projxon.ai/entries/1035) (dataset, #1035)
- [BigO(Bench): Can LLMs Generate Code with Controlled Time and Space Complexity?](https://papers.projxon.ai/entries/777) (paper, #777)
- [Nemotron-Pretraining-Code-v1](https://papers.projxon.ai/entries/87) (dataset, #87)
- [The Stack](https://papers.projxon.ai/entries/92) (dataset, #92)
- [Cross-Benchmark Transfer from RL on Agentic Coding Tasks](https://papers.projxon.ai/entries/1245) (paper, #1245)
- [MiMo-V2.6-RL-harbor-code](https://papers.projxon.ai/entries/1132) (dataset, #1132)
