Retrieve evidence
Encode the question and search the offline document index to select the top-K passages.
Bypassing the Textual Bottleneck
via Decoupled Learning and Continuous Soft Tokens
Bringing the retriever’s semantic signals into the generator’s reasoning.
1 Department of Artificial Intelligence, Hanyang University
2 Department of Data Science, Hanyang University
* Corresponding author
One backbone. Two task-specific adapters. A continuous interface for evidence.
Most RAG systems retrieve documents and pass their text to a language model. ShiftRAG also transfers the retriever’s internal signals: how the question aligns with each document and how strongly that document is ranked. A Semantic Signal Translator (SST) converts these signals into continuous vectors in the generator’s token-embedding space. The generator reads the question and retrieved passages together with these soft knowledge tokens.
The framework uses one pretrained LLM backbone in two modes. Encoder mode enables bidirectional attention with a retrieval-specific LoRA adapter. Decoder mode uses causal attention with a separate generation adapter. Training the modes in stages lets the retrieval space stabilize before the generator learns to use it.
Encode the question and search the offline document index to select the top-K passages.
Map question–document embeddings and relevance weights into continuous soft knowledge tokens.
Condition the decoder on the question, retrieved text, and the translated retrieval signals.
Better retrieval needs an interface that preserves what the retriever has learned.
Raw passage text does not directly convey the retriever’s embedding geometry or the strength of question–document alignment. Passing only text discards these signals and leaves the generator to infer document relevance again.
Deep decoder-only representations can concentrate in a narrow subspace. Higher token covariance and lower effective rank indicate reduced diversity, making it harder to separate supporting evidence from distractors.
Retrieval favors contrastive separation; generation favors next-token prediction. Shared adaptation can produce conflicting updates. Even with separate parameters, joint training makes the generator follow a changing retrieval interface.
Learn a discriminative retrieval space first, then train the generator against that stable interface.
Layer-wise Gap-aware Contrastive Learning (LGC) learns from the change in relevance between shallow and final layers. The largest question–document similarity gap becomes the contrastive training score, capturing semantic refinement across depth.
Soft Orthogonal Alignment (SOA) discourages excessive correlation among token representations. It softly regularizes their cosine-similarity Gram matrix toward the identity to preserve diverse directions in the retrieval space.
At inference, retrieval uses final-layer cosine similarity, avoiding the overhead of multi-layer scoring.
The decoder combines next-token supervision on the answer with rationale-conditioned self-distillation. A teacher context contains explicit document-level rationales; the student receives soft knowledge tokens.
Matching the teacher’s answer-token distribution teaches the student to use the translated signals. The answer loss provides direct supervision for generating the ground-truth response.
Explicit rationales provide training-time supervision. They are not required as inference inputs.
Question–document alignment becomes a small set of generation-friendly vectors.
For each retrieved document, SST concatenates the question and document embeddings, projects them through a learnable encoding layer, and expands the representation into token vectors. A low-rank transformation produces an offset in the generator’s embedding space. The document’s normalized relevance weight controls the strength of that offset.
Anchors give the translation a vocabulary-aligned reference. The offset carries question-specific retrieval information. Positions distinguish the resulting tokens.
These vectors supplement the retrieved passages, allowing explicit evidence and embedding-level alignment to guide answer generation together. The reported configuration uses five soft knowledge tokens per question–document pair.
Highest recall, Exact Match, and F1 among the methods in the reported three-benchmark comparison.
The main evaluation covers HotpotQA, 2WikiMultihopQA, and MuSiQue, with 1,000 test questions per dataset. Retrieval is measured by Recall@2, @5, and @10; QA uses Exact Match (EM) and F1. Retrieval-only baselines are paired with Gemma2-9B for answer generation.
Absolute percentage-point gains over NV-Embed-v2. The MuSiQue gain is 23.0% relative.
LLM2Vec, OneGen, and ShiftRAG use Gemma2-9B in this reported comparison.
Controlled ablations examine the contribution of each training objective and decoder component.
Removing either LGC or SOA lowers retrieval performance in the reported comparison. Replacing LGC with standard InfoNCE causes the larger drop; SOA provides a consistent complementary benefit. On MuSiQue, Recall@10 falls from 65.16% to 61.40% without LGC and to 60.51% without both objectives.
Removing SST reduces MuSiQue EM from 30.5% to 24.5%. Removing decoder-side LoRA lowers it to 26.5%; removing both lowers it to 19.7%. Translation and decoder adaptation contribute together to the strongest result.
More accurate answers with a small translation overhead.
On HotpotQA, ShiftRAG takes 2.79 seconds per example, compared with 8.72 seconds for the NV-Embed-v2 pipeline: a 3.13× speedup, or 68.0% lower latency. Peak VRAM drops from 38.82 to 24.14 GiB while EM rises from 51.4% to 56.1%.
GritLM remains faster at 2.42 seconds and uses less memory at 20.25 GiB. ShiftRAG adds 0.37 seconds while raising EM from 44.3% to 56.1%, offering a different accuracy–efficiency trade-off.
Most time is spent generating the answer. The reported breakdown is 0.13 s for question encoding, 0.02 s for Faiss retrieval, 0.0007 s for SST, and 2.64 s for answer generation. Values are rounded measurements from the paper’s inference setup.
Code and datasets for retrieval and generation.