Datasets:

Modalities:
Text
Formats:
arrow
Languages:
code
ArXiv:
Libraries:
Datasets
License:
git-commits / README.md
iNeil77's picture
Update README.md
82aaa3e verified
|
raw
history blame
8.51 kB
metadata
tags:
  - code
  - github
  - commits
  - multilingual
license: apache-2.0
task_categories:
  - text-generation
language:
  - code
size_categories:
  - 10M<n<100M

Themis-Git-Commits

arXiv Models Datasets & Benchmarks GitHub Docker

Overview

Themis-Git-Commits is a large-scale dataset of single-file code commits mined from permissively licensed GitHub repositories via the BigQuery GitHub public dataset. The SQL query restricts to repositories under permissive open-source licenses only (MIT, Apache-2.0, BSD-2/3-Clause, ISC, CC0-1.0, EPL-1.0, MPL-2.0, Unlicense, AGPL-3.0, LGPL-2.1, Artistic-2.0). The BigQuery snapshot used contains commits up to early 2022 — predating the widespread availability of LLM code generation tools — ensuring that all code changes in the dataset represent genuine human-authored preferences.

This is the raw commit dataset — prior to merging with pull request data to subset only for merged commits. It serves as the foundational data source for the commit-based preference pairs in Themis-CodePreference, which is used to train the Themis-RM suite of multilingual code reward models.

Each row represents a single commit that changes exactly one file in a repository with a permissive open-source license. The dataset includes the commit metadata (SHA, message, timestamp, license) along with the pre-commit and post-commit file contents, enabling downstream construction of code-change preference pairs across multiple quality dimensions.

Collection Pipeline

The commit mining pipeline is described in detail in the Themis paper and the Dataset folder in the GitHub repository. The BigQuery SQL query and scraping infrastructure are modified from the OctoPack pipeline (CommitPack); the subsequent filtering, classification, and preference construction stages are original to Themis. At a high level:

  1. BigQuery Mining — A GoogleSQL query (modified from OctoPack) extracts single-file commits from bigquery-public-data.github_repos, filtering for permissive licenses, target programming languages, and non-trivial commit messages.

  2. Repository Reputation Filtering — Commits are subset to those originating from curated high-reputation repositories (15+ GitHub stars, 5+ contributors, 10+ issues).

  3. Content Retrieval — The pre-commit (old_contents) and post-commit (new_contents) file contents are fetched from GitHub via shallow git fetches using retrieve_commit_contents.py.

  4. MinHash Deduplication — Near-duplicate content is removed using MinHash LSH deduplication (shingle size 5, 256 permutations, Jaccard threshold 0.7).

Downstream Processing (Not in This Dataset)

The steps below are applied downstream and are not reflected in this raw dataset:

  • Extension Filtering — Commits are filtered so the changed file's extension matches a target programming language. Applied in Themis-Git-Commits-Merged.
  • Pull Request Cross-Referencing — Commits are cross-referenced with GHTorrent pull request data (through end of 2021) to retain only non-reverted commits that are part of successfully merged pull requests, ensuring implicit human validation. Applied in Themis-Git-Commits-Merged.
  • Temporal Subsetting — For training data (Themis-CodePreference), only commits pushed before March 2019 are retained. For benchmark data (Themis-CodeRewardBench), commits are scoped to June 2019 – January 2021 from disjoint repositories.
  • Aspect Classification — Commits are assigned to quality dimensions (Functional Correctness, Runtime Efficiency, Memory Efficiency, Security Hardness, Readability & Maintainability) using criteria-specialized ModernBERT commit classifiers, trained on seed positives retrieved via curated term lists.
  • LLM Scoring & Instruction Synthesis — Frontier LMs validate preference strength and generate realistic inverse instructions.
  • LLM-as-a-Judge Preference Labelling — Multi-sample voting with frontier LMs produces consensus preference labels.

Dataset Schema

Column Type Description
commit string Git commit SHA
subject string First line of the commit message
message string Full commit message body
repos string Comma-separated list of repository names containing this commit
file_path string Path of the changed file
license string SPDX license identifier of the source repository
unix_time int64 Committer timestamp (seconds since epoch)
new_contents string File contents after the commit (post-commit)
old_contents string File contents before the commit (pre-commit)

Filters Applied During Mining

Filter Purpose
License allowlist MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, CC0-1.0, EPL-1.0, MPL-2.0, Unlicense, AGPL-3.0, LGPL-2.1, Artistic-2.0
Language allowlist Python, Java, JavaScript, C, C#, C++, TypeScript, Go, Ruby
Message length 10 < length < 15,000 characters
Message blocklist ~50 low-signal messages excluded (e.g., "initial commit", "wip", "yolo")
Pattern exclusion Merge commits and CI push messages filtered out
Same-path constraint old_path = new_path — file was modified in place, not renamed or moved
Single-file constraint Commit touches exactly one file
Content retrieval Both pre-commit and post-commit file contents successfully fetched
Near-deduplication MinHash LSH with Jaccard threshold 0.7

Usage

from datasets import load_dataset

dataset = load_dataset("project-themis/git-commits")

# Inspect a sample
sample = dataset["train"][0]
print(f"Commit: {sample['commit']}")
print(f"Subject: {sample['subject']}")
print(f"License: {sample['license']}")
print(f"File: {sample['file_path']}")
print(f"Old contents length: {len(sample['old_contents'])}")
print(f"New contents length: {len(sample['new_contents'])}")

License

This dataset is released under the Apache 2.0 License. The source commits are drawn exclusively from repositories with permissive open-source licenses (see filter table above).

Citation

@article{themis2025,
  title={Themis: Training Robust Multilingual Code Reward Models for Flexible Multi-Criteria Scoring},
  author={Paul, Indraneil and Gurevych, Iryna and Glava\v{s}, Goran},
  journal={arXiv preprint arXiv:2605.00754},
  year={2025}
}