← All posts
Research & Engineering

Harder training examples made our reranker worse. Here is the curve that fixed it.

Harder training examples made our reranker worse. Here is the curve that fixed it.

Most advice about training a reranker tells you to feed it hard negatives: wrong answers that look almost right, so the model has to learn a real distinction instead of an easy one. We tried that on our new government reranker, using the hardest negatives our retriever could produce, and the model got 45% worse than no reranker at all. This is the story of why, and the curve that fixed it.

The model is rerank-gov-indic, it is public on Hugging Face, and the weights are Apache-2.0.

huggingface.co/quanfire-ai/rerank-gov-indic

What it is

rerank-gov-indic is a cross-encoder reranker for Indian government press-release text, across 16 languages, cross-lingual: a query in one Indian language finding the release about the same event written in another. A retriever encodes the query and each passage separately and compares vectors. A cross-encoder instead reads the query and one candidate passage together and returns a single relevance score. You run it as a second stage: the retriever pulls a shortlist, and the reranker reorders it so the right passage moves to the top.

It is the companion to embed-gov-indic, the retriever that powers our live cross-lingual government demo. That model finds candidates; this one decides the order. It is a reranker, not a retriever, it produces no embeddings, and it cannot be used for search on its own.

The number that matters

We measured the honest end-to-end quantity: retrieve first, then rerank, and see how often the single top result is correct. On 1,200 held-out cross-lingual queries against a pool of 1,096 passages, scored on GPU, with the shipped embed-gov-indic as the first stage:

StageRecall@195% CI
Retrieve only (embed-gov-indic)0.308[0.283, 0.335]
Retrieve then rerank0.407[0.378, 0.436]

That is a +0.098 gain, or +31.9%, and the paired 95% confidence interval is [+0.069, +0.128], which excludes zero. Put differently: of the queries whose correct passage the retriever manages to surface anywhere in its top-100 (a ceiling of 0.9475), the reranker lifts 42.9% of them to first place.

The curve worth telling you about

A reranker learns from wrong answers. For every query you show it the correct passage and a pile of negatives, and it learns to score the right one highest. The only real knob here is how hard those negatives are, and we changed exactly that, one variable at a time, three times.

  • Random negatives (passages picked at random): +10.5%. A real gain, but thin. Random wrong

answers are too easy, so the model barely has to learn anything.

  • The retriever's hardest negatives (its own top-ranked candidates): minus 45.1%. The model

did not just fail to improve, it made retrieval worse than doing nothing. Here is why. In a press-release corpus, the retriever's top ranks are full of near-duplicate releases about the same event, issued by different ministries or on different dates. Those are not wrong answers. Labelling them as negatives and training on them teaches the model to push correct-looking passages down, which is the opposite of the job. The hardest negatives were poison.

  • Semi-hard negatives, drawn from the retriever's ranks 20 to 100: +31.9%, the version we

shipped. Hard enough to teach a real cross-lingual distinction, but past the near-duplicate head at the very top. Its confidence interval sits entirely above the random-negative version's, so it is a clean, not marginal, improvement over the thin recipe.

The lesson generalizes past this one model. "Use the hardest negatives" is good advice right up until your corpus contains near-duplicates, and then the hardest negatives are often just unlabelled positives. The negatives have to be hard enough to be informative and easy enough to still be wrong. For this corpus, that sweet spot was in the middle of the ranking, not at the top.

Keeping the absolute number in proportion

An absolute Recall@1 of 0.407 is a real but modest level, and we will say so. Retrieving and then top-ranking the one correct passage out of a 1,096-passage pool spanning 16 languages is a genuinely hard cross-lingual task. Our evaluation also counts a single gold passage as the only correct answer, so when the reranker puts a near-duplicate release about the same event first, that scores as a miss even though a human would accept it. The measured gain is, if anything, conservative. And a reranker can only reorder what the retriever already found, so the 0.9475 ceiling is a wall this stage works under, not something it can break.

Where the data came from

The reranker is trained on Press Information Bureau (PIB) government press releases, the same release published in many languages, which is what gives the naturally parallel cross-lingual pairs. We reuse that text under PIB's reproduction policy, which permits royalty-free reproduction with attribution and carries no non-commercial or share-alike restriction. The model is non-reconstructive: it emits a relevance score and cannot reproduce the source text. We ship the weights, not the corpus. This is general information about how the model was built, not legal advice.

What it is for, and what it is not

We are precise about scope. rerank-gov-indic is built and validated for cross-lingual Indian government press-release text, as a second-stage reranker over a retriever's shortlist, and specifically on top of embed-gov-indic. It is not a retriever and has no embedding output. The result above is a single aggregate across the mixed-language query set, not a per-language guarantee. It is not validated on other domains, and it has not been tested on top of a different retriever. A model that tells you where it works is worth more than one that claims to work everywhere.

Why we build in the open

We told you about the run that regressed by 45% for the same reason we publish the confidence intervals: we would rather you trust the method than the marketing. The negative-sampling curve is the useful part, and it is not the kind of thing that shows up in a leaderboard row. The model card has the full benchmark, the ceiling, the intervals and the scope in one place, and our training framework is open source at github.com/quanfire-ai/quanfire-multilingual-embedding (Apache-2.0). Pull it, put it behind your own retriever, and judge it on your own text. That is the discipline we bring to our products too.

DocPro

Want that same measure-it-honestly discipline applied to your own documents? The same team builds DocPro. Try it on your contracts and filings.

Share

Keep reading