Parallel Context-of-Experts Decoding for Retrieval Augmented Generation

Giulio Corallo, Paolo Papotti

TL;DR

Parallel Context-of-Experts Decoding (PCED) is a training-free framework for Retrieval-Augmented Generation (RAG) that processes retrieved documents in parallel as isolated "experts." By shifting evidence aggregation from the attention mechanism to a novel retrieval-aware contrastive decoding step, PCED achieves up to a 180× speedup in Time-to-First-Token (TTFT) while matching or exceeding the accuracy of standard long-context concatenation.

What Problem Does This Paper Address?

Standard Retrieval-Augmented Generation (RAG) pipelines face a frustrating trade-off between accuracy and speed. To answer complex, multi-hop queries, systems typically concatenate dozens of retrieved documents into a single, massive prompt. However, this creates a massive prefill bottleneck, drastically increasing latency. Furthermore, stuffing the context window full of documents often introduces noise, leading to reasoning failures because language models can get "lost in the middle."

An alternative is parallel KV cache encoding, which processes and caches each document independently. While this eliminates the prefill bottleneck, it completely breaks cross-document attention. Without this interaction, the model cannot synthesize information spread across multiple documents, causing performance to plummet on complex reasoning tasks.

Methods

PCED solves this dilemma by shifting cross-document evidence aggregation from the attention mechanism to the decoding phase.

The PCED framework runs multiple contextual experts and an amateur prior in parallel, selecting the next token via retrieval-aware contrastive decoding.

The framework operates as follows:

  1. Parallel Streams (Experts): For a given query, PCED runs $N+1$ parallel streams in a single batched forward pass. This includes $N$ "contextual experts" (each with its own precomputed, isolated KV cache for a single document) and one "amateur expert" (the model prior with an empty context).
  2. Retrieval-Aware Contrastive Decoding: At each generation step, the logits from each contextual expert ($s_k$) are sharpened against the amateur prior ($s_0$) to isolate document-specific knowledge. Crucially, the authors inject a retrieval-based prior ($\gamma \log r_k$) derived from the fusion of retrieval and reranker scores to gate noise from irrelevant documents.
  3. Token-Level Expert Switching: Instead of averaging the distributions, PCED applies a token-wise Max operation across all experts to choose the next token: $$y_t = \arg\max_{v \in V} \max_{k} \hat{s}_k(v)$$
  4. Shared Generation History: The chosen token is appended to the generation history of all experts. This allows the model to dynamically pivot between different documents from one token to the next.

Datasets

The authors evaluated PCED across several standard benchmarks:

  • LOFT Benchmark: Used for evaluating both RAG and In-Context Learning (ICL) tasks (e.g., HotpotQA, MuSiQue, NQ, QAMPARI, QuEST).
  • LongBench Subsets: Used to test query-focused QA, summarization, code completion, and few-shot inference under long-context constraints with distractors.
  • Synthetic Dataset: Created specifically to benchmark Time-to-First-Token (TTFT) and end-to-end latency under controlled context lengths (up to 65k tokens).

Key Insights and Ideas

  • Cross-Document Reasoning at Decode Time: The most surprising finding is that joint attention across documents isn't strictly necessary during encoding. By sharing the token history at each step, the model can "hop" between isolated document caches mid-sentence to stitch together a multi-hop answer.
An expert trace from HotpotQA showing the model dynamically switching between different gold documents (Expert 0 and Expert 1) to synthesize the final answer.
  • Isolation Reduces Noise: Concatenating documents dilutes relevant evidence with near-miss distractors. Treating documents as isolated experts prevents this dilution, making the model inherently more robust to irrelevant context.
  • The Power of Max Aggregation: For multi-hop reasoning, selecting the maximum logit across experts (Max) significantly outperforms soft mixtures like Mixture-of-Experts (MoE) or Product-of-Experts (PoE). Max allows a single well-supported expert to dominate a specific generation step without needing consensus from other streams.

Key Results

  • Massive Speedups: PCED achieves a >180× reduction in Time-to-First-Token (TTFT) compared to vanilla full-context concatenation (0.14 seconds vs. 25.50 seconds) and cuts end-to-end latency by ~1.7× on long-context workloads.
Latency benchmarks demonstrating the flat TTFT scaling of PCED across Top-k values and its superior end-to-end latency.
  • State-of-the-Art Accuracy: On the QAMPARI benchmark using Llama-3.1-8B, PCED improved the score from 7.0 (prior parallel KV merging method, APE) to 77.0.
  • Beating Full Context: PCED-Dense outperformed full-context concatenation (Corpus in Ctx All) in 11 out of 16 experimental settings on the LOFT benchmark, proving that isolating documents can yield better accuracy than processing them jointly.

Limitations and Future Work

  • Logit Dependence: PCED requires full access to per-token model logits. This makes it incompatible with closed-source, API-only models (like GPT-4) that only return sampled text or limited log-probabilities.
  • Storage-Computation Trade-off: Eliminating online prefill latency requires storing precomputed KV caches offline. This introduces a significant storage footprint that scales linearly with corpus size (e.g., ~11.04 GB for the relatively small LOFT HotpotQA corpus using Llama-3.1-8B).
  • Future Directions: The authors suggest explicitly training language models to accept parallel contextual inputs and natively learn token-level expert selection, which could eliminate the reliance on external retrieval/reranking pipelines entirely.

Summary updated

BibTeX
@inproceedings{corallo2026parallel,
  author = {Giulio Corallo and Paolo Papotti},
  title = {{Parallel Context-of-Experts Decoding for Retrieval Augmented Generation}},
  booktitle = {Annual Meeting of the Association for Computational Linguistics},
  year = {2026},
  doi = {10.18653/v1/2026.findings-acl.1635},
}
Figure