Profile

Settings

Loading…

← Papers

Help

FAQ

Which features require signing in?

You can read the commentary, paper info, Model Structure and related papers of public papers without signing in. Sign in to manage your account or contact us about your inquiries.

Can I upload a PDF file?

Upload papers with an arXiv or DOI link; the commentary is public to everyone. Papers whose source and terms of use can't be verified, so the commentary can't be made public, can't be uploaded. Uploading PDF files and keeping papers private are for subscribers only, and a paper uploaded as a file is saved as private only. Searching for official info by title runs only when you press the button.

Are the figures and AI commentary accurate?

Figures come only from the original paper, and only those whose terms of use are verified are shown. The commentary is written by AI and may be wrong. Check important claims, numbers and figure context against the evidence in the original paper.

I want to report a copyright issue.

Terms of use and the source of the original paper are on the Paper info tab. If there's a problem, choose "Paper content, figures and copyright" under Contact us and send the paper link, the part in question, and evidence that you hold the rights. Receiving your report doesn't confirm any rights or remove anything right away. You can see the result of the review under My inquiries.

I forgot my password.

If you signed up with email, use Forgot password in the sign-in window to reset it with your verified email. If you signed up with Google, Naver or Kakao, change your password with that service.

What should I include in an inquiry?

Tell us which screen you were on and what you were doing when the problem happened, along with the paper link. Don't include personal information such as passwords, API keys, verification codes or phone numbers. Inquiries and replies are stored in Refivu and you can see them under My inquiries.

How do I delete my account?

In Settings, under My account, press Delete account. Review what will be deleted and complete identity verification to delete your account. For other requests, choose "Account" under Contact us.

Paper commentary

Git History Is a Pangenome: Repetition in Code Training Corpora and What Deduplication Removes, Keeps and Misses

  • Problem Training sets now include repository history, so one file can enter a corpus as many near-identical versions, and the deduplicators built for snapshots were never measured on that history.
  • Method Measures repetition, deduplicator output, kept versions and benchmark-fix recurrence across a pre-registered random sample, a set of mature repositories and the SWE-bench repositories, using BigCode's released script and two custom instruments.
  • Results A typical repository history holds 19× the current code, and BigCode's script at Jaccard 0.7 reduces that to 2.0×. Keep-newest retains the current version of 94% of mature-set files, against 40% under the script's default rule.

Figure 1: Bytes relative to the current code (HEAD text) along the pipeline, for the random sample and the mature set: the history corpus, what survives exact…

Fig. 1 . Bytes relative to the current code (HEAD text) along the pipeline, for the random sample and the mature set: the history corpus, what survives exact and near-duplicate deduplication at three thresholds, the keep-newest alternative, and git’s own delta-compressed storage of every version. The mature set’s history and git-storage bars are medians over all 25 repositories; its near-deduplication and keep-newest bars come from the 10 repositories that could be deduplicated across all versions (Section IX).

Original paper · CC BY 4.0 · Saurabh Chopra · Git History Is a Pangenome: Repetition in Code Training Corpora and What Deduplication Removes, Keeps and Misses · Original paper figure · Extracted the figure area from page 5 of the original PDF.

Why one file fills a training corpus many times

Code models were trained for years on one snapshot per repository, so a file such as utils.py entered a corpus once.

Exact deduplication cannot see these copies, because each version has its own hash. Commit-level deduplication compares the change itself, and each of the edits to the file is a different change. Similarity-based deduplication with MinHash and locality-sensitive hashing (LSH) would group these versions, but large pipelines run it on the snapshot, comparing each current file with files from other repositories.

That leaves two open questions: which version survives the grouping, and whether a benchmark fix sitting in an older version survives it too.

The authors separate three kinds of code corpus, since the findings bear on each in a different way. Snapshot corpora keep one version of each repository, full-file history corpora treat every version as a training document charged on the whole file, and edit corpora train on the change while keeping intermediate versions. Benchmark fixes are to be kept out of all three kinds.

Populations and what each instrument counts

The mature set holds 25 repositories with 613,849 non-merge commits between them. The SWE-bench repositories contribute 2,294 test instances, of which 2,229 have a gold patch that applies cleanly to its base commit.

The repeat counter sums the sizes of distinct versions per path and weights versions per path by the size of the latest version, so a version recommitted unchanged counts once. The script keeps the member of a group that came first in its input, and the authors fed it versions sorted by hash.

The byte attributor builds a suffix array over the reference text and the new text and parses the new text into relative Lempel–Ziv factors at a factor length L, labelling each byte as copied from the same file, copied from other files, repeated earlier in the new text, or new. The overlap test marks a later version as a carrier of a fix when at least 90% of the fix's substantive added lines, those with 12 or more non-space characters, appear verbatim in it.

As a baseline, git's delta-compressed storage of every version reachable from HEAD is divided by the bytes of HEAD text.

How much a history repeats and what deduplication keeps

In the random sample, every version of every file adds up to a population-weighted median of 19× the current code, with a 95% CI of 17–23. Across the 25 mature repositories the same corpus is 89× the current code, with a range of 18–175×. Counting only files still present at HEAD gives 13× in the sample and 53× in the mature set.

Running the script across versions at the default Jaccard threshold of 0.7 keeps 11% of the sample's history bytes and 2% of the mature set's. Raising the threshold to 0.85 leaves 3.3× in the random sample and 3.7× in the mature set, and 0.9 leaves 4.4× and 5.8×.

