aifree.dev

Why does a reranker fix RAG’s top result?

Reranking: a cross-encoder reorders the search’s top chunks · Builder · 5 min · rag, embeddings · after Chunking: chunk size, overlap and boundaries in RAG

A reranker is a second model that reads the question and each retrieved chunk together and scores how well the chunk answers it. It reorders the search’s top few, but cannot find a chunk the search left out.

Before you start: could you explain this to a friend?

1 = not at all · 5 = easily

  1. 1 Guess first

    On the chunking lesson’s pricing page, you ask: “What is the daily limit if I don’t pay?” (answer: 1,000). The search’s top 3 are below, best first. A reranker re-reads all three. Which does it put first?
  2. 2 Look

    Search, then rerank

    1 / 3
    ask:

    “What is the daily limit if I don’t pay?” (answer: 1,000)

    1 · search: top 3 by cosine (question and chunk embedded apart)

    1. A✗ Every account starts on the Free plan. The Pro plan costs $20 a month, billed in advance. It allows 50,0000.40
    2. C✓ address and your API key appears at once. It allows 1,000 requests per day. Requests over the daily limit return0.39
    3. B✗ requests per day, and support answers within four hours. The Free plan needs no card: sign up with an email0.37

    2 · reranker: reads the question and each chunk together

    1. C✓ address and your API key appears at once. It allows 1,000 requests per day. Requests over the daily limit return-6.4
    2. B✗ requests per day, and support answers within four hours. The Free plan needs no card: sign up with an email-10.2
    3. A✗ Every account starts on the Free plan. The Pro plan costs $20 a month, billed in advance. It allows 50,000-10.8

    Search alone returns A ✗ · after the reranker: C ✓, which holds the answer

    search: all-MiniLM-L6-v2, cosine · reranker: ms-marco-MiniLM-L6-v2, relevance score · measured 2026-10-23

    The search ranks the Pro chunk first. The reranker reads each of the top 3 with the question and lifts C, the one with 1,000.

    The search shortlists chunks by how they sound; the reranker reads each with the question and reorders the shortlist, but only the shortlist.

  3. The search compares two embeddings made apart: the chunk’s, made once at indexing, and the question’s. Fast enough for millions of chunks. A reranker (a model that scores question–chunk pairs) reads both texts in one pass, so each question word meets each chunk word. Sharper, but it runs once per pair, so it sees only the top few.

  4. 4 You are the model

    You are the reranker. For four questions, read the search’s top 3 chunks and pick the one ms-marco-MiniLM-L6-v2 scores highest.

    you are the reranker · read the question and the search’s top 3, pick the chunk ms-marco-MiniLM-L6-v2 puts first

    “What is the daily limit if I don’t pay?”

    search: all-MiniLM-L6-v2, cosine · reranker: ms-marco-MiniLM-L6-v2, relevance score · measured 2026-10-23

    You are the reranker. Which chunk answers the question?
  5. 5 Check

    In the picture, “Can I carry over unused requests…?” The answer, D, ranks third in the search. What is the smallest top k that lets the reranker find it?
  6. Habits that help. Retrieve wide, rerank, keep few: fetch the top 20 to 100 chunks, rerank, paste the best 3 to 5. A reranker cannot restore context a cut removed, so fix the chunking first. It can be wrong too: here it pushed the chunk with Pro’s 50,000 below two without it. Test with real questions.

  7. 7 Say it back

  8. 8 Mission · 5 min

    Copy the free key on Jina’s site (no card) and POST to https://api.jina.ai/v1/rerank with model "jina-reranker-v3.5", the query “How many requests per day does the free plan allow?” and chunks B and C as documents (B: “requests per day, and support answers within four hours. The Free plan needs no card: sign up with an email”; C: “address and your API key appears at once. It allows 1,000 requests per day. Requests over the daily limit return”). Does a bigger reranker still pick B?

Three quick ones

Drawn at random from this lesson's pool; different next time.

Done?

Now: could you explain this to a friend?

1 = not at all · 5 = easily

Answer the three quick ones first.

