Maxwell Para Simples Indexação

Título
[pt] CONSULTANDO BANCOS DE DADOS COM LINGUAGEM NATURAL: O USO DE MODELOS DE LINGUAGEM GRANDES PARA TAREFAS DE TEXTO-PARA-SQL

Título
[en] QUERYING DATABASES WITH NATURAL LANGUAGE: THE USE OF LARGE LANGUAGE MODELS FOR TEXT-TO-SQL TASKS

Autor
[pt] EDUARDO ROGER SILVA NASCIMENTO

Vocabulário
[pt] GRANDE MODELO DE LINGUAGEM

Vocabulário
[pt] GPT

Vocabulário
[pt] LANGCHAIN

Vocabulário
[pt] TEXTO PARA SQL

Vocabulário
[en] LARGE LANGUAGE MODEL

Vocabulário
[en] GPT

Vocabulário
[en] LANGCHAIN

Vocabulário
[en] TEXT TO SQL

Resumo
[pt] A tarefa chamada brevemente de Texto-para-SQL envolve a geração de uma consulta SQL com base em um banco de dados relacional e uma pergunta em linguagem natural. Embora os rankings de benchmarks conhecidos indiquem que Modelos de Linguagem Grandes (LLMs) se destacam nessa tarefa, eles são avaliados em bancos de dados com esquemas bastante simples. Esta dissertação investiga inicialmente o desempenho de modelos Texto-para-SQL baseados em LLMs em um banco de dados disponível ao público (Mondial)com um esquema conceitual complexo e um conjunto de 100 perguntas em Linguagem Natural (NL). Executando sob GPT-3.5 e GPT-4, os resultados deste primeiro experimento mostram que as ferramentas baseadas em LLM têm desempenho significativamente inferior ao relatado nesses benchmarks e enfrentam dificuldades com a vinculação de esquemas e joins, sugerindo que o esquema relacional pode não ser adequado para LLMs. Essa dissertação propõe então o uso de visões e descrições de dados amigáveis ao LLM para melhorara precisão na tarefa Texto-para-SQL. Em um segundo experimento, usando a estratégia com melhor performance, custo e benefício do experimento anterior e outro conjunto com 100 perguntas sobre um banco de dados do mundo real, os resultados mostram que a abordagem proposta é suficiente para melhorar consideravelmente a precisão da estratégia de prompt. Esse trabalho conclui com uma discussão dos resultados obtidos e sugere abordagens adicionais para simplificar a tarefa de Texto-para-SQL.

Resumo
[en] The Text-to-SQL task involves generating an SQL query based on a given relational database and a Natural Language (NL) question. While the leaderboards of well-known benchmarks indicate that Large Language Models (LLMs) excel in this task, they are evaluated on databases with simpler schemas. This dissertation first investigates the performance of LLM-based Text-to-SQL models on a complex and openly available database (Mondial) with a large schema and a set of 100 NL questions. Running under GPT-3.5 and GPT-4, the results of this first experiment show that the performance of LLM-based tools is significantly less than that reported in the benchmarks and that these tools struggle with schema linking and joins, suggesting that the relational schema may not be suitable for LLMs. This dissertation then proposes using LLM-friendly views and data descriptions for better accuracy in the Text-to-SQL task. In a second experiment, using the strategy with better performance, cost and benefit from the previous experiment and another set with 100 questions over a real-world database, the results show that the proposed approach is sufficient to considerably improve the accuracy of the prompt strategy. This work concludes with a discussion of the results obtained and suggests further approaches to simplify the Text-to-SQL task.

Orientador(es)
MARCO ANTONIO CASANOVA

Banca
MARCO ANTONIO CASANOVA

Banca
LUIZ ANDRE PORTES PAES LEME

Banca
MELISSA LEMOS CAVALIERI

Catalogação
2024-05-23

Apresentação
2024-04-04

Tipo
[pt] TEXTO

Formato
application/pdf

Idioma(s)
INGLÊS

Referência [pt]
https://www.maxwell.vrac.puc-rio.br/colecao.php?strSecao=resultado&nrSeq=66799@1

Referência [en]
https://www.maxwell.vrac.puc-rio.br/colecao.php?strSecao=resultado&nrSeq=66799@2

Referência DOI
https://doi.org/10.17771/PUCRio.acad.66799


Arquivos do conteúdo
NA ÍNTEGRA PDF