Friday, October 16, 2026
Science
No Result
View All Result
  • Login
  • HOME
  • SCIENCE NEWS
  • CONTACT US
  • HOME
  • SCIENCE NEWS
  • CONTACT US
No Result
View All Result
Scienmag
No Result
View All Result
Home Science News Technology and Engineering

GPT-4 beats fine-tuned BERT models at spotting names in legal contracts — but only when the workload is light

October 16, 2026
in Technology and Engineering
Denise Maddox
By Denise Maddox Scienmag Editorial Profile - Mechanical Engineering
Reading Time: 6 mins read
0
GPT-4 beats fine-tuned BERT models at spotting names in legal contracts — but only when the workload is light

GPT-4 beats fine-tuned BERT models at spotting names in legal contracts — but only when the workload is light

65
SHARES
587
VIEWS
Share on FacebookShare on Twitter
ADVERTISEMENT

Legal contracts are dense thickets of names — people, companies, agencies, subsidiaries — and finding every one of them reliably has long been one of the most stubborn problems in legal technology. A new study from researchers at Ulster University and the law firm A&O Shearman, published in the journal Knowledge and Information Systems, has now put the hype to a hard test, pitting OpenAI’s GPT-4 against a battery of fine-tuned BERT-family models on a real legal entity recognition task — and then asking the question most academic papers avoid: which one is actually worth the money?

The task in question is named entity recognition, or NER, a foundational technique in natural language processing that involves locating and classifying mentions of things like persons and organisations within raw text. In the legal world, NER is the engine behind contract analysis, document redaction and large-scale information extraction. The trouble is that legal language is notoriously hostile to generic models: entities appear as abbreviations, acronyms and synonyms, and off-the-shelf tools trained on general English text stumble badly when confronted with contract boilerplate.

Traditionally, high-performing NER has required either hand-crafted rules or vast amounts of manually annotated training data — a bottleneck that is especially painful in law, where labelling must be done by qualified legal experts. The research team, led by Shefali Singhal and Niall McCarroll, took a different route. They repurposed the Contract Understanding Atticus Dataset (CUAD), a collection of 510 real contracts spanning 25 different contract types, into a new NER benchmark called CUAD-NER, with five legal domain experts labelling every PERSON and ORGANISATION entity — nearly 100,000 organisation mentions in total.

Against this dataset they lined up an unusually broad field of competitors: the industry-standard SpaCy pipeline, Microsoft’s Azure Entity Recognition V3 service, and four transformer models — DistilBERT, BERT base (cased), RoBERTa and DeBERTa — each fine-tuned on the legal contract data using standard low-rank adaptation (LoRA) settings on Azure’s machine learning platform. The challenger was GPT-4, deployed not with any fine-tuning at all, but with a carefully structured few-shot prompt that included ten worked examples written in a chain-of-thought style, adapted from the PromptNER strategy of Ashok and Lipton.

The prompt itself is a study in prompt engineering discipline. It contains three components: a definition section spelling out exactly what does and does not count as a PERSON or ORGANISATION entity, the contract text to be analysed, and the ten few-shot exemplars that force the model to reason step by step — deciding whether a given phrase is an entity, justifying the decision, and then assigning a label of ORG, PER or NA. The exemplars were chosen to give balanced coverage of positive identifications and negative rejections, and the team deliberately avoided optimising over example choice or ordering, aiming instead for the kind of reliable average-case performance a practitioner would actually deploy.

The results were striking. GPT-4 with few-shot chain-of-thought prompting achieved a Micro F1 score of 73 percent across both entity types — a five percentage point improvement over the best fine-tuned competitor, BERT base (cased), which scored 69 percent. RoBERTa managed 67 percent, while DistilBERT and DeBERTa each reached 66 percent. The generically trained baselines fared far worse: Azure Entity Recognition V3 scored just 53 percent, and SpaCy collapsed to a dismal 10 percent, mislabelling common nouns like

