Back to search

Universidade de Coimbro

Augmenting Large Language Models with Context Retrieval

Abstract

dc:description.abstract

In recent years, AI has witnessed significant advancements, particularly in NLP. The breakthroughs in Large Language Models(LLMs) have showcased remarkable capabilities in understanding and generating human-like text. However, challenges arise when dealing with large context sizes, both in terms of computational costs and model performance.In the context of OutSystems, the company is trying to use these models to improve the developer workflow in the Service Studio platform. With the increasing complexity of applications, models struggle to handle large context sizes, both in terms of computational complexity as in model architectural limitations.In this work, we aim to investigate the impact of context size in LLMs accuracy and performance. The objectives include analysing the gains and drawbacks faced by these models when dealing with large context sizes, and proposing an approach to mitigate these effects. We propose a two-step approach to handle these context limitations, where the first step should be able to select relevant context from a reduced section of the complete context and the second model generates the expected result to the problem. Furthermore, we apply and analyse this approach in two different use cases with direct relation to the OutSystems platform, one related to code completion and another related to a Text-To-SQL task.The results obtained by our proposal show that it is possible, depending on the use case, to increase the accuracy of the models results without substantially increasing the computational costs to achieve this result.In the code generation use case, we were able to process 24% more instances of the test dataset and get an increase in accuracy of approximately over 20%. The average extra inference time was 40ms per instance.In the Text-To-SQL use case, we verified that our approach can be limited by other factors. In this scenario, despite a substantial increase of nearly 30% in the number of processed instances, reaching approximately 100% of the test cases, the accuracy only showed a minor improvement of 2% compared to the baseline. Additionally, the average inference time per instance almost doubled.

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Henriques, Pedro Duarte Santos
Advisors dc:contributor.advisor
  • Assunção, Filipe
  • Lourenço, Nuno António Marques

Subjects

dc:subject × 10

Rights

dc:rights
Statement dc:rights
  • openAccess
Language dc:language.iso
eng

Identifiers

dc:identifier.*
Dc Identifier Tid
203693825

Chain of custody

source
Harvested from
Universidade de Coimbro
Base URL
estudogeral.sib.uc.pt/oai/request
Last updated
2026-11-26
Source record
OAI-PMH GetRecord
citation

Henriques, Pedro Duarte Santos. Augmenting Large Language Models with Context Retrieval. 2024. https://hdl.handle.net/10316/116586