Optimization of Data Representations for RAG-Based Chatbots
2025 (English)Independent thesis Advanced level (degree of Master (Two Years)), 20 credits / 30 HE credits
Student thesisAlternative title
Optimering av datarepresentationer för RAG-baserade chattbottar (Swedish)
Abstract [en]
Scattered technical documentation makes it difficult for developers and IT support to quickly and reliably find relevant information. This thesis investigates how Retrieval-Augmented Generation (RAG) chatbots can be improved to better retrieve and generate accurate answers in such environments. The focus lies on optimizing table and text representations for retrieval, and identifying which automated evaluation metrics best reflect human judgment.
To address this, a wide range of table and text formats were deliberately selected and compared, including simple, verbose, and structured styles such as and fixed-size chunking and representing tables as natural language sentences, JSON and Markdown formats. The methods were assessed using manual review and a diverse set of automated metrics.
For text-related questions, fixed-size chunks achieved the most reliable performance. A sliding window approach using overlapping windows also performed well by preserving boundary context. For table-related questions, the Markdown format stood out when preserving full tables and sentences within a chunk, likely due to its addition of structural clarity and mapping of table header and cell values without adding verbosity, as well as LLMs usual familiarity with Markdown during training, such as from GitHub README files.
In terms of evaluation, our custom LLM-as-a-judge method, named “Our-Judge“, presented in this paper achieved the highest alignment with human assessments, outperforming traditional metrics such as BLEU, ROUGE, and BERTScore. This alignment was likely also improved in comparison to other LLM-based metrics by the use of chain-of-thought prompting, which encouraged the model to reason more deliberately about correctness and completeness.
The results show that combining clearly structured representations, particularly Markdown or JSON for tables and fixed-size chunking for text, with or without the addition of a small window overlap, in combination with reasoning-aware evaluation techniques utilizing chain-of-thought prompting, significantly improves the accuracy and assessment of RAG-based chatbots in technical documentation settings.
Place, publisher, year, edition, pages
2025. , p. 57
Keywords [en]
Retrieval-Augmented Generation (RAG), Large Language Models (LLMs), Natural Language Processing (NLP), Text Chunking, Table Representation, Automated Evaluation Metrics
National Category
Natural Language Processing
Identifiers
URN: urn:nbn:se:liu:diva-214410ISRN: LIU-IDA/LITH-EX-A--25/026--SEOAI: oai:DiVA.org:liu-214410DiVA, id: diva2:1965487
External cooperation
Ericsson
Subject / course
Computer Engineering
Presentation
2025-05-26, Linköping, 10:26 (English)
Supervisors
Examiners
2025-06-092025-06-092025-06-09Bibliographically approved