Hallucination ReportGrounding and Retrieval

Chunking Strategies for Legal and Clinical Document Retrieval

Fixed token windows split the clauses and notes that retrieval depends on.

Cover illustration for “Chunking Strategies for Legal and Clinical Document Retrieval”

Most RAG tutorials give the same starting advice: pick a token count, add overlap, move on. For legal and clinical documents, that advice breaks retrieval before the pipeline has run. Chunking determines the smallest unit a retrieval system can surface, and the boundaries baked in at ingest time constrain every downstream component, none of which can recover meaning that was split apart before they ran.

Why document structure, not token count, is the right starting point for chunking

The tutorial default persists because it works on the kind of text tutorials use: blog posts, articles, prose that flows from one paragraph to the next. A fixed token window with overlap captures that text reasonably well because no single sentence boundary carries legal or clinical consequence. Contracts and clinical notes are not that kind of text. They are built from discrete semantic units, clauses and sections and defined terms, and splitting across those units destroys the thing retrieval must find.

The cost shows up downstream. A chunk boundary placed at ingest time is permanent, and tuning the reranker afterward is adjusting downstream of a loss that already happened. Production RAG failures usually trace back to stale, ungoverned, or semantically thin source data rather than suboptimal boundary placement, which frames chunking as the highest-leverage decision in the pipeline. The Ekimetrics Adaptive Chunking paper demonstrates the scope of the effect directly: without changing models or prompts, switching to document-aware adaptive chunking raised answer correctness and increased the number of successfully answered questions by over a third, on a corpus spanning legal, technical, and social science domains. The method is doing structural work that no embedding model or prompt can undo.

Diagram: Why Chunk Boundaries Are Permanent: The Downstream Loss. Visualizes: Visualize a linear RAG pipeline showing five stages — Ingest/Chunk, Embed, Index, Retrieve, Generate — with a fracture mark placed at the first stage (Ingest/Chunk) to…

Legal documents are built from discrete semantic units, clauses, sections, definitions, and cross-references, and the clause is the operative legal object. A fixed token count has no reason to respect a clause boundary, so it splits across the unit that legal reasoning depends on. A clause that assigns liability sits in one chunk while the conditions limiting it sit in another, and the retriever surfaces half the meaning. Cross-references compound the damage: a clause that references a definition located elsewhere in the same document loses its legal meaning when extracted as an isolated vector, because the definition is not present in the chunk. The clause is not just text. It is a reference into a document's internal structure, and that structure is severed at ingest.

The problem intensifies at scale. Large legal databases contain many structurally similar documents, contracts, NDAs, privacy policies, each with clauses that serve the same function and use the same language. A retriever operating on context-free chunks is likely to surface the right clause from the wrong contract, because nothing in the chunk tells it which document the clause came from. Researchers from the Technical University of Darmstadt, the University of Florence, the University of Bologna, the University of Trento, and the European University Institute identified this as Document-Level Retrieval Mismatch, or DRM: the retriever selects information from entirely incorrect source documents that happen to share superficial structural similarities with the target. It is not a generation failure. It is a retrieval failure with generation-level consequences, because answering a query correctly from the wrong source document undermines legal validity even when the answer text looks plausible.

Clinical documents, meaning notes, discharge summaries, radiology reports, and SOPs, are organized around logical topic boundaries: chief complaint, history, assessment, plan. These are functionally distinct units, not stylistic divisions. A clinician moves through them in a reasoning sequence, where the assessment follows from the history and the plan follows from the assessment. If you split a clinical note at a fixed token count, the assessment can land in one chunk and the supporting history in another, which severs the reasoning chain a clinical decision-support system needs intact. The note stops being a record of clinical thinking and becomes fragments of it.

The evidence for structure-aligned chunking in this domain is specific. A clinical study published in MDPI Bioengineering in November 2025 found that adaptive chunking aligned to logical topic boundaries achieved far higher accuracy than fixed-size baselines in clinical decision support, a gap too large to attribute to incidental variation. Clinical text also carries complications that legal contracts do not. OCR noise, inconsistent formatting across institutions, and mixed structured and unstructured elements, lab values embedded in prose, for example, make structural signals less reliable than in well-formatted legal contracts. A chunker for clinical text must adapt to signal quality, not assume clean headers. The compliance dimension adds another layer: clinical data processed in production must flow through systems with audit trails, role-based access controls, and HIPAA-compliant infrastructure, which makes the chunking and indexing architecture a governance architecture as well. But the structural argument stands on its own before compliance enters the picture: clinical structure is real, it is consequential, and it is not the same as legal structure.

