paper-with-me

홈 › Papers

LLM-SQL-Solver: Can LLMs Determine SQL Equivalence?

2023-12-16 · Fuheng Zhao, Jiayue Chen, Lawrence Lim, Ishtiyaque Ahmad, Divyakant Agrawal, Amr El Abbadi

Judging the equivalence between two SQL queries is a fundamental problem with many practical applications in data management and SQL generation (i.e., evaluating the quality of generated SQL queries in text-to-SQL task). While the research community has reasoned about SQL equivalence for decades, it poses considerable difficulties and no complete solutions exist. Recently, Large Language Models (LLMs) have shown strong reasoning capability in conversation, question answering and solving mathematics challenges. In this paper, we study if LLMs can be used to determine the equivalence between SQL queries under two notions of SQL equivalence (semantic equivalence and relaxed equivalence). To assist LLMs in generating high quality responses, we present two prompting techniques: Miniature & Mull and Explain & Compare. The former technique is used to evaluate the semantic equivalence in which it asks LLMs to execute a query on a simple database instance and then explore if a counterexample exists by modifying the database. The latter technique is used to evaluate the relaxed equivalence in which it asks LLMs to explain the queries and then compare if they contain significant logical differences. Our experiments demonstrate using our techniques, LLMs is a promising tool to help data engineers in writing semantically equivalent SQL queries, however challenges still persist, and is a better metric for evaluating SQL generation than the popular execution accuracy.

📄 PDF Abstract BibTeX arXiv:2312.10321

Code (1)

ZhaoFuheng/LLM-SQL-Solver 공식 구현

Tasks

Question AnsweringText to SQLText-To-SQL

Similar Papers 제목 키워드 기반

ORGEval: Graph-Theoretic Evaluation of LLMs in Optimization Modeling

2025-10-31 · Zhuohan Wang, Ziwei Zhu, Ziniu Li, Congliang Chen 외 arxiv

Formulating optimization problems for industrial applications demands significant manual effort and domain expertise. While Large Language Models (LLMs) show promise in automating this process, evaluating their performan…

Strong Equivalence in Answer Set Programming with Constraints

2025-02-06 · Pedro Cabalar, Jorge Fandinno, Torsten Schaub, Philipp Wanko

We investigate the concept of strong equivalence within the extended framework of Answer Set Programming with constraints. Two groups of rules are considered strongly equivalent if, informally speaking, they have the sam…

Translation

EquivaMap: Leveraging LLMs for Automatic Equivalence Checking of Optimization Formulations

2025-02-20 · Haotian Zhai, Connor Lawless, Ellen Vitercik, Liu Leqi

A fundamental problem in combinatorial optimization is identifying equivalent formulations. Despite the growing need for automated equivalence checks -- driven, for example, by optimization copilots, which generate probl…

Combinatorial Optimizationvalid

On Neural Network Equivalence Checking using SMT Solvers

2022-03-22 · Charis Eleftheriadis, Nikolaos Kekatos, Panagiotis Katsaros, Stavros Tripakis

Two pretrained neural networks are deemed equivalent if they yield similar outputs for the same inputs. Equivalence checking of neural networks is of great importance, due to its utility in replacing learning-enabled com…

Knowledge Distillation

Beyond Solver Verdicts: Generative Reward Models for Autoformalization

2026-09-10 · Vikash Singh, Debargha Ganguly, Aman Goel, Ali Torkamani 외 hf

Neurosymbolic systems rely on mathematical solvers to guarantee reasoning correctness, yet solvers are fundamentally blind to whether a formal translation maintains strict reference-equivalence to a designated formalizat…