Urgent.News

What's breaking now, across hundreds of outlets.

Tech

Cross-Encoder Reranker max_length=512: Half My Chunk Was Never Read

My reranker gave the right passage a score of -7.9. The passage contained the exact sentence the user asked about, word for word. It just contained it around token 600, and the reranker stopped reading at 512. No error. No warning. Just a confident, wrong ranking. This is the cross-encoder reranker max_length=512 problem, and if your RAG pipeline uses bge-reranker , an ms-marco cross-encoder, or…

A cross-encoder reranker with a max_length of 512 tokens can fail to read the relevant portion of a passage, even if the answer is present later in the text. This happens because the reranker reads the query and passage as a single sequence and cuts off anything beyond the 512-token limit. The default truncation method removes tokens from the longer sequence, often cutting off the tail of the passage. This results in answers near the end of a chunk being scored as if they don't exist.

The problem arises when the chunker and reranker use different tokenizers, leading to discrepancies in how token counts are calculated. BERT-based models use WordPiece tokenization with a large vocabulary, while cross-encoders typically use smaller vocabularies like BERT's. As a result, the reranker may see a passage as longer than it actually is, causing truncation.

To fix this issue, one option is to size chunks using the reranker's tokenizer instead of the LLM's. This ensures that the passage fits within the reranker's token budget. Another solution is to score overlapping windows of the passage and take the maximum score, a method known as MaxP. This approach scores multiple sub-segments of the passage, identifying the most relevant portion even if the answer is split across multiple chunks.

Raising the max_length of the reranker could also work, but it requires additional compute resources and is less efficient than other solutions.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

CherryTree's title matches describe pages, not installed desktop copies

CherryTree's title matches describe pages, not installed desktop copies CherryTree is a desktop note-taking application with no official hosted service.

  • CherryTree is a desktop note-taking app without a central service
  • Title matches query for "CherryTree" returns 34 unrelated results
  • CVE vulnerabilities involve parsing, rendering, and LaTeX file reading

Best Cloudflare Alternatives for Indie SaaS 2026

Originally published on Shipfolio . Cloudflare appears in more indie product stacks on Shipfolio than any other hosting tool (21 products at last count). That does not mean it is the only good choice.

  • Vercel is a top Cloudflare alternative for Next.js users with zero-config deployments.
  • Google Cloud Run suits containerized apps needing more control or already in Google Cloud ecosystem.
  • Firebase Hosting is convenient for those already using Firebase for authentication or messaging.

More from Sunday, 29 November 2026 →