The five-point margin in favour of GPT-4 is notable not only for its size but for what it represents: a model that never saw a single labelled contract during training outperforming systems that were explicitly fine-tuned on the very same corpus. The fine-tuned transformers in the study were adapted using LoRA, a parameter-efficient technique that freezes the bulk of a pre-trained model’s weights and trains only small, low-rank update matrices. This keeps training costs manageable compared with full fine-tuning, but it still requires the annotated corpus, the compute infrastructure, and the engineering effort to run the adaptation — all of which the few-shot approach sidesteps entirely. For organisations that lack teams of legal experts available to annotate documents, that difference in workflow may matter as much as the difference in F1 score.

The Micro F1 metric used in the evaluation blends precision and recall into a single figure, and in an entity recognition task it treats every mention as equally important. That makes it a reasonable headline number, but the underlying trade-offs are worth considering. A redaction system, for instance, may tolerate false positives — flagging a phrase as an entity when it is not — far more readily than false negatives, which would leave sensitive names exposed in a document. Conversely, an information extraction pipeline feeding a contract analytics dashboard might prefer precision, since spurious entities clutter downstream analysis. The study’s aggregate scores do not by themselves reveal how each model distributes its errors between these two failure modes, and practitioners deploying such systems would likely want per-class breakdowns before committing to a choice.

The collapse of SpaCy to a 10 percent score is a reminder of how domain-specific legal text really is. SpaCy’s general-purpose pipeline relies on statistical models trained largely on news wire and web text, where entities tend to appear in predictable contexts — a person’s name adjacent to a title or a company name followed by corporate suffixes. Contract language inverts many of these expectations: defined terms appear in quotation marks, parties are referred to by capitalised shorthand after their first mention, and organisational names can be embedded deep within nested clauses. The result is a cautionary tale about assuming that tools which perform well on general text will transfer to specialised professional domains without substantial retraining.

The choice of CUAD as the foundation for the new benchmark also carries significance. CUAD was originally designed for contract clause classification — identifying which of 41 clause types appear in a given contract — rather than for token-level entity tagging. Converting it into CUAD-NER required the five legal experts to annotate every PERSON and ORGANISATION mention across roughly 100,000 organisation references, a labour-intensive process that itself illustrates the annotation bottleneck the paper seeks to address. The fact that such a dataset had to be created by hand underscores the economics at play: once a labelled corpus exists, fine-tuned models become viable; without one, few-shot prompting may be the only practical option.

The cost–benefit analysis that accompanies the performance comparison is arguably the study’s most distinctive contribution. Academic NER papers routinely report F1 scores but rarely model the financial realities of deployment, where inference costs scale with usage volume. The study distinguishes between low-usage and high-usage scenarios, recognising that the economics of calling a commercial LLM API differ fundamentally from hosting a fine-tuned open-weight model. At low volumes, the absence of training and infrastructure costs gives the few-shot approach an advantage; at high volumes, the per-token pricing of a commercial API can accumulate to the point where a self-hosted fine-tuned model, despite its lower accuracy, becomes the more economical choice. The crossover point between these regimes is exactly the kind of information practitioners need but rarely find in the literature.

It is also worth situating the findings within the broader trajectory of LLM capabilities. GPT-4’s performance here reflects a model evaluated without any task-specific adaptation, relying purely on in-context learning — the ability to infer a task’s requirements from examples embedded in the prompt. Chain-of-thought prompting, the technique used to elicit step-by-step reasoning before the model commits to a label, has been shown across many benchmarks to improve performance on tasks requiring deliberate judgement rather than pattern matching. Entity recognition in legal text sits somewhere between these categories: it involves both surface pattern recognition and contextual judgement about whether a phrase refers to a person or an organisation in a given contractual role. The structured reasoning the prompt enforces appears to help the model navigate this ambiguity more effectively than direct labelling would.

