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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
pretty_name: CRJudgeBenchmark
|
| 3 |
+
task_categories:
|
| 4 |
+
- text-classification
|
| 5 |
+
size_categories:
|
| 6 |
+
- 1K<n<10K
|
| 7 |
+
tags:
|
| 8 |
+
- code-review
|
| 9 |
+
- software-engineering
|
| 10 |
+
- llm-as-a-judge
|
| 11 |
+
- benchmark
|
| 12 |
+
- code
|
| 13 |
+
- datasets
|
| 14 |
+
configs:
|
| 15 |
+
- config_name: default
|
| 16 |
+
data_files:
|
| 17 |
+
- split: train
|
| 18 |
+
path: train.jsonl
|
| 19 |
+
- split: validation
|
| 20 |
+
path: validation.jsonl
|
| 21 |
+
- split: test
|
| 22 |
+
path: test.jsonl
|
| 23 |
+
---
|
| 24 |
+
|
| 25 |
+
# CRJudgeBenchmark
|
| 26 |
+
|
| 27 |
+
CRJudgeBenchmark evaluates whether a model can judge the technical correctness of a code-review comment in its pull-request context. It contains **1,199 labeled examples from 124 pull requests across 9 GitHub repositories**, with fixed train, validation, and test splits.
|
| 28 |
+
|
| 29 |
+
Each example pairs a pull request with one target review comment. It includes the PR description, a base commit, a review patch, linked issues, and a PR activity timeline. The binary `trustworthy` label applies only to the comment identified by `judged_entry_id`.
|
| 30 |
+
|
| 31 |
+
The dataset supports training and evaluating code-review judges, including agents that inspect repository code before making a judgment. It contains examples and labels; agent trajectories, teacher guidance, and model weights are not included.
|
| 32 |
+
|
| 33 |
+
## Task and labels
|
| 34 |
+
|
| 35 |
+
The current project rubric is **technical correctness and correct file location**:
|
| 36 |
+
|
| 37 |
+
- **`true`**: the target comment is technically correct and attached to the correct file.
|
| 38 |
+
- **`false`**: the target comment is technically incorrect or attached to the wrong file, even if its statement would hold in another file.
|
| 39 |
+
- General PR comments without a file association are judged by technical correctness.
|
| 40 |
+
|
| 41 |
+
A useful observation does not override a technical error. Missing evidence alone is not proof that a comment is wrong. The label evaluates an individual comment, not the trustworthiness of its author or the overall quality of the PR. All released labels are JSON booleans; none are missing.
|
| 42 |
+
|
| 43 |
+
## Dataset splits
|
| 44 |
+
|
| 45 |
+
| Split | Examples | `true` | `false` | Unique PRs | Repositories |
|
| 46 |
+
| --- | ---: | ---: | ---: | ---: | ---: |
|
| 47 |
+
| Train | 714 | 455 | 259 | 86 | 8 |
|
| 48 |
+
| Validation | 126 | 80 | 46 | 8 | 3 |
|
| 49 |
+
| Test | 359 | 229 | 130 | 30 | 7 |
|
| 50 |
+
| **Total** | **1,199** | **764** | **435** | **124** | **9** |
|
| 51 |
+
|
| 52 |
+
Splits are grouped by `(repo, pull_request.pull_number)`. No PR appears in more than one split. Repository identities can recur across splits, so this is a PR-disjoint benchmark rather than an evaluation on entirely unseen repositories.
|
| 53 |
+
|
| 54 |
+
The original train/test split targeted 70%/30% of examples while preserving PR groups and approximately preserving each label's proportion. Validation was then drawn from 15% of the original training pool, leaving the test split unchanged. Both selections used seed 42 and a subset-sum procedure over shuffled PR groups to reach the label-count targets. The final proportions are approximately 59.55% train, 10.51% validation, and 29.94% test.
|
| 55 |
+
|
| 56 |
+
## Data sources and construction
|
| 57 |
+
|
| 58 |
+
The project pipeline collects GitHub PR discussions, filters unsuitable or insubstantial comments, and provides tools for human labeling. This release contains three recorded sources:
|
| 59 |
+
|
| 60 |
+
| `source` | Description | Train | Validation | Test | Total |
|
| 61 |
+
| --- | --- | ---: | ---: | ---: | ---: |
|
| 62 |
+
| `crawled_swebench` | Crawled review comments retained as positive examples | 455 | 80 | 229 | 764 |
|
| 63 |
+
| `human_wrong` | Genuine reviewer comments labeled incorrect | 43 | 6 | 16 | 65 |
|
| 64 |
+
| `perturbation` | Modified comments retained as negative examples after manual review | 216 | 40 | 114 | 370 |
|
| 65 |
+
|
| 66 |
+
The source names are provenance tags. In this release, every `crawled_swebench` example has label `true`, and every `human_wrong` or `perturbation` example has label `false`. **Do not expose these tags to the judge.**
|
| 67 |
+
|
| 68 |
+
Perturbations modify a target comment's identifier, recommendation, or file location while retaining its PR context. The released perturbation types are:
|
| 69 |
+
|
| 70 |
+
| `perturbation_kind` | Modification | Examples |
|
| 71 |
+
| --- | --- | ---: |
|
| 72 |
+
| `location` | Redirect the comment to another reviewed file and its code context | 152 |
|
| 73 |
+
| `negation` | Reverse the polarity of a statement or recommendation | 130 |
|
| 74 |
+
| `symbol` | Replace a code identifier with an incorrect identifier | 88 |
|
| 75 |
+
|
| 76 |
+
All 370 released perturbation records match the project's manually verified negative set. Annotator agreement scores and per-example adjudication histories are not included in this release.
|
| 77 |
+
|
| 78 |
+
## Repository coverage
|
| 79 |
+
|
| 80 |
+
| Repository | Examples |
|
| 81 |
+
| --- | ---: |
|
| 82 |
+
| `ManimCommunity/manim` | 363 |
|
| 83 |
+
| `pandas-dev/pandas` | 349 |
|
| 84 |
+
| `OpenHands/OpenHands` | 206 |
|
| 85 |
+
| `Significant-Gravitas/AutoGPT` | 165 |
|
| 86 |
+
| `PostHog/posthog` | 69 |
|
| 87 |
+
| `BerriAI/litellm` | 31 |
|
| 88 |
+
| `Comfy-Org/ComfyUI` | 6 |
|
| 89 |
+
| `crewAIInc/crewAI` | 5 |
|
| 90 |
+
| `OpenBB-finance/OpenBB` | 5 |
|
| 91 |
+
|
| 92 |
+
The repository-level `language` field records Python for 993 examples and TypeScript for 206. This is repository metadata, not a classification of every code fragment or the natural language of each comment. PR creation dates range from October 28, 2016 to June 30, 2025.
|
| 93 |
+
|
| 94 |
+
## Data format
|
| 95 |
+
|
| 96 |
+
The release consists of three UTF-8 JSON Lines files: `train.jsonl`, `validation.jsonl`, and `test.jsonl`. Each line is one example.
|
| 97 |
+
|
| 98 |
+
| Field | Type | Description |
|
| 99 |
+
| --- | --- | --- |
|
| 100 |
+
| `instance_id` | string | PR-derived identifier; perturbed variants have a `#perturb-…` suffix. Not unique by itself. |
|
| 101 |
+
| `judged_entry_id` | integer | ID of the target entry in `code_review`. |
|
| 102 |
+
| `judged_user` | string | GitHub login associated with the target comment; inherited from the original comment for perturbations. |
|
| 103 |
+
| `repo` | string | GitHub repository in `owner/name` form. |
|
| 104 |
+
| `language` | string | Recorded primary language of the repository. |
|
| 105 |
+
| `pull_request` | object | `pull_number`, `title`, `body`, `created_at`, `base_commit`, and `patch_to_review`. |
|
| 106 |
+
| `resolved_issues` | list of objects | Linked issues with `number`, `title`, and `body`. |
|
| 107 |
+
| `code_review` | list of objects | PR activity timeline, including comments, reviews, replies, and commits. |
|
| 108 |
+
| `problem_domain` | string | Recorded task category, such as `Bug Fixes` or `New Feature Additions`. |
|
| 109 |
+
| `hint_text` | string | Reserved context field; empty in every released example. |
|
| 110 |
+
| `trustworthy` | boolean | Gold label for the target comment. |
|
| 111 |
+
| `source` | string | Construction provenance; exclude from model inputs. |
|
| 112 |
+
| `perturbation_kind` | optional string | `location`, `negation`, or `symbol`; present only for perturbations in the raw JSONL. |
|
| 113 |
+
|
| 114 |
+
The pair `(instance_id, judged_entry_id)` uniquely identifies all 1,199 examples. Every example has exactly one matching target entry in its timeline.
|
| 115 |
+
|
| 116 |
+
Timeline entry types are `inline`, `inline_reply`, `pr_comment`, `review`, and `commit`. Comment entries contain `id`, `body`, `user`, and `created_at`; depending on type, they may also contain `review_path`, `diff_hunk`, `in_reply_to_id`, or `review_state`. Commit entries use `sha` and `message`. Optional fields may load as `None` through tabular dataset libraries.
|
| 117 |
+
|
| 118 |
+
## Loading the dataset
|
| 119 |
+
|
| 120 |
+
```python
|
| 121 |
+
from datasets import load_dataset
|
| 122 |
+
|
| 123 |
+
dataset = load_dataset("dcloud347/CRJudgeBenchmark")
|
| 124 |
+
print({split: len(rows) for split, rows in dataset.items()})
|
| 125 |
+
# {'train': 714, 'validation': 126, 'test': 359}
|
| 126 |
+
|
| 127 |
+
row = dataset["train"][0]
|
| 128 |
+
target = next(
|
| 129 |
+
entry for entry in row["code_review"]
|
| 130 |
+
if entry.get("id") == row["judged_entry_id"]
|
| 131 |
+
)
|
| 132 |
+
|
| 133 |
+
# Construct a focused input; keep the gold label outside the model prompt.
|
| 134 |
+
judge_input = {
|
| 135 |
+
"repo": row["repo"],
|
| 136 |
+
"pull_request": {
|
| 137 |
+
key: row["pull_request"][key]
|
| 138 |
+
for key in ("title", "body", "base_commit", "patch_to_review")
|
| 139 |
+
},
|
| 140 |
+
"target_comment": {
|
| 141 |
+
key: target.get(key)
|
| 142 |
+
for key in ("type", "body", "review_path", "diff_hunk")
|
| 143 |
+
},
|
| 144 |
+
}
|
| 145 |
+
gold_label = row["trustworthy"] # For supervision or scoring only.
|
| 146 |
+
```
|
| 147 |
+
|
| 148 |
+
## Evaluation protocol
|
| 149 |
+
|
| 150 |
+
1. Evaluate the target comment using the rubric above. A prediction can be represented as `{"prediction": true}` or `{"prediction": false}`.
|
| 151 |
+
2. Keep `trustworthy`, `source`, `perturbation_kind`, and original `instance_id` values outside model inputs and agent-accessible files. Perturbation suffixes and source tags reveal labels. Use opaque evaluation IDs if needed.
|
| 152 |
+
3. Specify the context policy. The raw timeline can contain later replies or reviews that reveal the answer. The focused input above omits other timeline entries, reviewer identities, and review states. Results using complete timelines should be reported separately.
|
| 153 |
+
4. For repository inspection, use the recorded `base_commit` and distinguish base-version evidence from evidence obtained after applying `patch_to_review`. Repository checkouts are not bundled with these files.
|
| 154 |
+
5. Use training examples for parameter updates and teacher-generated supervision, validation for model selection, and the fixed test set for final evaluation. Preserve PR groups in any derived data.
|
| 155 |
+
|
| 156 |
+
Treat `true` as the positive class. Report accuracy, macro-F1, per-class precision and recall, and invalid/missing prediction counts. Source-specific results help distinguish performance on natural incorrect comments from performance on perturbations; include sample counts for each slice.
|
| 157 |
+
|
| 158 |
+
## Limitations
|
| 159 |
+
|
| 160 |
+
- Coverage is concentrated in a small number of repositories and in Python. The validation split contains only 8 PRs, only Python examples, and only 6 natural incorrect comments.
|
| 161 |
+
- Perturbations account for 370 of 435 negative examples. Performance may reflect sensitivity to these edits and may not generalize to the full range of naturally occurring review errors.
|
| 162 |
+
- Multiple examples share PR context, and original comments can have perturbed counterparts. Examples are therefore correlated; PR-level grouping matters for both splitting and uncertainty estimates.
|
| 163 |
+
- Labels are task-specific judgments. The release does not establish inter-annotator agreement or guarantee error-free annotations.
|
| 164 |
+
- Public GitHub content may already occur in model pretraining data. Pretraining contamination has not been measured.
|
| 165 |
+
- GitHub usernames and discussion text are retained. Modified comments should not be attributed to the original reviewers as statements they actually made.
|
| 166 |
+
|
| 167 |
+
## License and attribution
|
| 168 |
+
|
| 169 |
+
No dataset-wide license is specified for this release. This card does not assign a new license to the collected code or discussions. Source repositories are identified in the `repo` field, and PR numbers are available in `pull_request.pull_number`.
|
| 170 |
+
|
| 171 |
+
When referencing the dataset, link to [dcloud347/CRJudgeBenchmark](https://huggingface.co/datasets/dcloud347/CRJudgeBenchmark) and record the dataset revision used for the experiment.
|