Beyond Trial-and-Error: A Multi-Stage Approach for Selecting Embeddings and Chunking Strategies in RAG
DOI:
https://doi.org/10.5753/jidm.2026.7426Keywords:
Retrieval-Augmented Generation (RAG), Retriever Optimization, Embedding Model Selection, Text Chunking Strategies, Stability AnalysisAbstract
The performance of Retrieval-Augmented Generation (RAG) systems critically depends on the interplay between embedding models and text chunking strategies. However, selecting the optimal configuration is often a computationally expensive, trial-and-error process. To address this, we propose a multi-stage optimization framework designed to automate the selection of retriever components. Our approach introduces a preliminary ranking phase that efficiently filters embedding models using lightweight metrics (MRR and Recall) on synthetic queries, significantly reducing the search space before exhaustive indexing. We formally model this selection process as an optimization problem and validate it across three distinct domains: Legal, Audit, and News. Results confirm that the preliminary ranking effectively anticipates downstream performance, preserving top-performing models while discarding suboptimal ones. Furthermore, we extend the evaluation to include stability analysis, revealing a critical trade-off between granularity and reliability: while sentence-level chunking introduces high performance variance ($\sigma$) in complex documents, larger window strategies offer superior robustness and predictability. This work provides a generalized, empirically validated pipeline for constructing efficient and stable RAG systems.Downloads
References
Antematter team (2024). Optimizing retrieval-augmented generation with advanced chunking techniques: A comparative study. Accessed: 2025-03-31.
Bender, E. M., Gebru, T., McMillan-Major, A., and Shmitchell, S. (2021). On the dangers of stochastic parrots: Can language models be too big? In Proceedings of FAccT.
Buckley, C. and Voorhees, E. M. (2000). Evaluating evaluation measure stability. In Proceedings of the 23rd Annual International ACM SIGIR Conference on Research and Development in Information Retrieval, pages 33–40. ACM.
Chalkidis, I., Fergadiotis, M., Malakasiotis, P., Aletras, N., and Androutsopoulos, I. (2020). LEGAL-BERT: The muppets straight out of law school. In Findings of the Association for Computational Linguistics: EMNLP 2020, pages 2898–2904. DOI: 10.18653/v1/2020.findings-emnlp.261.
Es, S., James, J., Espinosa-Anke, L., and Schockaert, S. (2023). Ragas: Automated evaluation of retrieval augmented generation.
Es, S., James, J., Espinosa-Anke, L., and Schockaert, S. (2024). RAGAS: Automated evaluation of retrieval augmented generation. In Proceedings of the 18th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations, pages 150–158.
Gao, Y., Xiong, Y., Gao, X., Jia, K., Pan, J., Bi, Y., Dai, Y., Sun, J., Wang, M., and Wang, H. (2023). Retrieval-augmented generation for large language models: A survey. arXiv preprint arXiv:2312.10997.
Gupta, N. (2024). BGE-M3 vs OpenAI embeddings: A comparative study. https://naman1011.medium.com/bge-m3-model-vs-openai-embeddings-e6d6cda27d0c.
Izacard, G. and Grave, E. (2021). Leveraging passage retrieval with generative models for open domain question answering. In Proceedings of EACL.
Kang, J., Lee, J., and Kang, J. (2023). Knowledge graph-augmented language models for knowledge-grounded dialogue generation. arXiv preprint arXiv:2305.18846.
Karpukhin, V., Oguz, B., Min, S., Lewis, P., Wu, L., Edunov, S., Chen, D., and Yih, W.-t. (2020). Dense passage retrieval for open-domain question answering. In Proceedings of EMNLP.
Khandelwal, U., Levy, O., Jurafsky, D., Zettlemoyer, L., and Lewis, M. (2020). Generalization through memorization: Nearest neighbor language models. arXiv preprint arXiv:1911.00172.
Lee, J., Yoon, H., and Park, H.-A. (2021). Explainable AI in healthcare: From black box to interpretable models. Healthcare Informatics Research, 27(1):1–9.
Lewis, P., Perez, E., Piktus, A., Petroni, F., Karpukhin, V., Goyal, N., Fan, A., Chaudhary, V., Rocktäschel, T., and Riedel, S. (2020a). Retrieval-augmented generation for knowledge-intensive NLP tasks. In Advances in Neural Information Processing Systems.
Lewis, P., Perez, E., Piktus, A., Petroni, F., Karpukhin, V., Goyal, N., Küttler, H., Lewis, M., Yih, W., Rocktäschel, T., Riedel, S., and Kiela, D. (2020b). Retrieval-augmented generation for knowledge-intensive NLP tasks.
Liu, X., Zhou, Z., Zhou, T., Sun, M., and Wang, T. (2024). BGE-M3: A multi-function embedding model for dense, sparse and multi-vector retrieval. arXiv preprint arXiv:2402.03216.
Liu, Z., Simon, C.-E., and Caspani, F. (2025). Passage segmentation of documents for extractive question answering.
Luan, Y., Tang, K., Gupta, M. J., and Zettlemoyer, L. (2021). Sparse retrieval for question answering. In Proceedings of ACL.
Mitchell, M., Wu, S., Zaldivar, A., Barnes, P., Vasserman, L., Hutchinson, B., Spitzer, E., Raji, I. D., and Gebru, T. (2019). Model cards for model reporting. Proceedings of the Conference on Fairness, Accountability, and Transparency.
Muennighoff, N., Tazi, N., Magne, L., and Reimers, N. (2022). MTEB: Massive text embedding benchmark. arXiv preprint arXiv:2210.07316.
Muennighoff, N., Tazi, N., et al. (2023). MTEB: Massive text embedding benchmark. https://huggingface.co/spaces/mteb/leaderboard.
Nishikawa, T., Hidaka, S., Yokoi, S., and Nakayama, H. (2022). Towards entity-enhanced RAG: Augmenting retrieval augmented generation with entity annotation. In Proceedings of EMNLP.
Paranhos, S. L., Tomazini, J., Oliveira, S., Junior, C. C., and de Oliveira, S. (2025). Preliminary ranking-based selection for optimized retriever configuration in RAG systems. In Anais do XL Simpósio Brasileiro de Bancos de Dados, pages 725–738. DOI: 10.5753/sbbd.2025.247492.
Ram, O., Levine, Y., Dalmedigos, I., Muhlgay, D., Shashua, A., Leyton-Brown, K., and Shoham, Y. (2023). In-context retrieval-augmented language models. Transactions on Machine Learning Research.
Reimers, N. and Gurevych, I. (2019). Sentence-BERT: Sentence embeddings using siamese BERT-networks. In Proceedings of EMNLP.
Safjan, K. (2023). From fixed-size to NLP chunking: A deep dive into text chunking techniques. Accessed: 2025-03-31.
Sakai, T. (2006). Evaluating evaluation metrics based on the bootstrap. In Proceedings of the 29th Annual International ACM SIGIR Conference, pages 525–532. ACM.
Sheng, E., Chang, K.-W., Natarajan, P., and Peng, N. (2019). The woman worked as a babysitter: On biases in language generation. In Proceedings of EMNLP.
Thakur, N., Reimers, N., Rücklé, A., Srivastava, A., and Gurevych, I. (2022). BEIR: A heterogeneous benchmark for zero-shot evaluation of information retrieval models. In Proceedings of NeurIPS.
Wang, R. and Zhao, L. (2023). AI in education and policymaking: A review of recent advances. Educational Technology Research and Development, 71(2):135–152.
Wang, X., Dong, X., Zhang, F., Wang, L., and Xie, X. (2021). KEPLER: A unified model for knowledge embedding and pre-trained language representation.
Wu, S. et al. (2023). Chunking strategies for retrieval-augmented generation. arXiv preprint arXiv:2308.08973.
Yates, A., Hofstätter, S., and Zuccon, G. (2021). Pretrained transformers for text ranking: BERT and beyond. arXiv preprint arXiv:2104.08663.
Zhong, Z., Liu, H., Cui, X., Zhang, X., and Qin, Z. (2025). Mix-of-granularity: Optimize the chunking granularity for retrieval-augmented generation.

