License filtering for code data: what remains after removal
License screening changes the composition of a code dataset, but The Stack's experiments only measured function-level generation on HumanEval and MBPP, not building a runnable project. Whether engineering habits are lost is therefore a claim for the buyer to test, not a finding of the paper.
On this page
You receive two versions of the same code dataset. The old one is 800GB, the new one 520GB. A bit over a third is gone, and sales says it was mostly deduplication and junk removal. Suppose you sample a batch of directory names and the missing part is not random: test directories, build scripts and CI configuration have clearly shrunk, while ordinary source files have grown as a share. What got deleted may be exactly the part you wanted the model to learn. (The figures and this observation above are an invented example, not a real version comparison and not a result from the paper.)
Two versions, and more than a third of a difference
The 800GB and 520GB above are invented to illustrate a common acceptance scene, not a real version comparison. Actual volumes differ, and whether deletion is even or which categories shrink has to be established by counting, not inferred from this example. The Stack paper reports a pipeline and aggregate sizes, not a per-file-category difference between two releases [1].
Why care? I split code capability into two rough layers, and this is my classification rather than a finding of the paper. One is syntax and idiom, learnable from a huge pile of ordinary functions. The other is engineering habit: how a project is organised, how tests are written, how dependencies are declared, how the build is wired, what CI checks. Under that split the second layer has very uneven information density, concentrated in a few file types; but the paper never tests which files carry it or what happens when they are missing.
License screening draws its line by licence category, not by what a file is for. Whether the two coincide, and which categories shrink, is not reported per category by the paper and has to be counted [1]. That is the whole argument: not that filtering is wrong, but what to check afterwards and whether anything needs replacing.
How The Stack did the filtering
The Stack is the best-documented dataset of this kind, but the pipeline has to be read correctly. Version 1 of the paper reports 3.1 TB of permissively licensed source code in 30 programming languages [1]; version 1.1 switches to the Blue Oak Council classification, lists 193 permissive licences and covers more languages. The key point is that licence screening is not done at the entrance. The paper first collects everything: 220.92M unique repository names from GHArchive events between early 2015 and March 2022, 137.36M repositories downloaded successfully between November 2021 and June 2022, and 92.36 TB of stored files uncompressed [1]. Collection applies only basic filters: no binary files, no files over 1 MB unless the extension is on an approved list, and exact duplicates removed via git hashes. Only afterwards is the permissive subset constructed: the 30-language all-licence data is over 29 TB, drops to 3.1 TB (roughly 10%) when only permissive files are kept, and to 1.4 TB after near-deduplication [1].
Nor is the unit of decision a merge of file headers and a repository LICENSE. The paper uses the licence a repository owner explicitly sets in GHArchive (26.4M repositories) and runs go-license-detector over the remaining 110.9M, which returns an associated file, an SPDX identifier and a confidence score [1]. For each separate file the detector flags as a potential licence, the highest-confidence prediction is taken, and a repository is marked permissive only if all such predictions are permissive; a file is included if at least one repository containing it is permissive [1]. The detector found no licence for over 80% of repositories (Table 2: not_found 81.91%, error 0.42%); those repositories do not enter the permissive subset, but the paper does not say they are deleted from the full dataset and describes no manual review [1]. An opt-out process does exist: the Am I in The Stack lookup tool, a request form with manual verification, removal in the next release cycle, updates roughly every 3 months, and a requirement that downloaders use the latest version [1]. PII is different: the paper states the data still contains names and email addresses and lists PII removal as future work, not a completed cleanup [1].
Are short files removed? Yes, but not because they lack a licence header, and through other steps [1]. Near-deduplication splits files into tokens on non-alphanumeric characters and drops files with fewer than 10 tokens, then uses MinHash with 256 permutations plus LSH to find duplicate clusters, treating files as similar when Jaccard similarity exceeds 0.85. The experiments also follow Codex and remove files whose average line length exceeds 100 characters, whose maximum line length exceeds 1000, whose alphanumeric share is below 25%, or whose first lines indicate automatic generation [1]. For configuration and test files the paper only detects and counts them: in the Python permissive subset it looks for keywords such as configuration file and test file in the first 5 lines, or for config/test literals appearing in over 5% of the lines, and this filter selects 15% of the files representing 23% of the data by volume. The authors say such files are abundant on GitHub but do not capture complex source-code features, and they do not say these files are removed from the released dataset [1].
On detection error the paper actually publishes checkable numbers and statements, so it is not a black box [1]. The detector found no licence for over 80% of repositories (Table 2: not_found 81.91%, error 0.42%); the authors write that the detector may have misclassified a number of repositories and ask users to report files without a permissive licence; MPL, LGPL and EPL were at one point labelled permissive despite being weak copyleft, and were removed without rerunning the experiments (under 0.5% of the Python subset); and the cross-repository rule can admit non-permissive files [1]. The authors also stress that The Stack is a compilation of source files including attribution and licence notices, that each source file carries its own permissive licence, and that users must respect it [1]. A buyer only sees the outcome, true, but that outcome already includes these self-reported limits.
Which categories disappear wholesale
The paper does not report what was removed by file category [1], so the table below is not a finding of the paper but a checklist to verify: several file types worth counting separately, and which step in the paper could plausibly affect them. The second column lists only steps the paper actually documents and says the paper does not say where it is silent; the third column is my inference about what might be lost if such samples really did shrink.
| File category | Step in the paper that could affect it | If it shrank, what might be lost (my inference) |
|---|---|---|
| Test files (test_ prefix, _test suffix) | The paper detects config/test files in the Python permissive subset by keywords or literal share; this filter selects 15% of files and 23% of volume but is only a count, not a removal. Near-dedup dropping files under 10 tokens and Codex-style filters may remove very short files [1] | How assertions and edge cases are written |
| Build and CI configuration (Makefiles, workflow files) | Collection stores no binaries and no files over 1 MB, and Appendix C excludes extensions including .lock, .log, .gitignore and .gradle; the paper does not describe deleting CI/workflow files [1] | Toolchain order, dependency declaration, build and release wiring |
| Generated code (protocol definitions, migrations) | The experiments filter files whose first lines indicate automatic generation; near-dedup treats Jaccard similarity above 0.85 as duplicate and removes 38.6% of files [1] | The shape of long boilerplate, schema-to-code mapping |
| Vendored third-party directories | The paper includes a file if at least one containing repository is permissive and admits this can admit non-permissive files; it does not describe deleting directories wholesale [1] | How real dependencies are called and adapted |
| Single-file scripts and snippets | Near-dedup drops files with fewer than 10 tokens; collection excludes some extensions [1] | A short task closed end to end, from input to output |
Taken stage by stage, the paper reports aggregate sizes, not per-category deltas [1]. In the permissive data 38.6% of files and 53.7% of volume were judged near-duplicates and removed, taking 3.1 TB down to 1.4 TB, and this step is a measured net gain: on the permissive subset HumanEval pass@100 rises from 27.21% to 37.00% and MBPP from 44.99% to 54.69%, while on the all-licence subset they rise from 36.67% to 44.00% and 53.59% to 61.00% [1]. So the claim that deduplication cleared away useful engineering habits has no support here and runs against the measured direction; the paper also reports matching previously published Codex and CodeGen HumanEval performance using only permissively licensed data [1]. Which categories shrink, and whether that affects engineering tasks, the paper does not test; it has to be counted on the two datasets with one consistent definition, not inferred backwards from the pipeline.
In other words, do not trust a vague claim about how much was removed, and do not treat the share of such files in real repositories as a known fact. The only related number in the paper is a detection statistic: in the Python permissive subset, config/test files identified by the keyword rule are 15% of files and 23% of volume [1]. That is a detector's selected share, not the true share of those categories in the released dataset, and certainly not a before-and-after comparison. To conclude anything you have to count test and build files in both datasets yourself.
One rule, two readings, two different datasets
The repository, both rules and the six rows below are invented to show how a change of decision rule changes what survives. They are not how The Stack actually works: as noted above, the paper decides at repository level and includes a file when at least one containing repository is permissive. Both rules are implementable engineering options; whether either is compliant depends on the specific licence text and the specific use, and a technical paper cannot settle that in general. This piece offers no legal conclusion either [1].
repo acme/widget (invented)
repo-level LICENSE = MIT
Rule A (invented): decide only from an explicit file-header licence, keep permissive headers only; drop when the header is absent or non-permissive
Rule B (invented): header first, fall back to repo-level LICENSE when absent; drop when an explicit header is non-permissive
file header A B
src/widget.py MIT keep keep
tests/test_widget.py none drop keep
Makefile none drop keep
.github/workflows/ci.yml none drop keep
third_party/requests/*.py Apache-2.0 keep keep
third_party/gpl_tool.py GPL-3.0 drop drop
total (six files) A keeps 2, B keeps 5
test / build / CI only A keeps 0, B keeps 3The six rows can be recomputed by hand: count the keeps in column A and in column B and you get the two totals above. The entire difference sits on the three files with no header, and they happen to be the test, the Makefile and the CI configuration. This is arithmetic inside an invented example; it shows that a decision rule changes the shape of what survives, not that those categories really shrink in any real dataset.
The point is not that B is better. My judgment is that B carries more risk, because it leans on the accuracy of repository-level inheritance: if that MIT declaration never covered anything in third_party, inheritance gets it wrong, and the paper itself admits that the at-least-one-permissive-repository rule can admit non-permissive files [1]. The point is that one governance goal can be implemented with different decision rules, and the difference never shows up in bytes removed, only in what shape survives. That shape is what a buyer should look at first, and it has to be asked about using the real pipeline above, not this invented example.
Five things to do at acceptance
- 1. Ask for a file-share breakdown before and after filtering, counted with one consistent definition. The categories need not be fine: source, tests, build and CI, docs, examples; write down the definition (what counts as a test, what counts as a build file) so the two columns are comparable.
- 2. Sample a batch of repositories yourself and compute the share of test and build files under the same definition, then align it with public repositories of the same kind or with the vendor's definition. Set sample size and effort to your own data scale; this piece gives no fixed number.
- 3. Ask which decision rule was used: file-level, repository-level, or something else, and what happens to undeterminable cases. The Stack decides at repository level and includes a file when at least one containing repository is permissive; repositories with no detected licence stay out of the subset but are not deleted from the full data [1]. Which rule the vendor uses decides which shape you receive.
- 4. Run a set of build a runnable small project tasks: give a requirement, ask for a directory layout, a dependency declaration, one test and one build command, and check whether it actually runs. Set the task count and rubric yourself; this kind of engineering task is not in The Stack's experiments, which measured only function-level generation on HumanEval and MBPP [1], so this is an acceptance test you add, not a finding of the paper.
- 5. If a category really is short, then decide what to replace: write the tests and build configuration yourself, or draw that category from a compliant internal repository. Check the licence and intended use of those files first; adding data is not automatically a compliant act.
The step that tests engineering tasks directly is the one that matters, because it measures exactly what the paper did not; the other four check composition and are indirect inference. Set the rubric yourself and do not adopt a ready-made threshold; this piece gives no task count or pass mark.
What follows is an assumed failure pattern, not a measurement. If such samples really were missing, a model might propose a sensible-looking layout with no findable entry point, dependencies that will not install, or a test file with no assertions. That is a guess to be verified by the tasks above; stating flatly that the model has never seen a complete repository has no evidence behind it.
I am not arguing against filtering
The position first: this piece does not argue for relaxing licence screening. The paper frames selecting permissive licences as a data-governance goal and a response to community concerns, states that it intentionally excludes copyleft licences such as GPL, and stresses that each source file still carries its own licence that users must respect [1]. Whether licence filtering is a legal requirement depends on the specific licence text, the specific use and the applicable jurisdiction; a technical paper cannot give a general answer, and this piece offers no legal conclusion either. The opt-out process does exist [1]; PII removal is still listed as future work, and the current data still contains names and email addresses [1].
The claim narrows to one line: screening changes the composition of the data, and whether that change has a cost has to be judged against the pipeline and measurements, not waved through as junk removal. Neither opposite claim is supported by this paper. Saying everything removed was junk ignores that licence screening never drew its line by file purpose [1]; saying everything removed was useful engineering habit contradicts the measured gains from near-deduplication [1]. The paper reports results on function-level generation only; whether engineering tasks degrade, it did not test.
One action available immediately: ask the vendor for the share of test files and build files before and after filtering, counted with one consistent definition. With two columns of numbers you can judge what the gap actually contains, whether to replace anything, and which category. If you cannot get them, you at least know which piece of evidence is missing; whether to sign is your decision. This piece sets no contract terms and offers no unsourced rule of thumb about double digits turning into single digits.
