Skip to main content
Try Lexiel for freeTry now →
How to Verify Legal Citations with AI and Avoid Hallucinations: Guide for Lawyers

How to Verify Legal Citations with AI and Avoid Hallucinations: Guide for Lawyers

Product6 min read

AI hallucinations are the biggest risk for lawyers using ChatGPT or Copilot. Learn to detect them, avoid them, and how automatic citation verification works in Lexiel against BOE and CENDOJ.

by Equipo Lexiel

Table of contents
  1. The Case That Changed Everything
  2. What Is an AI Hallucination in Legal Context
  3. How RAG Helps Solve the Problem at Source
  4. How Lexiel Citation Verification Works

The Case That Changed Everything

In 2023, in Mata v. Avianca, a lawyer filed a brief before a federal court in New York citing several judicial decisions as precedents. The judge asked to see them. They did not exist. ChatGPT had invented them. The lawyer was sanctioned. The risk is identical in Spain.


A generative language model without access to verified databases doesn't "search" information, it generates plausible-sounding text based on statistical patterns. In legal context: citing judgments that were never handed down, inventing article numbers or attributing to a real article something it does not say, citing repealed rules as current law.

The problem: the generated text sounds convincing. Correct format, correct numbering, correct legal language. No external signal that it's false.


How RAG Helps Solve the Problem at Source

RAG (Retrieval-Augmented Generation): the system first searches official sources (BOE, CENDOJ, TC), then generates the answer based on the retrieved fragments. Having the source text in front of the model greatly reduces inventions but does not remove them entirely, which is why a verifier that checks each citation is also needed.


How Lexiel Citation Verification Works

Lexiel's chat answers go through the verifier; you can also verify a brief from its editor, or paste any text (including one written with another tool) into the citation verifier in the tools section. The system extracts legal references, checks legislation against the BOE consolidated text (does the article and paragraph exist, is the statute in force, is the article about what the sentence says) and case law against CENDOJ and Lexiel's corpus, and marks each one: Verified / Pending (the source did not respond or the reference is ambiguous) / Not confirmed (the source responded and does not contain it) / Unverifiable. Every unverified citation carries a note with the reason.

Try Lexiel's citation verifier free →

Try Lexiel free · 28 days

Use code LEX-BLOG for double the standard trial period. Cancel anytime, no commitment.

Get started free

Keep reading

Weekly legal updates

Legislative changes, relevant case law, and Lexiel news. No spam. Unsubscribe anytime.

GDPR compliant. We never share your email with third parties.