The VectorStackAI blog
Search That Works

vstackai-law-1: a best-in-class legal embedding model.

Announcing our embedding model for legal retrieval: top of the MTEB law leaderboard, a 32,000-token context, multilingual coverage, and roughly 3x the accuracy per dollar of the nearest legal-domain rival.

Shreyas Saxena · Founder, VectorStackAI
Dec 2024·6 min read
TL;DR
  • vstackai-law-1 is our embedding model for legal document retrieval. It tops the MTEB law leaderboard with the highest average NDCG@10 across eight legal datasets, ahead of VoyageAI's voyage-law-2 and OpenAI's text-embedding-3-large.

  • It reads up to 32,000 tokens per input, double voyage-law-2's limit, so long contracts and full case documents embed without chunking.

  • It is multilingual across English, major European languages, and Chinese, with its largest wins on the hardest non-English datasets: LeCaRDv2 (Chinese) and GerDaLIR (German).

  • At $0.04 per million tokens, it delivers roughly 3x higher accuracy per dollar than the nearest domain-specific alternative, with binary quantization and variable-length embeddings to cut vector database costs further.

At VectorStackAI, we build foundational components for a Generative AI stack that can be optimized end to end for specialized industries. This post focuses on the legal domain, a field ripe for transformation through Generative AI.

A significant portion of legal work involves sifting through vast repositories of cases, documents, and contracts, which makes it an ideal field for AI-driven optimization. With GenAI, legal professionals can improve how they conduct research across case law, precedents, and statutes, how they draft documents, and how they derive insights from complex legal materials.

Embeddings: the backbone of legal AI

Embedding models are the foundation of any AI application in the legal domain. They take text as input and transform it into a sequence of numbers, known as an embedding. The figure below shows the practical shape of this: a legal query is processed by the embedding model to produce its embedding, which a vector database then compares against the embeddings of an entire corpus. The document closest to the query comes back.

legal query“Are there legal benefitsto incorporating astartup in Delawareinstead of anotherstate?”embedding modelvstackai-law-11.00.60.30.50.11.11.30.2corpus documentsTerms and Conditionsof Employmentembedding modelvstackai-law-1vector databaseprivacy & GDPRmergers & acquisitionsincorporationqueryretrieveddocumentCorporate PolicyBrief on DelawareIncorporation“Delaware is hometo more than 60%of Fortune 500companies…”
Documents and queries meet in the same vector space: the corpus is embedded into the database, the query is embedded the same way, and the nearest document comes back. The embedding model decides what counts as close, so retrieval quality is embedding quality.

This example is a simplified overview, but the real-world applications reach much further. Embedding models improve legal tasks such as identifying similar cases, finding relevant precedents, and locating applicable statutes, streamlining and accelerating legal research and analysis.

Why generic embedding models fall short on legal text

Compared to most text domains, legal text presents unique challenges: precise language, nuanced context, and specialized terminology. Generic embedding models from providers like OpenAI, Cohere, and Mistral offer broad applicability, but they fail to capture the intricate details of legal text with the accuracy that high-stakes legal applications require.

The comparison below shows the top passage retrieved by OpenAI's text-embedding-3-large next to the one retrieved by vstackai-law-1 for the same query. The generic model's passage is related to the query, mentioning relevant terms and concepts, but it does not answer the question. vstackai-law-1 retrieves a precise, contextually accurate passage that cites the governing precedent directly.

queryWhat legal precedent governs the doctrine of contributory negligence in product liability cases under U.S. law?
retrieved by · text-embedding-3-large
Related terms, no answer

“Contributory negligence is a concept in contract law that invalidates agreements if one party is found to have contributed to the misunderstanding of the contract terms. This principle arises when a contractual dispute centers on whether the actions or inactions of one of the parties directly led to a misinterpretation of key provisions, obligations, or expectations within the agreement.”

contract law, not product liability; the question is unanswered
retrieved by · vstackai-law-1
The governing precedent, cited

“In U.S. law, contributory negligence has historically been a common law doctrine applied in various tort cases but has largely been replaced by comparative negligence frameworks across most jurisdictions. In the context of product liability, courts frequently turn to principles outlined in Restatement (Second) of Torts § 402A, which established strict liability for defective products.”

direct answer, with the controlling authority
Top retrieved passage for the same query. The generic model retrieves the topic; the legal model retrieves the answer.

Best-in-class legal-domain embeddings

To bridge this gap, we developed vstackai-law-1, an embedding model built specifically for the legal domain. The model is trained on a comprehensive, high-quality corpus of legal text spanning a wide range of complexities, languages, and subdomains: some training tasks retrieve relevant contracts for a query, others identify legal precedents from case documents. The training process pairs a legal-domain curriculum learning framework with a novel metric learning formulation.

