‹ All AI-300 questions

AI-300 Practice Question 40: Vector Query Similarity Threshold

Microsoft Machine Learning Operations Engineer Associate (AI-300) · Test 4 · question 10 of 10

Optimize generative AI systems and model performancemedium

A RAG application uses a pure vector query with k set to 5 against Azure AI Search. When users ask off-topic questions, the search still returns five chunks with low similarity scores, and the model builds confident answers from them. The team wants the application to pass only reasonably similar chunks to the model, so it can say it has no answer otherwise. The team accepts using a preview feature of the search API. What should they change?

Select one answer
Show answer and explanation

Answer:

  • C. Add a threshold to the vector query so that results below a minimum similarity score are excluded

In vector search, *"k determines how many nearest neighbor results are returned ... vector queries always return k results, assuming at least k documents exist, even if some documents have poor similarity."* The documentation explains that *"to exclude low-scoring search results, you can add a threshold query parameter that filters out results based on a minimum score,"* and that it applies to a pure single vector query (hybrid queries are not conducive to minimum thresholds because RRF score ranges are smaller and more volatile). With a threshold of, for example, 0.8, weaker matches are excluded even if fewer than k results remain, so the application can detect that nothing relevant was found (option C). The threshold parameter is in preview and is available only in the preview REST API version (2026-08-01-preview).

- A is wrong because raising k returns more results, and the extra ones are also nearest neighbors, so the number of weak matches goes up. - B is wrong because k = 1 still returns the single nearest neighbor, however poor its score, so an off-topic query still gets one irrelevant chunk. - D is wrong because the metric only changes how similarity is computed. Nearest-neighbor search returns k results whichever metric is used, and Azure OpenAI embeddings are designed for cosine similarity.

Reference: Create a Vector Query - Azure AI Search

Practice Test 4 ›

Study guides for AI-300