Top-K
Top-K is a filtering strategy that selects the K highest-scoring elements from a candidate set, widely applied in information retrieval, recommendation systems, natural language processing, and machine learning. Its core mechanism ranks candidate results by similarity, probability, or other scoring criteria and retains the top K as output, balancing result quality with computational efficiency. The choice of K directly affects the trade-off between coverage and precision of results.
Core Facts
Timeline (last 90 days)
The value of K in Top-K should be determined through offline evaluation by measuring Recall@K at different K values on an annotated test set and finding the inflection point where the recall curve begins to flatten.
The Top-K pruning strategy is essentially a branch-and-bound algorithm based on a priority queue (min-heap).
All Facts (5)
Top-P (nucleus sampling) samples from the smallest set of tokens whose cumulative probability exceeds the threshold P, while Top-K selects only from the K candidates with the highest probabilities.
80%UnverifiedTop-K检索是从向量数据库中取相似度最高的前K个片段作为候选内容
95%UnverifiedTop-K的K值存在经典权衡:K太小会漏掉关键信息,K太大会引入噪声导致大模型答案跑偏
90%UnverifiedThe value of K in Top-K should be determined through offline evaluation by measuring Recall@K at different K values on an annotated test set and finding the inflection point where the recall curve begins to flatten.
50%UnverifiedThe Top-K pruning strategy is essentially a branch-and-bound algorithm based on a priority queue (min-heap).
50%