The Retrieval-Augmented Generation (RAG) architecture is widely applied in diverse business domains, from content creation to automated customer support. However, these systems often lack flexibility and modularity, which limits their customization across different use cases. Furthermore, evaluating RAG retrieval components remains underdeveloped in academic research, impacting their practical application. This thesis presents ModRAG, a modular and flexible RAG architecture developed to streamline and customize AI-powered text generation in various business contexts. ModRAG operates through a sequence of modular steps, each configurable via YAML files, allowing for high adaptability and interoperability in real-world applications. The architecture can be tailored to tasks ranging from academic chatbots to technical support systems by configuring steps like LLM querying, document indexing, and information retrieval. Additionally, this work presents a new framework for evaluating the retrieval component, consisting of two distinct metrics: Context Relevance (CR) and Context Usefulness (CU). The former introduces an innovative approach to a retriever’s typical task of measuring semantic similarity between a query and a context. Meanwhile, the latter, which is designed to address the observed discrepancies in how the retriever identifies the most relevant contexts, leverages a Large Language Model to assess the effectiveness of a context in directly answering the query. Experiments show that the CU metric correlates more closely with retrieval performance, offering a more accurate evaluation tool than CR. ModRAG and these metrics are expected to improve the effectiveness and usability of RAG systems by enabling enhanced adaptability and more precise performance assessment.
Le architetture Retrieval-Augmented Generation (RAG) sono ampiamente utilizzate in diversi ambiti aziendali, dalla creazione di contenuti al supporto clienti automatizzato. Tuttavia, questi sistemi spesso mancano di flessibilità e modularità, limitandone la personalizzazione nei vari scenari di utilizzo. Inoltre, la valutazione dei componenti di retrieval di RAG è ancora poco sviluppata nella ricerca accademica, riducendone l’applicabilità pratica. Questa tesi presenta ModRAG, un'architettura RAG modulare e flessibile progettata per semplificare e personalizzare la generazione di contenuti testuali basati su intelligenza artificiale in diversi contesti aziendali. ModRAG opera attraverso una sequenza di step modulari, ciascuno configurabile tramite file YAML, permettendo un’elevata adattabilità e interoperabilità nelle applicazioni reali. L'architettura può essere adattata a compiti che vanno da chatbot accademici a sistemi di supporto tecnico, configurando step come la richiesta all'LLM, l'indicizzazione dei documenti e il recupero delle informazioni. Inoltre, questo lavoro presenta un nuovo framework per la valutazione della componente di retrieval, costituito da due metriche distinte: Context Relevance (CR) e Context Usefulness (CU). La prima introduce un approccio innovativo al tipico compito di un retriever, misurando la similarità semantica tra una query e un contesto. Nel mentre, la seconda, progettata per affrontare le discrepanze osservate nel modo in cui il retriever identifica i contesti più rilevanti, sfrutta un Large Language Model per valutare l'efficacia di un contesto nel rispondere direttamente alla query. Gli esperimenti mostrano che la metrica CU si correla maggiormente con le performance di retrieval, offrendo uno strumento di valutazione più accurato rispetto a CR. ModRAG e queste metriche sono pensati per migliorare l'efficacia e la fruibilità dei sistemi RAG, consentendo una maggiore adattabilità e una valutazione delle prestazioni più precisa.
Designing versatile RAG architecture with novel retrieval evaluation framework for scalable and trustworthy AI applications
PAGANO, GABRIELE
2023/2024
Abstract
The Retrieval-Augmented Generation (RAG) architecture is widely applied in diverse business domains, from content creation to automated customer support. However, these systems often lack flexibility and modularity, which limits their customization across different use cases. Furthermore, evaluating RAG retrieval components remains underdeveloped in academic research, impacting their practical application. This thesis presents ModRAG, a modular and flexible RAG architecture developed to streamline and customize AI-powered text generation in various business contexts. ModRAG operates through a sequence of modular steps, each configurable via YAML files, allowing for high adaptability and interoperability in real-world applications. The architecture can be tailored to tasks ranging from academic chatbots to technical support systems by configuring steps like LLM querying, document indexing, and information retrieval. Additionally, this work presents a new framework for evaluating the retrieval component, consisting of two distinct metrics: Context Relevance (CR) and Context Usefulness (CU). The former introduces an innovative approach to a retriever’s typical task of measuring semantic similarity between a query and a context. Meanwhile, the latter, which is designed to address the observed discrepancies in how the retriever identifies the most relevant contexts, leverages a Large Language Model to assess the effectiveness of a context in directly answering the query. Experiments show that the CU metric correlates more closely with retrieval performance, offering a more accurate evaluation tool than CR. ModRAG and these metrics are expected to improve the effectiveness and usability of RAG systems by enabling enhanced adaptability and more precise performance assessment.File | Dimensione | Formato | |
---|---|---|---|
2024_12_Pagano_Tesi.pdf
non accessibile
Descrizione: Testo della tesi
Dimensione
1.67 MB
Formato
Adobe PDF
|
1.67 MB | Adobe PDF | Visualizza/Apri |
2024_12_Pagano_Executive Summary.pdf
non accessibile
Descrizione: Testo dell'executive summary
Dimensione
398.52 kB
Formato
Adobe PDF
|
398.52 kB | Adobe PDF | Visualizza/Apri |
I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.
https://hdl.handle.net/10589/230957