← Datasets

Compare

The Stack v2
#1179 · remove
The Stack v2
#232 · remove
The Stack GitHub Issues
#124 · remove
Kinddatasetdatasetdataset
Published202420242023
Licenseother / per-file SPDX; ToU requires original license compliance + SWH LLM principlesVarious (per-repository licenses; must abide by original license terms)Various (governed by The Stack Terms of Use; original repository licenses apply)
License familyOtherOtherOther
AccessFree metadata after gate; bulk content agreement requiredrestrictedrestricted
Language codescodecodeen
Modalitiescode, texttexttext
Size——10M to 100M rows
Downloads (last month)6,0316,031500
Likes63863852
Last updated2026-08-032026-08-032023-03-20
Taskstext-generationtext-generationtext-generation
Formats——parquet
ScaleFull 67.5TB / >3B files / 104.2M repos; dedup 32.1TB; train-full ~900B tokens. Hub metadata usedStorage ~427 GB. size_categories unknown.Hub parquet (partial conversion): algorithmic_corpus 5.3M / 1.4 GB; synthetic_code_snippet 3.1M / 1.4 GB; synthetic_qa 3.2M listed vs 7.2M estimated / 2.3 GB. Viewer total 11.6M rows (est. 15.6M). size_categories 10M<n<100M. Canonical dump is JSONL: algorithmic_corpus 54 files ~3.78 GB; synthetic_code_snippet 31 files ~4.94 GB; synthetic_qa 106 files ~17.6 GB (~26.3 GB LFS). Paper Table 3 annealing mix (training tokens, includes RefineCode which is NOT this repo): RefineCode 83.94B + Algorithmic Corpus 12.44B + High Quality Code Snippet 2.71B + Code Textbooks 0.91B. Hub 43.9K downloads / 44 likes at check.~30.98M conversations; ~54GB cleaned (card); ~66.6 GB usedStorage
FormatParquet metadata per language config (600+); contents fetched via blob_id from s3://softwareheritage/content/JSONL on the Hub (canonical). Configs algorithmic_corpus, synthetic_code_snippet, synthetic_qa. Schemas: {type, lang, text} for the first two; {text, file_name, file_ext, file_size_in_byte, lang, program_lang} for synthetic_qa. Parquet conversion exists but is partial.Parquet; content + structured events JSON-like fields
TypeCode corpus / SWHID + metadata (contents on SWH S3)Pretraining annealing corpus / algorithmic code + synthetic rewritesConversational issue/PR corpus
CostFree metadata after gate; bulk content agreement requiredFreeFree after gate; tens of GB download
Languages658 langs (card); paper 619. High-resource langs (C, JS, etc.) overrepresented vs niche (Julia, Scala). Natural language in comments mostly English.Code-first. JSONL `lang` on algorithmic_corpus/synthetic_code_snippet is a programming language (preview python/java). synthetic_qa JSONL has lang=en plus program_lang (preview java). Card has no spoken-language tag. Paper also synthesizes multilingual snippets. No LID table.Mostly English (card)
ModalitySource code / text. No images.Text-only (source code + English comments/prompts).Text
Domaincode pretraining; multilingual source code; Software Heritagecode pretraining annealing; algorithmic/LeetCode-style files; synthetic self-contained functions and code-exercise QA; multilingual source filesSoftware engineering / GitHub issues & PRs (mostly English)
Time periodSWH 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).Algorithmic seed sampled from The Stack v2 / GitHub-style LeetCode solutions (paper RefineCode GitHub cutoff Nov 2023). Synthetic rewrite during OpenCoder annealing. HF createdAt 2024-11-12; lastModified 2025-05-29. Paper arXiv 2411.04905 (2024-11-07).Hub 2023-03-16 to 2023-03-20; Discord mid 1429930543075557406
PurposeOpen reproducible Code LLM pretraining corpus with license/provenance metadata and developer opt-outHigh-quality extra mix for the OpenCoder annealing stage (paper: quality over quantity after general RefineCode pretrain), beyond the original RefineCode distributionCode-adjacent conversational pretraining from issue/PR threads
Used forStarCoder2 3B/7B/15B (paper). Hub 6.3K downloads / 626 likes at check; paper 160 upvotes.OpenCoder-1.5B/8B-Base annealing (paper Table 3 + Fig 9 ablation: dropping this high-quality mix hurts HumanEval/MBPP). Companion of already-cataloged opc-fineweb-code-corpus and opc-fineweb-math-corpus. Hub 43.9K downloads / 44 likes at check. Discord posted the OpenCoder-LLM collection.Code LM pretraining; SE dialogue modeling
AuthorsBigCode 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.OpenCoder-LLM / INF / M-A-P. algorithmic seed: public GitHub/Stack v2 authors (synthetic_qa JSONL has @author javadoc and leetcode-cn URLs). Snippets/QA-style rows rewritten by a strong LLM (paper: Qwen2-72B-Instruct / GPT-4o-Mini-related hqcode for textbooks). Residual LeetCode/contest-solution culture.Crowdsourced GitHub users; curated by BigCode; bots filtered
BiasPermissive-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.LeetCode/algorithm-keyword sample (paper: leetcode / def solution / class solution), not general GitHub. Card folder names do not match JSONL schemas: synthetic_qa JSONL is raw source files (file_name/file_ext/program_lang), while algorithmic_corpus JSONL is type=qa prompt+code and synthetic_code_snippet is type=snippet. Hub parquet conversion for synthetic_qa looks incomplete. Seeded from gated Stack v2; this derived dump is public. English comments + many languages of code.Public GitHub projects; English-heavy; bot/short-thread filters change community mix; username masking
Text qualityExact-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.Paper: algorithmic files are self-contained and closer to interactive tasks; synthetic snippets kept only if generated tests pass. JSONL preview: real LeetCode Java (pivot index) plus synthetic documented functions. Residual contest boilerplate and incomplete test harnesses in type=qa rows. Not RefineCode (960B) and not the SFT stages.Cleaned (bots removed, short dropped, PII regex); still noisy social/tech support text
Sample sizeNo official train/test split (near-dup leakage risk). Language configs e.g. Python, Dockerfile, default=all.Three train configs, no default. Viewer: algorithmic_corpus 5.3M; synthetic_code_snippet 3.1M; synthetic_qa 3.2M parquet / ~7.2M estimated. No official val/test. Paper token mix above is the training recipe, not a guarantee each HF folder equals that token count.127 train parquet shards; variable thread lengths (long comments truncated)
Long contextMixed (file-level; train-* group by repo for full-repo context).No (self-contained files/functions; OpenCoder-8B trained at 8K, 1.5B at 4K).Medium - multi-comment threads; very long ones truncated in cleaning
Intermediate stepsYes (SWH traversal; GH Archive metadata; ScanCode license detect; permissive filter; near-dedup; opt-out removals v2.0.1–v2.2.0).Yes (keyword sample from Stack v2/RefineCode; LLM rewrite to snippets with tests; LLM textbooks). Paper §2.2. Sibling SFT dumps opc-sft-stage1/stage2 are separate repos.Yes - collect from Stack pipeline, regex clean, bot filter, quality heuristics, PII redact
Idea qualityHighHighHigh
NoveltyHigh (largest open SWH-backed code dump with governance; still foundational vs newer niche dumps)Medium (public annealing extras for an already-cataloged OpenCoder FineWeb pair; still a distinct dump)Medium-High as large open issue/PR dialogue companion to The Stack
Text conversionMetadata load_dataset works after gated ToU. Bulk contents need SWH/INRIA agreement + AWS credentials. Streaming supported.Ready JSONL; load_dataset('OpenCoder-LLM/opc-annealing-corpus', '<config>'). Streaming recommended (~26 GB JSONL). Prefer JSONL over the incomplete parquet conversion.High - training-ready content column
Collection methodDownload (gated) + optional SWH S3DownloadAccept HF gate/ToU; respect provenance licenses; track Stack version removals
StaticNo (periodic opt-out updates; lastModified 2026-08-03)Unknown (HF lastModified 2025-05-29; one-shot annealing dump. Stack v2 / GitHub later grew; this snapshot was not refreshed.)Card lastModified 2023-03-20; Stack family may issue removal updates
ProcessedUnknownUnknownYes - cleaned and PII-redacted
SummaryOpen reproducible Code LLM pretraining corpus with license/provenance metadata and developer opt-outThe Stack v2 is a large-scale pre-training dataset of source code containing over 3 billion files in 600+ programming and markup languages, derived from the Software Heritage archive. It serves as a pre-training corpus for Code LLMs (used to train StarCoder2), with the full dataset at 67.5TB and the deduplicated version at 32.1TB (~900B tokens). The dataset provides SWHIDs (Software Heritage IDs) for provenance and compliance, with file contents stored on Software Heritage's S3 bucket.The Stack GitHub Issues dataset contains ~30.9 million conversations from GitHub issues and pull requests, extracted as part of the larger Stack code dataset. Each conversation includes events such as issue opening, comments, and closures, with author usernames masked for PII protection. The dataset was cleaned from 180GB down to 54GB by removing bot comments, automated email replies, and low-quality conversations, and is used to train code generation models like Stable Code 3B.