Skip to content

BenchChecker: Evaluating the trustworthiness of defect repair benchmarks for LLMsBenchChecker: Assessing the Credibility of Bug-Fixing Benchmarks for LLMs

arXiv· arXiv:2610.19447· USENIX Security 2026· Di Wu, Xu He, Shu Wang, Kun SunGeorge Mason University; Palo Alto Networks, Inc.Indexed by this site · 2026-10-15· Originally publishedTools

Quick read

Evaluation and benchmarks

Based on the paper PDF (AI-generated); refer to the original

BenchChecker uses text output to detect contamination in bug-fix benchmarks, and the authors claim leaderboard resolution rates are overestimated.

Questions
Bug-fix benchmarks often come from popular open-source repositories, and patches often remain in training snapshots; closed-source models do not disclose training sets and only provide text, so logit membership inference cannot be directly used, and resolution rate may mix in memorization.
Methods
BenchChecker only reads text outputs: uses hits of signature snippets for repository existence hypothesis testing, then aligns patches with cutoff snapshots via similarity, and when uncertain, uses test suites to check equivalent implementations.
Experiments and results
On three models across six benchmarks, the authors claim AUC about 0.9 and FPR no higher than 0.1, outperforming logit baselines. After filtering SWE-bench Verified and Multi-SWE-bench, the authors claim medium-difficulty resolution rate relatively declines by more than 20%.
Limitations and future work
The authors point out word-level rather than structural-level distinctiveness, patches must remain in the cutoff snapshot, and text pollution from issues without corresponding code. Controlled evaluation covers three open-source models and six Python/Java benchmarks; empirical results are 159 submissions from two leaderboards as of October 2025.
Experimental setupStarCoder-15B、StarCoder2-15B et al. · SWE-bench Verified、BugsInPy et al. · AUC、TPR et al.
Evaluated models
StarCoder-15BStarCoder2-15BCodeGen2-16BDoubao-SeedClaude-4-SonnetClaude-4-OpusGPT-5Gemini-2.5-ProClaude-3.7DeepSeek-R1OpenAI o1Claude-3.5OpenAI o3Llama-4GPT-4Claude-3Llama-3GPT-4oQwen2.5-CoderGemini-2.0DeepSeek-V3Qwen3-CoderDoubao-1.5OpenAI o3-mini
Benchmarks
SWE-bench VerifiedBugsInPyBugSwarmMulti-SWE-benchDefects4JGrowingBugsRepoBenchThe Stack v2
Metrics
AUCTPRFPRresolution ratep-valueexact match rate
AI summaryThe paper proposes the BenchChecker framework to detect data contamination in defect repair benchmarks, compatible with both open-source and closed-source models. The method is based on the observation that persistent patches may remain in recent repository snapshots used for training, and employs a two-stage forensic detection that uses only the model's text outputs and public repository history: the first stage probes the model with code prefixes to infer whether a sample entered training; the second stage verifies whether the patch persists through similarity alignment and test suite validation. On StarCoder-15B, StarCoder2-15B, and CodeGen2-16B trained on The Stack v2, the method achieves an AUC of approximately 0.9 across six benchmarks. Applied to SWE-bench Verified and Multi-SWE-bench, filtering contaminated samples reduces the reported resolution rates of most LLMs on medium-difficulty tasks by more than 20% relative to the original values.

The paper proposes the BenchChecker framework to detect data contamination in defect repair benchmarks, compatible with both open-source and closed-source models. The method is based on the observation that persistent patches may remain in recent repository snapshots used for training, and employs a two-stage forensic detection that uses only the model's text outputs and public repository history: the first stage probes the model with code prefixes to infer whether a sample entered training; the second stage verifies whether the patch persists through similarity alignment and test suite validation. On StarCoder-15B, StarCoder2-15B, and CodeGen2-16B trained on The Stack v2, the method achieves an AUC of approximately 0.9 across six benchmarks. Applied to SWE-bench Verified and Multi-SWE-bench, filtering contaminated samples reduces the reported resolution rates of most LLMs on medium-difficulty tasks by more than 20% relative to the original values.

