All benchmarks

  Peer-reviewed journal article

A fine-tuned DeBERTa beat zero-shot GPT-4 at sorting contract clauses into 23 types

Made by Eoin O’Connell and seven co-authors

Artificial Intelligence and Law

Weights not on Hugging FaceSource: O’Connell et al.

The result

  • Quality

    Weighted accuracy on CUAD-SL (23 contract-clause types). Small model: DeBERTa large, fine-tuned. Large model: GPT-4 (8K context), zero-shot with the 23 label names.

    87.8%vs 67.2%

    Ahead by 20.6 points

    DeBERTa large, fine-tuned87.8%
    GPT-4, zero-shot67.2%

    Contract-clause accuracy · higher is better

  • Cost per call

    Depends on volume, and the order flips. We divided the authors’ one-year Azure totals (Table 3) by their request counts: about 1 request a minute or about 120 a minute over a 1,650-hour working year, i.e. 99,000 or 11,880,000 requests. High usage: DeBERTa £48,968 / 11,880,000 = about £0.00413 and GPT-4 £115,958 / 11,880,000 = about £0.00976 per request (rounded against DeBERTa). Low usage: DeBERTa £13,862 / 99,000 = about £0.14 and GPT-4 £2,487 / 99,000 = about £0.025, so GPT-4 is the cheaper one. The totals include labelling at £0.50 per clause (GPT-4 pays only for the test labels), training and test compute, hosting (1 or 3 Azure Standard_NC6 VMs at £1/h for DeBERTa, none for GPT-4) and GPT-4 tokens with a 50% mark-up for the longer prompt. All inputs are the authors’ price-list estimates, not bills; GPT-4’s token price and its date aren’t given. Table 3’s high-usage totals are larger than the rows above them add up to (see flags); this division uses the printed totals. As reported: Per day, as printed in Table 3: DeBERTa £38 at low usage and £134 at high usage; GPT-4 £7 and £317 (one-year totals: DeBERTa £13,862 and £48,968; GPT-4 £2,487 and £115,958).

    2.3×cheaper

    At about 120 requests a minute, the paper’s high-usage case.

    At about 1 a minute the order flips: GPT-4 is cheaper (£7 a day against £38, as Table 3 prints).

    DeBERTa large, fine-tuned£0.00413on 3 Azure NC6 VMs at £1 an hour
    GPT-4, zero-shot£0.00976via the GPT-4 API

    £ per call (GBP), high-usage scenario · lower is better

The story

Sorting contract clauses

Lawyers reviewing a commercial contract look for specific clauses: who may terminate, how liability is capped, which law governs. CUAD, a dataset curated by legal experts at The Atticus Project, marks such clauses in 510 commercial contracts, with 41 label types and over 13,000 annotations by law students.

A team from Ulster University and the law firm A&O Shearman in Belfast rebuilt it as a cleaner single-label task, CUAD-SL. They cut each contract into segments with a version of the GraphSeg algorithm, gave each segment its dominant label and, with a legal domain expert, merged the 41 labels into 23. About 90% of segments had no label and were left out; the rest were split 7:3, stratified by clause type. Segments are short, a median of 10 to 11 words.

Data

CUAD-SL (single-label CUAD)

7,104 training and 3,045 test clause-label pairs (Table 3)

Training 7,104Test 3,045

CUAD by The Atticus Project: 510 commercial contracts; re-segmented with GraphSeg and mapped from 41 labels to 23 with a legal domain expert

Unlabelled segments (about 90%) dropped; 7:3 split stratified by clause type. Table 1’s per-class counts add up to 8,881 and 3,819 instead. The dataset isn’t released with the article.

Seven models, one of them zero-shot

The lineup ran from a classic TF-IDF + SGD classifier through fine-tuned BERT base, RoBERTa large and DeBERTa large to GPT-3 Ada and Curie fine-tuned through OpenAI’s API, and GPT-4 with no training at all. DeBERTa was fine-tuned the standard way: a classification head on top, all weights trained for 5 epochs at a learning rate of 2e-5.

Small model

DeBERTa large (fine-tuned)

not stated in the article · Microsoft

Classification head added and all weights fine-tuned on the CUAD-SL training clauses

Base
The DeBERTa large model through Hugging Face; v1 or v3 checkpoint not named

Training

Full fine-tune with Hugging Face Transformers

5 epochs, batch size 1,000, learning rate 2e-5, 20 warm-up steps, AdamW, weight decay 0, seed 42

Hardware
Costed on an Azure Standard_NC24s_v3 VM (low priority, £2.25/h)
Cost
£17 of training compute plus £3,552 to label the training data (authors’ estimates)

Not reported: time.

Large model

GPT-4 (8K context)

Size not disclosed · OpenAI

Used as released through the GPT-4 API, zero-shot: the clause, ‘You are a lawyer’, the 23 labels and a label-only answer

Base
General model; fine-tuning wasn’t offered for GPT-4 at the time

GPT-4 got the clause, a one-line instruction to classify it as a lawyer would, and the list of 23 labels, with no examples; its answers were cleaned into labels afterwards. The authors name few-shot prompting as the obvious next step and did not test it.

What they found

Evaluation

3,045 test items per Table 3 (Table 1 and Section 4 give other counts)

Test set
CUAD-SL test split (30%, stratified by clause type)
Metric
Weighted accuracy over 23 clause types (each type weighted by its share of the test data)
How it was compared
Same test clauses and metric for all seven models. GPT-4 got a one-line instruction and the 23 label names, zero-shot, with no examples; temperature and snapshot not stated.