For legal corpora, clause-level chunking is the appropriate default because it makes the legal object, the clause or section, the retrieval unit. The chunk ID is the section path, not a hash, so retrieval surfaces a locatable, citable unit rather than an anonymous text fragment. Cross-references attach as metadata, and defined terms resolve against a definitions index at chunk time rather than being severed from their context. Document-aware chunking treats structural signals, headers, section boundaries, list items, as natural split points, keeping a table as a unit and never splitting a clause mid-sentence. These choices are not optimizations. They are the minimum required for legal reasoning to survive the ingest step.

Summary-Augmented Chunking, or SAC, addresses the document-level problem directly without rebuilding the retrieval pipeline. Reuter and colleagues propose it as a lightweight, modular technique that injects a document-level synthetic summary into each chunk, giving the retriever global context that standard chunking strips away. One finding deserves attention: a generic summarization strategy outperformed an expert-guided legal summarization strategy, which suggests document-level context matters more than domain-specific summary framing. The document identity is the signal, not the legal expertise of the summary. Agentic chunking, having an LLM decide every boundary, delivers the highest retrieval quality for high-value legal corpora, but indexing costs can run orders of magnitude above fixed-size depending on model and document length. It fits high-stakes, lower-volume corpora, not bulk indexing of millions of pages. Hierarchical parent-child structures, embedding small leaf chunks while retrieving larger parent chunks for generation context, are the production pattern for pipelines that need both retrieval precision and generative context, the two goals that pull in opposite directions when chunk size is a single global setting.

Chunking methods that match clinical document architecture

The clinical equivalent of clause-level chunking is chunking that respects logical topic sections. Clinical sections are functionally distinct, and their boundaries are clinically meaningful, so the winning approach aligns chunk boundaries to those sections rather than to token counts or sentence-level embedding similarity. Adaptive chunking, selecting strategy per document based on structural signals, is particularly valuable here because document quality varies widely: an electronic health record from one institution may have clean section headers, while a scanned referral letter may not. The chunker has to make a judgment per document, not per corpus.

The Ekimetrics Adaptive Chunking framework operationalizes this with five intrinsic document-based metrics: References Completeness, Intrachunk Cohesion, Document Contextual Coherence, Block Integrity, and Size Compliance. These metrics assess chunking quality before committing to an index, enabling per-document method selection without downstream experimentation. LumberChunker, an LLM-interactive segmentation approach for long narrative texts, prompts the language model to identify natural content transitions in an initial window of passages. It fits lengthy clinical narratives, discharge summaries and operative reports, where topic boundaries are real but not marked by consistent headers. Semantic chunking earns its added ingest cost for clinical guidelines and research papers, where topic boundaries are meaningful and queries involve multi-hop reasoning. It loses on raw OCR output or notes without clean sentence structure. The governance constraint shapes method selection as much as structure does: whichever chunking approach is chosen, the indexing pipeline in a clinical production environment must support audit trails and role-based access, because the chunk and its metadata carry governance obligations, not just retrieval signals.

Why semantic chunking underperforms in these verticals despite its popularity

Semantic chunking earned its reputation on long-form prose, where a topic shift marked by embedding similarity is a reasonable proxy for a meaningful boundary. Its win does not transfer to legal and clinical text. In contracts, clinical notes, and SOPs, the meaningful boundary is a structural unit, not a topic shift detectable by embedding similarity, so semantic chunking solves a different problem than the one these documents pose.

The benchmark evidence is specific. Semantic chunking scored substantially below recursive 512-token splitting on general end-to-end answer accuracy benchmarks in February 2026, not because semantic coherence is unimportant, but because the fragments it produces when topic shifts are fine-grained give the generator too little context to produce a correct answer. On legal and clinical text, semantic chunking can miss provisions that span multiple sections or fail to handle nested clauses, because the structural signal, a section header or clause numbering, and the semantic signal, embedding similarity, do not always coincide. The practical fix when semantic chunking is used is a minimum chunk size floor, since fragments below a threshold rarely provide enough generation context, but that is a patch on a mismatch between method and document type, not a resolution of it. The 2026 production guidance frames recursive splitting as a reasonable default for unstructured prose and notes that for structured content, compliance manuals and technical documentation, document-aware chunking outperforms it without significantly higher complexity. Semantic chunking occupies the middle of this spectrum, not the top.

