A RAG-Based Institutional Assistant
Gustavo Kuratomi, Paulo Pirozelli, Fabio G. Cozman, Sarajane M. Peres
TL;DR
The paper addresses the challenge that large language models struggle with knowledge-intensive tasks without access to structured sources. It proposes a modular retrieval-augmented generation (RAG) system tailored to the University of São Paulo, combining a retriever over 866 normative documents with a generator, and evaluating via a generated QA dataset (592 questions) and paraphrased variants. Key findings show that the retriever alone achieves a Top-5 accuracy of 30% and the best generator attains 22.04% accuracy against ground truth, but providing the correct document chunks to the LLM markedly increases accuracy to 54.02%, while no-context prompts drop to 13.68%. The work highlights the critical role of database access for LLM performance, exposes limitations of current semantic search in precise document retrieval, and provides a runnable RAG framework with open data/code to support institutional information tasks.
Abstract
Although large language models (LLMs) demonstrate strong text generation capabilities, they struggle in scenarios requiring access to structured knowledge bases or specific documents, limiting their effectiveness in knowledge-intensive tasks. To address this limitation, retrieval-augmented generation (RAG) models have been developed, enabling generative models to incorporate relevant document fragments into their inputs. In this paper, we design and evaluate a RAG-based virtual assistant specifically tailored for the University of São Paulo. Our system architecture comprises two key modules: a retriever and a generative model. We experiment with different types of models for both components, adjusting hyperparameters such as chunk size and the number of retrieved documents. Our optimal retriever model achieves a Top-5 accuracy of 30%, while our most effective generative model scores 22.04\% against ground truth answers. Notably, when the correct document chunks are supplied to the LLMs, accuracy significantly improves to 54.02%, an increase of over 30 percentage points. Conversely, without contextual input, performance declines to 13.68%. These findings highlight the critical role of database access in enhancing LLM performance. They also reveal the limitations of current semantic search methods in accurately identifying relevant documents and underscore the ongoing challenges LLMs face in generating precise responses.
