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.
ContractScrub-style synthetic stand-in (unofficial re-implementation)
This is not the ContractScrub dataset and is not affiliated with its authors. The official gold set
(tri-fair-lab/contract_scrub) was unreleased as of 2026-10-02. The numbers below come from a scripted
synthetic benchmark and cannot be compared with the paper's Table 2.
What this repo contains: a re-implementation of the scoring and per-category prompt structure of ContractScrub: A benchmark for final review of legal contracts (Bang et al., arXiv:2608.20204), run on a stand-in benchmark of 44 CUAD contracts with errors injected by script, and one model run.
Results (synthetic gold; not comparable to the paper)
On this stand-in, Gemma 4 26B (NVFP4) finds 47% of 980 scripted items (macro recall 0.472). The paper reports 0.365 for Gemma 4 26B on its lawyer-written gold. The two figures measure different things.
Precision (0.172) and F1 (0.238) are reported for completeness but are not meaningful here: the CUAD contracts contain pre-existing errors that the paper's lawyers annotated and this gold does not, so a correct flag of a real error counts as a false positive.
| Category | Gold items | Recall (exact) | Recall (term-only) | Gold determinable? |
|---|---|---|---|---|
defined_terms |
555 | 0.369 | 0.995 | yes |
undefined_capitalized_terms |
88 | 0.909 | 0.977 | yes |
uncapitalized_defined_terms |
39 | 0.179 | 0.513 | yes |
incorrectly_capitalized_terms_in_context |
44 | 0.727 | 0.773 | disputed |
unused_defined_terms |
88 | 0.909 | 0.977 | yes |
terms_defined_multiple_times |
44 | 0.159 | 0.795 | partly (23 of 44 items name one location twice) |
incorrect_section_article_paragraph_references |
41 | 0.000 | 0.000 | no |
incorrect_party_references |
37 | 0.081 | 0.108 | no |
inconsistent_terms |
44 | 0.909 | 1.000 | yes |
Term-only macro recall over the paper's eight term-only categories (its Table 5 has no Inconsistent
Language row) is 0.642.[^1] Defined Terms rises from 0.369 exact to 0.995 term-only mostly because the gold
records "body" where the prompt tells the model to answer "P" or "Recitals" (see below).
[^1]: Averaging all nine categories, as results.json does, gives 0.682.
Of the 396 outputs, 3 do not parse as JSON (python scrub/score.py); the n_unparsed_outputs: 256 in
results.json counted every output that did not begin with {, including fenced JSON that parses.
Known defects of the synthetic gold
- Section references: the "correct" section is chosen at random from the contract, so the right answer cannot be determined from the text; the 0.000 recall is an artifact, not a measurement.
- Party references: the injected clause swaps in the other party with no contextual basis that makes the swap detectable.
- Capitalised in context: the injected clause uses the term generically in lower case and mentions the capitalised form only to say it remains governed by the agreement; it contains no such error.
- Defined multiple times: when the original definition is not found, both gold locations are the injected clause; 23 of the 44 items name one location twice and cannot be matched under exact scoring.
- Locations: gold uses
"body"for anything before the first numbered heading and bare numbers inside schedules, contradicting the prompt's location rules. - Placement: every injected clause is appended after the original text, after the signature block and schedules, as a new numbered section; each contract receives the same fixed sentences.
- Contracts are 44 CUAD agreements chosen by seed, not the paper's 44.
- Model and decoding:
nvidia/Gemma-4-26B-A4B-NVFP4(FP4 quantisation) on vLLM, temperature 0.0; the paper used Google's endpoint and temperature 0.6. - Prompts are paraphrased from the paper's Appendix G, not verbatim: Undefined Capitalized Terms has 8
exclusions against the paper's 7 and drops "References to agreement sections, exhibits, and schedules";
Terms Defined Multiple Times drops "A term that is merely repeated with the same meaning is NOT an
error" and adds a sentence not in the paper; Incorrect References drops the "list each reference as a
SEPARATE item" rule and changes the example; the location rules drop the "Attachment X Section Y" rule;
an
AGREEMENT:trailer is added.
Reproduce
# 1. Re-score the published outputs, no GPU (prints the table above and the diagnostics)
python scrub/score.py --benchmark benchmark/benchmark.jsonl --raw results/raw_outputs.jsonl
# 2. Regenerate the benchmark from CUAD v1 (theatticusproject/cuad, full_contract_txt/)
python scrub/make_synthetic.py --help
# 3. Re-run the model (one A100 80 GB; the published run took 11 minutes, 288 s of generation)
VLLM_USE_FLASHINFER_SAMPLER=0 python scrub/run_eval.py --benchmark benchmark/benchmark.jsonl \
--out-dir results --model nvidia/Gemma-4-26B-A4B-NVFP4
Versions: requirements.txt (vllm 0.29.0, trackio 0.37.1, huggingface_hub 1.31.0). The published run used
Hugging Face Jobs, flavor a100-large, image ghcr.io/astral-sh/uv:python3.12-bookworm, running
scrub/job_bootstrap.py with HF_TOKEN passed as a job secret. kv_cache_dtype is forced to bfloat16
because the NVFP4 checkpoint requests an FP8 KV cache the Triton backend did not support on the first
(A10G) attempt.
Contents
SCORING.md: walkthrough of the deterministic multiset scoringscrub/prompts.py: the nine categories and prompt assembly (paraphrased from the paper's Appendix G)scrub/eval_lib.py: parsing, normalisation, location canonicalisation, multiset scoringscrub/make_synthetic.py: the stand-in benchmark generatorscrub/run_eval.py,scrub/job_bootstrap.py: the model runscrub/score.py: re-scoring without a GPUtests/: checks thatscore.pyre-derives every number inresults.jsonand that the docs keep their correctionsbenchmark/benchmark.jsonl,results/: the benchmark, raw outputs and results
Attribution and licences
- Contract text: CUAD v1, The Atticus Project, CC BY 4.0, modified here by scripted error injection.
- Category definitions and prompt text: adapted from Bang et al., arXiv:2608.20204, CC BY-NC-SA 4.0.
- Licence for this repo's code and data: not yet set.
@misc{contractscrub2026, title={ContractScrub: A benchmark for final review of legal contracts},
author={Bang and others}, year={2026}, eprint={2608.20204}, archivePrefix={arXiv}}
@article{hendrycks2021cuad, title={CUAD: An Expert-Annotated NLP Dataset for Legal Contract Review},
author={Hendrycks, Dan and Burns, Collin and Chen, Anya and Ball, Spencer}, journal={NeurIPS}, year={2021}}
- Downloads last month
- 176