Optimize RAG Performance and Accuracy
How RAG optimization works
A retrieval-augmented generation (RAG)[1] system answers a question in two stages: it retrieves passages from your own documents, then generates an answer from them. Optimizing one stage is a different job from optimizing the other, and the fastest way to waste a tuning cycle is to fix the wrong one.
Think of the pipeline as two halves. The retrieval half turns documents into searchable vectors and pulls back candidates: chunk the text, embed each chunk, store the vectors in an index, then run a query that retrieves and optionally reranks. The generation half is the prompt and the model that read those candidates and write the reply. Every lever on this page lives in one half or the other, and the figure traces a query through both, previewing the concrete tool at each retrieval step — the Text Split skill, a text-embedding-3 model, and an HNSW index — that the sections below unpack.
The three built-in RAG evaluators[2] turn "which half is broken" from a guess into a measurement, each scoring a response from 1 to 5. Retrieval rates how well the retrieved chunks rank the relevant context; Groundedness rates whether the answer is supported by that context without fabricating; Relevance rates whether the answer addresses the question. Read them together: a low Retrieval score is a retrieval-half problem, while a high Retrieval score paired with low Groundedness or Relevance is a generation-half problem, because the right context was fetched and the answer still missed it.
Fix retrieval first
When Retrieval is the weak metric, tune retrieval before you touch the prompt. No prompt rewrite can ground an answer on context that was never retrieved, so a prompt change layered on top of a retrieval failure just moves noise around. The rest of this page walks the retrieval half in pipeline order (chunking, embeddings, vector search, then hybrid and semantic ranking) and returns to measurement and A/B testing at the end, which is where generation-half fixes get validated too.
Chunk documents before you embed
Every embedding model has a hard input ceiling, and that ceiling is why chunking is the first retrieval lever. The Azure OpenAI text-embedding-3 models accept at most 8,191 tokens per call[3], so a document longer than that cannot be embedded whole; it has to be split first. In Azure AI Search integrated vectorization[4], an indexer pulls documents from a data source and runs a skillset that does this automatically: the Text Split skill[5] breaks each document into chunks, and an embedding skill (for example the Azure OpenAI Embedding skill) vectorizes each chunk. The figure shows that indexing pipeline, from data source through indexer and skillset to the index.
Sizing the chunk: precision versus context
Chunk size is a trade-off, and it is the single setting that most changes retrieval quality. Smaller chunks return more precise matches but can strip the surrounding context a passage needs to make sense; larger chunks keep the context but dilute relevance, since one vector now has to represent several ideas, and they cost more to embed. Microsoft recommends starting near a 512-token chunk with about 25 percent overlap, roughly 128 tokens, then tuning from there per the chunking guidance[3].
Overlap keeps passages whole
Overlap repeats a slice of text at each chunk boundary so a sentence that straddles two chunks is not cut in half. Setting overlap to 0 to avoid duplicate text is a false economy: a relevant passage split across two chunks lowers recall, because neither chunk now embeds the whole idea. In the Text Split skill, the pageOverlapLength parameter sets that repeated slice, and it must be less than half of maximumPageLength.
Text Split skill parameters (integrated vectorization)
{
"@odata.type": "#Microsoft.Skills.Text.SplitSkill",
"textSplitMode": "pages", // "pages" = fixed-size chunks (default); "sentences" = one sentence each
"maximumPageLength": 512, // max characters or tokens per chunk
"pageOverlapLength": 128, // repeated text at each boundary; must be < half of maximumPageLength
// ... input (document text) and output (chunked pages) field bindings omitted
}
The textSplitMode key chooses the strategy: pages (the default) packs multiple sentences up to maximumPageLength, while sentences emits one sentence per chunk. maximumPageLength caps the chunk size, and pageOverlapLength is the overlap slice named above. The // ... comment marks the input and output field bindings left out for brevity. Because the whole split-then-embed flow runs inside one skillset, the chunk size you set here is exactly what the embedding model sees on the next step.
Embedding models and dimensions
The embedding model decides how much meaning each vector can carry, and unlike a chat model you tune it by selection, not training. text-embedding-3-large[6] outputs 3,072-dimensional vectors by default and text-embedding-3-small outputs 1,536; the older text-embedding-ada-002 is fixed at 1,536. A larger, higher-dimensional model captures more semantic nuance and tends to raise domain accuracy, at the price of more vector storage and slower, costlier queries.
The dimensions parameter and Matryoshka truncation
The v3 models add a dimensions parameter that shortens the output vector, for example from 3,072 down to 1,536 or 256, trading a small accuracy loss for lower storage and faster search. This works because the models are trained with Matryoshka Representation Learning, which front-loads the most important information into the first components of the vector, so a truncated vector still represents the concept. One rule makes or breaks it: the same dimensions value must be used at indexing time and at query time, or the index and query vectors have different lengths and cannot be compared. Reducing dimensions only on the query side silently breaks the similarity comparison.
You select and tune; you do not fine-tune
Azure OpenAI embedding models cannot be fine-tuned; fine-tuning applies to chat and completion models only. To raise domain-specific retrieval accuracy you pick the right model and dimension count, improve chunking, and add hybrid and semantic ranking, rather than training the embedder on your data. Fine-tuning as a customization path for generation models is a separate topic, covered in advanced fine-tuning.
Match the similarity metric to the model
A vector field's similarity metric must match how the model was trained. Azure OpenAI embeddings are trained for cosine similarity[7], so cosine is the default and correct choice; dotProduct and euclidean are the alternatives, and switching to euclidean to "improve" OpenAI-embedding relevance actually degrades it. Cosine compares the angle between two vectors and is unaffected by their length, which is why documents of very different sizes still compare fairly.
| Model | Default dimensions | Fine-tunable |
|---|---|---|
| text-embedding-3-large | 3,072 (adjustable via dimensions) | No |
| text-embedding-3-small | 1,536 (adjustable via dimensions) | No |
| text-embedding-ada-002 | 1,536 (fixed) | No |
Vector retrieval: HNSW, k, and thresholds
Once chunks are embedded and indexed, retrieval quality comes down to the search algorithm and two query knobs. The vector field's algorithm sets the strategy. HNSW (Hierarchical Navigable Small World) runs an approximate nearest-neighbor (ANN) search[8]: it builds a layered proximity graph at indexing time and navigates it at query time, which scales to large indexes with low latency. Exhaustive KNN (k-nearest neighbors) instead scans every vector for the exact nearest neighbors, which is more accurate but does not scale. The default for a large production index is HNSW; reach for exhaustive KNN only on small or medium data, or to build a ground-truth set for measuring an ANN index's recall. Choosing exhaustive KNN for a large index just because it is "exact" is the classic scaling mistake. An HNSW field can still be forced to run an exact scan for a single query with "exhaustive": true.
HNSW exposes three tuning parameters: m (the number of neighbor links per node), efConstruction (how many candidates are considered while building the graph, default 400, range 100 to 1,000), and efSearch (how many candidates are held while searching). Higher values raise recall at the cost of index size, latency, or both.
k sets recall, and always returns k
The k parameter is the number of nearest neighbors a vector query returns. Raising k hands the reranker or the model more candidates, which raises recall but also latency and noise. The behavior that surprises people: a pure vector query always returns k results[9], even when the nearest neighbors are barely similar, because nearest-neighbor search just finds the closest vectors regardless of how close they actually are. Do not confuse k with the embedding dimension count; k is the number of documents returned, unrelated to the 1,536 or 3,072 vector dimensions. When a vector query feeds semantic ranking, Microsoft recommends setting k to 50 so the reranker receives a full candidate set.
A similarity threshold is the only weak-match filter
Because k always returns k, neither a smaller k nor a different similarity metric will remove off-topic chunks; the only lever that does is a per-query similarity threshold. Setting a threshold of kind vectorSimilarity (in preview) excludes any result scoring below the minimum even if fewer than k results survive, so weakly related chunks never reach the generator. This is a precision lever distinct from top-k and from the metric. One boundary: apply it only to single-vector queries. Hybrid queries fuse ranks with Reciprocal Rank Fusion (RRF) — covered in Hybrid search and semantic ranking below — and those fused rank ranges are too small and volatile for a raw score cutoff, so the threshold does not apply to them.
A single-vector query with k, exhaustive, and a similarity threshold
{
"vectorQueries": [
{
"kind": "vector",
"fields": "contentVector",
"vector": [ /* ... query embedding, elided ... */ ],
"k": 50, // return 50 nearest neighbors (full input for semantic ranking)
"exhaustive": false, // false = use the HNSW graph; true = exact scan for this query
"threshold": { "kind": "vectorSimilarity", "value": 0.8 } // drop matches below 0.8 (single-vector only, preview)
}
]
}
Here k caps the result count at 50, exhaustive chooses approximate versus exact search for this one query, and the threshold block drops weak matches by score. The /* ... */ marks the embedding array elided for brevity. This is a single-vector query, which is the only query shape where threshold is valid.
Hybrid search and semantic ranking
Vector search alone misses exact-keyword hits (a product code, an error string, a rare name) because those tokens may not sit close in embedding space. Hybrid search fixes that by running the vector (HNSW) query and a BM25 keyword query in parallel over one index, then merging their two ranked lists. BM25 is the classic keyword-ranking function; it scores on term frequency, so it nails the literal matches the vector side can paraphrase past. Hybrid retrieval[10] usually beats either method alone, especially for queries that mix exact terms with semantic intent. The figure traces a query through both stages.
RRF merges by rank, not by score
The merge uses Reciprocal Rank Fusion (RRF)[11], and the key idea is that it combines results by rank position, not raw score. BM25 scores have no upper bound while cosine scores sit in a small range, so adding or averaging the two would let one scale dominate. Instead RRF gives each document a score of 1 / (rank + k) in each list (where this k is a small RRF constant, about 60, entirely separate from the k-nearest-neighbors count) and sums those across the lists, so a document ranked highly by both the vector and the keyword query rises to the top. RRF never adds or averages the BM25 and cosine scores themselves.
Semantic ranker: an L2 rerank of the top 50
Setting queryType=semantic adds a semantic ranker[12] pass on top. It takes the first-stage BM25 or RRF result and applies a second-level (L2) rerank using Microsoft's language models, rescoring the top 50 candidates and returning @search.rerankerScore from 4.0 (highly relevant) down to 0.0 (irrelevant). The load-bearing limit: it reranks only those existing top 50 candidates and never re-queries the corpus, so first-stage recall still depends entirely on the vector and keyword query. Expecting the reranker to surface a document the first-stage query missed is the most common mistake here; raise recall in the retrieval query (a bigger k, hybrid search, better chunks), not in the reranker.
Captions, answers, and query rewrite
Beyond reranking, the semantic ranker returns verbatim semantic captions (usually under 200 words) and optional semantic answers extracted from indexed text, and with query rewrite enabled it expands a query into up to 10 semantically similar variants that each run and are rescored. One caveat readers get wrong: captions and answers are always verbatim from your index, so no generative model composes them, and if the indexed text contains no answer-like passage, none is produced.
Evaluate, diagnose, and A/B test
Every lever above is only worth pulling if you can measure its effect, so RAG tuning ends where it began: with the same three RAG evaluators[2] — Retrieval, Groundedness, and Relevance — that How RAG optimization works defined at the top of this page. What that section left for here is where they run and how to read the number: the Azure AI Evaluation SDK and Foundry evaluations host them, each returns its 1-to-5 score against a default pass threshold of 3, and you run them together, often alongside content-safety evaluators, for a full quality picture. Groundedness and Relevance are the same RAG pair introduced in generative AI evaluation and validation.
The evaluators localize the fault
The scores are a map to the broken component. A low Retrieval score points at the retrieval half (chunking, the embedding model or dimensions, k, or hybrid search). A high Retrieval score with low Groundedness or Relevance points at the generation half (the prompt or the model), because the right context was retrieved and the answer failed to use it. So the fix order is fixed: when Retrieval is the weak metric, repair retrieval first. Rewriting the prompt while Retrieval is low cannot help, since no prompt change grounds an answer on context that was never fetched.
A/B test one variable on a fixed dataset
To actually improve the system, run A/B tests[13] that change one variable at a time (chunk size, overlap, k, embedding model or dimensions, hybrid on or off, semantic ranker on or off) and score every variant on the same evaluation dataset, then keep the configuration with the higher aggregate scores. A shared, controlled test set is what makes the comparison valid; comparing two configurations on different query sets proves nothing. If production queries are unavailable, a synthetic-but-consistent test set still works, because consistency, not realism, is what the comparison requires. The evaluate() API takes the dataset as a file path: JSON Lines (JSONL) is the standard format, and the SDK reference also lists CSV as accepted.
Exam-pattern recognition
AI-300 questions on this objective usually hinge on one distinction. Read the stem for the signal:
- A low Retrieval score in the stem means fix indexing or the query (chunking, embedding model or dimensions, k, hybrid), never the prompt.
- High Retrieval, low Groundedness or Relevance means fix generation (the prompt or the model); the context was already retrieved.
- "Irrelevant chunks reach the model" points to a vector-similarity threshold on a single-vector query, not a smaller k or a different metric.
- "Queries mix exact terms and meaning" points to hybrid search with RRF; "reorder for intent" or "the top results are in the wrong order" points to the semantic ranker.
- "Surface a document the query missed" is a recall problem in retrieval; the semantic ranker only reorders the top 50 it was handed.
- "Raise domain accuracy on the embedding model" means select a larger model or tune the dimension count; it never means fine-tune the embedder.
- "Compare two configurations fairly" means change one variable at a time and score on one fixed evaluation dataset.
Retrieval strategies: vector, hybrid, and semantic ranking
| Dimension | Pure vector (HNSW) | Hybrid (vector + BM25) | Hybrid + semantic ranker |
|---|---|---|---|
| What runs | One approximate vector query | Vector and BM25 keyword query in parallel | Hybrid, then an L2 rerank of the top 50 |
| How results combine | Similarity metric (cosine) | RRF by rank position | RRF, then @search.rerankerScore 0 to 4 |
| Main strength | Semantic similarity matching | Adds exact-keyword matches | Reorders for query intent, adds captions and answers |
| Effect on recall | Returns k neighbors; weak ones stay unless a threshold is set | Usually beats either method alone | No new recall; only reorders the top 50 |
| Relative cost | Lowest | Two queries per request | Premium reranker billing |
Decision tree
Sharp facts the exam loves — give these one last read before exam day.
Cheat sheet
Sharp facts the exam loves — scan these before test day.
- Text Split skill chunks documents before embedding in integrated vectorization
In Azure AI Search integrated vectorization, a skillset runs the Text Split skill to break documents into chunks and then an embedding skill (for example the Azure OpenAI Embedding skill) vectorizes each chunk. textSplitMode is set to "pages" (default fixed-size chunks) or "sentences", and maximumPageLength plus pageOverlapLength control chunk size and overlap. Chunking is required because embedding models cap input length (text-embedding-3 models accept at most 8,191 tokens per call).
Trap Trying to embed whole documents directly: inputs over the model's 8,191-token limit are rejected, so documents must be chunked first.
7 questions test this
- Your Azure AI Search index holds wiki pages that are already small enough to stay under the embedding model's input limit, so chunking is not required for size. Each page, though, mixes many unrelated
- You configure an Azure AI Search skillset that sends full documents directly to the Azure OpenAI Embedding skill for a RAG index. Indexing fails for your largest documents with an error that the input
- A RAG solution indexes long manuals with the Text Split skill using very large page chunks. Reviewers find that vector search often returns a chunk whose overall topic only loosely matches the questio
- You configure a Text Split skill for integrated vectorization. Your source files are long reports, and you want fixed-length chunks of roughly a target size so that most chunks are similar in length a
- Your team's RAG assistant sometimes misses answers that sit exactly where the Text Split skill ends one chunk and begins the next, because a relevant sentence is cut between two adjacent chunks and ne
- You want Azure AI Search to automatically split documents into chunks and generate vector embeddings for those chunks during indexing, without writing and hosting a separate preprocessing service. You
- Your team runs integrated vectorization over a set of long technical manuals for a RAG assistant. Testers report that some answers are incomplete because a passage that fully answers a question is bei
- Chunk size and overlap trade retrieval precision against context
Smaller chunks return more precise matches but can lose surrounding context, while larger chunks preserve context but dilute relevance and cost more to embed. Microsoft recommends starting near a 512-token chunk size with about 25 percent overlap (roughly 128 tokens); pageOverlapLength repeats text at chunk boundaries so a relevant passage is not split across two chunks.
Trap Setting overlap to 0 to avoid duplicate text: zero overlap can cut a relevant passage in half across two chunks and lower recall.
7 questions test this
- You are setting the page overlap for the Text Split skill in a new RAG pipeline. You want to reduce the chance that a relevant passage is split across two chunks, but you also do not want to waste emb
- In a RAG pipeline, the chunks your Text Split skill produces are used two ways: they are embedded for vector search, and the top retrieved chunks are also passed to a chat model that summarizes them i
- In your RAG solution the Text Split skill currently emits very large chunks, and users complain that results return long passages where the specific answer is buried among unrelated text, lowering ans
- A RAG solution indexes long manuals with the Text Split skill using very large page chunks. Reviewers find that vector search often returns a chunk whose overall topic only loosely matches the questio
- Your team's RAG assistant sometimes misses answers that sit exactly where the Text Split skill ends one chunk and begins the next, because a relevant sentence is cut between two adjacent chunks and ne
- A RAG assistant answers questions over legal contracts where an answer usually depends on a full clause spanning several sentences. With the current small chunks, retrieved passages frequently start o
- Your team runs integrated vectorization over a set of long technical manuals for a RAG assistant. Testers report that some answers are incomplete because a passage that fully answers a question is bei
- HNSW gives fast approximate search; exhaustive KNN gives exact but slow search
A vector field's algorithm sets the retrieval strategy: HNSW performs fast approximate nearest-neighbor search (tunable with m, efConstruction, and efSearch) and scales to large indexes, while exhaustive KNN scans every vector for exact nearest neighbors, which is more accurate but slower and costlier. An HNSW field can be forced to run exact search on a per-query basis with "exhaustive": true.
Trap Choosing exhaustive KNN for a large production index because it is 'exact': it does not scale; HNSW approximate search is the default for large indexes.
6 questions test this
- You are tuning the Azure AI Search vector index that grounds a Microsoft Foundry RAG assistant. The index already holds several million chunks embedded with an Azure OpenAI model, the corpus keeps gro
- You operationalize a retrieval-augmented generation assistant in Microsoft Foundry whose grounding data lives in an Azure AI Search index of several million embedded document chunks. Query latency mus
- Your Azure AI Search RAG pipeline runs a hybrid query with semantic ranking, but the semantic reranker seems starved of candidates and its ordering looks poor. You already set top to control how many
- Your production RAG vector field in Azure AI Search is indexed with HNSW so normal traffic stays fast. For one high-stakes compliance lookup, an auditor requires an exact, complete comparison against
- Users report that your Foundry RAG assistant often answers from too little context and misses relevant passages that exist in the Azure AI Search index. The retrieval step currently returns only a han
- Before you promote a large HNSW-based RAG index to production, you must measure how much recall its approximate search sacrifices. On a small, fixed evaluation corpus you need a ground-truth list of t
- The k parameter sets how many nearest neighbors a vector query returns
A vector query's k (k-nearest-neighbors) controls how many documents the retrieval step returns; increasing k raises recall by giving the reranker or LLM more candidates, at the cost of latency and noise. For hybrid queries that feed semantic ranking, Microsoft recommends setting k to 50 so the reranker receives a full candidate set.
Trap Confusing k with the embedding dimension count: k is the number of returned neighbors, unrelated to the 1,536/3,072 vector dimensions.
10 questions test this
- During a RAG tuning review, a teammate proposes returning more grounding passages by raising the Azure OpenAI embedding model's dimension count from 1,536 to 3,072. You need to correct the plan and id
- You operationalize a retrieval-augmented generation assistant in Microsoft Foundry whose grounding data lives in an Azure AI Search index of several million embedded document chunks. Query latency mus
- Your Azure AI Search RAG pipeline runs a hybrid query with semantic ranking, but the semantic reranker seems starved of candidates and its ordering looks poor. You already set top to control how many
- To cut low-quality grounding chunks, your team wants to apply a minimum-score threshold to a hybrid query in Azure AI Search that fuses keyword and vector results with Reciprocal Rank Fusion. In testi
- Users report that your Foundry RAG assistant sometimes omits facts that clearly exist in the Azure AI Search index. Investigation shows the vector query returns too few chunks, so relevant grounding n
- Users report that your Foundry RAG assistant often answers from too little context and misses relevant passages that exist in the Azure AI Search index. The retrieval step currently returns only a han
- While tuning retrieval for a Foundry RAG solution, a teammate argues that to make each Azure AI Search vector query return more candidate chunks you must increase the embedding dimension count of the
- A colleague changed the similarity metric on your production Azure AI Search vector field to euclidean, hoping to improve relevance for your Azure OpenAI-embedded RAG corpus. Since then, retrieved chu
- Your Foundry RAG pipeline runs a hybrid query against Azure AI Search and then applies semantic ranking as a second-stage reranker. Evaluation shows recall is low: relevant chunks that exist in the in
- Your RAG team has tried to eliminate off-topic grounding from a single-vector Azure AI Search query by first lowering k and then experimenting with a different similarity metric, yet low-scoring, weak
- Cosine is the correct similarity metric for Azure OpenAI embeddings
The vector field's similarity metric must match how the embedding model was trained: cosine is the default and correct choice for Azure OpenAI text-embedding models, with dotProduct and euclidean as the alternatives. On pure single-vector queries, a per-query similarity threshold (preview) can additionally drop low-scoring matches so weakly related chunks never reach the generator; hybrid/RRF queries are not eligible because their fused score ranges are too small and volatile for a cutoff.
Trap Switching the metric to euclidean to 'improve' OpenAI embedding relevance: OpenAI embeddings are tuned for cosine, so a mismatched metric degrades results.
7 questions test this
- During a RAG tuning review, a teammate proposes returning more grounding passages by raising the Azure OpenAI embedding model's dimension count from 1,536 to 3,072. You need to correct the plan and id
- You operationalize a retrieval-augmented generation assistant in Microsoft Foundry whose grounding data lives in an Azure AI Search index of several million embedded document chunks. Query latency mus
- Your Azure AI Search RAG pipeline runs a hybrid query with semantic ranking, but the semantic reranker seems starved of candidates and its ordering looks poor. You already set top to control how many
- Users report that your Foundry RAG assistant often answers from too little context and misses relevant passages that exist in the Azure AI Search index. The retrieval step currently returns only a han
- A colleague changed the similarity metric on your production Azure AI Search vector field to euclidean, hoping to improve relevance for your Azure OpenAI-embedded RAG corpus. Since then, retrieved chu
- Your RAG team has tried to eliminate off-topic grounding from a single-vector Azure AI Search query by first lowering k and then experimenting with a different similarity metric, yet low-scoring, weak
- You are configuring a new Azure AI Search vector index whose embeddings come from an Azure OpenAI text-embedding-3-large deployment used by your Foundry RAG app. Relevance in early tests is weak, and
- A vector-query similarity threshold drops weak matches that k would still return
A pure vector query always returns its k nearest neighbors even when they are barely similar, because the nearest-neighbor search just finds the closest vectors regardless of score. To drop weak, off-topic matches, set a per-query threshold (kind vectorSimilarity, in preview) that excludes any result scoring below the minimum even if fewer than k results remain; this is a precision lever distinct from top-k and from the similarity metric. Apply it only to single-vector queries, not to hybrid/RRF queries, whose fused rank ranges are too small and volatile for a score cutoff.
Trap Expecting a smaller k or a different similarity metric to filter out irrelevant chunks; k always returns k results, so only a similarity threshold removes weak matches, and the threshold does not apply to hybrid/RRF queries.
4 questions test this
- Your Azure AI Search RAG retrieval currently runs a hybrid query that fuses vector and keyword results with Reciprocal Rank Fusion. Weakly related chunks still reach the generator, and you want to enf
- To cut low-quality grounding chunks, your team wants to apply a minimum-score threshold to a hybrid query in Azure AI Search that fuses keyword and vector results with Reciprocal Rank Fusion. In testi
- A pure single-vector query in your Azure AI Search RAG index keeps returning a fixed number of chunks, and several of them are only weakly related to the user's question, which pollutes the grounding
- Your RAG team has tried to eliminate off-topic grounding from a single-vector Azure AI Search query by first lowering k and then experimenting with a different similarity metric, yet low-scoring, weak
- text-embedding-3-large defaults to 3072 dimensions, 3-small to 1536
text-embedding-3-large outputs 3,072-dimensional vectors by default and text-embedding-3-small outputs 1,536; both accept up to 8,191 input tokens. A larger, higher-dimensional model captures more semantic nuance to improve domain accuracy, but it increases vector storage and query cost.
Trap Believing text-embedding-ada-002 produces 3,072 dimensions: ada-002 is fixed at 1,536, and only the v3 models reach 3,072.
13 questions test this
- You are designing a RAG index in Azure AI Search that must hold tens of millions of document chunks. The vector storage budget is tight and p95 query latency must stay low, while moderate retrieval ac
- You are sizing a vector field in an Azure AI Search index and want to reserve exactly the number of dimensions that text-embedding-ada-002 emits, because a teammate insists ada-002 now produces the sa
- Your team must choose between text-embedding-3-large and text-embedding-3-small for a new RAG index and needs the accurate default-dimensionality tradeoff to decide, because storage cost and retrieval
- Retrieval accuracy for a specialized legal RAG assistant in Microsoft Foundry is poor because relevant clauses are often missed. A teammate proposes fine-tuning text-embedding-3-large on your labeled
- A customer-support RAG app in Microsoft Foundry keeps returning off-target passages whenever users type product-specific acronyms and part numbers, which pure vector search struggles to match exactly.
- Your team already fine-tunes the gpt-4o chat model that writes RAG answers, and now wants the same customization applied to the text-embedding-3-large model that retrieves context, expecting better do
- A GenAIOps engineer is building a retrieval-augmented generation solution over a large, specialized biomedical corpus in Microsoft Foundry. Domain answer accuracy is the top priority, the backing vect
- A RAG assistant over legal contracts keeps returning off-topic passages, and leadership asks whether you can train the embedding model on the contract set to make it domain-aware. You must explain the
- You are building a high-volume RAG feature where millions of chunks must be embedded and stored cheaply, and moderate retrieval quality is acceptable. You want the newest-generation Azure OpenAI embed
- Domain retrieval accuracy on your Azure OpenAI RAG pipeline over financial filings is too low, and a data scientist proposes fine-tuning text-embedding-3-large on your labeled domain corpus to special
- You already index a knowledge base with text-embedding-3-large at its full default dimensionality, but vector storage and query latency in Azure AI Search have grown beyond budget. You must shrink the
- A cost review flags that your text-embedding-3-large index consumes roughly twice the vector storage of a comparable text-embedding-3-small index, and finance asks you to justify it. You must explain
- Your team is building a retrieval-augmented generation solution over a large corpus of dense biomedical research papers, and for nuanced domain queries retrieval accuracy matters far more than vector
- The dimensions parameter shortens v3 embeddings via Matryoshka learning
text-embedding-3 models support a dimensions parameter that truncates the output vector (for example from 3,072 down to 1,536 or 256) using Matryoshka Representation Learning, trading a small accuracy loss for lower storage and faster search. The same dimensions value must be used at indexing time and query time or the vectors are not comparable.
Trap Reducing dimensions only on the query side: index and query embeddings must share the same dimension count or the similarity comparison breaks.
11 questions test this
- You are designing a RAG index in Azure AI Search that must hold tens of millions of document chunks. The vector storage budget is tight and p95 query latency must stay low, while moderate retrieval ac
- To reduce query latency, an engineer truncated the query-side embeddings for a RAG solution to 512 dimensions, but the Azure AI Search index was built with full 3,072-dimension text-embedding-3-large
- You have a single text-embedding-3-large deployment and want it to serve full 3,072-dimension vectors for a high-accuracy index and shorter 256-dimension vectors for a latency-sensitive index, without
- You reduce your text-embedding-3-large vectors to 1,024 dimensions with the dimensions parameter to save storage, and you reindex the whole corpus at 1,024. After release, vector search returns irrele
- A GenAIOps engineer is building a retrieval-augmented generation solution over a large, specialized biomedical corpus in Microsoft Foundry. Domain answer accuracy is the top priority, the backing vect
- A production RAG index in Azure AI Search stores millions of text-embedding-3-large vectors at their full 3,072 dimensions, and both storage cost and query latency are climbing beyond target. Your tea
- You are building a high-volume RAG feature where millions of chunks must be embedded and stored cheaply, and moderate retrieval quality is acceptable. You want the newest-generation Azure OpenAI embed
- Domain retrieval accuracy on your Azure OpenAI RAG pipeline over financial filings is too low, and a data scientist proposes fine-tuning text-embedding-3-large on your labeled domain corpus to special
- You already index a knowledge base with text-embedding-3-large at its full default dimensionality, but vector storage and query latency in Azure AI Search have grown beyond budget. You must shrink the
- To cut storage costs, you configured the Azure OpenAI embedding skill to build your Azure AI Search index using 1,024-dimension vectors truncated from text-embedding-3-large. You now need queries to r
- A stakeholder asks how text-embedding-3-large can output a 3,072-dimensional vector for one workload and a 256-dimensional vector for another from the very same deployment. You must identify the model
- Azure OpenAI embedding models are chosen and dimension-tuned, not fine-tuned
Azure OpenAI text-embedding-3 models cannot be fine-tuned; fine-tuning applies to chat/completion models only. To raise domain-specific retrieval accuracy you select the right embedding model and dimension count, improve chunking, or add hybrid and semantic ranking, rather than training the embedding model itself.
Trap Fine-tuning text-embedding-3-large on domain data: Azure OpenAI offers no embedding-model fine-tuning; model and dimension selection plus retrieval tuning are the levers.
6 questions test this
- Retrieval accuracy for a specialized legal RAG assistant in Microsoft Foundry is poor because relevant clauses are often missed. A teammate proposes fine-tuning text-embedding-3-large on your labeled
- A customer-support RAG app in Microsoft Foundry keeps returning off-target passages whenever users type product-specific acronyms and part numbers, which pure vector search struggles to match exactly.
- Your team already fine-tunes the gpt-4o chat model that writes RAG answers, and now wants the same customization applied to the text-embedding-3-large model that retrieves context, expecting better do
- A RAG assistant over legal contracts keeps returning off-topic passages, and leadership asks whether you can train the embedding model on the contract set to make it domain-aware. You must explain the
- Business stakeholders complain that a RAG knowledge assistant misses answers because retrieved passages are either too broad or cut off mid-topic. Leadership asks whether you should train the embeddin
- Domain retrieval accuracy on your Azure OpenAI RAG pipeline over financial filings is too low, and a data scientist proposes fine-tuning text-embedding-3-large on your labeled domain corpus to special
- Hybrid search fuses vector and keyword results with Reciprocal Rank Fusion
Hybrid search runs a vector (HNSW) query and a BM25 keyword query in parallel over one index and merges them with Reciprocal Rank Fusion (RRF), which combines results by rank position rather than by raw score because BM25 and cosine scores are on incompatible scales. Hybrid retrieval usually beats either method alone, especially for queries that mix exact keywords with semantic intent.
Trap Thinking RRF averages the BM25 and cosine scores: it fuses by rank position, and the raw scores are never added or averaged.
15 questions test this
- You are building a retrieval-augmented generation app on Azure AI Search to ground a Foundry chat model. User questions mix exact tokens such as part numbers and error codes with paraphrased, conceptu
- A RAG solution over an internal parts catalog uses vector-only retrieval in Azure AI Search. Support agents report that queries containing exact part numbers and rare model codes often fail to surface
- Your team enables hybrid search on an Azure AI Search index so that a keyword query and a vector query run together for each request. During a design review, a colleague asks how the two independently
- A teammate wants your Azure AI Search RAG index to return grounding that reflects both semantic similarity and exact keyword precision, and proposes adding a scoring profile to a keyword-only query to
- You are preparing an Azure AI Search index to support hybrid retrieval for a RAG chatbot. A teammate proposes keeping the plain-text content in one index and the generated embeddings in a separate vec
- While reviewing a hybrid RAG query on Azure AI Search, a colleague notes that BM25 keyword scores have no fixed upper bound while the vector cosine scores fall in a small bounded range, and asks how t
- Users of a RAG assistant on Azure AI Search report that for some questions the correct answer is missing entirely from the cited sources, even though the source document exists in the index. Your curr
- An existing RAG solution on Azure AI Search retrieves grounding chunks with a vector-only query. Users report that questions containing exact identifiers, such as SKUs, invoice numbers, and acronyms,
- You are documenting the ranking pipeline of a hybrid semantic query in Azure AI Search for your team's runbook. The request runs a keyword query and a vector query, merges them, and then applies the s
- Your RAG retrieval on Azure AI Search issues a full-text keyword query together with two vector queries against different embedding fields in the same request, and the response must come back as one u
- You are optimizing grounding relevance for a RAG chat app on Azure AI Search and Microsoft Foundry. Microsoft's benchmark testing on real-world datasets indicates one retrieval configuration consisten
- Your RAG app on Azure AI Search grounds a Foundry model, but several documents that clearly answer users' questions never appear anywhere in the results. A teammate turned on semantic ranking expectin
- Your team stores each document chunk in a single Azure AI Search index with both a searchable text field and its embedding vector. Today the app runs a keyword query and a vector query as two separate
- After switching a RAG retriever from pure vector search to hybrid search in Azure AI Search, an engineer notices the @search.score values dropped from around 0.8 to roughly 0.03 and files a bug claimi
- You are tuning the retrieval quality of a RAG application on Azure AI Search to give the language model the most relevant grounding passages. Microsoft's own benchmark guidance points to one combinati
- Semantic ranker L2-reranks the top 50 results and scores them 0 to 4
Setting queryType=semantic adds an L2 reranking pass that rescores the top 50 RRF/BM25 results with Microsoft's language models and returns @search.rerankerScore from 4.0 (highly relevant) down to 0.0 (irrelevant). It reranks only the existing top 50 candidates and never re-queries the whole corpus, so first-stage recall still depends on the vector/keyword query.
Trap Expecting semantic ranker to surface documents the first-stage query missed: it only reorders the top 50 already retrieved, so raise recall in the retrieval query, not the reranker.
11 questions test this
- During a RAG design review, an engineer claims that enabling semantic ranking on your Azure AI Search hybrid query will let the app find and return relevant documents that the current keyword-and-vect
- A RAG solution over an internal parts catalog uses vector-only retrieval in Azure AI Search. Support agents report that queries containing exact part numbers and rare model codes often fail to surface
- A RAG pipeline on Azure AI Search returns roughly the right documents with hybrid search, but the single most on-topic passage is often not in the top position, so the language model sometimes grounds
- A RAG application on Azure AI Search already retrieves the right grounding documents with a hybrid query, but stakeholders want the ranking of those results to better match the meaning of each user qu
- Users of a RAG assistant on Azure AI Search report that for some questions the correct answer is missing entirely from the cited sources, even though the source document exists in the index. Your curr
- You are documenting the ranking pipeline of a hybrid semantic query in Azure AI Search for your team's runbook. The request runs a keyword query and a vector query, merges them, and then applies the s
- You are optimizing grounding relevance for a RAG chat app on Azure AI Search and Microsoft Foundry. Microsoft's benchmark testing on real-world datasets indicates one retrieval configuration consisten
- Your RAG app on Azure AI Search grounds a Foundry model, but several documents that clearly answer users' questions never appear anywhere in the results. A teammate turned on semantic ranking expectin
- In a RAG solution on Azure AI Search you enable semantic ranking and want to drop weakly relevant passages before sending grounding context to the language model, keeping only strongly relevant ones.
- You are tuning the retrieval quality of a RAG application on Azure AI Search to give the language model the most relevant grounding passages. Microsoft's own benchmark guidance points to one combinati
- You are reasoning about how the semantic ranker fits into a hybrid retrieval pipeline on Azure AI Search before you enable it for a RAG workload. You want to set expectations for how much of the resul
- Semantic ranker also returns captions, answers, and query rewrites
Beyond L2 reranking, semantic ranker returns verbatim semantic captions (usually under 200 words) and optional semantic answers extracted from indexed text, and with query rewrite enabled it expands a query into up to 10 semantically similar variants that each run and are rescored. Captions and answers are always verbatim from the index; no generative model composes new text.
Trap Assuming semantic answers are generated by an LLM: they are extracted verbatim from your index, not synthesized.
- RAG evaluators score Retrieval, Groundedness, and Relevance from 1 to 5
The Azure AI Evaluation SDK and Foundry evaluations provide built-in RAG evaluators that each return a 1-to-5 score: Retrieval rates how well the retrieved chunks rank the relevant context, Groundedness rates whether the response is supported by that context without fabrication, and Relevance rates whether the response addresses the user's query. Combine them, often with content-safety evaluators, for a full quality picture.
Trap Treating Groundedness and Relevance as the same metric: Groundedness checks support by the retrieved context (hallucination), while Relevance checks that the answer addresses the question.
8 questions test this
- A retrieval-augmented generation assistant in Microsoft Foundry returns answers that are fully supported by the retrieved passages and read well, but users complain that the answers often discuss rela
- During evaluation of a RAG assistant in Microsoft Foundry, you find responses that faithfully repeat only what the retrieved context says - no fabrication - yet wander into related material and never
- You evaluate a retrieval-augmented generation assistant in Microsoft Foundry. The Retrieval score is high, confirming the correct passages are being returned, but the Groundedness score is low because
- You are preparing a pre-deployment quality assessment for a RAG customer-support assistant in Microsoft Foundry. You want a well-rounded view that covers whether the search step surfaces the right con
- You review Azure AI Evaluation SDK results for a RAG assistant and see a consistently high Retrieval score paired with a low Relevance score on the shared evaluation dataset. You must explain to the t
- You evaluate a retrieval-augmented generation assistant in Microsoft Foundry. The Retrieval score is high and Groundedness is acceptable, but the Relevance score is low: answers are supported by the r
- A team building a retrieval-augmented generation app in Microsoft Foundry wants a full quality picture that separately captures how relevant the retrieved chunks are, whether the response is supported
- An evaluation run on your Foundry RAG assistant reports a high Retrieval score but a low Groundedness score across the shared evaluation dataset, while Relevance is acceptable. The retrieved chunks cl
- A/B test RAG configurations on one fixed evaluation dataset
To improve a RAG system, run A/B tests that change one variable at a time (chunk size, overlap, k, embedding model or dimensions, hybrid on/off, semantic ranker on/off) and score each variant on the same evaluation dataset, then keep the configuration with the higher aggregate evaluator scores. A consistent, controlled test set, synthetic if production data is unavailable, is what makes the comparison valid.
Trap Comparing two configurations on different query sets: only a shared, fixed evaluation dataset yields a valid A/B comparison.
8 questions test this
- Before deploying a retrieval-augmented generation assistant in Microsoft Foundry, your team has no production traffic yet but needs a consistent, repeatable set of query and response inputs to A/B tes
- Your team wants to know whether increasing the retrieval chunk size improves a RAG application in Microsoft Foundry. One engineer proposes indexing the corpus with the larger chunk size, then judging
- You complete an A/B test of two RAG configurations in Foundry, changing only the retrieval chunk size and scoring both variants on the same fixed evaluation dataset. Variant B earns higher aggregate R
- A team compares two retrieval-augmented generation configurations in Microsoft Foundry, one with the semantic ranker on and one with it off. They scored the first configuration on last quarter's logge
- A colleague is running an A/B test to decide whether a new embedding model improves your RAG system in Foundry. To save time, the colleague also turns on the semantic ranker and doubles the retrieved-
- You are tuning a retrieval-augmented generation pipeline in Microsoft Foundry and suspect that a larger chunk size will improve answer quality. You already have a fixed evaluation dataset of represent
- Before launching a RAG knowledge assistant in Microsoft Foundry, you want to A/B test two retrieval configurations, but the application has no production traffic yet and therefore no real user queries
- You A/B tested two retrieval-augmented generation configurations in Microsoft Foundry on the same fixed evaluation dataset, changing only whether the semantic ranker was enabled. One variant now shows
- Evaluator scores localize a RAG fault to retrieval or generation
The evaluators show where to fix a RAG system: a low Retrieval score points to indexing (chunking, embedding model or dimensions, k, or hybrid search), while a high Retrieval score with low Groundedness or Relevance points to the generation step (prompt or model), because the right context was retrieved but the answer did not use it. Fix retrieval first when Retrieval is the weak metric.
Trap Rewriting the prompt when Retrieval is low: if the right chunks were never retrieved, no prompt change can ground the answer, so fix retrieval first.
6 questions test this
- You evaluate a retrieval-augmented generation assistant in Microsoft Foundry. The Retrieval score is high, confirming the correct passages are being returned, but the Groundedness score is low because
- An Azure AI Evaluation SDK run on your RAG assistant returns a low Retrieval score together with low Groundedness and Relevance scores on the shared evaluation dataset. A teammate suggests rewriting t
- You review Azure AI Evaluation SDK results for a RAG assistant and see a consistently high Retrieval score paired with a low Relevance score on the shared evaluation dataset. You must explain to the t
- You evaluate a retrieval-augmented generation assistant in Microsoft Foundry. The Retrieval score is high and Groundedness is acceptable, but the Relevance score is low: answers are supported by the r
- You evaluate a retrieval-augmented generation solution in Microsoft Foundry and the built-in Retrieval evaluator returns a low score across the dataset, yet spot checks confirm the model answers well
- An evaluation run on your Foundry RAG assistant reports a high Retrieval score but a low Groundedness score across the shared evaluation dataset, while Relevance is acceptable. The retrieved chunks cl
References
- RAG and Generative AI - Azure AI Search
- Retrieval-Augmented Generation (RAG) Evaluators for Generative AI - Microsoft Foundry
- Chunk Documents - Azure AI Search
- Integrated Vectorization Overview - Azure AI Search
- Text Split Skill - Azure AI Search
- Foundry Models sold by Azure - Microsoft Foundry
- Azure OpenAI in Microsoft Foundry Models embeddings (classic) - Microsoft Foundry (classic) portal
- Vector Relevance and Ranking - Azure AI Search
- Create a Vector Query - Azure AI Search
- Hybrid Search Overview - Azure AI Search
- Hybrid Search Scoring (RRF) - Azure AI Search
- Semantic Ranking Overview - Azure AI Search
- Local Evaluation with the Azure AI Evaluation SDK (classic) - Microsoft Foundry (classic) portal