﻿# The Stack: track repository and file provenance

The Stack file-level corpus needs release, repository provenance and near-duplicate controls before code-model training or evaluation.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/data-guide-stack-v1-file-provenance/
Language: en

The Stack is a code-pretraining resource whose basic observation is a source file. This profile concerns the original The Stack family, rather than The Stack v2 or a later model-specific mixture. Its [owner card](https://huggingface.co/datasets/bigcode/the-stack) describes both file metadata and access conditions that matter when planning a technically reproducible experiment.

## Resolve the usable release before fixing an input manifest

The card makes file access conditional and describes validated removal requests and maintainer guidance about usable versions. Historical experiment identity and present usability therefore need separate records. Preserve which release a published result used, but check the maintainers' current requirements before any new authorized use. This profile does not request access or download files. A repository being publicly described is different from unrestricted access to its content.

## Read file identity and repository context together

Fields include content, size, language and extension, together with hashes and repository-related metadata. A file can appear in several repositories; the visible repository association is not necessarily a complete account of every origin. A content hash identifies bytes, whereas a repository path supplies development context. Keep both before normalization. Generated code, vendored dependencies and copied utility files can otherwise appear to provide independent evidence from many projects.

## Construct a code holdout above the file level

The card presents the corpus through a train split rather than supplying a ready-made independent test. It explicitly warns about near duplicates. An editorial completion experiment should group repository families and detect copied content before assigning evaluation files. Holding out one file while training on a near-identical fork tests memorization opportunities as well as completion. The [curation repository](https://github.com/bigcode-project/bigcode-dataset) gives the implementation context for the resource rather than defining a universal downstream evaluation protocol.

## Separate language selection from working-program validity

A source-file corpus does not imply that each file parses under the chosen compiler or runs with available dependencies. Inspect language detection, file extensions, generated artifacts and unusually repetitive content in the selected subset. The [original paper](https://arxiv.org/abs/2211.15533) explains collection and license-oriented selection. Those descriptions are provenance evidence, not a blanket legal determination for every downstream activity, nor a claim that every retained file is correct or secure.

## Keep useful code and test data distinct

The Stack is useful for studying code exposure, filtering and pretraining mixtures. It should be paired with a separately defined execution or repository task when evaluating practical coding ability. [Deduplication and memorization](/journal/training-deduplication-memorization/) explains why repeated code changes exposure; [document-level splitting](/journal/document-level-data-split-leakage/) supplies the analogous grouping principle for file-derived examples. Report selected languages, release, grouping, exclusions and tokenizer behavior so that a larger apparent corpus is not confused with more independent programming knowledge.
