AI Aulis

AI NEWS IN ENGLISH · 20 October 2026

The most important AI news every morning. AI writes and checks the stories against the original sources – check important facts in the sources.

← Issue 20 October 2026Paper

RRF constant k=1 outperformed the widely used k=60 in FastAPI documentation search

AI-generated contentWritten by AI

learn.microsoft.com, recallrun.dev · 2 sources · Sources published: 19 October 2026 · Some source publication dates are unknown

Alby Tomy used RRF to combine BM25 and vector search results when searching the FastAPI documentation. With k=1, mean MRR@5 was 0.733, while the widely used k=60 gave 0.692. With values above 100, the result barely changed any further.

Alby Tomy, a Python and AI developer, measured how the constant k affects hybrid search results in a post published on RecallRun on 19 October 2026. Hybrid search combines two searches: keyword-based BM25 search and vector search, which looks for the texts closest in meaning. The results of the two are often merged with Reciprocal Rank Fusion (RRF). Tomy wrote that almost every guide uses k=60.

In Tomy’s data, k=1 raised the mean MRR@5 across three query sets to 0.733, while k=60 gave 0.692. With k between 100 and 1,000, the result differed from the k=60 result by no more than 0.002. The default is safe but not the best, Tomy said. The result applies to one dataset, one embedding model and one way of splitting the text. Tomy did not test weighted fusion or longer result lists, and said the best k may be different for those. Tomy added that the outcome could also differ if there are more than two lists or if one of the lists is clearly less accurate.

RRF gives a document a score from each result list using the formula 1/(k + rank) and adds the scores together. Microsoft’s Azure AI Search documentation describes the same formula and says experiments have shown that the algorithm performs best with a small value, such as 60. Microsoft points out that this constant is not the same as the k in vector search, which sets how many nearest matches are retrieved.

Tomy explained that k determines how much weight the top rank carries. With a small k, first place in a single list counts for a lot. With a large k, what matters most is whether the document appears in both lists. At k=60, rank 1 is worth only 1.15 times as much as rank 10. For example, at k=0 and k=1, a document that tops one list but is missing from the other scores more than a document ranked fifth in both lists. At k=5 or above, the latter moves ahead.

Tomy split the English documentation of the FastAPI framework into 2,771 chunks and used the all-MiniLM-L6-v2 model for vector search. Tomy merged the top 50 results from each search with equal weights. The queries were 780 section headings from the documentation, 309 names used in code, each of which appears in only one chunk, and 30 hand-written questions. MRR@5 gives a query one point if the correct answer comes first, half a point if it comes second, and so on. If the answer is not among the top five, the score is zero.

Search Headings Code names Questions Mean
BM25 alone 0.859 0.773 0.566 –
Vector search alone 0.493 0.285 0.768 –
RRF, k=0 0.751 0.704 0.741 0.732
RRF, k=1 0.745 0.710 0.743 0.733
RRF, k=10 0.704 0.700 0.747 0.717
RRF, k=60 0.679 0.684 0.712 0.692
RRF, k=1,000 0.676 0.683 0.712 0.690

MRR@5, higher is better. Source: Alby Tomy, RecallRun, 19 October 2026. Single run, FastAPI documentation.

A small k helped most on the heading queries, where BM25 clearly outperformed vector search. On those, k=0 scored 0.751 against 0.679 for k=60 (a difference of 0.072). However, Tomy noted that the headings are part of the BM25 index, so these queries favour BM25 and likely make the advantage of a small k look larger than it really is. The difference was 0.020 on the code name queries and 0.029 on the questions. Tomy said differences of a few hundredths in the question set should be treated as noise, because in a set of 30 questions a single query shifts the hit rate by 3.3 percentage points.

At k=60, a document that neither search had ranked first rose to the top in about one query in five. In Tomy’s data, this hurt accuracy more than it helped.

No combination scored better than the best single search, either. Tomy’s interpretation is that equal-weight fusion works more reliably across different kinds of query but does not improve on the best result. The type of a query cannot be known in advance, Tomy said.

Report an error in this story