Fusion-in-decoder (FiD) is a retrieval-augmented generation architecture in which an encoder-decoder model encodes each retrieved passage independently together with the question, concatenates all the encoded representations, and lets a single decoder attend to every passage at once while generating the answer. In artificial intelligence, and specifically in the Retrieval & knowledge area, it is one of the most influential reader designs for open-domain question answering.
The architecture was introduced in 2020 by Gautier Izacard and Edouard Grave and published at EACL 2021. Its key contribution is showing that evidence fusion can happen inside the decoder, which lets a model read tens or hundreds of passages at a cost that grows linearly rather than quadratically with the number of passages.
How fusion-in-decoder processes retrieved passages
FiD is a reader, not a retriever: it assumes that a separate retriever has already returned a ranked list of passages. The original work used both BM25 sparse retrieval and Dense passage retrieval (DPR), and paired them with a pretrained T5 encoder-decoder model.
- The retriever returns the top N passages, typically 25 to 100 passages of about 100 words each.
- Each passage is formatted as a separate input such as
question: ... title: ... context: .... - The encoder processes each question-passage pair independently, so self-attention never spans two passages.
- The encoder outputs are concatenated into one long sequence of N times L token vectors.
- The decoder generates the answer with cross-attention over the full concatenated sequence, combining evidence across passages.
The separation matters because encoder self-attention is quadratic in input length. Encoding 100 passages of 250 tokens as one 25,000-token sequence would be prohibitive, while encoding 100 short sequences is cheap and parallel. The decoder still sees everything, but cross-attention is linear in the encoder length for each generated token.
Why the decoder is the right place for fusion
Earlier extractive readers scored passages one at a time and selected an answer span from the best one, which made them weak at aggregating evidence spread across documents. FiD lets the decoder weigh partial clues from several passages, so the answer can reflect agreement among multiple sources instead of a single top hit.
The authors reported that accuracy kept rising as the number of passages grew from 5 to 100, a finding that distinguished FiD from extractive readers, whose gains flattened early. A large FiD model reached roughly 51 percent exact match on Natural Questions and roughly 68 percent on TriviaQA at publication, a strong result for its size. The table summarizes the scaling behavior qualitatively.
| Passages read | Evidence coverage | Compute cost | Typical accuracy trend |
|---|---|---|---|
| 5 to 10 | Answer often missing | Low | Clearly below best |
| 25 to 50 | Most answers present | Moderate | Large gains |
| 100 | Near retriever recall limit | High, decoder-dominated | Best in original study |
| More than 100 | Mostly redundant passages | Very high | Small or no gains |
The cross-attention weights of a trained FiD model also turned out to be useful relevance signals. A follow-up method distilled these attention scores into the retriever, training a dense retriever without labeled passage annotations, an approach often called FiD-KD.
Fusion-in-decoder compared with other retrieval-augmented designs
FiD occupies a specific point in the design space of retrieval-augmented models. Its neighbors differ in where retrieved text enters the network and whether the retriever is trained jointly.
| Architecture | Where retrieved text enters | Cross-passage interaction | Main trade-off |
|---|---|---|---|
| Extractive reader | Encoder, one passage at a time | None | Cannot combine evidence |
| Concatenation reader | One long encoder input | Full self-attention | Quadratic cost limits passages |
| Fusion-in-decoder | Separate encoder passes | Decoder cross-attention only | Decoder memory grows with N |
| REALM | Encoder, with retriever trained end to end | Marginalized over passages | Costly index refresh |
| RETRO | Chunked cross-attention in decoder layers | Per chunk of generated text | Requires retrieval during pretraining |
| Decoder-only RAG prompt | Prompt context of a large language model | Full self-attention | Long context cost and position bias |
In modern RAG systems built on decoder-only language models, passages are usually concatenated into the prompt, which reintroduces quadratic attention. FiD remains relevant where a compact, fine-tuned reader is preferred, and its ideas reappear in systems such as Atlas, which pairs a FiD reader with a jointly trained retriever.
Efficiency bottlenecks and later variants
Although the encoder is efficient, analysis published in 2022 showed that most inference time is spent in the decoder, because every generated token performs cross-attention over tens of thousands of encoder vectors and must load large key-value tensors from memory. This memory bandwidth bottleneck motivated several variants.
| Variant | Core change | Effect |
|---|---|---|
| FiDO | Layer-sparse cross-attention, multi-query attention | Much faster decoding at similar accuracy |
| FiD-Light | Keeps only first k vectors per passage | Shorter decoder input, lower latency |
| FiD-KD | Distills reader attention into retriever | Better retrieval without labels |
| Passage reranking before FiD | Fewer, better passages | Lower cost with modest accuracy loss |
In practice, engineers tune N, passage length and decoder size together. Halving the number of passages roughly halves decoder cross-attention work, while a stronger reranking stage often recovers most of the lost accuracy.
Limitations and common misconceptions
FiD is powerful but bounded by its inputs and its training setup. The most frequent problems come from retriever recall, answer format and long outputs.
- Retriever recall caps accuracy: if no passage contains the answer, the decoder can only guess or hallucinate.
- Short answers were the original target; long-form generation multiplies decoder cost and exposes weaker grounding.
- No cross-passage reasoning in the encoder: multi-hop questions that need one passage to reinterpret another rely entirely on the decoder.
- A common misconception is that FiD retrieves by itself; it is a reader and always depends on an external retriever.
- Fine-tuning is required: a FiD reader must be trained on question-answer pairs, unlike prompt-based RAG with an instruction-tuned model.
The simple explanation
Imagine you ask a question and receive a stack of one hundred short articles. Reading all of them glued together as one huge document would be slow. Fusion-in-decoder takes a smarter route. It reads each article on its own and writes a compact note about it.
Then a single writer looks at all the notes together and composes the answer. The writer can notice that five notes agree and one disagrees. That is the fusion. The approach is fast because the expensive reading is split into small pieces. The final answer still uses every piece of evidence.
How it is used in practice
A pharmaceutical company builds an internal question-answering assistant over two million pages of study reports and regulatory submissions. A dense retriever returns the top 50 passages of about 200 tokens for each employee question, and a fine-tuned T5-based FiD reader generates a short answer such as a dosage range or a study endpoint.
During evaluation, the team finds that answers improve steadily from 10 to 50 passages but not beyond, and that decoder latency dominates response time. They add a cross-encoder reranker, cut the input to 30 passages and keep accuracy within one point of the original. Median latency drops by about a third, and analysts get sourced answers in under two seconds instead of searching documents manually.