The use of Large Language Models (LLMs) in semantic operators makes it possible to query unstructured content through conditions expressed in natural language, but it also introduces high execution costs. This thesis investigates the reuse of results from previously executed semantic queries in the case of two hierarchically related queries, where a broader query Q1 has already been evaluated and a more specific query Q2 must be executed over the same items. Two strategies are analyzed. Q1-Context uses the prediction produced for Q1 as additional information during the execution of Q2, while Q1-Filter uses the result of Q1 to directly exclude part of the input from the second query. The two strategies are evaluated within the LOTUS model cascade on a benchmark built from 1,758 ACM research papers and 14 query pairs derived from the hierarchy of the ACM Computing Classification System. The results show that Q1-Context reduces main-model calls by 36.9% on average, but provides a more limited benefit in terms of total cost and shifts the system toward higher precision and lower recall. Q1-Filter instead achieves a larger and more systematic reduction, decreasing main-model calls by 76.7% and the total cost of Q2 by 70.4%, at the cost of a greater recall loss. For this strategy, an end-to-end lower bound on recall is also derived. Overall, the thesis shows that the results of semantically related queries can be a useful resource for optimizing subsequent queries, but that the achievable benefit and the resulting cost-quality trade-off strongly depend on the reuse strategy adopted and on the specific query pair being considered.
L’impiego dei Large Language Models (LLM) nei semantic operators permette di interrogare contenuti non strutturati attraverso condizioni espresse in linguaggio naturale, ma introduce costi di esecuzione elevati. Questa tesi studia il riutilizzo dei risultati di query semantiche precedenti nel caso di due query gerarchicamente correlate, in cui una query più generale Q1 è già stata eseguita e una query più specifica Q2 deve essere valutata sugli stessi elementi. Sono analizzate due strategie. Q1-Context utilizza la predizione di Q1 come informazione aggiuntiva durante l’esecuzione di Q2, mentre Q1-Filter usa il risultato di Q1 per escludere direttamente parte dell’input dalla seconda query. Le due strategie sono valutate all’interno della model cascade di LOTUS su un benchmark costruito a partire da 1.758 articoli ACM e da 14 coppie di query derivate dalla gerarchia dell’ACM Computing Classification System. I risultati mostrano che Q1-Context riduce in media del 36,9% le chiamate al main model, ma con un beneficio più limitato sul costo complessivo e con uno spostamento verso maggiore precision e minore recall. Q1-Filter produce invece una riduzione più marcata e sistematica, pari al 76,7% delle chiamate al main model e al 70,4% del costo complessivo di Q2, accompagnata però da una maggiore perdita di recall. Per questa strategia viene inoltre derivato un lower bound end-to-end sul recall. Nel complesso, il lavoro mostra che i risultati di query semanticamente correlate possono costituire una risorsa utile per ottimizzare query successive, ma che il beneficio ottenibile e il relativo trade-off tra costo e qualità dipendono fortemente dalla modalità di riutilizzo adottata e dalla coppia di query considerate.
Ottimizzazione degli operatori semantici nei database relazionali attraverso gerarchie di query
DISARO', ALESSANDRO
2025/2026
Abstract
The use of Large Language Models (LLMs) in semantic operators makes it possible to query unstructured content through conditions expressed in natural language, but it also introduces high execution costs. This thesis investigates the reuse of results from previously executed semantic queries in the case of two hierarchically related queries, where a broader query Q1 has already been evaluated and a more specific query Q2 must be executed over the same items. Two strategies are analyzed. Q1-Context uses the prediction produced for Q1 as additional information during the execution of Q2, while Q1-Filter uses the result of Q1 to directly exclude part of the input from the second query. The two strategies are evaluated within the LOTUS model cascade on a benchmark built from 1,758 ACM research papers and 14 query pairs derived from the hierarchy of the ACM Computing Classification System. The results show that Q1-Context reduces main-model calls by 36.9% on average, but provides a more limited benefit in terms of total cost and shifts the system toward higher precision and lower recall. Q1-Filter instead achieves a larger and more systematic reduction, decreasing main-model calls by 76.7% and the total cost of Q2 by 70.4%, at the cost of a greater recall loss. For this strategy, an end-to-end lower bound on recall is also derived. Overall, the thesis shows that the results of semantically related queries can be a useful resource for optimizing subsequent queries, but that the achievable benefit and the resulting cost-quality trade-off strongly depend on the reuse strategy adopted and on the specific query pair being considered.| File | Dimensione | Formato | |
|---|---|---|---|
|
Disarò_Alessandro.pdf
accesso aperto
Dimensione
1.64 MB
Formato
Adobe PDF
|
1.64 MB | Adobe PDF | Visualizza/Apri |
The text of this website © Università degli studi di Padova. Full Text are published under a non-exclusive license. Metadata are under a CC0 License
https://hdl.handle.net/20.500.12608/112992