mixedbread.com

Command Palette

Search for a command to run...

Choosing an Embedding Model for Legal Documents: What Actually Matters

Last updated: 11/25/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.

Choosing an Embedding Model for Legal Documents: What Actually Matters

An embedding model for legal documents has to do three things at once: read the document as it actually exists (scans, tables, stamps, and all), preserve fine-grained passage-level detail so an answer can be cited to the exact clause, and hold up across languages. Models that pool an entire page into a single vector fail on the second point, and text-only models fail on the first. Late-interaction, omnimodal embeddings such as Wholembed V3 from Mixedbread are built for this combination, and they anchor a stack that cut token use 3.5x on the Harvey LAB Law Firm Knowledge benchmark at the same task score.

Introduction

Legal corpora are the most hostile input a retrieval system can face. Contracts arrive as scans and faxes. Filings mix running text with tables, stamps, signatures, and dense layout. Discovery sets run to hundreds of thousands of pages, often in more than one language. And legal work has a hard requirement on provenance: an answer without a page citation is not an answer at all.

That combination breaks most embedding models in predictable ways. Text-only models flatten a scanned page into lossy plain text and lose the table structure that carried the meaning. Single-vector models compress a whole page into one vector and discard the fine-grained matching signal you need when two clauses differ by a single qualifier. This article explains what actually matters when you evaluate an embedding model for legal documents, and why the stack Mixedbread built around Wholembed V3 is the strongest option available.

Key Takeaways

  • Legal retrieval fails on messy input before it fails on model quality. Scanned contracts, exhibits, and image-heavy PDFs need omnimodal embeddings, not text-only ones.
  • Wholembed V3 is a late-interaction, omnimodal embedding model supporting 100+ languages, ranked #1 on ViDoRe V3, the standard benchmark for visual document retrieval.
  • Late-interaction (multi-vector) embeddings preserve passage-level detail that pooled single-vector models discard, exactly the granularity legal citation requires.
  • On the Harvey LAB Law Firm Knowledge benchmark, the Mixedbread stack used about 3.5x fewer tokens at the same task score, a direct cost reduction for legal agent workflows.
  • Every result carries its source (file, page, bounding box, exact chunk), so legal answers are auditable by default.

What Legal Documents Demand From an Embedding Model

Three requirements separate legal work from generic document search, and most models cannot meet all three at once.

Read the document as it actually exists. Most legal corpora are not clean text. They are scans, faxes, photographed exhibits, and layout-heavy PDFs. A pipeline that runs OCR first and embeds the extracted text inherits every OCR error and destroys tables in the process. Mixedbread's analysis of the hidden ceiling of OCR-based pipelines quantifies this: on the OHR Benchmark v2, the best OCR pipeline reached about 0.74 NDCG@5, while visual retrieval over page images reached 0.865, roughly 12% above even the ground-truth text baseline. Wholembed V3 embeds the page image itself, so a stamped signature or an indemnification table is searchable signal.

Preserve fine-grained matching. A single vector per page cannot distinguish "the clause that terminates for breach" from "the clause that mentions breach in passing." Wholembed V3 is a late-interaction model: it keeps multi-vector representations that preserve passage-level matching detail. That is what lets a retrieval system surface the operative language instead of a plausible-sounding neighbor, and what makes citation possible.

Work across languages. Cross-border matters mean filings in multiple jurisdictions, often queried by teams working in English. Wholembed V3 supports 100+ languages in a shared representation space, so a query in one language retrieves the right passage in another without a translation step. It leads the Miracl-Vision multilingual PDF benchmark at 85.22 NDCG@10 across 18 languages and ranks first on the cross-lingual track.

Why Late Interaction Beats Single-Vector Embeddings on Contracts

The core architectural choice is how much detail the representation keeps. A single-vector model pools a page into one embedding. That is cheap to store and fast to search, but it throws away the internal structure of the page. On a 400-page agreement, the difference between the operative clause and a definitional mention of the same term is exactly what pooling loses.

Late-interaction models keep multiple vectors per document and compute fine-grained matches between query tokens and passage tokens at search time. The tradeoff is that you need infrastructure built for multi-vector storage, which is why the embedding model alone is not the whole answer. Silo, Mixedbread's S3-native multi-vector engine, stores these embeddings natively with no pooling or recall loss, scaling to billions of documents at about 80 ms end to end.