The study’s authors acknowledge that the few-shot approach is not without limitations. Performance on unfamiliar, domain-specific NER tasks had remained uncertain precisely because LLM behaviour on such tasks is sensitive to prompt design, and the team deliberately avoided optimising over example selection or ordering to reflect realistic deployment conditions. This choice favours robustness over peak performance, but it also means that a practitioner willing to invest in prompt refinement — selecting exemplars that better cover edge cases, or tuning the definition section — might achieve results beyond those reported. Conversely, the fine-tuned baselines were trained with standard LoRA settings rather than exhaustively hyperparameter-optimised, so neither side of the comparison represents a ceiling on what is achievable.

Looking forward, the authors suggest that few-shot chain-of-thought learning could be strengthened with additional support strategies, and that flexible prompting approaches are likely to prove especially valuable in low-resource scenarios where annotated data is scarce. The legal domain is a prime example: contracts are confidential, annotation requires expertise, and the diversity of contract types means that a model fine-tuned on one organisation’s documents may not generalise to another’s. In such settings, the ability to obtain competitive performance from a general-purpose model with nothing more than a well-crafted prompt and a handful of examples represents a genuine shift in the accessibility of legal NLP technology — one that could bring sophisticated document analysis within reach of smaller firms and legal aid organisations that could never afford the annotation campaigns traditional approaches demand.

The broader implication for the field is that the evaluation of NLP systems is maturing beyond accuracy metrics alone. By pairing performance figures with a structured cost analysis, this study offers a template for how future work might be framed: not as a simple leaderboard, but as a decision-support tool that acknowledges the real constraints under which organisations operate. As LLMs continue to improve and API pricing evolves, the balance between prompting-based and fine-tuning-based approaches will shift, but the framework for comparing them — performance, cost, and the practical realities of deployment — is likely to endure.

Subject of Research: Evaluating LLMs for named entity recognition: a cost-benefit analysis in the legal domain

Article Title: Evaluating LLMs for named entity recognition: a cost-benefit analysis in the legal domain

Article References: Evaluating LLMs for named entity recognition: a cost-benefit analysis in the legal domain. (n.d.). https://doi.org/10.1007/s10115-026-02886-z

Image Credits: AI Generated

DOI: 10.1007/s10115-026-02886-z

Keywords: Evaluating, LLMs, named, entity, recognition, cost-benefit, analysis, legal, domain, scientific research

Cite Scienmag News

Denise Maddox. (October 16, 2026). GPT-4 beats fine-tuned BERT models at spotting names in legal contracts — but only when the workload is light. Scienmag. https://scienmag.com/gpt-4-beats-fine-tuned-bert-models-at-spotting-names-in-legal-contracts-but-only-when-the-workload-is-light/

Denise Maddox. "GPT-4 beats fine-tuned BERT models at spotting names in legal contracts — but only when the workload is light." Scienmag, 16 October 2026, https://scienmag.com/gpt-4-beats-fine-tuned-bert-models-at-spotting-names-in-legal-contracts-but-only-when-the-workload-is-light/. Accessed 16 October 2026.

Denise Maddox. "GPT-4 beats fine-tuned BERT models at spotting names in legal contracts — but only when the workload is light." Scienmag. October 16, 2026. https://scienmag.com/gpt-4-beats-fine-tuned-bert-models-at-spotting-names-in-legal-contracts-but-only-when-the-workload-is-light/

Tags: AI model comparison in legal applicationsAI performance in legal document processinganalysiscontract analysis automationcost-benefitdomainentityEvaluatingfine-tuned BERT modelsGPT-4 vs BERT modelslarge-scale information extractionlegalLegal contract entity recognitionlegal language complexitylegal text analysisLLMsnamednamed entity recognition challengesnatural language processing in legal techrecognitionScientific Researchworkload impact on AI NER performance
Share26Tweet16
Previous Post

Virtual Primates Evolve Real Societies in a New Agent-Based Modeling Tool

