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.
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.
“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.”
“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.”
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:
- Multilingual support. The model handles English, major European languages (German, Dutch, French), and Chinese.
- Variable embedding size. Embeddings are 1,536 dimensions by default, with binary quantization and variable-length embeddings (in the spirit of Matryoshka representations) for teams that want to reduce vector database hosting costs.
- Extended token limit. Competitor models like voyage-law-2 process inputs up to 16,000 tokens; vstackai-law-1 accommodates sequences up to 32,000 tokens, so large legal documents embed in their entirety with no chunking.
| Capability | vstackai-law-1 | voyage-law-2 |
|---|---|---|
| Max sequence lengthtokens per input | 32k | 16k |
| Cost$ per million tokens | $0.04 | $0.12 |
| Latencyseconds | 0.7 | 3.3 |
| Variable embedding sizebinary quantization, variable length | Yes | No |
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.
| Dataset | vstackai-law-1 | voyage-law-2 | Mistral | OpenAI | Cohere |
|---|---|---|---|---|---|
| LegalSummarization | 68.37 | 68.90 | 66.51 | 71.55 | 61.70 |
| ConsumerContractsQA | 81.72 | 83.27 | 75.46 | 79.39 | 77.12 |
| CorporateLobbying | 95.28 | 95.66 | 94.01 | 95.09 | 93.68 |
| AILACasedocs | 45.88 | 44.56 | 38.76 | 39.00 | 31.54 |
| AILAStatutes | 47.12 | 45.51 | 38.07 | 41.31 | 27.15 |
| LeCaRDv2Chinese | 75.95 | 72.75 | 68.56 | 57.20 | 21.02 |
| LegalQuADGerman | 64.90 | 67.47 | 59.64 | 57.47 | 26.08 |
| GerDaLIRGerman | 50.04 | 44.91 | 37.18 | 32.77 | 6.05 |
| Average | 66.16 | 65.40 | 59.80 | 59.20 | 43.04 |
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.
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.
later
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.