The authors' own implementation gives 3.1× (CI 2.7–3.4) on the sample, above the range their addendum anticipated, and they treat it as an upper bound because the released script is what pipelines run. In the 10-repository mature subset, the median source file falls from 44 versions to 2 survivors at 0.7 and to 7–8 at 0.9.

Git's delta-compressed storage holds every version at a median 2.6× the current code in the sample and 4.7× in the mature set.

How much new content a single commit adds

In the mature set, 1.9% of bytes are new and 95.8% already occur.

Most of the copied content comes from the same file: 77% of the sample's post-image bytes, pooled over 80,225 modifying commits, were already in the previous version of that file. In the mature set the same share is 93% pooled, and 95% for the median repository.

For edit corpora, a typical training example is mostly text that is repeated unchanged, so a model charged loss on the whole file spends much of its compute on copying. The authors measured the share of new bytes but not the effect on model quality.

Which version the deduplicator keeps

Its cost is 2.1× the current code in the random sample against 2.0× for the default rule, and 2.2× in the mature set against 2.0×. It needs only a commit date per version, and it adds 0.1–0.2× the current code in extra bytes.

Without training any model, the authors argue that a survivor chosen without regard to time can predate a fix, since the fixes benchmarks use spread into later versions.

Run locally on a 1.28 GB snapshot corpus of 31 repositories, its hashing removed 15.6% of bytes against 16.5% for the local script.

Why deduplication leaves benchmark fixes in place

Within a year of the fix the median is 8, and repository medians run from 10 for Django and Astropy to 44 for Matplotlib.

Django, SymPy, xarray and Flask all-refs counts are lower bounds, since their clones expose only four remote branches.

Deduplication keeps one version of each group and so never removes every copy, but whether the survivor carries the fix depends on the keep rule. Under keep-newest, a group containing fixed versions keeps its newest member, which still holds the fix unless later edits rewrote the fixed lines; under the default rule a group mixing pre-fix and post-fix versions may keep a pre-fix one.

Run before deduplication, the filter deletes every fixed version and keep-newest keeps the newest unfixed one, which leaves a stale state. Run after deduplication, the filter scans about 2× HEAD instead of 19–89×, but it may leave only older, dissimilar versions of a fixed file.

Rules for teams that train on history

The pass costs compute at corpus scale, but the authors note it is one the pipeline already knows how to run.

For edit corpora, keep every version and spend training on the change rather than on the rest of the file. Computing loss only on changed lines stops the model being taught to copy, but the rest is still read, so the authors cite StarCoder's window around each change as the alternative.

Every pipeline should also keep a count of versions per file, using one pass over git log with the raw output and version sizes. The first three rules follow one observation applied three times: the deduplicator treats each version as a separate document, so the surplus versions are removed, the surviving version is chosen by date, and the benchmark versions are removed.

Limitations

The Stack v2 Spark job was not run end to end; only its hashing was run, on a local corpus.

The random sample excludes repositories under 200 commits, and the corpus multiple rises with commit count, so the excluded tail is likely lower. RQ4 concerns one benchmark and its 12 repositories, all Python.

Paper info

Authors
Saurabh Chopra
Venue
arXiv · Preprint
First published
2026-11-20
Added
2026-11-23
Updated
2026-11-20
Version
v1
arXiv
2611.27154
Category
cs.SE · cs.LG
Original paper terms
CC BY 4.0
What we show
Paper info, commentary and permitted figures from the original paper

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

Abstract

Code models are increasingly trained on the full history of software repositories, every version of every file, rather than on a single snapshot. The tools that deduplicate training data were built for snapshots, and what they do to a history has not been measured. We measured it on a pre-registered random sample of 306 public repositories, 25 mature projects, and the 12 repositories behind the SWE-bench benchmark. A history is mostly repetition: in the vocabulary of text indexing, a pangenome, one text in many near-identical variants. The history of a typical repository holds the equivalent of 19 copies of its current code, and a mature repository holds 89. The reason is that each edit changes a few lines and leaves the rest of the file in place: nine tokens in ten of a changed file already existed before the change. Exact-match deduplication removes none of these copies, since no two versions are identical. Large training pipelines already deduplicate their snapshots by grouping near-identical files and keeping one. Applied across versions, the same step brings the repetition down to about two copies. But two problems remain. The deduplicator keeps one version of each file, and in widely used implementations, including the one we measured, the rule for choosing that version ignores dates, so for half of all files the version kept for training is an old one. Sorting versions newest first before deduplicating fixes the problem at almost no cost. The second problem is benchmark answers. Benchmarks such as SWE-bench test a model on real bug fixes, and a merged fix survives in a median of 18 later versions of the files it changed. Therefore, removing benchmark fixes needs a separate step that checks every version. We turn the measurements into a short set of rules for teams that train on code history, and release the instruments and frozen outputs.

Quote from the paper

Saurabh Chopra (2026). Git History Is a Pangenome: Repetition in Code Training Corpora and What Deduplication Removes, Keeps and Misses. arXiv:2611.27154v1. https://arxiv.org/abs/2611.27154v1

BibTeX
@misc{chopra2026history,
  title = {{Git History Is a Pangenome: Repetition in Code Training Corpora and What Deduplication Removes, Keeps and Misses}},
  author = {Saurabh Chopra},
  year = {2026},
  eprint = {2611.27154},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2611.27154v1}
}

See related papersBrowse other papers

Paper preview
Account security

Connect Google account

If you connect a Google account, you can sign in with it too.

Refivu

Delete account

Refivu
Refivu

Sign up