Adapting LLMs to New Domains: A Comparative Study of Fine-Tuning and RAG strategies for Portuguese QA Tasks - da Costa, Leandro Yamachita; Oliveira e Souza Filho, João Baptista de (Anais do Simpósio Brasileiro de Tecnologia da Informação e da Linguagem Humana (STIL); 2024: Anais do XV Simpósio Brasileiro de Tecnologia da Informação e da Linguagem HumanaDO - 10.5753/stil.2024.245443, 2024)
The rise of Large Language Models (LLMs) represented a significant advance in text generation applications. However, LLMs face challenges in domains outside the scope of their original training. This study investigates the following two approaches to adapt LLMs to new domains in the context of generative question-answering (QA) with data in Portuguese: fine-tuning and Retrieval-Augmented Generation (RAG). The experiments carried out in this study demonstrate the effectiveness of incorporating external data sources, even in models that had not been adjusted for the specific domain. Furthermore, the combination of supervised fine-tuning with RAG proved to be the most effective approach.