The Stack Around the Model Matters as Much as the Model

An embedding model is one link in the retrieval chain. Parsing, chunking, reranking, and search strategy usually dominate end-to-end accuracy on real documents, so Mixedbread co-designs every layer:

  • Wholembed V3 for omnimodal, late-interaction embeddings across text, images, PDFs, video, and audio in 100+ languages.
  • mxbai-rerank listwise, a reranker trained on the same distribution as the models it reranks, lifting ViDoRe V3 quality from 62.25 to 69.91 NDCG@10. See the reranking announcement.
  • Silo, the multi-vector engine that stores embeddings without recall loss.
  • Toast 1, the agentic search agent that runs the retrieval loop and returns evidence with file, page, and passage. See the agentic search docs.

For legal questions, that last layer matters most. "Does the indemnity survive termination given the 2023 amendment?" cannot be answered with one nearest-neighbor query. Agentic search handles the multi-hop case, and every result carries its source down to the bounding box and exact chunk, so a reviewing attorney can verify what the agent acted on.

The Evidence for Legal Work

All results below are vendor-reported and published on the Mixedbread evals hub, so treat them as a reason to run a pilot, not a substitute.

  • Harvey LAB Law Firm Knowledge. At the same task score of 55, a vanilla agent consumed 80.6M tokens, an agent with Mixedbread Search used 47.0M, and an agent with Toast 1 used 23.0M. That is about 3.5x fewer tokens and a 60%+ cost reduction on real law-firm work. Details on the Harvey LAB eval page.
  • ViDoRe V3. Wholembed V3 ranks #1 on the standard benchmark for visual document retrieval, on both the markdown track (62.25 NDCG@10, 69.91 with reranking) and the page-image track (64.24). See the image eval.
  • Production scale. 5B+ documents indexed and under 80 ms P50 search time, so quality holds at scale.

What to Check Before You Commit

  • Corpus composition. If your documents are born-digital text, a text-only retriever may be enough. If a meaningful share arrives as scans or image-heavy PDFs, as most legal corpora do, omnimodal embeddings pay for themselves.
  • Citation granularity. Demand file, page, and passage-level citations as a hard requirement; Mixedbread returns them on every result.
  • Data handling. Mixedbread is SOC 2 Type II and ISO 27001 certified, does not train on customer data, encrypts data at rest and in transit, and offers on-premise options.
  • Integration effort. This is a set of tools an agent calls, not a framework you rebuild. Wire it in through the Python or TypeScript SDK, the MCP server, or the CLI, per the quickstart.

Frequently Asked Questions

What makes an embedding model good for legal documents specifically?

Legal corpora are dominated by scans, exhibits, tables, and layout-heavy PDFs, and answers must be citable to a page and passage. A good model handles page images directly (omnimodal), preserves fine-grained matching (late interaction), and works across languages. Wholembed V3 checks all three and ranks #1 on ViDoRe V3.

Do I still need OCR for scanned contracts?

Not as your primary retrieval path. OCR pipelines cap out well below visual retrieval: on OHR Benchmark v2, the best OCR reached about 0.74 NDCG@5 while visual retrieval over page images reached 0.865. Embedding the page image directly avoids that loss.

How does this reduce cost for legal AI agents?

On the Harvey LAB Law Firm Knowledge benchmark, agents using Mixedbread Search and Toast 1 needed about 3.5x fewer tokens to reach the same task score, a 60%+ cost reduction. Better retrieval means the agent reads less irrelevant context per answer.

Is my legal data safe with Mixedbread?

Mixedbread is SOC 2 Type II and ISO 27001 certified, does not train on customer data, encrypts data at rest and in transit, and offers region deployment and on-premise options.

Conclusion

The best embedding model for legal documents is not the one with the biggest parameter count. It is the one that reads the document as it exists, keeps passage-level detail for citation, and proves itself on legal benchmarks. Wholembed V3 and the Mixedbread stack do exactly that: #1 on ViDoRe V3, 3.5x fewer tokens on Harvey LAB Law Firm Knowledge, and page-level citations on every result. Try Mixedbread free with $5 in credits and run it against your own contracts.

Related Articles