An Analysis of Hyper-Parameter Optimization Methods for Retrieval Augmented Generation
Matan Orbach, Ohad Eytan, Benjamin Sznajder, Ariel Gera, Odellia Boni, Yoav Kantor, Gal Bloch, Omri Levy, Hadas Abraham, Nitzan Barzilay, Eyal Shnarch, Michael E. Factor, Shila Ofek-Koifman, Paula Ta-Shma, Assaf Toledo
TL;DR
This work addresses the costly problem of tuning Retrieval-Augmented Generation configurations by benchmarking five HPO methods across five diverse datasets within a 162-configuration search space. It demonstrates that effective improvements can be achieved with around 10 evaluated configurations, and that greedy, model-first optimization outperforms sequential, pipeline-order strategies. The study also reveals that the optimization objective strongly shapes the best RAG configuration and that development-set sampling can dramatically reduce HPO costs, making practical deployment feasible. Open resources, including full grid-search results and a new enterprise WatsonxQA dataset, are released to support reproducibility and future explorations into larger or multi-modal RAG pipelines.
Abstract
Optimizing Retrieval-Augmented Generation (RAG) configurations for specific tasks is a complex and resource-intensive challenge. Motivated by this challenge, frameworks for RAG hyper-parameter optimization (HPO) have recently emerged, yet their effectiveness has not been rigorously benchmarked. To fill this gap, we present a comprehensive study involving five HPO algorithms over five datasets from diverse domains, including a newly curated real-world product documentation dataset. Our study explores the largest RAG HPO search space to date that includes full grid-search evaluations, and uses three evaluation metrics as optimization targets. Analysis of the results shows that RAG HPO can be done efficiently, either greedily or with random search, and that it significantly boosts RAG performance for all datasets. For greedy HPO approaches, we show that optimizing model selection first is preferable to the common practice of following the RAG pipeline order during optimization.