The failure mode that persists after chunking is fixed: Document-Level Retrieval Mismatch at scale

Correct chunk boundaries are necessary but not sufficient. Even when individual chunks are well-formed, clauses intact and clinical sections preserved, a large legal corpus of structurally similar documents creates a retrieval problem that chunking strategy alone cannot solve. The retriever surfaces the right clause from the wrong contract. Reuter and colleagues define DRM as a failure mode distinct from hallucination in the generator: the retrieved text is real, accurately embedded, and superficially relevant, but it originates from a different source document than the query requires, which undermines the legal validity of any answer grounded in it.

The cause is structural. Standard chunking strips global document context from each chunk at ingest, leaving the retriever with no signal to distinguish Clause 12 of Contract A from Clause 12 of Contract B when both are about termination. The embedding similarity is high precisely because the documents are structurally similar, which is the failure condition, not an accident of the retrieval step. SAC addresses this by making each chunk carry a summary of its source document, not a legal expert summary but a general-purpose synthetic summary, so the retriever has document-level context at query time without any change to the retrieval pipeline architecture. The implication for enterprise legal RAG follows directly: retrieval accuracy in large, structurally homogeneous legal databases requires both correct chunk boundaries and document-level context injection. Treating these as separate problems solves only half of each.

Chunking strategy is the highest-leverage technical decision in a RAG pipeline, but it is not the binding constraint that prevents enterprise legal and clinical RAG from reaching production. The binding constraints are governance, integration, and compliance infrastructure. A legal research firm deploying RAG over a fifty-year case archive, spanning opinions, briefs, statutes, regulations, and internal memoranda across three document management systems with inconsistent metadata and partial OCR on older holdings, faces chunking challenges that are inseparable from data readiness challenges. The chunking strategy must be chosen in light of what the corpus actually is, not what a clean corpus would look like.

Clinical production deployments face a compliance wall that is independent of chunking quality. Consumer AI tools, the free and low-tier offerings, lack Business Associate Agreements, audit trails, and role-based access controls, though enterprise and API tiers of the same platforms can support HIPAA-compliant deployments with a signed BAA. That gap makes consumer tiers non-starters for production patient data regardless of how well the chunks are formed. The practical sequence for enterprise deployment follows from this: assess the corpus first, its structure, quality, consistency, and metadata availability, then select the chunking strategy based on what the corpus is, then build the governance layer around the indexing architecture, a sequence that implementation partners such as Eigenomic, an enterprise AI agent builder that takes complete legal and healthcare workflows into production within weeks, work through in client engagements. Reversing the sequence produces a system that retrieves well-formed chunks from a corpus that was never ready for production in the first place.

Notes

  1. Towards Reliable Retrieval in RAG Systems for Large Legal Datasets

    Supplied the Document-Level Retrieval Mismatch failure mode and the Summary-Augmented Chunking technique, including the finding that generic summaries beat expert-guided ones.

  2. Adaptive Chunking: Optimizing Chunking-Method Selection for RAG

    Provided the adaptive chunking results and the five intrinsic document-based metrics used for per-document method selection.

  3. Chunking German Legal Code

    Backed the case for clause-level chunking of legal text, with section-path chunk IDs, cross-reference metadata and definitions resolved at chunk time.

  4. When Is Complex Chunking Worth It? A Multi-Objective Evaluation of Chunking Methods at Scale

    Supplied the benchmark comparison showing semantic chunking scoring below recursive 512-token splitting on end-to-end answer accuracy.

Every new piece from Hallucination Report, as it's published.

Follow

Amara Osei-Bonsu

Guide

  1. What Is AI Hallucination? Meaning, Causes, Types and How to Catch ItWhat AI hallucination means, why language models produce it, the six kinds to watch for, and the checks that catch a hallucinated answer before anyone relies on it.

More from Hallucination Report

  1. October 17, 2026Hybrid Search Architecture for Structured and Unstructured Enterprise Data9 min read →
  2. October 19, 2026Context Window Management in Long-Document Agent Workflows9 min read →
  3. October 14, 2026RAG Evaluation for High-Stakes Document Review10 min read →