Datasets:
The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.
SWE-bench Complex
A contamination-free, complexity-focused evaluation set for AI coding agents.
SWE-bench Complex is a curated dataset of 115 real-world GitHub issues from major Python open-source projects, designed specifically for studying code complexity in AI-generated patches. All tasks were merged between January–March 2026, guaranteeing they postdate the training cutoff of current frontier models.
Task-Text Judge Comparison
GPT-5.4 reviewed solver-visible text across Complex (115), Lite (300), Verified (500), and Pro (731) using independent 0-3 scales for clarity concern, internal inconsistency and visible repair disclosure.
All 1,646 task memberships are included, including 30 reviews with quotation flags and three unresolved disclosure ratings. These are uncalibrated model judgments, not human-validated quality scores. Disclosure measures visible guidance, not contamination, correctness or a quality penalty. A recent merge date alone cannot guarantee an unseen task.
The judge method, full rubric and comparisons explain inputs, repetitions, deterministic response selection, exact quotation checks, denominators and limitations. Separate PNGs are available for clarity, consistency, and repair disclosure, alongside vector PDFs, the exact prompt and schema, aggregate counts, pinned dataset revisions and artifact hashes.
This documentation release does not change the 115-task dataset. The judge study uses frozen dataset revisions recorded in its manifest; it does not use a moving repository HEAD.
Why SWE-bench Complex?
Existing benchmarks like SWE-bench Verified suffer from two problems for complexity research:
1. Data Contamination
Over 94% of SWE-bench issues predate current LLM training cutoffs. Aleithan et al. found that 32.67% of successful patches involve "cheating" through solution leakage, and resolution rates dropped from 12.47% to 3.97% when leaked instances were filtered out (SWE-bench+, 2024).
All SWE-bench Complex instances postdate the training cutoffs of:
| Model | Provider | Training Cutoff | Gap |
|---|---|---|---|
| Claude Opus 4.6 | Anthropic | Oct 2025 | 3+ months |
| GPT-5.3-Codex | OpenAI | Sep 2025 | 4+ months |
| GPT-5.4 | OpenAI | Nov 2025 | 2+ months |
| Gemini 3.1 Pro | Oct 2025 | 3+ months |
2. Trivial Patches
SWE-bench Verified has a median patch size of just 7 changed lines — 44.6% of tasks require only 1–5 lines. These trivial patches yield near-zero complexity deltas, reducing statistical power for quality studies.
SWE-bench Complex targets substantive patches with a median of 45 changed lines — 6.4× larger than SWE-bench Verified.
Dataset Comparison
| Characteristic | SWE-bench Verified | SWE-bench Complex |
|---|---|---|
| Tasks | 500 | 115 |
| Repositories | 12 | 8 |
| Median changed lines | 7 | 45 |
| Mean changed lines | 14.3 | 74.4 |
| Mean Python files changed | 1.2 | 3.9 |
| Human ΔCC (mean) | +1.14 | +4.06 |
| Human ΔLLOC (mean) | +2.77 | +19.08 |
| Human ΔMI (mean) | −0.230 | −0.417 |
| Human ΔCogC (mean) | N/A | +3.63 |
| Post-training-cutoff | <6% | 100% |
Complexity metrics measured using Wily v2:
- ΔCC: Cyclomatic Complexity change (McCabe, 1976)
- ΔLLOC: Logical Lines of Code change
- ΔMI: Maintainability Index change (Oman & Hagemeister, 1992)
- ΔCogC: Cognitive Complexity change (Campbell, 2018)
Repository Distribution
| Repository | Instances |
|---|---|
| django/django | 37 |
| astropy/astropy | 22 |
| pydata/xarray | 15 |
| scikit-learn/scikit-learn | 14 |
| matplotlib/matplotlib | 9 |
| pylint-dev/pylint | 9 |
| sympy/sympy | 8 |
| pallets/flask | 1 |
Selection Criteria
Instances were collected from merged pull requests in the SWE-bench ecosystem repositories with the following filters:
- Date range: Merged January 1 – March 10, 2026 (post-training-cutoff)
- Issue linkage: PR explicitly references a GitHub issue via "fixes #N" or equivalent
- Test coverage: PR includes both implementation and test changes to Python files
- Minimum complexity: Implementation patch modifies ≥4 changed lines
- Python files: Only
.pyfile changes retained - Manual review: Each candidate reviewed for solvability — documentation-only changes, large-scale refactors (>300 lines or >10 files), and tasks requiring external domain knowledge were excluded
From 1,043 scraped PRs → 712 with issue references → 224 after automated filters → 119 after manual review → 115 with validated four-state test contracts.
Schema
Each instance contains:
| Field | Type | Description |
|---|---|---|
instance_id |
string | Unique identifier ({owner}__{repo}-{pr_number}) |
repo |
string | GitHub repository (owner/repo) |
base_commit |
string | Parent commit SHA |
problem_statement |
string | GitHub issue text (title + body) |
test_patch |
string | Unified diff of test-file changes |
human_patch |
string | Unified diff of implementation-file changes |
pr_number |
int | Pull request number |
pr_url |
string | Pull request URL |
pr_merged_at |
string | Merge timestamp (ISO 8601) |
issue_number |
int | Referenced issue number |
issue_url |
string | Issue URL |
human_changed_lines |
int | Total changed lines in the human patch |
FAIL_TO_PASS |
string | JSON array of test IDs that must go FAIL→PASS |
PASS_TO_PASS |
string | JSON array of test IDs that must remain PASS |
SWE-bench Compatibility
SWE-bench Complex uses the same schema as SWE-bench Verified and can be evaluated using the standard SWE-bench harness:
python -m swebench.harness.run_evaluation \
-d anthonypjshaw/SWE-bench_Complex \
-s test \
-p predictions.jsonl \
-id my_run \
--max_workers 4
Test construction and reproducibility
The test-construction report documents candidate screening, environment recovery, the B0/B1/G1/G2 protocol, classification rules, explicit test-patch repairs, and the four excluded candidates.
The reproducibility/ directory contains the generated
ARM64 Docker build contexts for all 115 accepted instances: one base layer, 72
deduplicated environment layers, and one instance layer per task. It also
contains a manifest, SHA-256 checksums, a layered image builder, the frozen
environment evidence, contract audit, and the exact runner and override code.
python reproducibility/build_images.py --instance django__django-20766
Usage
from datasets import load_dataset
dataset = load_dataset("anthonypjshaw/SWE-bench_Complex", split="test")
print(f"Tasks: {len(dataset)}")
print(f"Repos: {len(set(dataset['repo']))}")
Citation
If you use SWE-bench Complex in your research, please cite:
@inproceedings{Shaw2026SWEbenchComplex,
author = {Shaw, Anthony},
title = {Beyond the Benchmark: A Contamination-Free Study of {AI} Code Complexity Across Four Frontier Models},
booktitle = {Proceedings of the IEEE International Conference on Software Engineering (SSE)},
year = {2026},
}
License
MIT License. The dataset contains references to publicly available open-source code under their respective licenses.
- Downloads last month
- 202
