Fusion-in-Decoder (FiD) is a transformer architecture where the encoder processes each retrieved passage in isolation, and the decoder performs cross-attention over the concatenated hidden representations of all passages simultaneously. This design allows the model to scale to large numbers of retrieved documents without quadratic encoder complexity, fusing evidence only at the generation stage.
Glossary
Fusion-in-Decoder (FiD)

What is Fusion-in-Decoder (FiD)?
Fusion-in-Decoder is a retrieval-augmented generation architecture that processes multiple retrieved passages independently in the encoder and performs joint attention over their concatenated representations solely in the decoder to fuse evidence for answer generation.
By decoupling the encoding of individual passages from their fusion, FiD enables the model to reason over hundreds of knowledge sources while keeping memory requirements linear. The decoder synthesizes a single coherent answer by jointly attending to all encoded passages, effectively performing multi-hop reasoning across disparate evidence without explicit query decomposition.
Key Architectural Properties
Fusion-in-Decoder is a transformer architecture that processes multiple retrieved passages independently in the encoder and performs joint attention over the concatenated representations in the decoder. This design enables the model to reason over a large set of evidence documents while keeping encoder computation linear with respect to passage count.
Independent Encoder Processing
Each retrieved passage is encoded separately and in parallel by the encoder, without cross-attention between passages. This means:
- Linear scaling: Processing 100 passages costs O(n) rather than O(n²) in the encoder
- No token limit bottleneck: Each passage can use the full encoder context window independently
- Trivial batching: Passages are processed as independent items in a batch, maximizing GPU utilization
The encoder outputs a set of hidden representations for each passage, which are then concatenated into a single sequence for the decoder.
Joint Decoder Attention
The decoder performs cross-attention over the concatenated representations of all passages simultaneously. This fusion mechanism:
- Allows the model to compare and contrast evidence from different sources
- Enables evidence synthesis where facts from multiple documents are combined into a single answer
- Preserves the ability to attribute generated text to specific passages through attention weight analysis
The decoder sees all evidence at once, unlike retrieve-and-read architectures that process passages sequentially or truncate to fit a single context window.
Scalability Advantage
FiD's architectural separation of encoding and fusion provides a fundamental scalability advantage over long-context approaches:
- Encoder: Scales linearly with passage count, enabling retrieval of hundreds of documents
- Decoder: Scales quadratically with total concatenated length, but this is manageable because only the decoder pays the O(n²) cost
- Memory efficiency: Encoder activations can be computed once and cached, then reused across multiple decoding steps
This makes FiD particularly effective for open-domain question answering where the retriever returns dozens or hundreds of candidate passages.
Training Methodology
FiD models are trained with a supervised sequence-to-sequence objective where:
- The input is a set of retrieved passages concatenated with the question
- The target is the ground-truth answer string
- Teacher forcing is used during training, with the decoder attending to all encoded passages
- The retriever and reader can be trained jointly or separately depending on the implementation
Key training considerations include passage sampling strategy (how many passages, which ones) and negative example construction to teach the model to ignore irrelevant retrieved content.
Comparison to Alternative Architectures
FiD occupies a distinct position in the RAG architecture landscape:
- vs. Long-Context Models: FiD avoids the O(n²) encoder cost of processing all passages as one long sequence
- vs. Retrieve-and-Read: FiD fuses evidence in the decoder rather than concatenating before encoding, preserving per-passage independence
- vs. Map-Reduce: FiD performs joint reasoning rather than independent summarization followed by aggregation
- vs. Iterative Retrieval: FiD processes all passages in one forward pass rather than sequentially refining retrieval
The trade-off is that FiD requires a fixed retrieval set before generation begins, limiting dynamic retrieval during decoding.
Attention Attribution and Interpretability
Because the decoder attends to all encoded passages jointly, FiD provides natural interpretability through attention analysis:
- Passage-level attribution: Aggregate attention weights reveal which passages most influenced each generated token
- Cross-passage dependencies: Attention patterns show how the model connects information across documents
- Evidence provenance: Generated claims can be traced back to specific source passages for verification
This transparency is valuable for factual grounding and hallucination detection in production RAG systems, as it provides a built-in mechanism for citation generation.
FiD vs. Alternative Fusion Strategies
Architectural comparison of Fusion-in-Decoder against early fusion and late fusion strategies for multi-document question answering.
| Feature | Fusion-in-Decoder (FiD) | Early Fusion (Concatenation) | Late Fusion (Score Aggregation) |
|---|---|---|---|
Fusion Point | Decoder cross-attention layer | Encoder input layer | Post-encoding output layer |
Encoder Processing | Independent per-passage | Single concatenated sequence | Independent per-passage |
Cross-Passage Attention | |||
Quadratic Complexity in Passage Count | |||
Max Passages (T5-770M) | 100 passages | ~10 passages (truncated) | Unlimited (post-hoc) |
Evidence Aggregation Granularity | Token-level in decoder | Token-level in encoder | Document-level scores |
NaturalQA Exact Match | 51.4% | 44.1% | 46.8% |
Memory Footprint Scaling | Linear in passage count | Quadratic in total tokens | Linear in passage count |
Frequently Asked Questions
Core questions about the Fusion-in-Decoder architecture, its mechanisms, and its role in multi-hop retrieval-augmented generation.
Fusion-in-Decoder (FiD) is a retrieval-augmented generation architecture that processes multiple retrieved text passages independently in the encoder and fuses their representations through joint cross-attention in the decoder. The encoder processes each passage in isolation, producing a set of hidden states. These states are then concatenated into a single, large sequence that the decoder attends to jointly. This design allows the decoder to draw evidence from any passage when generating each token, effectively performing evidence fusion at the generation stage rather than during encoding. The key insight is that scaling to hundreds of retrieved passages becomes computationally tractable because the encoder's quadratic self-attention cost is linear in the number of passages—each passage is encoded separately—while the decoder's cross-attention cost scales linearly with the total concatenated length.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
Key architectural patterns and reasoning strategies that complement or contrast with the Fusion-in-Decoder (FiD) approach to multi-evidence synthesis.
Multi-Hop Reasoning
The process of synthesizing an answer by retrieving and connecting information from multiple distinct data sources. Unlike FiD's flat concatenation of passages, multi-hop reasoning requires the model to perform sequential logical steps where the answer to one sub-question becomes the retrieval query for the next. This creates a dependency chain that FiD's parallel encoder processing does not explicitly model.
Query Decomposition
A technique that breaks down a complex, multi-faceted user query into a set of simpler, independently answerable sub-questions. These sub-questions can be solved sequentially or in parallel before their answers are aggregated. This contrasts with FiD, which processes all retrieved passages simultaneously in the encoder without explicit sub-question structuring.
Iterative Retrieval
A dynamic search process where the initial query is repeatedly reformulated based on newly retrieved information. Unlike FiD's single-shot retrieval of all passages upfront, iterative retrieval allows the system to gather additional context required to resolve the original complex question. This creates a feedback loop between generation and retrieval that FiD's architecture does not natively support.
Chain-of-Thought (CoT) Retrieval
A reasoning paradigm where the model generates intermediate rationales and retrieves supporting evidence for each step, interleaving retrieval with the generation of a logical path to the final answer. FiD performs joint attention over all passages at once in the decoder, but does not explicitly generate intermediate reasoning traces that guide subsequent retrieval steps.
ReAct (Reasoning and Acting)
A prompting framework that interleaves discrete reasoning traces with tool-use actions, enabling a language model to dynamically plan, execute, and update its strategy based on external feedback. While FiD fuses evidence in a single decoder pass, ReAct extends the paradigm by allowing the model to decide when to retrieve, what to retrieve, and how to reason over intermediate results across multiple cycles.
GraphRAG
A retrieval-augmented generation approach that uses a knowledge graph derived from source documents to perform community summarization, enabling holistic reasoning over entire datasets rather than isolated text chunks. This contrasts with FiD's flat passage processing by introducing structured semantic relationships between retrieved entities, allowing for more deterministic multi-hop traversal.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us