AIOct 6, 2025

MHA-RAG: Improving Efficiency, Accuracy, and Consistency by Encoding Exemplars as Soft Prompts

arXiv:2510.05363v1h-index: 4
Originality Highly original
AI Analysis

This work addresses the problem of computational expense and instability in domain adaptation for AI practitioners, offering a novel method that improves efficiency and accuracy.

The paper tackled the challenge of adapting foundation models to new domains with limited data by introducing MHA-RAG, which encodes exemplars as soft prompts, resulting in a 20-point performance gain over standard RAG and a 10X reduction in inference costs.

Adapting Foundation Models to new domains with limited training data is challenging and computationally expensive. While prior work has demonstrated the effectiveness of using domain-specific exemplars as in-context demonstrations, we investigate whether representing exemplars purely as text is the most efficient, effective, and stable approach. We explore an alternative: representing exemplars as soft prompts with an exemplar order invariant model architecture. To this end, we introduce Multi-Head Attention Retrieval-Augmented Generation (MHA-RAG), a framework with the number of attention heads serving as a simple hyperparameter to control soft prompt-generation across different tasks. Across multiple question-answering benchmarks and model scales, MHA-RAG achieves a 20-point performance gain over standard RAG, while cutting inference costs by a factor of 10X GFLOPs-delivering both higher accuracy and greater efficiency, invariant to exemplar order.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes