Large Language Models (LLMs) have captured widespread attention due to their impressive ability to mimic language understanding and generate compelling text. However, their use in structured output tasks often leads to unreliable completions due to excessive creativity, making it challenging to evaluate the quality of their outputs. This situation calls for innovative approaches. The investigations of this thesis focus on enhancing and refining the application of LLMs for data retrieval tasks within MongoDB databases, aiming to enhance user experience and streamline query generation using natural language. Additionally, the thesis proposes dynamic and data-agnostic prompt-engineering techniques tailored to maximize accuracy within the specified context. Extensive testing across various LLM architectures is conducted to evaluate their proficiency in interpreting domain-specific language and properly retrieving the desired information. Furthermore, a novel obfuscation technique is introduced, aimed at concealing prompts while preserving their underlying semantics. This method holds particular significance for companies with stringent security requirements, offering a practical solution to protect sensitive information within automated query systems. Overall, this work provides novel strategies for optimizing LLM inference in specialized applications, laying the groundwork for future advancements in Natural Language Processing for query generation, obfuscation, and evaluation.
I modelli linguistici di grandi dimensioni (LLM) hanno catturato l’attenzione grazie alla loro impressionante capacità di imitare la comprensione del linguaggio e di generare testi convincenti. Tuttavia, il loro utilizzo in compiti che richiedono output strutturati porta spesso a generazioni inaffidabili a causa dell’eccessiva creatività, rendendo difficile la valutazione della qualità e della correttezza dell’output. Questa situazione richiede quindi approcci innovativi. Questa tesi si concentra sul miglioramento e sul perfezionamento dell’applicazione dei LLM per il reperimento di dati all’interno dei database MongoDB, con l’obiettivo di migliorare l’esperienza dell’utente e semplificare la generazione di query utilizzando il linguaggio naturale. Inoltre, la tesi propone tecniche di prompt-engineering dinamiche e indipendenti dai dati, studiate per massimizzare l’accuratezza all’interno del contesto specificato. Sono stati condotti test approfonditi su diverse architetture LLM per valutare la loro capacità di interpretare il linguaggio specifico del dominio di riferimento e di recuperare correttamente le informazioni desiderate. Inoltre, viene introdotta una tecnica di offuscamento, che mira a nascondere dati sensibili dai prompt preservando la semantica sottostante. Questo metodo è particolarmente importante per le aziende con requisiti di sicurezza molto severi, in quanto offre una soluzione pratica per proteggere le informazioni sensibili all’interno dei sistemi di interrogazione automatica. Nel complesso, questo lavoro fornisce nuove strategie per ottimizzare l’inferenza LLM in applicazioni specializzate, ponendo le basi per futuri progressi nell’elaborazione del linguaggio naturale per la generazione, l’offuscamento e la valutazione delle query.
Effectiveness and optimization of large language models in natural language querying for MongoDB data retrieval
Riboni, Andrea
2023/2024
Abstract
Large Language Models (LLMs) have captured widespread attention due to their impressive ability to mimic language understanding and generate compelling text. However, their use in structured output tasks often leads to unreliable completions due to excessive creativity, making it challenging to evaluate the quality of their outputs. This situation calls for innovative approaches. The investigations of this thesis focus on enhancing and refining the application of LLMs for data retrieval tasks within MongoDB databases, aiming to enhance user experience and streamline query generation using natural language. Additionally, the thesis proposes dynamic and data-agnostic prompt-engineering techniques tailored to maximize accuracy within the specified context. Extensive testing across various LLM architectures is conducted to evaluate their proficiency in interpreting domain-specific language and properly retrieving the desired information. Furthermore, a novel obfuscation technique is introduced, aimed at concealing prompts while preserving their underlying semantics. This method holds particular significance for companies with stringent security requirements, offering a practical solution to protect sensitive information within automated query systems. Overall, this work provides novel strategies for optimizing LLM inference in specialized applications, laying the groundwork for future advancements in Natural Language Processing for query generation, obfuscation, and evaluation.File | Dimensione | Formato | |
---|---|---|---|
2024_07_riboni.pdf
accessibile in internet per tutti a partire dal 23/06/2025
Descrizione: Thesis pdf
Dimensione
4.93 MB
Formato
Adobe PDF
|
4.93 MB | Adobe PDF | Visualizza/Apri |
2024_07_riboni_Executive summary.pdf
accessibile in internet per tutti a partire dal 23/06/2025
Descrizione: Executive summary
Dimensione
587.03 kB
Formato
Adobe PDF
|
587.03 kB | Adobe PDF | Visualizza/Apri |
I documenti in POLITesi sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.
https://hdl.handle.net/10589/223237