Manuscript Offprint

arXiv:2610.27816

RAG-NIMBF: A Non-Invasive, Modular Benchmarking Framework for Automated RAG Configuration Analysis

Niclas Hart, Nicolas Weeger

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Niclas Hart ∗^{*}, 1^{1} and Nicolas Weeger 1^{1}

Ansbach University of Applied Sciences

n.hart18293@hs-ansbach.de, nicolas.weeger@hs-ansbach.de

Abstract. Retrieval-Augmented Generation (RAG) has become the dominant paradigm for grounding the outputs of large language models (LLM) in external knowledge. However, practitioners are faced with a vast configuration space comprising chunking, embedding, retrieval, reranking, prompting and generation models, and there is limited guidance on how these components interact. We present RAG-NIMBF, a modular benchmarking framework that attaches to existing RAG pipelines as a non-invasive evaluation layer. It evaluates the configuration space through controlled ablation with end-to-end experiment tracking and is publicly available via GitHub. 1^{1} The evaluation combines LLM-based answer quality scores, retrieval correctness measures, and runtime indicators. This study validates the framework across multiple generation models on the SQuAD dataset. This process reveals non-obvious interactions and demonstrates how the experiments are tracked. The findings indicate that the retrieval balance of relevance and diversity substantially enhances the relevance and coverage of retrieved context in comparison to a conventional similarity search, with MMR raising nDCG@5 by +4 to +11 percentage points across the swept models. More detailed prompt instructions meaningfully increase how faithfully generated answers stick to the retrieved evidence, especially for capable and reasoning models (+10 to +13pp on Qwen3.6-27B, GPT-4o-mini and Qwen3.5-think, but negligible on the 20B generator). Larger generation models improve answer quality at the cost of higher latency, yet the local Qwen3.6-27B matches GPT-4o-mini at mean faithfulness 0.89, and the frontier reference does not dominate the smaller generators on RAG-relevant metrics. Overall, RAG-NIMBF transforms the configuration space of RAG into reproducible, comparable experiments. By attaching to existing production pipelines in a non-invasive way, it enables practitioners to systematically evaluate and improve deployed systems without disrupting existing workflows. This replaces ad hoc choices with evidence-based decisions.

Keywords: Retrieval-Augmented Generation · Benchmarking Framework · RAG Evaluation · Configuration Analysis

  • Corresponding author

1^{1} https://github.com/aiengineeringblueprints/RAG-NIMBF

1 Introduction

Retrieval-Augmented Generation (RAG) [18] has emerged as the standard architecture for building knowledge-grounded question-answering systems. Rather than relying solely on parametric knowledge stored in model weights, RAG pipelines retrieve relevant documents from an external corpus and condition answer generation on the retrieved context. This approach reduces hallucination [32] and enables domain-specific applications without costly fine-tuning.

A production RAG pipeline involves multiple interacting components:

  1. A chunking strategy splits source documents into retrievable segments.

  2. An embedding model maps chunks and queries to a shared vector space.

  3. A retrieval method selects the most relevant chunks.

  4. An optional reranker re-orders them.

  5. A prompt template frames the generation task.

  6. A generation model produces the final answer [9].

Each component offers multiple design choices resulting in a large combinatorial configuration space. Even small changes in chunk size, retrieval strategy, or prompt wording can shift faithfulness scores by more than ten percentage points [6]. However, practitioners often select configurations based on intuition, vendor claims, or community defaults rather than systematic evaluations against their own data [8,31], and such defaults are highly sensitive to corpus and model [1,28]. For smaller organisations, building RAG on consumer-grade hardware rather than dedicated GPU clusters is the only economically viable path [33], so this study covers models that run on such hardware. Although several evaluation frameworks exist [8,31,30], their primary focus is on scoring a given pipeline rather than treating the configuration itself as the object of study. Systematic sweeps, component-interaction analysis, and reproducibility tracking are typically out of scope, and none of them are compatible with existing RAG pipelines.

These issues are addressed by RAG-NIMBF (RAG-Non-Invasive Modular Benchmarking Framework), a framework which is designed around three core principles:

  1. Non-invasive integration: The framework wraps existing RAG components without modifying model or retriever internals. It connects to Ollama and OpenAI compatible endpoints (vLLM, TGI, ...) through provider routing, requiring only model identifier strings and access data.

  2. Systematic configuration exploration: A declarative environment configuration specifies parameter ranges for all components. The framework generates the cartesian product and benchmarks every combination, producing and tracking structured results suitable for direct comparison.

  3. Hybrid evaluation: Each run is assessed through a combination of answer-quality, retrieval, generation, and runtime metrics, so that configuration effects can be inspected from multiple complementary angles.

RAG-NIMBF is validated by benchmarking several configurations across different generation models spanning local, cloud-hosted, and API deployments on a 100-question sample from the SQuAD dataset [26]. Experiment tracking is built into the framework itself, with every run automatically logged in MLflow. This includes parameters, metrics, artifacts and traces, so the results reported here are fully reproducible without additional bookkeeping.

The following design choices materialise in three concrete contributions:

  1. A modular, non-invasive benchmarking framework for systematic RAG configuration analysis, with integrated MLflow tracking that makes every sweep reproducible by default.

  2. A hybrid evaluation methodology combining answer-quality, retrieval, and generation metrics with runtime measurements.

  3. An empirical study revealing non-obvious interactions between chunking, retrieval, prompting, and generation components, with explicit focus on models that fit on consumer-grade hardware so that smaller organisations can adopt the findings without dedicated AI infrastructure.

References (33)