What is an AI similarity threshold?

A similarity threshold is the minimum similarity score a vector search result has to exceed against the query to be accepted; results below it are kept out of context or treated as "no relevant result".

Unlike top-k retrieval, which always returns a set number of results however low their relevance, a threshold takes only sufficiently similar results and may return none. The two are often combined: at most k results, but only those above the threshold.

Topic
Embeddings, document processing and RAG
Also known as
Similarity cut-off

How an AI similarity threshold works

  1. Similarity, such as cosine similarity, is computed between the query and candidates.
  2. Candidates below the threshold are dropped.
  3. If none remain, the system can route the query elsewhere or say no information was found rather than inventing an answer.
  4. The threshold is tuned on labelled validation questions for the balance between precision and coverage.

In more detail

Thresholding in hybrid search and at the reranker stage

In hybrid pipelines that combine dense vector search with keyword search (BM25) via Reciprocal Rank Fusion (RRF), fused scores depend on rank rather than raw semantic similarity, so cosine thresholds cannot be applied directly after fusion. In practice, a similarity threshold is applied to the dense branch beforehand or a cross-encoder reranker score is thresholded at the final stage.

Relative and dynamic thresholding

Instead of a single fixed cutoff, production RAG systems often use relative or dynamic thresholding, such as rejecting candidates that fall too far below the top match (score-gap filtering) or using calibrated sigmoid probabilities from a reranker. Because bi-encoder cosine scores cluster in narrow bands and vary with query length, relative margins reduce false rejections on broad or phrasing-diverse queries.

Metric direction, normalisation and score range

When an embedding model produces unit-normalised vectors, cosine similarity and squared L2 distance are monotonically linked, whereas unnormalised dot product also reflects vector magnitude. Vector databases differ in whether they expose similarity (higher is better) or distance (lower is better), so the threshold direction and range should always be verified against the index metric.

Commonly confused terms

TermHow it differs
Reranker score thresholdBi-encoder cosine similarity measures embedding proximity at the initial recall stage; a cross-encoder reranker scores query-document pairs jointly with logits, requiring a separate threshold calibration.

Why an AI similarity threshold matters for on-premises AI

A threshold simply keeps irrelevant, misleading chunks out of RAG context while reducing made-up answers when no information exists. Yet absolute similarity values vary by model: a study of contextual representation geometry shows these representations do not spread evenly in all directions of vector space, while another paper warns cosine similarity can sometimes yield arbitrary, meaningless results. A threshold set for one model should therefore not be reused for another and needs retuning when the embedding model changes.

ON-PREMISES EXAMPLE

A telecom operator's customer assistant hands the question to live support when no chunk clears the threshold rather than inventing an answer; the threshold is tuned by tracking wrong answers and needless handovers on a labelled question set.

Common questions

How is a similarity threshold set?

By testing thresholds on labelled validation questions and measuring precision against coverage. Tune it separately for each embedding model.

What if the threshold is too high?

Relevant chunks are dropped too and the system says it found nothing for answerable questions. Too low a threshold lets irrelevant chunks in.

Sources

In the glossary: Glossary, R to Z

What does this term mean for your infrastructure?

We can work out together in a technical assessment how it maps onto your data, hardware and security requirements.

Request a technical assessment →

This site sets no cookies. Visitor numbers are counted in aggregate using a cookieless method that does not identify anyone. See the Privacy Policy for details.