↓ Skip to main content
  1. Glossary/

Top-k

The k results with the highest scores that a search returns. A RAG system passes only these results to the language model, so a relevant result outside the top k never reaches it.

With k = 5, a search over 10,000 contract clauses returns the five clauses that score highest against the question. The clause that holds the answer is in sixth place, so the model answers without it.

Appears in