Modern data management systems organize long documents, such as web pages, encyclopedia articles, and technical manuals, to support information retrieval and downstream applications. To make them searchable at scale, systems split each document into chunks and index them as independent records. Chunking separates passages from the document-level context needed to identify and rank them. Contextual encoders pack this context into chunk vectors, leaving it inaccessible to downstream components. LLM-generated prefixes make context readable to both vector search and reranking, but prompting large models for each chunk incurs high indexing costs, and their prefixes often underperform specialized contextual encoders. We introduce ConTra (Context That Travels), a reinforcement learning framework that trains lightweight language models to generate one concise prefix per chunk during index construction. Its reward combines feedback from frozen embedding and reranking models with factual verification and length control. The stored prefix can be reused across retrieval stages. We also introduce RecoBench (Retrieval in Natural and Perturbed Contexts Benchmark), comprising five real-world collections and three controlled conditions with distracting text. Across ConTEB and RecoBench, ConTra-2B outperforms PPLX-4B, Voyage-4, and a prompted 9B baseline using Anthropic's method overall. On ConTEB, it surpasses the best overall scores of the 9B baseline and PPLX-4B by up to 3.15 points while indexing short documents 7.74x and 2.15x as fast as those baselines, respectively. Post-trained only on ConTEB, ConTra-2B achieves the highest overall reranking score among standalone methods on RecoBench and shows lower sensitivity to random and topically similar distractors. Code, datasets, and trained models are available at https://sstan1.github.io/ConTra-Context-That-Travels/
翻译:暂无翻译