Next Post

New Auxiliary Equation Method Reveals Solitons and Chaos in Time-Fractional Long-Wave Equation

Related Posts

AI Audit of 950 Studies Reveals Most Microplastic Exposure Data Fall Short for Health Risk Assessment
Technology and Engineering

AI Audit of 950 Studies Reveals Most Microplastic Exposure Data Fall Short for Health Risk Assessment

October 16, 2026
Sliding metasurfaces steer beams and filter frequencies with no electronics
Technology and Engineering

Sliding metasurfaces steer beams and filter frequencies with no electronics

October 16, 2026
Lidar That Knows What It Is Looking At Cuts Beijing PM2.5 Profile Errors by 38 Percent
Athmospheric

Lidar That Knows What It Is Looking At Cuts Beijing PM2.5 Profile Errors by 38 Percent

October 16, 2026
Femtosecond laser writing builds chiral nanostructures inside crystals
Technology and Engineering

Femtosecond laser writing builds chiral nanostructures inside crystals

October 16, 2026
Zeolite-Trapped Rhodium Ions Deliver Record Selectivity in Industrial Hydroformylation
Medicine

Zeolite-Trapped Rhodium Ions Deliver Record Selectivity in Industrial Hydroformylation

October 16, 2026
Human Milk After NICU Discharge Tied to Fewer Breathing Problems in Children With BPD
Technology and Engineering

Human Milk After NICU Discharge Tied to Fewer Breathing Problems in Children With BPD

October 16, 2026
Next Post
New Auxiliary Equation Method Reveals Solitons and Chaos in Time-Fractional Long-Wave Equation

New Auxiliary Equation Method Reveals Solitons and Chaos in Time-Fractional Long-Wave Equation

  • Mothers who receive childcare support from maternal grandparents show more optimized

    Mothers who receive childcare support from maternal grandparents show more parental warmth, finds NTU Singapore study

    27656 shares
    Share 11059 Tweet 6912
  • University of Seville Breaks 120-Year-Old Mystery, Revises a Key Einstein Concept

    1061 shares
    Share 424 Tweet 265
  • Bee body mass, pathogens and local climate influence heat tolerance

    682 shares
    Share 273 Tweet 171
  • Researchers record first-ever images and data of a shark experiencing a boat strike

    546 shares
    Share 218 Tweet 137
  • Groundbreaking Clinical Trial Reveals Lubiprostone Enhances Kidney Function

    531 shares
    Share 212 Tweet 133
Science

Embark on a thrilling journey of discovery with Scienmag.com—your ultimate source for cutting-edge breakthroughs. Immerse yourself in a world where curiosity knows no limits and tomorrow’s possibilities become today’s reality!

RECENT NEWS

  • Rewiring the Tumor: How Cancer Metabolism Is Becoming Medicine’s Next Target
  • Functional Ultrasound Brain-Computer Interfaces Move From Reading the Brain Toward Bidirectional Control
  • Enormous Fluid Antenna System Passes First Real-World Test, Guiding Radio Waves Across Programmable Surfaces
  • Satellite corrections that come and go: a positioning service that adapts in seconds

Categories

  • Agriculture
  • Anthropology
  • Archaeology
  • Athmospheric
  • Biology
  • Biotechnology
  • Blog
  • Bussines
  • Cancer
  • Chemistry
  • Climate
  • Earth Science
  • Editorial Policy
  • Marine
  • Mathematics
  • Medicine
  • Pediatry
  • Policy
  • Psychology & Psychiatry
  • Science Education
  • Science News
  • Social Science
  • Space
  • Technology and Engineering

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 5,150 other subscribers

© 2025 Scienmag - Science Magazine

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result
  • HOME
  • SCIENCE NEWS
  • CONTACT US

© 2025 Scienmag - Science Magazine

Discover more from Science

Subscribe now to keep reading and get access to the full archive.

Continue reading