flashrag-rag-benchmark-eval
FlashRAG: A Modular Toolkit for Efficient Retrieval-Augmented Generation Research — Jin et al. (2024) (arXiv:2405.13576, 2024)
What this evaluates
Evaluates the effectiveness of various Retrieval-Augmented Generation (RAG) methods across text and multimodal question-answering tasks. It probes how different retrieval strategies, context compression techniques, and generator optimizations impact answer accuracy and faithfulness on single-hop and multi-hop datasets.
Datasets
- NQ — total ?; splits: test (-1)
- TriviaQA — total ?; splits: test (-1)
- HotpotQA — total ?; splits: test (-1)
- 2WikiMultihopQA — total ?; splits: test (-1)
- Gaokao-MM — total ?; splits: test (-1)
- MultimodalQA — total ?; splits: test (-1)
- MathVista — total ?; splits: test (-1)
Metrics
Acc(primary) — range: [0, 1]- Calculated as the percentage of queries where the model's generated answer exactly matches the ground truth answer.
EM— range: [0, 1]- Binary score of 1 if the predicted answer string exactly matches the gold answer string (case-insensitive), else 0.
F1— range: [0, 1]- Token-level F1 score measuring the harmonic mean of precision and recall between the predicted and gold answers.
Input / output format
Input: Query string and a set of retrieved text passages (chunked from Wikipedia or other corpora) provided as context.
Output: Generated natural language answer string.
Scoring recipe
def evaluate(predictions, golds):
acc = sum(1 for p, g in zip(predictions, golds) if p.strip().lower() == g.strip().lower()) / len(golds)
em = sum(1 for p, g in zip(predictions, golds) if p.strip().lower() == g.strip().lower()) / len(golds)
f1_scores = [token_f1(p, g) for p, g in zip(predictions, golds)]
return {'Acc': acc, 'EM': em, 'F1': sum(f1_scores)/len(f1_scores)}
Common pitfalls
- Performance is highly sensitive to the number of retrieved passages; using a fixed count (e.g., top-1 or top-10) instead of the optimal range (~top-5) can skew results.
- Larger generator models do not consistently outperform smaller ones in RAG settings due to differences in training data quality or architecture rather than parameter scale.
- Overlapping text chunks during corpus segmentation were found to yield inferior performance compared to non-overlapping chunks, contrary to some common assumptions.
Evidence (verbatim from paper)
The experimental results are shown in Table[3]. Overall, RAG methods significantly outperform the direct generation baseline, which clearly demonstrates the benefits of incorporating external knowledge into the generation process. ... | Gaokao-MM | MultimodalQA | | | MathVista | | | | | | Acc | EM | F1 | Acc | EM | F1 | Acc |
Citation
@misc{jin2024flashrag,
title={FlashRAG: A Modular Toolkit for Efficient Retrieval-Augmented Generation Research},
author={Jin et al. (2024)},
year={2024},
note={arXiv:2405.13576}
}
- arXiv: 2405.13576