LLM extraction isn’t the hard part – modelling the knowledge in context is

08/25/2026

The first demo of contract extraction with a language model is almost always impressive. You feed in a contract and get the parties, term, amounts and notice periods back as clean data. After an afternoon the problem looks solved.

It isn’t. Extraction delivers the nodes. The knowledge lives in the edges – and in the layers a contract is embedded in.

A contract is a knowledge model

Behind every contract there is an ontology: parties, services, obligations, rights, deadlines, conditions and defined terms – and the relations between them. A notice period depends on a term, a penalty on an obligation, an obligation on a definition (“Services as defined in this Agreement”).

This can be described as a technical graph: nodes for parties, clauses, obligations and terms; edges for “refers to”, “defines”, “amends”, “takes precedence over” and “depends on”. A reference such as “pursuant to clause 4.2” is an edge, not a string.

No contract stands alone

The model of a single contract is embedded in layers that have a say:

  • The contract stack: individual contract or call-off, framework agreement, annexes and SLA, general terms and conditions, amendments.
  • Mandatory law: limits no party can negotiate away – consumer protection, public policy, the review of standard terms.
  • Default law: the statute that applies where the contract is silent.
  • Case law: not a layer of norms of its own in civil-law systems, but it shapes how clauses are read and which of them survive review.

The law does not simply sit on top. Mandatory law ranks above the contract, default law below it – the contract may override it. Modelling “the legal framework” as one top layer gets the most common case wrong.

Precedence is not an order but a set of rules

When two layers contradict each other, conflict rules decide:

  • Lex superior: the higher norm prevails over the lower – mandatory law over the contract.
  • Lex specialis: the more specific rule prevails over the general one – the individual contract over the framework agreement, an individually negotiated term over the standard terms.
  • Lex posterior: the later rule prevails over the earlier one – the amendment over the original text. For this the model needs time: versions and effective dates.
  • The order-of-precedence clause: “In case of conflict: 1. … 2. …” – a rule about rules that is itself part of the model.

These rules can contradict each other. When an older specific rule meets a newer general one, the later general rule does not displace the earlier specific one (lex posterior generalis non derogat legi priori speciali). A system that models precedence as a simple sort order decides such cases silently – and wrongly. The conflict rules belong in the model as data, together with a record of which rule decided which conflict.

Three levels of decision

  • The system decides by rule – where a precedence rule resolves the conflict unambiguously. It shows which rule and which source were decisive.
  • A human acknowledges – where the outcome is clear but has legal consequences: a clause that fails against mandatory law, a deviation from the framework agreement.
  • A human weighs – where no rule decides: in interpretation, in good faith, with a clause that may be grossly unfair, with two rules of equal rank pointing in different directions. The system lays out the positions with their sources; it cannot decide.

Every human decision goes back into the model – who, when, and why. That keeps it traceable, and the next contract goes faster.

What this means for a reliable system

  • Every value with its source: document, page, section – and the layer it comes from.
  • Conflicts as objects: a contradiction is not silently resolved but stored – with both sources and the rule that decides it, or a note that none does.
  • Rules before trust: deterministic checks for everything that can be checked – deadlines, sums, dependencies, precedence.

A language model delivers the nodes. The knowledge of how they connect – the edges, the layers and the rules between them – has to be modelled. And where the rules end, it takes a human who weighs.