Teaching Machines the Language of Law

Editorial / August 03, 2026



Tens of thousands of contracts can bind a large company like a country at once. Each one is a dense thicket of clauses, conditions, and exceptions where a single missed line, or even what's between the lines, can cost billions. For decades, lawyers have read them painstakingly, page after page. It is slow, costly work, and the kind of machines are meant to take it off our hands. But why has artificial intelligence found legal contracts so hard to crack?

The prize for the solution is massive. Research firm Gartner expects the global legal technology market to reach $50 billion by 2027. However, there is a catch. In law, an answer on its own is not enough; one needs to know how the system reached it. That is why explainable, auditable models matter so much, and why human oversight is not going anywhere.

Seen this way, the goal is less about replacing lawyers than about handing them a sharper instrument. Contracts hold modern economies together, and teaching machines to read them and show their reasoning could change how much business gets done.

A new survey sets out to take stock. In it, Dr Sonia Khetarpaul of the Department of Computer Science and Engineering at Shiv Nadar Institution of Eminence, Delhi NCR, with former M.Tech student Kapil Vuthoo and L. Venkata Subramaniam of Qbit Force Quantum, has mapped the fast-moving field of applying natural language processing (NLP) to read and analyse contracts. Their paper, published in the journal Expert Systems, brings together datasets, models, and unsolved problems in one place. It may be among the first in-depth reviews to look squarely at contracts rather than at law in general.

Ordinary language models, the kind trained on news articles and web pages, do not transfer neatly to legal documents. Contracts carry meaning in their structure. A definition buried in one section can change what a clause means twenty pages later. The wording is precise on purpose, and the penalty for a wrong reading is steep. In most NLP tasks, a mistake is a nuisance. A breach of contract can lead to a lawsuit.

The breakthrough came with transformers, the model design introduced in a 2017 paper titled 'Attention Is All You Need'. Earlier systems read text word by word, losing the thread of long sentences. Transformers use a mechanism called attention, which lets a model weigh each word against every other word simultaneously. This made them quicker and far better at holding context. The same idea powers familiar tools such as BERT and GPT-4.

The clever step for legal work is to take a model trained on everyday English and fine-tune it on legal text. Legal-BERT, for instance, was trained on around 12 gigabytes of legislation, court cases and contracts, and it reliably beats the general-purpose version on legal tasks. To train and test such systems, researchers need carefully labelled examples, and the survey catalogues the main ones. The Contract Understanding Atticus Dataset (CUAD) offers more than 13,000 expert annotations across 41 clause types. Labelled Electronic Data Gathering, Analysis and Retrieval (LEDGAR) draws on company filings to the US Securities and Exchange Commission. The newer Material Contracts Corpus runs to over a million real contracts filed between 2000 and 2023. With these, models can pick out parties, dates and values, sort contracts by type, answer plain questions such as 'what is the termination notice period?', and flag terms that look risky.

Yet the survey is candid about the limits. These tools read the page, but they struggle to reason about how the parts of a contract connect. A single obligation may be scattered across several paragraphs, and current models tend to lose the link. Ask how editing one clause would ripple through the rest of the agreement, and they fall short. Most datasets are also English-only and cover a narrow range of common clauses, leaving rarer and cross-border provisions poorly served.

Dr. Khetarpaul and her team think the next promising direction is neuro-symbolic AI, which pairs neural-network pattern-spotting with the hard logic of rule-based systems. The knowledge graph is one practical version. It treats clauses as connected concepts, not isolated lines of text, so once you build the links, a system can trace how a change to a termination clause ripples through liability, deadlines, and waivers elsewhere. The survey also examines retrieval-augmented generation, in which a model fetches relevant documents before answering. That tends to curb the confident errors that large language models make. Further out are agentic systems that review, draft and even negotiate on their own. Even then, the survey suggests, the tools that earn trust will be the ones that can show their working.

More Blogs

Editorial / June 22, 2023
The Hawthornden Literary Retreat bestowed on Dr Sambudha Sen to complete the manuscript of a novel

Professor Sambudha Sen, Head of the Department of English at Shiv Nadar Institution of Eminence, Delhi-NCR, was awarded a residency at the...

Editorial / June 22, 2023
The Power of the Moving Body

Movement is an innate bodily action that humans have been exhibiting for the longest time. Long before language was invented, the body was the...

Editorial / June 22, 2023
How Does A Multi-Disciplinary Approach To Education Enhance Learning And Prepare Students For A Multi-Faceted World?

In today’s world, where businesses are changing almost every day, it is the responsibility of educational institutes to provide holistic...