Paper analysis

6 questions; open one to read the full answer

  1. What problem does this paper attempt to solve?

    When closed-source models only provide text, it is difficult to check whether bug-fix benchmarks are contaminated by training data using logits.

    If patches from bug-fix benchmarks have already entered the training set, resolution rate mixes in memorization, not just repair capability.

    • Where it appears: The authors say code LLMs include recent repository snapshots before the cutoff to maintain freshness, while bug-fix benchmarks are mostly drawn from popular open-source repositories. The abstract states OpenAI stopped reporting SWE-bench Verified scores due to contamination concerns. The authors say that across six commonly used benchmarks, over 85% of source repositories appear in The Stack v2, and over 50% of test patches still remain in the corresponding repositories (Table 1 gives breakdowns).
    • Existing limitations: Training sets are usually not public; closed-source models only give text, so logit-based membership inference cannot be used directly. Directly generating patches and comparing is also unstable: context can imply similar patches, equivalent but differently written fixes are missed, and long agent trajectories can rewrite the final diff.
    • Core observation: Patches merged early and not deleted before the cutoff are likely to remain in recent snapshots. Contamination is therefore split into two necessary conditions: the repository is in the training set, and the target patch was merged before the cutoff and persists.
    • This paper proposes: BenchChecker, a forensic two-stage detection method that uses only text outputs and public repository history, for both open-source and closed-source models. The first stage tests whether a repository entered the training set; the second verifies whether the patch remains in the cutoff snapshot.
    • Detection setup: Input is a patch, source repository, and target LLM with known cutoff but unknown training set. The authors set the system as black-box, with access only to text outputs. It needs benchmark metadata, open-source code history, and cutoff; when cutoff is not published, it can be estimated from release date.
  2. What related research exists?

    The paper discusses benchmark contamination, logit membership inference, and patch existence testing; the authors state it relies only on text outputs.

    Contamination in bug-fix benchmarks

    • Ramos et al. (2024) use metrics such as negative log-likelihood to assess LLM memorization of Defects4J.
    • Liang et al. (2025) observe that several models achieve high file-path identification accuracy on SWE-bench Verified despite lacking repository structural information.
    • Kong et al. (2025) heavily mutate code on Defects4J and check whether models still produce the original patch. The paper also states recent cybersecurity benchmarks show limited cutoff effects on vulnerability detection, patching, and PoC generation.

    Membership inference and direct querying

    • Carlini et al. (2021) and later work use confidence or logits to determine whether a sample is in the training set. The paper states such methods rely on logits and cannot be directly applied to closed-source models that provide only text.
    • Querying with defect samples and comparing generated patches: The paper considers this unreliable. Similarity itself cannot distinguish between memorization and generalization; long interactions in modern agents can substantially rewrite the final diff.

    Patch presence testing

    • The security field's patch presence test, when not relying on version numbers or changelogs, checks whether a known security patch has been incorporated into an executable or firmware, used for closed-source components, third-party libraries, and supply chains. The paper states their scenario differs: source code is available, defects are in the target repository, and benchmarks have built-in test suites.

    Baselines and benchmarks

    • Baseline methods: Loss, Zlib, Reference-based (Ref), Min-K%. The paper claims to its knowledge BenchChecker is the first detection method for contaminated samples in bug-fix benchmarks, so these logit-based membership inference methods are used as baselines.
    • Benchmarks/datasets: SWE-bench Verified, BugsInPy, BugSwarm, Multi-SWE-bench, Defects4J, GrowingBugs; membership is referenced against The Stack v2. Empirics also use leaderboard submissions from the first two benchmarks.

    The authors position this as a two-stage forensic framework relying only on text output and covering both open-source and closed-source models, and claim it outperforms logit-based baselines across multiple benchmarks.

  3. How does the paper address this problem?

    BenchChecker first tests whether the repository is in the training set, then checks whether the patch remains in the cutoff snapshot.

    BenchChecker splits contamination detection into two steps: whether the repository is in the training set, and whether the patch remains in the cutoff snapshot. It only reads text outputs and public history, not logits.

    Problem Setting and Time Overlap

    • Input and black-box: A defect sample (patch and its source repository) plus a target LLM with known cutoff and unknown training set. The authors assume access to benchmark metadata, open-source code history, and cutoff.
    • Ground truth: If the patch lifecycle overlaps with the snapshot collection interval, it is ground-truth contaminated; otherwise clean. Figure 1 divides into four categories. Patches that persist until cutoff and are introduced before collection ends overlap with the interval; those introduced after collection ends but before cutoff are false positives, which the authors consider usually short; those that exist after collection starts but are deleted before cutoff are false negatives, which the authors state account for about 10% of samples; those deleted before collection starts should be judged clean.
    • Only checking cutoff snapshot: Does not track historical commits one by one. The authors state that patch deletion followed by re-introduction is rare, so presence in the snapshot can be considered as persisting since introduction.

    Stage I: Repository Existence Test

    • Hits: Split code snippets into prefix query and suffix target, generate a set of responses for the query; a target appearing in the response set counts as a hit. The authors assume seen repositories have higher hit probability and rely on multiple rare, high-entropy hits rather than a single hit.
    • Signature snippets: Must appear more than once within the repository; the number of repositories in the reference corpus containing the target does not exceed threshold τ; the conditional entropy of the target given the query is not below δ. The reference corpus is OctoPack, and the authors state its common word set overlaps 98% with The Stack v2. Targets are simplified to single words for precomputed word frequencies and constant-time queries.
    • Hypothesis testing: The null hypothesis is that hit probability does not exceed the default probability P0 for unseen repositories. P0 can be estimated from the average hit rate of out-of-training repositories, or set to a small empirical value, e.g., 0.1 in the text. The p-value is the probability of at least k hits in n trials: p=\sum_{i=k}^{n}\binom{n}{i}P_0^{i}(1-P_0)^{n-i}. Smaller p supports the repository being in the training set. Snippets from the same repository are not independent; the authors use pattern deduplication and query deduplication to mitigate correlation. Hits are weighted by "prediction entropy / frequency of repositories containing the target", so no explicit feature threshold is set, leaving only P0 as a hyperparameter.
    • Extraction: NiCad 6.2 finds code block clones, Simhash clusters duplicate text, PrefixSpan mines word co-occurrence; SequenceMatcher extracts templates and does syntactic deduplication. Entropy is computed by Qwen2.5-Coder-0.5B on subwords, taking the maximum loss of unrevealed subwords. This stage uses only one snapshot, taken as the cutoff snapshot in the text.

    Stage II: Patch Existence Test

    • Preprocessing and localization: Remove comments and documentation, extract fix code blocks and normalize. Python uses Black, Java uses JavaParser. First restrict scope to functions in the target class, then use GumTree for AST alignment; on failure, do fuzzy syntactic matching within that scope. The authors state full-text search is slow and causes false positives due to intra-repository reuse.
    • Similarity: Lines without exact matches first use edit distance for candidates, then rerank with jina-code-embeddings-0.5B. If every patch block has a corresponding block with similarity above the threshold, it is judged contaminated.
    • Test fallback: When similarity cannot decide, replace the patch block with aligned code from the snapshot, apply to the buggy version, and run the sample's test suite. If all pass, it is judged contaminated, indicating an equivalent implementation exists in the cutoff snapshot. The authors state this is only a fallback because snapshot context changes often prevent diff application.

    Decision Method

    • Stage I directly uses the p-value as evidence of repository existence; Section 6 empirically judges repository existence with p<0.05. Stage II does not query the model, so results are identical across models on the same training set.
    • The method text does not give final P0 and similarity thresholds; Section 5.5 selects them on validation sets by language, see Question 4.
  4. What experiments did the paper conduct?

    The authors state that on Table 2, it outperforms logit baselines, and medium difficulty resolution rate relatively decreases by more than 20%.

    Experimental Setup

    • Controlled models: StarCoder-15B, StarCoder2-15B, CodeGen2-16B. The paper states all three were trained on The Stack v2, with known membership. This dataset contains 7,505,725 Python repositories and 7,997,020 Java repositories, with a cutoff of September 2023.
    • Six benchmarks (Table 1): SWE-bench Verified 12 repos/500 samples, BugsInPy 17/500, BugSwarm 34/170, Multi-SWE-bench 9/128, Defects4J 17/835, GrowingBugs 171/1839. Languages are Python and Java.
    • Baselines and metrics: Loss, Zlib, Ref, Min-K%. Metrics are AUC, TPR, FPR. Labels come from The Stack v2 membership, not LLM judges.
    • Stage I negative examples: Most benchmark repositories are already in The Stack v2. The authors add repositories created after September 2023, with at least 500 stars and automated tests, 100 each for Python and Java. Hyperparameters are tuned on BugSwarm and GrowingBugs with a 1:4 validation/test split.
    • Empirical protocol: SWE-bench Verified and Multi-SWE-bench (Java subset) up to October 2025, with 159 submissions (123+36) disclosing underlying models. When cutoff is not disclosed, the authors assume three months before the release date. P0 is calibrated separately for each target model on post-cutoff repositories; similarity thresholds come from The Stack v2. Stage I uses p<0.05判仓库存在。Table 8、Table 9还报告Claude-3、Llama-3、Qwen2.5-Coder、Gemini-2.0、DeepSeek-V3、Qwen3-Coder、Doubao-1.5、OpenAI o3-mini。
    • 实现模型:熵用Qwen2.5-Coder-0.5B,相似度用jina-code-embeddings-0.5B。论文未报告每次query的响应候选集大小,也未报告查询次数。

    主结果

    Table 2中BenchChecker(Ours)的AUC:

    Swipe horizontally to read the table

    基准StarCoder-15BStarCoder2-15BCodeGen2-16B
    SWE-bench Verified0.9450.9450.945
    BugsInPy0.9090.9190.905
    BugSwarm0.8650.9340.875
    Multi-SWE-bench0.9190.9190.919
    Defects4J0.8630.8500.863
    GrowingBugs0.8630.8380.859
    • 作者称只使用文本输出即优于四个logit基线,基线AUC多在0.5附近。Table 2中亦有更高的基线格子,例如Ref在BugSwarm、CodeGen2-16B上为0.654。
    • 作者称完整评测的FPR不超过0.1。Table 2中Ours在SWE-bench Verified上三模型FPR均为0.090、TPR均为0.979;Multi-SWE-bench的FPR均为0.100;Defects4J的TPR为0.777、0.746、0.777。
    • 作者称Java基准表现相对较低,并归因于代码复用带来的假阴性。Table 1括号内,cutoff快照已无但The Stack v2仍有的比例,三个Python基准为3.2%、3.3%、3.5%,三个Java基准为10.8%、10.2%、11.6%。

    仓库与补丁分阶段

    • Stage I(Table 3):SWE-bench Verified上AUC为1.000、0.999、1.000,TPR均为1.000,FPR为0.000、0.010、0.000。作者称该基准与Multi-SWE-bench上AUC和TPR接近1.0;后者三模型AUC为0.985、0.925、0.991,StarCoder2-15B的FPR为0.298。假阳性主要来自cutoff后负例中的代码复用(90.3%)。
    • Stage II(Table 4):假定仓库已在训练集中,且不查询模型,三模型数字相同。SWE-bench Verified为AUC 0.938、TPR 0.979、FPR 0.103;Defects4J为0.863、0.777、0.051。作者称logit基线分不清细粒度补丁是否被记住;Figure 4的单行字面量修改在logit分数上几乎不变。
    • 假阴性:作者称Stage II假阴性中87.0%是更早快照有补丁、cutoff快照已不可见,13.0%是大幅重构。对重构仍在的情形,相似度匹配处理77.0%的中等改写,测试套件再找回11.0%,其余12.0%仍然困难。

    排行榜过滤后的resolution rate

    • 协议:去掉被判污染的样本后,比较官方提交的resolution rate。相对下降是相对原比率;过滤后分母变小,且随模型cutoff不同而不同。难度分为SWE-bench Verified的<15 min、15-60 min、1-4 h、>4 h, and Multi-SWE-bench Easy, Medium, Hard.
    • Numbers: The authors state the top 10 relatively decrease by more than 20% on medium difficulty. In Table 6's 1-4 h, TRAE/Doubao-Seed is 19/42→9/25, a relative decrease of 20.4%; the lowest is Prometheus/GPT-5 at 20.0% (15/42→6/21), the highest is OpenHands/GPT-5 at 28.6%. The highest overall relative decrease is OpenHands/Claude-4-Sonnet at 11.8% (352/500→108/174). In Table 7, SWE-agent/Llama-4 overall relatively decreases by 55.9% (20/128→4/58), and Medium by 76.4% (12/65→1/23). The authors state that for Multi-SWE-bench top 10, Medium averages about 40% and Easy about 20%. Hard is mostly 0 before and after filtering. >4 h original denominator is 3, after filtering 1. Table 6 also shows increases: TRAE's 15-60 min is 2.1%, Refact's <15 min is 0.7%.
    • Author interpretation: Higher difficulty relies more on memorization; changing frameworks with the same underlying model gives similar relative decreases. The authors state that 7 of the top 10 on SWE-bench Verified use Claude-4 series, with overall relative decreases from 8% to 11%; in Table 6, Refact/Claude-4-Sonnet is 7.3%, Lingxi is 7.6%, OpenHands/Claude-4-Sonnet is 11.8%. The introduction states the contamination gap dropped from 40% in 2023 to 5% in 2025; Section 6.2 states the overall gap dropped from 42.5% to 5.2%, corresponding to Table 8's GPT-4 (112/500→17/132) and Doubao-Seed (394/500→130/174). For 15-60 min, the authors state it dropped from 55.8% to near 0%, but Doubao-Seed's subset increased by 2.1%. The authors also state that models with higher reported scores show smaller decreases after filtering. For every closed-source model analyzed, Stage I judges these repositories present with p<0.05.

    Repair Patterns with Seen and Unseen Patches

    • Seen but not fixed (30 stable in top 10 submissions): The authors state the most common is defect localization failure (16/30), followed by partial fixes (8/30). Figure 8 gives an example of localizing to the wrong function.
    • Unseen but fixed (61): 49/61 are single-file changes, 35/61 include specific trigger conditions, 21/61 have issues that directly give solution hints.
    • Unseen and not fixed (25): 25/25 have no clear solution hints, 15/25 require cross-file changes. The authors state single-file, self-contained defects are easier, and cross-file dependencies remain difficult.

    Other Ablations and Analyses

    • Removing repetitiveness: AUC 0.663, TPR 0.428, FPR 0.064 (Table 5, SWE-bench Verified, StarCoder-15B)
    • Removing distinctiveness: FPR 0.486; removing context-independence: FPR 0.323
    • Removing preprocessing AUC 0.786; removing localization FPR 0.287; removing similarity matching AUC 0.688; removing test verification TPR 0.891 (same table)
    • P0 about 0.08 (Python) and 0.2 (Java) (Figure 5); similarity threshold 0.7 (Figure 6); temperature deviation from default 1.0 changes AUC by at most 0.02 (Figure 7)
    • RepoBench v1.1 Cross-File-First: 580 repos, 5,054 questions; the authors state that when a repository is in the training set, exact match is up to 60% higher than for unseen repositories. In Table 10, the number of repositories with p<0.05 is 78, 82, 68 (CodeLlama-34B, DeepSeekCoderV2-Lite, GPT-4o); the authors state about 15%
    • Table 1: The proportion of source repositories entering The Stack v2 is 85.2%–100.0%, and patches 62.4%–78.9%
  5. What are some points that can be further explored?

    The authors point out lexical-layer distinguishability, cutoff snapshot assumptions, and lack of coverage for text contamination without corresponding code.

    Limitations and Future Directions Noted by the Authors

    • Lexical-level distinctiveness: For scalability, Stage I mainly judges target rarity at the lexical level rather than structural level (Section 7 Limitations and Future Work).
    • Cutoff snapshot assumption: If patches appear only in earlier training snapshots, are deleted before cutoff, or are heavily refactored, contamination may be underestimated. The authors state dataset analysis shows such samples are a small fraction, and refer to Section 5.2 (Section 7).
    • Artifacts without corresponding code: Does not directly cover contamination in issue descriptions or natural language discussions without comparable code. The authors state leaving these cases for future work (Section 7).

    Experimental Coverage

    • Controlled detection tested models are StarCoder-15B, StarCoder2-15B, CodeGen2-16B, with baselines Loss, Zlib, Ref, Min-K%; the six benchmarks' repository and sample counts are in Table 1, languages Python and Java.
    • Empirical coverage includes SWE-bench Verified and Multi-SWE-bench up to October 2025, with 159 submissions disclosing underlying models; Tables 6 to 9 give resolution rates and difficulty subsets before and after filtering.
    • Appendix A's RepoBench case uses CodeLlama-34B, GPT-4o, DeepSeekCoderV2-Lite, repositories created from 2023-10-06 to 2023-12-31, totaling 580 repositories and 5,054 questions.
    • Entropy computation uses Qwen2.5-Coder-0.5B, similarity uses jina-code-embeddings-0.5B; word frequency reference corpus is OctoPack.
    • The paper does not report the response candidate set size per query in Stage I, nor the number of probe queries. Hyperparameter selection uses BugSwarm and GrowingBugs with a 1:4 validation/test split (Section 5.5).
  6. Summarize the main content of the paper

    Two-stage text detection for bug-fix benchmarks; the authors state medium difficulty resolution rate relatively decreases by more than 20%.

    BenchChecker uses text outputs to check whether LLM bug-fix benchmarks are contaminated by training data, and re-evaluates leaderboards accordingly.

    The problem is that fix patches from popular repositories remain in training snapshots before the cutoff, so models may pass tests by memorization; closed-source models do not provide logits, so existing membership inference cannot be directly applied.

    The approach is divided into two stages. First, extract repetitive, rare, and context-hard-to-predict signature snippets, and use hit counts for a binomial test to determine whether a repository is in the training set. Then align patch blocks with the cutoff snapshot; if embedding similarities all exceed a threshold, it is judged contaminated; when alignment fails, replace the patch with snapshot code and run the original test suite.

    • Table 2: StarCoder-15B, StarCoder2-15B, CodeGen2-16B all have AUC 0.945 and FPR 0.090 on SWE-bench Verified; Ours has the lowest AUC of 0.838 for StarCoder2-15B on GrowingBugs. The authors state that logit baselines are mostly around 0.5, and the full evaluation FPR does not exceed 0.1.
    • Table 1: The proportion of the six benchmark source repositories entering The Stack v2 is 85.2%–100.0%, and patches 62.4%–78.9%.
    • After filtering, on Table 6's 1-4 h, Doubao-Seed relatively decreases by 20.4% (19/42→9/25); in Table 7, Llama-4 overall relatively decreases by 55.9%. The authors state that medium difficulty relatively decreases by more than 20%.
    • The introduction states the gap dropped from 40% in 2023 to 5% in 2025; Section 6.2 and Table 8 state the overall gap dropped from 42.5% (GPT-4) to 5.2% (Doubao-Seed).

    The authors believe the current leaderboard resolution rate is overestimated, and removing contaminated samples better reveals repair ability; they also believe newer models with higher reported scores generalize better. For samples where the patch was seen but not fixed correctly, the authors state the most common cause is defect localization failure (16/30).

Read originalUSENIX Security 2026