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

Saurabh ChopraarXiv 2026

Imagine you’re trying to learn to code by reading every single version of every file in a giant project’s history. You’d quickly realize that you’re reading the same lines over and over again. In fact, for every new thing you learn, you’re re-reading about nine things you already knew.

This is the reality for modern Large Language Models (LLMs) trained on "full-history" code datasets. In a new paper from GitLab, researcher Saurabh Chopra explores why this massive repetition—which he calls a pangenome—is a headache for training and how our current tools for cleaning data are failing to keep up.

TL;DR

Training AI on full git history is like reading the same book 89 times, with only a few words changed in each edition. This paper reveals that standard deduplication tools are "time-blind," often forcing models to learn from stale, buggy versions of code while accidentally leaking benchmark answers into the training set.

What Problem Does This Paper Address?

For years, code models were trained on "snapshots"—the latest version of a repository. Recently, the trend has shifted toward training on the full history (every commit) to teach models not just what code looks like, but how it changes.

The problem? Git history is incredibly redundant. If you edit one line in a 1,000-line file, the "new" version is 99.9% identical to the old one. Standard deduplication tools were built for snapshots, where they look for identical files across different projects. When you point these tools at the timeline of a single file, they get confused. They either miss the repetition entirely (because the files aren't exactly the same) or they pick a random version to keep, which might be a buggy version from three years ago instead of the fixed version from yesterday.

Methods

The author analyzed three groups of repositories: a random sample of 306 public repos, 25 "mature" projects (the heavy hitters), and the 12 repos used in the popular SWE-bench benchmark.

To measure the mess, they used:

  • A Repeat Counter: To see how many times a typical byte of code appears in a project's history.
  • BigCode’s Deduplicator: A standard industry tool (using MinHash and Locality-Sensitive Hashing) to see what actually gets removed.
  • A Byte Attributor: A custom tool based on the LZ77 compression algorithm to precisely identify which bytes in a commit are actually "new" vs. copied from the past.
  • Benchmark Overlap Tests: To track how a specific bug fix "survives" through subsequent versions of a file.

Datasets

  • Random Sample: 306 repositories across 8 languages (Python, Java, C++, etc.) from the GitHub Search dataset.
  • Mature Set: 25 projects with long histories, including infrastructure tools and major libraries.
  • SWE-bench: 12 Python repositories (like Django and scikit-learn) used to evaluate how well AI can fix real-world bugs.

Key Insights and Ideas

  • The "90% Old" Rule: In a typical commit, nine out of ten tokens already existed in the repository. We are spending massive amounts of compute teaching models to "copy-paste" existing code rather than learning the logic of the change.
  • Deduplication is Time-Blind: Most deduplicators pick a "survivor" from a group of similar files based on a random hash. This means that for about half of your files, the model is being trained on a "stale" version.
  • The Benchmark Ghost: When a developer fixes a bug, that fix persists in every future version of that file. If a deduplicator keeps any version of the file from after the fix was merged, the model has effectively "seen the answer" to the test. This is a major source of data contamination.
  • The Pangenome Analogy: Borrowed from biology, a pangenome is a collection of near-identical genetic sequences. Software history is exactly this: a single "organism" (the code) evolving through thousands of slightly different iterations.

Key Results

The scale of the repetition is staggering. As shown in Figure 1, a typical repository history contains 19x more data than its current state. For mature projects, that number jumps to 89x.

![Fig.

  1. Bytes relative to the current code (HEAD text) along the pipeline.](/figures/art_431331bf69034cb5b5b18abc30e62f88)
  2. Exact deduplication does nothing: Because every commit changes at least one byte, no two versions are identical.
  3. Near-deduplication helps, but... While tools like MinHash can bring that 89x multiplier down to about 2x, they only keep the "current" version of a file 40–52% of the time.
  4. The "Newest-First" Fix: The author found that simply sorting versions by date before deduplicating ensures the model sees the latest code 94% of the time, at virtually no extra cost.
  5. Fix Persistence: A merged bug fix survives in a median of 18 later versions of the file (see Figure 3). This means you can't rely on deduplication to "decontaminate" your data; you need a specific pass to scrub benchmark solutions from every single version in the history.

![Fig.

  1. Later versions carrying a SWE-bench gold fix.](/figures/art_df0fafb31efa416b9d47f084e71cab7f)

Limitations and Future Work

The paper focuses on measuring the data, not the models. While we know that repeated data hurts model performance, the author didn't run training experiments to see exactly how much "stale" code degrades a model's ability to write modern APIs.

Future work could involve "edit corpora"—training models specifically on the diffs (the changes) rather than the full files—to see if that's a more efficient way to capture the "signal" of git history without the "noise" of the pangenome.

Summary updated

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