Key takeaways
An AI assistant cannot reliably answer from company documents if its search layer fails to retrieve the right evidence.
Select embeddings for the actual retrieval task rather than relying on a model's overall benchmark ranking.
Compare keyword search, dense embeddings and hybrid retrieval before investing in a more complex architecture.
Evaluate language coverage, domain terminology, document structure, retrieval quality, latency and data-handling restrictions together.
Treat a change of embedding model as a search-index migration, not simply a change of API configuration.
Before replacing your chatbot, check what it is reading
Imagine an employee asking a company AI assistant whether an overseas medical expense is covered by their insurance policy. The assistant finds a document about domestic hospitalisation and produces a confident answer. The wording is professional, but the evidence is wrong.
The immediate reaction might be to replace the language model with a more powerful one. Yet the failure could have occurred before the answer was generated: the system retrieved the wrong document. A more capable language model may still produce an unreliable answer when it receives incomplete, irrelevant or outdated information.
This is where embedding model selection becomes a practical business decision. In retrieval-augmented generation (RAG), embeddings help the application identify which information to retrieve. Choosing them well can improve the chances that employees and customers receive answers grounded in relevant evidence. Choosing poorly can undermine an otherwise carefully engineered AI application.
How embeddings turn a question into a search
Traditional keyword search looks for words and expressions in documents. Semantic search aims to find passages with related meaning, even when the wording differs.
For instance, an employee may ask, 'Can I claim travel expenses for a client visit?' The relevant policy may use the expression 'reimbursement for business-related transportation'. An embedding model converts each text into a numerical representation, known as a vector, designed to capture useful relationships between texts.
During indexing, the application extracts and divides documents into passages, generates vectors for those passages and stores them alongside document references and access metadata. When a question arrives, a compatible embedding model encodes it. The search engine ranks authorised candidates using a measure such as cosine similarity, subject to the model's recommended settings. [1, 2]
The selected passages may then be supplied to a generative model to compose a response. This division of responsibilities matters: the embedding model helps find relevant evidence; the generative model interprets it. Neither operation by itself guarantees factual accuracy.
Similarity is not the same as validity. A superseded insurance policy may be extremely similar to the current one. Effective dates, product identifiers, document authority and user permissions must therefore remain explicit search conditions.
What is the best embedding model? Start with the task
Finding two nearly identical customer complaints is different from retrieving a paragraph that answers a short technical question. The first task compares similar kinds of text. The second connects a question with a potentially much longer passage. A model suited to one may perform less effectively on the other.
The original Massive Text Embedding Benchmark (MTEB), published in 2023, examined 33 models across 58 datasets and eight task categories. Its authors found that no single embedding approach led every task. [3] A leaderboard is useful for discovering candidates, but an aggregate score is not evidence that a model can understand your organisation's documents.
Consider these selection paths:
General-purpose managed embeddings | Suitable for: rapid implementation and diverse text collections | Check: approved data processing, service availability, per-token charges and retrieval results.
Self-hosted embedding models | Suitable for: workloads requiring greater control over deployment and model configuration | Check: licence terms, hardware capacity, maintenance and security.
Multilingual embeddings | Suitable for: users searching across different languages | Check: retrieval in each required language, including cross-language queries, transliteration and mixed-language text.
Domain-adapted retrieval models | Suitable for: specialised terminology in finance, insurance, medicine or engineering | Check: whether improved domain retrieval justifies extra training or maintenance.
Multimodal embeddings | Suitable for: search involving images, diagrams or visually structured documents | Check: whether the model supports the required input and query modalities; test alongside conventional document parsing.
First eliminate models that cannot satisfy mandatory security, licensing and deployment requirements. Then compare the remaining options against measurable retrieval and business objectives.
Three concrete candidates for a shortlist
OpenAI's text-embedding-3-small is a managed text embedding option with 1,536 default dimensions. Its text-embedding-3-large counterpart has 3,072 default dimensions. Both support requesting shorter output vectors through the documented dimensions parameter. [1] They provide useful comparison points when external processing is authorised; the larger output does not automatically justify its storage or processing cost.
BAAI's BGE-M3 provides a self-hostable candidate with 1,024-dimensional dense embeddings and multilingual capabilities. Its model documentation also describes sparse and multi-vector retrieval modes. [4] These additional modes need appropriate indexing and search infrastructure; they are not automatically available merely because the dense vectors have been stored.
Treat these models as a starting shortlist, not a ranking or an exhaustive list. Establish the exact model version, input instructions, token limit, output dimensions, licence and deployment configuration before running tests. A smaller model that reliably finds the necessary evidence can be a better business choice than a more resource-intensive alternative.
When semantic search needs help from keywords
Suppose a support engineer searches for error code E-1042. A dense vector search might retrieve text discussing related faults but miss the exact identifier. A keyword search can be especially useful in that situation. The reverse may happen when an employee describes a problem using language that does not appear in the knowledge base.
Hybrid retrieval combines the complementary strengths of lexical and vector search. One implementation, documented by Microsoft, merges the rankings from the two search methods using reciprocal rank fusion. [5] A reranker can then examine the most promising passages more closely before the application selects evidence for generation.
The BEIR information retrieval benchmark found that conventional BM25 was a competitive baseline across varied datasets, while reranking and late-interaction approaches performed strongly on average but required more computation. [6] This is a reason to test keyword retrieval and reranking, not proof that any one combination will win in your environment.
Before spending money on a different embedding model, examine document extraction, passage boundaries and metadata. A table separated from its column headings or an insurance exclusion detached from its surrounding clause may be difficult to retrieve and interpret with any model. Preserve document structure and evaluate chunking separately from model selection.
Build a test that reflects how people actually search
An evaluation should begin with real business questions, not a collection of convenient demonstration prompts. Gather authorised, representative queries and ask knowledgeable reviewers to identify the passages that should answer them. Include vague questions, exact identifiers, acronyms, uncommon terminology, obsolete documents, multilingual queries and questions for which no valid answer exists.
Compare a keyword baseline and a small number of eligible embedding models using the same document collection, passage boundaries, permissions and candidate count. Follow each model's required query and document encoding instructions, which may differ for retrieval tasks. [2] Document any necessary configuration differences, and reserve a separate held-out test set for the final comparison.
Recall@k: the proportion of all labelled relevant passages that appears among the first k results, averaged across the evaluated queries. It helps reveal missing evidence. For a question with three required passages, returning two in the top five gives a recall of two-thirds.
MRR (mean reciprocal rank): measures how early the first relevant result appears. If the first relevant passage appears third, its reciprocal rank is one-third. This metric does not establish whether all necessary evidence was retrieved.
nDCG@k (normalised discounted cumulative gain): rewards relevant results appearing near the top and can distinguish highly relevant passages from partially relevant ones. It is useful when reviewers can assign meaningful relevance grades.
Operational measures matter too. Track search latency at the 95th percentile, index creation time, query throughput, cost and resource consumption. Measure answer correctness, citation support, appropriate abstention and serious errors separately in the complete RAG application.
Do not average away important weaknesses. An insurance assistant may perform well across thousands of routine questions while repeatedly missing policy exclusions. Set acceptance criteria for consequential query types and each essential language. Report answerable and unanswerable queries separately and explicitly test that unauthorised documents cannot be retrieved.
Vector dimensions affect more than a benchmark score
An embedding's dimension is the number of numerical values in its vector. More dimensions typically increase raw storage requirements and can increase computational work. They do not provide a universal measure of retrieval quality.
For one million passages stored as uncompressed 32-bit floating-point vectors, the raw storage requirement is the number of passages multiplied by the dimensions multiplied by four bytes. A 768-dimensional representation requires approximately 3.07 GB, a 1,536-dimensional representation 6.14 GB and a 3,072-dimensional representation 12.29 GB, using decimal gigabytes.
These figures exclude search-index structures, metadata, original documents, replicas, backups and other storage overhead. Quantisation and compression can reduce memory usage, but their effects on search quality and latency should be tested.
Budget for the initial embedding of documents, new and changed content, query embeddings, index infrastructure and any reranking service. A managed API may avoid dedicated model-serving infrastructure but introduce usage charges and external-processing dependencies. Self-hosting may offer more control but introduces deployment, monitoring and capacity costs.
A useful economic measure is total search and generation cost per correctly resolved question, including retries and necessary human review. Lower vector-storage costs alone are not a saving if retrieval errors create more work for employees.
Changing models requires a controlled migration
Vectors generated by independently trained models generally occupy different representation spaces, even when they have the same dimensions. Replacing the query encoder without rebuilding the corresponding document vectors can therefore break retrieval without producing an obvious application error.
Maintain a record of the embedding model identifier and revision, query and document instructions, preprocessing, dimensionality, similarity metric, index settings and document version. Use a compatible query encoder for every active index.
For a significant change, build a new versioned index from the approved document corpus. Verify document completeness, access restrictions and deletion handling. Compare the new and existing indexes using the held-out evaluation set and controlled traffic. Keep the previous index available for rollback where retention policy permits.
Embeddings are derived from source information and should not automatically be treated as anonymous or harmless. Protect vectors, text passages, query logs and backups according to their sensitivity. Enforce document-level access restrictions during retrieval and prevent unauthorised content from reaching rerankers or the generative model.
After deployment, monitor evidence quality, missing-result rates, query latency and corpus freshness. Retest when policies change, new languages are introduced, a provider updates its model or the application starts serving materially different questions.
Make the decision about evidence, not model popularity
If a business already has a reliable knowledge search system, adding an embedding model may not be necessary for every query. Direct database lookups, exact-match search or structured policy rules can be more suitable for predictable requests.
For a RAG application that handles diverse questions, choose the simplest eligible retrieval configuration that consistently satisfies evidence-quality, service and security requirements. Use the business impact of incorrect or missing answers to decide how much evaluation and human oversight is appropriate.
If your organisation is experiencing inconsistent AI responses, a focused retrieval assessment can help establish whether the problem lies in embedding model selection, document preparation, search configuration or the generation stage. That diagnosis is a better starting point for investment than replacing a model on the basis of a public leaderboard.
References and further reading
[1] OpenAI. Vector embeddings: API documentation covering text embedding models, default dimensions and configurable vector size. https://developers.openai.com/api/docs/guides/embeddings
[2] Sentence Transformers. Semantic Search and Usage documentation: asymmetric retrieval and query/document encoding. https://www.sbert.net/examples/sentence_transformer/applications/semantic-search/README.html
[3] Muennighoff, N., Tazi, N., Magne, L. and Reimers, N. (2023). MTEB: Massive Text Embedding Benchmark. Proceedings of the 17th Conference of the European Chapter of the Association for Computational Linguistics. https://aclanthology.org/2023.eacl-main.148/
[4] Beijing Academy of Artificial Intelligence (BAAI). BGE-M3 official model card and technical specifications. https://huggingface.co/BAAI/bge-m3
[5] Microsoft Learn. Relevance scoring in hybrid search using Reciprocal Rank Fusion (RRF). https://learn.microsoft.com/en-us/azure/search/hybrid-search-ranking
[6] Thakur, N., Reimers, N., Rücklé, A., Srivastava, A. and Gurevych, I. (2021). BEIR: A Heterogeneous Benchmark for Zero-shot Evaluation of Information Retrieval Models. NeurIPS Datasets and Benchmarks. https://datasets-benchmarks-proceedings.neurips.cc/paper_files/paper/2021/hash/65b9eea6e1cc6bb9f0cd2a47751a186f-Abstract-round2.html
Apply the approach
A knowledge assistant indexes one million document passages. The engineering team compares three vector sizes to estimate raw storage before testing retrieval quality. The figures below are calculated from one million vectors × dimensions × four bytes (float32), expressed in decimal GB. They are not observed production costs or measured model performance.
Raw vector storage; excludes metadata, index structures and replicas.
Twice the raw storage of the 768-dimensional option.
Four times the raw storage of the 768-dimensional option; quality must be evaluated independently.
Put the approach into practice
- 01Catalogue business questions, required languages, document types, permissions and critical retrieval failures.
- 02Build a reviewed evidence dataset with a separate held-out test set and no-answer cases.
- 03Compare keyword, dense and hybrid search using eligible models, consistent inputs and appropriate model settings.
- 04Measure evidence retrieval and complete answer quality alongside latency, operating cost and access-control tests.
- 05Deploy a versioned index only after acceptance checks; monitor performance and maintain a tested rollback procedure.
Frequently asked questions
Is an embedding model the same as a large language model?
Not necessarily. An embedding model produces numerical representations that support tasks such as retrieval and classification. A generative large language model produces text or other outputs. Some architectures can support both tasks, but their roles in a RAG pipeline are distinct.
Can I use different models for document and query embeddings?
Yes, if the encoders were designed or trained to produce compatible representations in the same space. Do not mix independently trained encoders merely because their output dimensions match.
Does a higher similarity score mean the answer is correct?
No. Similarity indicates how the selected search method relates the query to a passage. It does not confirm truth, freshness, authority or completeness. Calibrate thresholds on representative data and verify the evidence before generating consequential answers.
Should I fine-tune an embedding model on my company's documents?
Only when a controlled evaluation demonstrates persistent domain-specific retrieval gaps that simpler improvements do not address. Fine-tuning normally requires suitable query–document training examples, a separate validation dataset and a plan to maintain the resulting model and index.
How many passages should a RAG system retrieve?
There is no universal value for k. Retrieve enough candidates to cover the evidence needed by your typical questions, then select or rerank the passages within the generator's context budget. Evaluate the effect on evidence recall, answer correctness, latency and cost.