Lesson 2 of 3 · Embeddings & Semantic Search
OpenAI Embedding Models
A machine learning engineer at a legal tech startup needed to build a contract similarity engine. She tested three embedding models on 10,000 legal documents. text-embedding-3-small found similar contracts with 89% accuracy. text-embedding-3-large hit 94%. But when she used the dimensions parameter to reduce text-embedding-3-large from 3,072 dimensions to 1,024, accuracy only dropped to 92% while storage costs fell by 67%. That single parameter saved her company $14,000 per year in vector database hosting.
Choosing the right embedding model is a cost-accuracy-speed tradeoff. This lesson covers every option and helps you make the right choice.
3
OpenAI embedding models to choose from -- each with distinct cost-performance characteristics
The Three Models
text-embedding-3-small
The workhorse. 1,536 dimensions by default. The cheapest option and fast enough for real-time applications. This is the model you should start with for most projects.
MTEB benchmark score: 62.3% (average across retrieval, classification, and clustering tasks)
Best for: Most production applications, high-volume processing, applications where cost matters more than maximum accuracy, prototyping and experimentation.
text-embedding-3-large
The premium option. 3,072 dimensions by default -- twice the dimensionality of text-embedding-3-small, capturing more nuanced semantic relationships. Higher accuracy on difficult retrieval tasks where subtle differences in meaning matter.
MTEB benchmark score: 64.6%
Best for: Legal document comparison, medical literature search, academic research, any domain where the difference between "similar" and "nearly identical" matters. Also useful when you need the dimensions parameter to find a custom accuracy-cost tradeoff.
text-embedding-ada-002 (legacy)
The previous generation. 1,536 dimensions, no dimensions parameter for reduction. Still functional but outperformed by text-embedding-3-small at a lower price. No reason to use this for new projects.
MTEB benchmark score: 61.0%
Best for: Nothing new. Only relevant if you have an existing system built on ada-002 and migration is not worth the effort.
The Dimensions Parameter
This is the most powerful and underused feature of the text-embedding-3 models. You can request embeddings with fewer dimensions than the default, and the model produces a compressed vector that retains most of the semantic information.
Why does this matter? Smaller vectors mean:
- Lower storage costs: A vector database storing 1 million 3,072-dimension vectors uses ~12 GB. At 1,024 dimensions, that drops to ~4 GB.
- Faster search: Comparing shorter vectors requires fewer mathematical operations.
- Lower memory usage: Smaller vectors fit in RAM, enabling faster indexing.
MTEB Scores: What They Mean
MTEB (Massive Text Embedding Benchmark) evaluates embedding models across dozens of tasks in multiple categories:
| Task Category | What It Tests | Example |
|---|---|---|
| Retrieval | Finding relevant documents for a query | Search engines, RAG |
| Classification | Categorizing text by topic or sentiment | Spam detection, routing |
| Clustering | Grouping similar texts together | Topic discovery, deduplication |
| Semantic similarity | Rating how similar two texts are | Duplicate detection, paraphrase identification |
| Pair classification | Determining if two texts have a specific relationship | Entailment, contradiction |
A model with a higher average MTEB score is not necessarily better for your specific use case. text-embedding-3-small might outperform text-embedding-3-large on certain retrieval tasks while underperforming on clustering. Always benchmark on your actual data with your actual queries. The leaderboard is a starting point, not a verdict.
Token Limits and Pricing
Embedding models have a maximum input length of 8,192 tokens (roughly 6,000 words). Inputs longer than this are silently truncated -- the model processes only the first 8,192 tokens and ignores the rest.
Pricing is per token, with batch discounts for large volumes. For cost estimation:
Measure the Dimensions Tradeoff
beginnerStart with text-embedding-3-small for new projects. Use the dimensions parameter on text-embedding-3-large to find your optimal accuracy-cost point. Benchmark on your actual data before committing to a model.
Use text-embedding-ada-002 for new projects -- it is outperformed by newer models at lower cost. Assume higher MTEB score means better results for your use case. Let long texts silently truncate -- chunk them explicitly instead.
Use ← → to navigate, Space to mark complete