DeBERTa scored 87.8% weighted accuracy, RoBERTa 86.4%, Ada-FT 83.8%, TF-IDF + SGD 83.7%, Curie-FT 81.7%, BERT 78.9% and GPT-4 67.2%. GPT-4’s results were uneven rather than uniformly low: it was the best model on the two clause types every model found hardest, Price Restrictions (85.7%) and Competitive Restriction Exception (56.7%), and got every Governing Law clause right.

What a year would cost

The paper then priced each model for a year on Azure: labelling at £0.50 per clause, training and test compute, hosting and inference, at about one request a minute and about 120 a minute over a 1,650-hour working year. At the low volume GPT-4 is the cheapest option, about £7 a day against £38 for DeBERTa, most of which pays for a dedicated hosting machine. At the high volume GPT-4 rises to about £317 a day and DeBERTa to £134. Our own division of the yearly totals by the requests (an estimate, not the paper’s) gives roughly £0.14 vs £0.025 per request at low volume, and £0.00413 vs £0.00976 at high volume.

These are the authors’ estimates from price lists, not measured bills, and no latency is reported. Their own pick for cost-efficiency is the fine-tuned Ada (83.8%, £15 to £20 a day), with DeBERTa for when accuracy matters most.

All the numbers

Show all numbersHide all numbersEvery model · Cost, latency and energy · 2 more results

Every model on the headline test

Cost, latency and energy, as reported

Cost · GBP per day, as reported (one-year total cost in Table 3: DeBERTa £13,862 low / £48,968 high; GPT-4 £2,487 low / £115,958 high)
DeBERTa large, fine-tuned38 low usage · 134 high usage
GPT-4, zero-shot7 low usage · 317 high usage
DeBERTa: trained and tested on Azure Standard_NC24s_v3 virtual machines (low priority, £2.25/hour); hosted on 1 (low usage) or 3 (high usage) dedicated Azure Standard_NC6 virtual machines at £1/hour each. GPT-4: OpenAI API, hardware not disclosed.
The authors’ estimate for running each model for a year on Azure, not a measured bill. Low usage: about 1 inference per minute over a 1,650-hour working year (25 million tokens). High usage: about 120 inferences per minute (3 billion tokens). Costs include labelling data at £0.50 per clause (£3,552 for training data and £1,523 for test data, treated as a yearly cost; GPT-4 pays only the test data), training and testing compute, hosting and inference. GPT-4 is billed per token with a 50% token mark-up for the longer prompt; DeBERTa pays for dedicated hosting and no per-token fees. Result: GPT-4 is the cheapest option at low usage (£7 vs £38 a day) and the most expensive at high usage (£317 vs £134 a day).
Latency
Not reported
Energy
Not reported

More from the source

  • Weighted accuracy and standard deviation of accuracy across clause types, all models

    modelaccuracysd Across Classes
    GPT-4 (zero-shot)67.224.1
    BERT base (fine-tuned)78.933.6
    GPT-3 Curie (fine-tuned via OpenAI)81.715.8
    TF-IDF + SGD (classic, non-neural)83.729
    GPT-3 Ada (fine-tuned via OpenAI)83.817
    RoBERTa large (fine-tuned)86.416.2
    DeBERTa large (fine-tuned)87.813.4

    Table 2

  • Clause types where GPT-4 did best

    Price RestrictionsGPT-4 85.7% vs 57.1% for Curie-FT and DeBERTa
    Competitive Restriction ExceptionGPT-4 56.7%, best of all models (all-model average 29%)
    Governing LawGPT-4 100%
    Audit Rights, Termination RightsGPT-4 about 94%

    Section 4, Figure 1

Worth knowing

  • GPT-4 was prompted zero-shot with only the list of labels; the fine-tuned models trained on labelled clauses. The authors suggest few-shot prompting as an improvement they did not test.
  • Cost cuts both ways: in the paper’s low-usage scenario GPT-4 is the cheapest option (£7 vs £38 a day). DeBERTa is cheaper only in the high-usage scenario (£134 vs £317 a day).
  • Costs are the authors’ estimates from Azure and OpenAI price lists in GBP and assumed labelling costs, not measured bills.
  • GPT-4 beat every other model on some rare clause types (Price Restrictions, Competitive Restriction Exception).
3 more caveats
  • Older OpenAI models (GPT-4 8K, GPT-3 Ada and Curie fine-tunes); the run dates are not stated.
  • Segments with no clause label (about 90% of all segments) were excluded, so the benchmark does not test telling relevant clauses from everything else.
  • Dataset counts differ between Table 1, Table 3 and the Section 4 text; repeated runs or confidence intervals are not reported.

Weights on Hugging Face

Not on Hugging Face

The paper names only ‘the DeBERTa large model’ used through Hugging Face, with no repo id. Both microsoft/deberta-large and microsoft/deberta-v3-large exist on Hugging Face (checked 03 Oct 2026), so the exact checkpoint is not identified.

Sources

  1. O’Connell et al., “Cost-benefit analysis of deploying shallow, deep learning and generative models for legal text classification”, Artificial Intelligence and Law (2025), open access
  2. Same article, DOI 10.1007/s10506-025-09484-4
  3. Artificial Intelligence and Law (Springer), version of record 11 Nov 2025; received 26 Jul 2024, accepted 2 Sep 2025. The paper does not say when the GPT-4 runs were made; it used GPT-4 with 8K context and fine-tuned GPT-3 Ada and Curie.
3 more sources behind this page
  1. link.springer.com/article/10.1007/s10506-025-09484-4/tables/2
  2. link.springer.com/article/10.1007/s10506-025-09484-4/tables/3
  3. link.springer.com/article/10.1007/s10506-025-09484-4/tables/1
Share this benchmark

Drawing the image…

Post text