Sources

  • Reranker scores: raw relevance logits of cross-encoder/ms-marco-MiniLM-L6-v2 (https://huggingface.co/cross-encoder/ms-marco-MiniLM-L6-v2: BERT, 6 layers, 384 wide, trained on MS MARCO; default activation Identity) on 2026-10-23 by scripts/explain-data/reranking.ts, a plain TS forward pass (pooler + classifier on the shared BERT encoder of scripts/explain-data/semantic-search.ts) that reproduces the model card example 8.607138, -4.320078
  • Search scores: cosine similarities with sentence-transformers/all-MiniLM-L6-v2, same script and date; the free-plan scores equal the chunking lesson’s (0.753, 0.637, 0.572)
  • The page and its five 20-word chunks are the chunking lesson’s (app/components/explain/lessons/chunking-data.ts); the questions are in app/components/explain/lessons/reranking-data.ts
  • Scores used (search cosine → reranker logit, chunks A–E): “don’t pay” A 0.404 → −10.76, B 0.373 → −10.22, C 0.387 → −6.43; carry over C 0.497 → −4.22, B 0.452 → −5.07, D 0.397 → −0.59; error C 0.321 → −9.46, D 0.293 → −7.09; free plan B 0.753 → 7.03, C 0.637 → 4.55, A 0.572 → −1.93; Pro plan A 0.613 → −0.56, C 0.596 → 4.14, B 0.594 → 3.77; cut by paragraph (the chunking lesson’s fix), free plan: the Free paragraph is first for both, cosine 0.780 and reranker 9.46 (next: Pro paragraph 4.33)
  • https://sbert.net/examples/cross_encoder/applications/README.html (checked 2026-10-23): “A Cross-Encoder does not produce a sentence embedding”; retrieve e.g. the top 100 with a bi-encoder, then re-rank them with a cross-encoder
  • https://jina.ai/reranker/ (checked 2026-10-23): endpoint https://api.jina.ai/v1/rerank (model, query, documents, top_n); recommended text model jina-reranker-v3.5; “New users get an auto-generated API key with free tokens usable across any of our models”; aifree.dev catalog jina-ai-free-api-tokens (verified 2026-10-12): 10M tokens per new API key, no card

Published Oct 23, 2026 · updated Oct 23, 2026

Embed this

Paste this into a blog post or course page: the lesson's main picture in an iframe, with a link back to the full lesson.

<iframe src="https://aifree.dev/embed/explain/reranking" width="100%" height="620" style="border:0;max-width:720px" title="Why does a reranker fix RAG’s top result? (aifree.dev Explain)" loading="lazy"></iframe>
<p><a href="https://aifree.dev/explain/reranking">Why does a reranker fix RAG’s top result? Interactive lesson on aifree.dev</a></p>

Never miss new offers and news

New tools, credits, and AI news are added regularly. Pick how you want to hear about them.

Telegram channel
Join @aifree_dev and get new free AI offers and news right in your Telegram feed.
Browser notifications
Turn on push notifications and get an alert on this device whenever something new is posted. No account needed.
Email newsletter
A weekly digest of new, changed and expiring free AI offers. Double opt-in, one-click unsubscribe.

Unsubscribe anytime. Privacy

Frequently asked questions

What is aifree.dev?

aifree.dev helps everyone access AI through a curated directory of free AI tools, API credits, free tiers, and startup programs for coding, image, voice, video, and students - verified regularly.

How are offers presented?

Each offer includes its access details, free models when available, and expiration information when provided. Limited-time deals stay visible so they are easy to compare.

Do education and startup programs need verification?

Yes. Providers usually ask students to verify their status with a school email, student ID, or a program like the GitHub Student Pack, and ask startups to verify company details such as age, funding, or website. Check each offer’s claim page for the exact requirements.

What kinds of free AI offers are listed?

Free tiers and free trials from AI providers, free API credits, startup and student programs, and free tools for coding, image generation, voice, and video.

How can I suggest a tool or report a broken link?

Use the submit form: paste the offer page URL and a short note. A person checks every submission before anything is listed. Broken links and changed terms go through the same form.

+

Know a good one?

Tell us about an AI tool worth knowing. Found a broken link? We want to hear that too.

Submit an offer