Commit ·
ef074e2
0
Parent(s):
Remove stale xet files after optouts
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- .gitattributesAdded+60
- README.mdAdded+368
- assets/banner.pngAdded
- assets/stack_v3_multiplier_light.pngAdded
- data/part-00000-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00001-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00002-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00003-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00004-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00005-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00006-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00007-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00008-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00009-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00010-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00011-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00012-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00013-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00014-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00015-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00016-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00017-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00018-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00019-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00020-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00021-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00022-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00023-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00024-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00025-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00026-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00027-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00028-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00029-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00030-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00031-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00032-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00033-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00034-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00035-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00036-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00037-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00038-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00039-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00040-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00041-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00042-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00043-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00044-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
- data/part-00045-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.avro filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ckpt filter=lfs diff=lfs merge=lfs -text*.ftz filter=lfs diff=lfs merge=lfs -text*.gz filter=lfs diff=lfs merge=lfs -text*.h5 filter=lfs diff=lfs merge=lfs -text*.joblib filter=lfs diff=lfs merge=lfs -text*.lfs.* filter=lfs diff=lfs merge=lfs -text*.lz4 filter=lfs diff=lfs merge=lfs -text*.mds filter=lfs diff=lfs merge=lfs -text*.mlmodel filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.npy filter=lfs diff=lfs merge=lfs -text*.npz filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.ot filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text*.pb filter=lfs diff=lfs merge=lfs -text*.pickle filter=lfs diff=lfs merge=lfs -text*.pkl filter=lfs diff=lfs merge=lfs -text*.pt filter=lfs diff=lfs merge=lfs -text*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -text*.safetensors filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tar filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.wasm filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text# Audio files - uncompressed*.pcm filter=lfs diff=lfs merge=lfs -text*.sam filter=lfs diff=lfs merge=lfs -text*.raw filter=lfs diff=lfs merge=lfs -text# Audio files - compressed*.aac filter=lfs diff=lfs merge=lfs -text*.flac filter=lfs diff=lfs merge=lfs -text*.mp3 filter=lfs diff=lfs merge=lfs -text*.ogg filter=lfs diff=lfs merge=lfs -text*.wav filter=lfs diff=lfs merge=lfs -text# Image files - uncompressed*.bmp filter=lfs diff=lfs merge=lfs -text*.gif filter=lfs diff=lfs merge=lfs -text*.png filter=lfs diff=lfs merge=lfs -text*.tiff filter=lfs diff=lfs merge=lfs -text# Image files - compressed*.jpg filter=lfs diff=lfs merge=lfs -text*.jpeg filter=lfs diff=lfs merge=lfs -text*.webp filter=lfs diff=lfs merge=lfs -text# Video files - compressed*.mp4 filter=lfs diff=lfs merge=lfs -text*.webm filter=lfs diff=lfs merge=lfs -text123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368---thumbnail: "https://huggingface.co/datasets/HuggingFaceCode/stack-v3-train/resolve/main/assets/banner.png"annotations_creators: []language_creators:- crowdsourced- expert-generatedlanguage:- codelicense:- odc-bymultilinguality:- multilingualsize_categories:- 100M<n<1Bsource_datasets: []task_categories:- text-generationtask_ids: []pretty_name: The Stack v3tags:- codedataset_info: features: - name: repo_path dtype: string - name: repo_id dtype: int64 - name: commit_id dtype: string - name: github_metadata struct: - name: branch dtype: string - name: commit_count dtype: int32 - name: repo_created_at dtype: string - name: is_fork dtype: bool - name: is_org_owned dtype: bool - name: forked_from dtype: string - name: stars dtype: int32 - name: forks dtype: int32 - name: issues dtype: int32 - name: pull_requests dtype: int32 - name: num_files dtype: int64 - name: files list: - name: content_id dtype: string - name: content dtype: string - name: size_bytes dtype: int32 - name: file_path dtype: string - name: file_timestamp dtype: int64 - name: language dtype: string - name: is_vendor dtype: bool - name: license_type dtype: string - name: detected_licenses sequence: stringconfigs:- config_name: default data_files: - split: train path: data/*.parquet---
<img src="./assets/banner.png" width="100%" alt="The Stack v3 banner">
# 🥞 The Stack v3
- [What is it?](#what-is-it)- [What is being released](#what-is-being-released)- [How to download and use it](#how-to-download-and-use-it)- [Dataset statistics](#dataset-statistics)- [Dataset structure](#dataset-structure)- [Dataset creation](#dataset-creation)- [Considerations for using the data](#considerations-for-using-the-data)- [Additional information](#additional-information)
## What is it?
The Stack v3 is the **largest, most up-to-date open dataset of source code**, crawled directly from GitHub and built to pre-train code LLMs with full-repository context. It is the successor to [The Stack v2](https://huggingface.co/datasets/bigcode/the-stack-v2) and, like its predecessor, is released to make the training of code models more **open, reproducible, and transparent**.
If your code is included in this version and you would like it removed for any reason, please use the ["Am I in The Stack?"](https://huggingface.co/spaces/HuggingFaceCode/in-the-stack) Space to submit a removal request. Repositories that opted out are removed from the dataset before each patch release.
Two things set v3 apart from earlier releases of The Stack:
1. **The file contents are included inline.** The decoded UTF-8 source text is embedded directly in the dataset, so it is fully self-contained — you can start training the moment the download finishes.2. **It reflects the state of GitHub in August 2025.** The corpus is a direct crawl of GitHub repositories at their default-branch HEAD, capturing roughly two additional years of open-source code compared to The Stack v2.
> The Stack v3 training subset contains **15.9 TB** of source code across **713** programming languages from **173M** repositories (~**4.9 trillion** tokens).> The Full Stack v3 corpus contains **113.7 TB** of source code across **770** languages from **224M** repositories.
### The Stack across versions
| | The Stack v1 | The Stack v2 | The Stack v3 ||-|-|-|--------------|| cutoff | 2022 | 2023 | 2025 || full | 6.4 TB | 67.5 TB | 113.7 TB || dedup | 2.9 TB | 32.1 TB | 99.3 TB || train | ~200B tokens | 2.0 TB / ~550B tokens | 15.9 TB / ~4.9T tokens || languages | 358 | 618 | 713 |
## What is being released
The Stack v3 is published in two complementary datasets:
| Dataset | What it is | Best for ||----------------------------------------------------------------------------------------------|---|---|| [`HuggingFaceCode/stack-v3-train`](https://huggingface.co/datasets/HuggingFaceCode/stack-v3-train) | Near-deduplicated, heuristically filtered code, **grouped by repository**, with file contents inline. Ready for training. | Pre-training code LLMs with repository context. || [`HuggingFaceCode/stack-v3-full`](https://huggingface.co/buckets/HuggingFaceCode/stack-v3-full) | The complete corpus before quality filtering and near-dedup selection. Hosted as an HF Storage Bucket. Split into a **`metadata`** part (repo/file metadata) and a **`contents`** part (one row per unique file blob). | Research on the raw corpus, custom filtering, or building your own training mix. |
`stack-v3-train` is derived from `stack-v3-full`: it is the near-deduplicated corpus with an additional round of quality heuristics applied, restricted to one representative per duplicate cluster, and grouped so that each row is a full repository.
`stack-v3-full` is documented in its own [dataset card](https://huggingface.co/buckets/HuggingFaceCode/stack-v3-full). Reach for it when `stack-v3-train` is not enough: it retains all near-duplicates with their **`dedup_cluster`** IDs and pre-filtering signals (so you can roll your own deduplication and filtering), and its metadata lists **every** file of every repository — including stubs for binary, oversized, and undetected-language files — so you can locate and re-crawl anything we excluded (PDFs, binary assets, niche languages).
### Changelog
| Release | Description ||---|---|| v3.0 | Initial release of The Stack v3. |
## How to download and use it
### `stack-v3-train`
Each row is a **repository**; the code lives inline under `files[].content`.
```pythonfrom datasets import load_dataset
# Full dataset (downloads locally)ds = load_dataset("HuggingFaceCode/stack-v3-train", split="train", cache_dir="/path/to/local/cache", num_proc=16)
# Streaming (downloads shards on demand — recommended for quick tests)ds = load_dataset("HuggingFaceCode/stack-v3-train", split="train", streaming=True)
for repo in ds: print(repo["repo_path"], "-", repo["num_files"], "files") for f in repo["files"]: print(f["file_path"], f["language"], f["license_type"]) print(f["content"][:100], "...") break```
> [!TIP]> There are no per-language configs: each row is a whole repository, and its files (usually a mix of languages) live in the `files[]` array. To filter by language, iterate the dataset (streaming works well) and keep the files you want, e.g. `[f for f in repo["files"] if f["language"] == "Python"]`. If you need language-partitioned files, use [`stack-v3-full`](https://huggingface.co/buckets/HuggingFaceCode/stack-v3-full), where contents are partitioned by language.
For analytical access without loading through the `datasets` library, you can query the Parquet files directly with DuckDB or Polars:
```pythonimport duckdbfrom huggingface_hub import HfFileSystem
duckdb.register_filesystem(HfFileSystem())
duckdb.sql(""" SELECT repo_path, num_files FROM 'hf://datasets/HuggingFaceCode/stack-v3-train/data/*.parquet' LIMIT 10""").show()```
### `stack-v3-full`
`stack-v3-full` is hosted as a [Hugging Face Storage Bucket](https://huggingface.co/docs/hub/storage-buckets) (not a regular dataset repo), split into a `metadata/` part (one row per repository) and a `contents/` part (one row per unique file blob, partitioned by language) that join on `content_id`. See [its dataset card](https://huggingface.co/buckets/HuggingFaceCode/stack-v3-full) for access instructions, join examples (DuckDB, pandas, PySpark), the full schema, and how stubs and `dedup_cluster` work.
## Dataset statistics
<img src="./assets/stack_v3_multiplier_light.png" alt="The Stack v3 compared to previous versions" style="max-width: min(100%, 720px);">
### Languages
The dataset contains **713** programming and markup languages.
Per-language breakdowns are available as JSON:
* **Train split:** [`stats/train/stats_by_language.json`](./stats/train/stats_by_language.json) — 713 languages* **Full (unfiltered):** [`stats/full/stats_by_language.json`](./stats/full/stats_by_language.json) — 770 languages
## Dataset structure
### `stack-v3-train` — data fields
Each row is a **repository**.
* `repo_path` (`string`): `owner/name` slug of the repository on GitHub.* `repo_id` (`int64`): Numeric GitHub repository ID.* `commit_id` (`string`): Commit (HEAD of the default branch) the snapshot was taken from.* `github_metadata` (`struct`): Repository-level metadata from the GitHub repository page: * `branch` (`string`): Default branch name. * `commit_count` (`int32`): Number of commits on the default branch. * `repo_created_at` (`string`): Repository creation timestamp. * `is_fork` (`bool`): Whether the repository is a fork. * `is_org_owned` (`bool`): Whether the repository is owned by an organization. * `forked_from` (`string`): Source repository if this is a fork, else `None`. * `stars` (`int32`): Star count at crawl time. * `forks` (`int32`): Fork count at crawl time. * `issues` (`int32`): Open issue count at crawl time. * `pull_requests` (`int32`): Open pull-request count at crawl time.* `num_files` (`int64`): Number of files in this repository row.* `files` (`list[struct]`): The files of the repository: * `content_id` (`string`): SHA-1 of the file content. * `content` (`string`): The UTF-8 file content (PII-redacted). * `size_bytes` (`int32`): Length of the content in UTF-8 bytes. * `file_path` (`string`): Path of the file within the repository. * `file_timestamp` (`int64`): File modification time (Unix seconds). Only as accurate as the GitHub metadata. * `language` (`string`): Programming language, detected by [`go-enry`](https://github.com/go-enry/go-enry) (a port of GitHub's Linguist). * `is_vendor` (`bool`): Whether the file is a vendored/third-party file (per `go-enry`). * `license_type` (`string`): `permissive` or `no_license`. * `detected_licenses` (`list[string]`): SPDX license identifiers detected by [ScanCode](https://github.com/nexB/scancode-toolkit).
### `stack-v3-full` — data fields
`stack-v3-full` shares the same repository-level fields, but its `files[]` structs reference content by `content_id` instead of embedding it, and include **stub** entries for excluded files (binary, oversized, undetected language). The full schema and stub semantics are documented in the [`stack-v3-full` dataset card](https://huggingface.co/buckets/HuggingFaceCode/stack-v3-full#data-fields).
## Dataset creation
The Stack v3 was built in a similar fashion as The Stack v2 — language detection with [`go-enry`](https://github.com/go-enry/go-enry), file-level license detection with [ScanCode](https://github.com/nexB/scancode-toolkit), MinHash-LSH near-deduplication, PII redaction, quality filtering, and repository-level grouping — with updated tool versions and a few meaningful changes:
### What changed from v2
| | The Stack v2 | The Stack v3 ||---|---|---|| **Source** | Software Heritage graph (2023) | Direct GitHub crawl (cutoff: 2025-08-07) || **Content** | File IDs only | File contents inline — self-contained || **Near-dedup** | Per-language | Language-agnostic, with Jaccard verification after connected-component clustering (no false positives) |
The rest of the pipeline (license detection, quality heuristics, PII redaction, grouping) follows the same methodology as v2 with updated tool versions.
> **Scope note:** This release focuses on **source code and Jupyter notebooks**. It does not include the additional non-code sources that accompanied StarCoder2 training (GitHub issues, pull requests, Kaggle notebooks, documentation, ArXiv, Wikipedia, OpenWebMath, etc.).
### Curation rationale
Most code LLMs are trained on data that is never released, making the systems hard to reproduce and study. By publishing a large, contemporary, contents-included code dataset together with its construction code, we aim to make code-LLM pre-training reproducible and to give researchers a transparent, up-to-date corpus to build on.
### Source data
#### Data collection
The list of repositories to crawl was assembled by taking the union of:
- Every GitHub repository that appears in [GH Archive](https://www.gharchive.org/) public event data, and- Every GitHub origin recorded in the Software Heritage graph (origin table, `2025-05-18` snapshot).
For each repository, the crawler fetched the GitHub repository page (for metadata such as stars, forks, and the HEAD commit) and downloaded a **single snapshot tarball** of the default branch at its HEAD commit — no git history is collected. Forks were only downloaded when they had at least **5 stars**.
During download, the following were dropped or emptied:
* Files larger than **5 MB**.* Binary files (files containing a null byte).* Symlinks and non-regular files.* Repositories were capped at **1,000,000 files**.
The crawl completed on **August 7, 2025**. The dataset reflects the state of public GitHub repositories as of that date.
The crawl collected snapshots from **224M** repositories containing **43.9 billion** files (including stubs for binary, oversized, and undetected-language files).
The exact snapshot for every repository is traceable via its `commit_id`.
#### Cleaning and filtering
The corpus then passes through the following stages (implemented in Spark):
1. **Decoding & language detection.** File bytes are decoded to UTF-8 (falling back to `cchardet` encoding detection). Language, vendor, and generated-file flags are assigned with [`go-enry`](https://github.com/go-enry/go-enry). Each unique content blob is content-addressed by its SHA-1 (`content_id`) and stored once.2. **License detection.** We detect licenses at the file level using the [ScanCode Toolkit](https://github.com/nexB/scancode-toolkit) and propagate them through the repository file tree: 1. *Identify license files.* Any file whose name matches a license-bearing pattern (e.g. `LICENSE`, `COPYING`, `MIT.txt`, `Apache2.0`, `NOTICE`, `README`, `GUIDELINES`, …) is selected for scanning. 2. *Detect licenses.* ScanCode's license detection runs on the content of each matching file and returns the SPDX identifiers of any licenses found. 3. *Propagate to siblings.* The detected licenses are propagated to every file that shares the same directory prefix as the license file — e.g. a `LICENSE` at the repo root covers all files, while one in `src/lib/` covers only files under that subtree. When a file is covered by multiple license files from different directories, their licenses are merged. 4. *Classify.* Each file is labelled `permissive` (at least one permissive license detected, no conflicting non-permissive license), `no_license` (no licenses detected, or only non-license legal texts such as CLAs), or `non_permissive`. The permissive allowlist follows the [Blue Oak Council](https://blueoakcouncil.org/list) list plus licenses categorized as *Permissive* or *Public Domain* by [ScanCode](https://scancode-licensedb.aboutcode.org/). **Files classified as `non_permissive` are excluded from both released datasets.**3. **Near-deduplication.** MinHash signatures (256 permutations, 5-grams, min. 5 tokens) are indexed with LSH; candidate pairs with estimated Jaccard similarity ≥ **0.7** are grouped into duplicate clusters via connected components. Unlike v2, deduplication runs across all languages at once (language-agnostic) and candidate pairs are verified against their Jaccard estimate to eliminate false positives. For `stack-v3-train`, a single **representative** file per cluster is retained, chosen by (in order) highest stars, highest forks, permissive license, earliest repository creation.4. **Quality heuristics** (applied to `stack-v3-train`). Same filters as the StarCoder2 pipeline, with minor adjustments to language lists to accommodate new or updated languages detected by the newer `go-enry` release: * Drop files with `<25%` alphabetic characters (alphanumeric for Assembly). * Drop files with average line length `>100` or maximum line length `>1000` (exempting data/markup formats such as Text, JSON, XML, HTML, Markdown, Roff, TeX). * Drop files with `>100,000` lines and cap several data/config formats (such as JSON, Yaml,...) at `512` lines. * Drop files with giant base64/hex/unicode-escape data blobs, LFS pointers, and files with auto-generation markers in the first 5 lines. * For HTML, keep only files whose visible text is ≥ 100 characters and ≥ 20% of the content. * Drop a curated blocklist of non-code languages/extensions. * Cap the largest markup/config languages (XML, HTML, JSON, JavaScript) at a fixed byte budget each, and probabilistically downsample any repository whose total size exceeds **1.5 GB** to fit Arrow/Parquet limits.5. **PII redaction** (applied to `stack-v3-train`). Same model and filtering as v2. File contents are scanned with [`StarPII`](https://huggingface.co/bigcode/starpii). Detected emails, keys, names, passwords, and IP addresses are replaced with placeholder tokens (`<EMAIL>`, `<KEY>`, `<NAME>`, `<PASSWORD>`, and synthetic private IPs).6. **Jupyter notebooks** (applied to `stack-v3-train`). `.ipynb` files are processed separately: cell **outputs, inline images, and volatile metadata are stripped**, and the notebook is kept as structured JSON. They pass through the same license, dedup, and PII steps. `stack-v3-full` keeps the raw `.ipynb` contents as crawled — use it if you want to apply your own notebook processing.7. **Grouping.** Files are grouped by repository so each row is a full repository, enabling repository-context pre-training.
Opt-out requests (see below) are applied before release.
#### Who are the source language producers?
The source code was written by GitHub users whose repositories were public at crawl time (up to August 7, 2025).
### Personal and sensitive information
`stack-v3-train` was scanned for PII (emails, keys, names, passwords, IP addresses) with the same model and heuristics as The Stack v2, and detected entities were replaced with placeholder tokens. Detection is imperfect: the released data may still contain sensitive information (emails, IP addresses, keys) that was previously published to public GitHub repositories.
Researchers should use only public, non-personal information for open-access research, and must not use any personal information for spamming or other harmful purposes.
### Opting out
Developers can request that their code be removed from The Stack v3. You can check whether your code is included via the ["Am I in The Stack?"](https://huggingface.co/spaces/HuggingFaceCode/in-the-stack) Space, and submit removal requests following the [opt-out instructions](https://github.com/bigcode-project/opt-out-v2). Repositories that opted out are removed from the dataset before each patch release.
## Considerations for using the data
### Social impact
The Stack v3 is released in the spirit of open science, to increase the accessibility, reproducibility, and transparency of code-LLM research. Code LLMs can help people of diverse backgrounds write better software, but they also carry risks such as over-reliance on generated code, generation of insecure or malicious code, and effects on the software-development labor market.
### Discussion of biases
Widely used languages (e.g. C, JavaScript, Python) are heavily overrepresented relative to niche languages, and some languages are far less likely to be permissively licensed than others, biasing their representation. Comments in code may contain harmful or offensive language. The majority of natural language in the code is English.
### Other known limitations
* License attribution is only as accurate as ScanCode and the GitHub metadata; report any mistakes for review.* The dataset may contain malicious code, and models trained on it could be used to generate malware.* Because content is a single default-branch snapshot (as of August 7, 2025), it does not capture development history or non-default branches.
## Additional information
### Licensing information
The dataset is released under the **Open Data Commons Attribution License (ODC-By) v1.0** [license](https://opendatacommons.org/licenses/by/1-0/).
The Stack v3 is a collection of source code from repositories with various licenses. Any use of all or part of the code gathered in The Stack v3 must abide by the terms of the original licenses, including attribution clauses where relevant; we provide provenance information (`repo_path`, `commit_id`, `detected_licenses`) for each file to facilitate this.
The list of [SPDX license identifiers](https://spdx.org/licenses/) included in the dataset can be found [here](stats/full/stats_by_license.json).
### Citation information
```bibtex@misc{lozhkov2026stack-v3, author = {Lozhkov, Anton and Larcher, Hugo and Morlon, Mathieu and Ben Allal, Loubna and von Werra, Leandro}, title = {The Stack v3: The Largest Open Code Dataset}, year = 2026, url = {https://huggingface.co/datasets/HuggingFaceCode/stack-v3-train}, publisher = {Hugging Face}}```
The Stack v3 builds on the methodology of The Stack v2 / StarCoder2:
```bibtex@misc{lozhkov2024starcoder, title={StarCoder 2 and The Stack v2: The Next Generation}, author={Anton Lozhkov and Raymond Li and Loubna Ben Allal and Federico Cassano and Joel Lamy-Poirier and Nouamane Tazi and Ao Tang and Dmytro Pykhtar and Jiawei Liu and Yuxiang Wei and Tianyang Liu and Max Tian and Denis Kocetkov and Arthur Zucker and Younes Belkada and Zijian Wang and Qian Liu and Dmitry Abulkhanov and Indraneil Paul and Zhuang Li and Wen-Ding Li and Megan Risdal and Jia Li and Jian Zhu and Terry Yue Zhuo and Evgenii Zheltonozhskii and Nii Osae Osae Dade and Wenhao Yu and Lucas Krauß and Naman Jain and Yixuan Su and Xuanli He and Manan Dey and Edoardo Abati and Yekun Chai and Niklas Muennighoff and Xiangru Tang and Muhtasham Oblokulov and Christopher Akiki and Marc Marone and Chenghao Mou and Mayank Mishra and Alex Gu and Binyuan Hui and Tri Dao and Armel Zebaze and Olivier Dehaene and Nicolas Patry and Canwen Xu and Julian McAuley and Han Hu and Torsten Scholak and Sebastien Paquet and Jennifer Robinson and Carolyn Jane Anderson and Nicolas Chapados and Mostofa Patwary and Nima Tajbakhsh and Yacine Jernite and Carlos Muñoz Ferrandis and Lingming Zhang and Sean Hughes and Thomas Wolf and Arjun Guha and Leandro von Werra and Harm de Vries}, year={2024}, eprint={2402.19173}, archivePrefix={arXiv}, primaryClass={cs.SE}}```
### Acknowledgements
This dataset is derived from source code hosted on GitHub. We thank the developers who make their work publicly available, and the [BigCode](https://www.bigcode-project.org/) community, whose work on dataset filters, PII detection, and open code dataset governance informed much of this pipeline.123version https://git-lfs.github.com/spec/v1oid sha256:a3914ab818595e5140bc21f09149406450f652b76eaa29bae0ff631c893faecfsize 386397466123version https://git-lfs.github.com/spec/v1oid sha256:3444f0884468c7bed7244dbf31fd0304828686d920d216e899f919ae0c27f4a9size 411937312123version https://git-lfs.github.com/spec/v1oid sha256:043aa7e4f95fc83f4466b0d76716f8def2e0fd6c5049acdda06fb254ca6cbf95size 478845066123version https://git-lfs.github.com/spec/v1oid sha256:eb87f9f3ea5dc3af48755462d5ed7e9e97e6d9ca3788752e53a469cd31818bb3size 346627385123version https://git-lfs.github.com/spec/v1oid sha256:18eae7a12531dd0dec58af80f51e121b60bfe01079ac50ee325a463ab072ecdesize 684369102123version https://git-lfs.github.com/spec/v1oid sha256:e8589932e94b9e437d3bf7c00f29d9e22c8d81708de147fead6facb19372ac59size 392889517123version https://git-lfs.github.com/spec/v1oid sha256:8d488a78c2fbde5b11c4bd32dbf0445db0ff655248923a95ad47e368e70cabb6size 403103660123version https://git-lfs.github.com/spec/v1oid sha256:e091ce29c62ed0e8f8172ab5448572af92e192c8a730306f79055dedc7e44432size 353912999123version https://git-lfs.github.com/spec/v1oid sha256:15a7ef017f71a74ff28d78ea9fb0d8513962eea404e8c6138186f6ac8ec4483bsize 356265157123version https://git-lfs.github.com/spec/v1oid sha256:579da5a6385284687a58bcb1f3b403c3771041239754be91e58b9115c111e744size 405417608123version https://git-lfs.github.com/spec/v1oid sha256:f2bb25c65b17801c87537fa0bb5796d02338622fcf6860f40f7aa1f43e197f51size 460868335123version https://git-lfs.github.com/spec/v1oid sha256:3b844956f0082c3aced26d119e0b4c89ec360628a8785aa95939d3192a0f3585size 785374130123version https://git-lfs.github.com/spec/v1oid sha256:74c1089ff8965ffbc80f86286dc2ee1d31bdc4f248a97c251e6a85aab0f8e888size 421747060123version https://git-lfs.github.com/spec/v1oid sha256:d262b06e9969b6c5d5816fad716a4c93376368586ab1234c8e065f3ff769b96asize 364331283123version https://git-lfs.github.com/spec/v1oid sha256:22edc72fd081bb02eac46f8959d3e9a892c90fc1c9260bf7519bacca9c883119size 493509726123version https://git-lfs.github.com/spec/v1oid sha256:ff300f7adda9e7dd1ea1e7acb735002591fbf0d8fa387ffc64652cdb50f1fbd2size 359916557123version https://git-lfs.github.com/spec/v1oid sha256:06abe9267b945578f9ac682aefe16412a997ebe96add11096cc763fd48d8c77dsize 556592487123version https://git-lfs.github.com/spec/v1oid sha256:bd21259bc9b2495aba42c49aca8db3f94b52dcd1a1e44b1dfc1e6ce4a8e537dcsize 434667685123version https://git-lfs.github.com/spec/v1oid sha256:733c9fecfb27bdaef483fc843e1bba87a606a404eea8d2c6b889df999add9b67size 518319038123version https://git-lfs.github.com/spec/v1oid sha256:741c9b1b18dabe7a487d7f732e7f2953eaceb0178b18bed87c61a29d64d539e1size 315186148123version https://git-lfs.github.com/spec/v1oid sha256:a634f03df138c2f4b5e37710700c18cfb95e06c575d1eecf348912a9a4a105c0size 350489986123version https://git-lfs.github.com/spec/v1oid sha256:dbffbfe3f3e1e9da3d87d6255f28164ce28a415df67c8a6abefd036cb84720e7size 388202219123version https://git-lfs.github.com/spec/v1oid sha256:5c5b2310d31872951d198cc965865491eae8d6d56c37b8564eab5d54bfca8312size 662778485123version https://git-lfs.github.com/spec/v1oid sha256:b5e28719f422c1129774ecc363780d23277ba75da645e8d4cf13a68060c248fcsize 344907501123version https://git-lfs.github.com/spec/v1oid sha256:1d77cc7ba0a0e8c55693a81568bd6ebf07a7d5569404fd46f2d4507c3b3c2599size 339643528123version https://git-lfs.github.com/spec/v1oid sha256:cb02834349c11d28aa57598b9dbe87a2ad71f9847bc8f6d4ad1495b66d0c383csize 433078536123version https://git-lfs.github.com/spec/v1oid sha256:9b3db766404f9f5e299c0a67ddac8e9e49d633a8e1ef72871c5864f6488eb6d7size 367315637123version https://git-lfs.github.com/spec/v1oid sha256:0715abbeba5bac4d9fca161cf111c40a8f42216941b6ef282699123445b75dfdsize 387846508123version https://git-lfs.github.com/spec/v1oid sha256:bf966ab777bdc2742530a4bf863e5a2c06c692f705bdb8da1acba82769950745size 380399097123version https://git-lfs.github.com/spec/v1oid sha256:a16b1c4000efc8d68588696875c4091a5c65a6c9c18a4837d427521c6bb7ef10size 421441033123version https://git-lfs.github.com/spec/v1oid sha256:b17badc83e81d4b4d5f5fb8d4e6e3d1a79bdd944873c024ee0991b502607c936size 366857500123version https://git-lfs.github.com/spec/v1oid sha256:1ffce69c19290bc806a989f3286867d79fc1d88ac804cd4d70d48f697b60a4aasize 332499274123version https://git-lfs.github.com/spec/v1oid sha256:96c046f4409d70dbefe6b2ec0918cf211fb2041d071fb396f055df5082b22140size 616049120123version https://git-lfs.github.com/spec/v1oid sha256:d07e0c585f53518f9b1c2f71c572f923333dcb07ab40a1786a372ab5c4fdc87dsize 395762287123version https://git-lfs.github.com/spec/v1oid sha256:e8f79d47c2814f65e846198bd02328d10f1ca91f292e05f88e1640cfdbb180d5size 358442698123version https://git-lfs.github.com/spec/v1oid sha256:415bf79b62c6892b6a41a94a06daac089124a562d765be9ae8c175606d9eb91asize 347950172123version https://git-lfs.github.com/spec/v1oid sha256:efdfe03d2aa3f62f074d09db69b9a24a94b5ed77e3fd22a534d522a5e9b07ef6size 444214259123version https://git-lfs.github.com/spec/v1oid sha256:f9d465212e4054dfab7ecd699c0afcdf522f013aefd49bf1919ad3ae0fc3e8bdsize 570952490123version https://git-lfs.github.com/spec/v1oid sha256:c2183b2e8a8b7d75452f68f3bf1ab5edd46195c1cfd84d45d81b43d2b84cc508size 464694707123version https://git-lfs.github.com/spec/v1oid sha256:963235e5e41b21c8e272ba1c2b86319b4031b13a8b7f205f572a8ecc3d0c2bbbsize 361294870123version https://git-lfs.github.com/spec/v1oid sha256:00950a5c606369634c7c8ba7d72b3045fd53b0414fffd24a47980121e9b44d92size 579842796123version https://git-lfs.github.com/spec/v1oid sha256:521054fa32ffd2cdac405dd40997a5e4d18853941be02e699ccab6ba01d3883fsize 440396761123version https://git-lfs.github.com/spec/v1oid sha256:66131b21eb286532f09a55ba8b88d9717bc712998af0a019237411a8dfa827a2size 613997215123version https://git-lfs.github.com/spec/v1oid sha256:a73b4d29cc21cf52c7e5dede9b2f6238dd18b5f0ee331fb30af5383f7469fb2asize 388359720123version https://git-lfs.github.com/spec/v1oid sha256:910d24cc079366cf65322f0533093bef061184c321569d1f088adeb110a51ba0size 358950972123version https://git-lfs.github.com/spec/v1oid sha256:d0fae468363f087155c3d39b34dffa6aae4ad856d1d6c608d3a12e1bf98319dcsize 355556477.gitattributesAdded+60
README.mdAdded+368
assets/banner.pngAdded

Large File Pointer Details
- SHA256: cdeb08746abf0928498195dd484a7e2399f87019a3912b373c6bc73738bb6f2f
- Pointer size: 132 Bytes
- Size of remote file: 1.57 MB
assets/stack_v3_multiplier_light.pngAdded

Large File Pointer Details
- SHA256: b921808cc4d3b12a68b34353680f16e7c051a399a9d98ddbf775d0f5970c5528
- Pointer size: 131 Bytes
- Size of remote file: 201 kB
data/part-00000-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00001-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00002-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00003-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00004-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00005-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00006-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00007-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00008-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00009-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00010-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00011-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00012-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00013-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00014-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00015-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00016-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00017-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00018-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00019-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00020-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00021-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00022-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00023-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00024-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00025-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00026-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00027-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00028-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00029-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00030-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00031-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00032-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00033-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00034-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00035-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00036-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00037-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00038-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00039-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00040-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00041-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00042-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00043-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00044-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3
data/part-00045-990b4288-3824-41ac-94a0-b6fd6fa23ffe-c000.snappy.parquetAdded+3