Key features of vstackai-law-1:

Capabilityvstackai-law-1voyage-law-2
Max sequence lengthtokens per input32k16k
Cost$ per million tokens$0.04$0.12
Latencyseconds0.73.3
Variable embedding sizebinary quantization, variable lengthYesNo
Operating characteristics against the nearest domain-specific rival: double the context, a third of the cost, and a fraction of the latency.

Quantitative evaluation on real-world datasets

We evaluated vstackai-law-1 against the domain-specific competitor, VoyageAI's voyage-law-2, and leading generic models: OpenAI's text-embedding-3-large, Mistral's mistral-embed, and Cohere's embed-english-v3. The benchmark covers eight datasets spanning contracts, Supreme Court cases, and statutes, scored with NDCG@10, a standard measure of ranking quality. The full evaluation is on MTEB's law leaderboard.

Datasetvstackai-law-1voyage-law-2MistralOpenAICohere
LegalSummarization68.3768.9066.5171.5561.70
ConsumerContractsQA81.7283.2775.4679.3977.12
CorporateLobbying95.2895.6694.0195.0993.68
AILACasedocs45.8844.5638.7639.0031.54
AILAStatutes47.1245.5138.0741.3127.15
LeCaRDv2Chinese75.9572.7568.5657.2021.02
LegalQuADGerman64.9067.4759.6457.4726.08
GerDaLIRGerman50.0444.9137.1832.776.05
Average66.1665.4059.8059.2043.04
NDCG@10 across eight legal retrieval datasets; bold marks the best score per row. vstackai-law-1 takes the top average, with its largest margins on the multilingual case-retrieval sets.

vstackai-law-1 posts the top average score, and its margins are largest exactly where the task is hardest. On LeCaRDv2 (Chinese) and GerDaLIR (German), which involve embedding large and complex legal cases, the second-best model drops off sharply while vstackai-law-1 holds. That is the payoff of specialized training on high-quality, domain-specific, and challenging legal data.

Beyond accuracy, vstackai-law-1 delivers exceptional cost-efficiency: roughly 3x higher accuracy per dollar than VoyageAI's legal model. This is a critical advantage for enterprise-scale applications, where embedding millions of tokens is a regular requirement. Combining state-of-the-art accuracy with a low cost per million tokens lets organizations achieve top-tier results while significantly reducing operational expenses.

3× higher accuracy per $706050400.030.060.090.120.15$ / million tokensNDCG@10vstackai-law-1voyage-law-2MistralOpenAICohere
Average NDCG@10 against price per million tokens. vstackai-law-1 sits alone in the top-left corner: above the accuracy of the best domain rival at a third of its price, 3× higher accuracy per dollar.

Conclusion and next steps

The launch of vstackai-law-1 demonstrates the transformative potential of domain-specific models in legal text analysis, offering precision, efficiency, and scalability that generic models do not reach. It also addresses a key enterprise challenge: the cost and complexity of fine-tuning generic models. vstackai-law-1 is designed for efficient fine-tuning, so organizations can reach state-of-the-art performance on their own requirements quickly and cost-effectively.

If your organization is interested in exploring our models, providing feedback, or requesting a custom legal embedding model, write to us at inquiry@vectorstack.ai. For the work we do with legal teams today, see our legal solutions.

photo
later
Shreyas Saxena
Founder, VectorStackAI

A decade optimizing ML across the layers it runs on: a PhD at INRIA, end-to-end ML at Apple, and hardware-aware optimization as a Principal Research Scientist at Cerebras. VectorStackAI is the synthesis: optimize the product metric by integrating across the stack, not competing within a layer.

Get the next one in your inbox.

New essays from Search That Works and the rest of the blog. No cadence promises, no funnel. Just the writing.

Related writing.

Search That Works
Component benchmarks lie. Tune the stack.

A ten-point component lead all but disappeared in the stack that shipped. The product boundary, not the leaderboard, is where the decision belongs.

9 min read · Jun 2026
From the Field
Legal tool calls, decomposed.

A field note on legal tool-call optimization: thin tool routing, per-tool argument builders, and failure-driven prompt/program optimization for higher argument accuracy with less context pressure.

11 min read · Jul 2026coming soon
From the Field
What a legal AI platform actually bought.

A field note on the legal-retrieval engagement: the all-premium build's accuracy with lower latency, lower embedding cost, and proprietary retrieval assets deployed in their VPC.

13 min read · Jul 2026coming soon