text2ql: Multi-Target Natural Language Querying via a Language-Agnostic Intermediate Representation
- URL: http://arxiv.org/abs/2609.02115v1
- Date: Wed, 02 Sep 2026 05:09:51 GMT
- Title: text2ql: Multi-Target Natural Language Querying via a Language-Agnostic Intermediate Representation
- Abstract summary: This paper presents text2ql, an open-source Python architecture for natural language interfaces.<n>It addresses three structural limitations of natural language interfaces to databases.<n>It is based on a language-agnostic Intermediate Representation (QueryIR) architecture.
- Score: 0.9927219503124457
- License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
- Abstract: Natural language interfaces to databases have traditionally suffered from three structural limitations: exclusive targeting of relational SQL, unconditional dependence on large language model (LLM) inference at query time, and absence of any runtime signal when generated queries are semantically incorrect. This paper presents text2ql, an open-source Python framework that addresses all three limitations through a language-agnostic Intermediate Representation (QueryIR) and a pluggable renderer architecture. A single seven-stage detection pipeline serves both SQL and GraphQL targets; a zero-LLM deterministic mode delivers 100% execution accuracy at a median latency of 3.2 ms with no API cost; and every generated query carries a runtime confidence score in [0.15, 0.97] computed from an additive signal model. Evaluated on 50-query random samples from the Spider and BIRD benchmarks (indicative results; full-set evaluation is planned), the LLM-backed mode achieves 62-70% exact match and 84-91% execution accuracy; the deterministic mode achieves 100% execution accuracy with zero parse errors across all 100 test cases. An ablation study isolates schema-aware prompting as the dominant accuracy lever, contributing +18.4 percentage points of exact-match gain over the schema-free baseline on both benchmarks. text2ql is publicly available at https://pypi.org/project/text2ql/ under the Apache 2.0 license.
Related papers
- Natural Language Knowledge Graph Query Execution: Leveraging Controlled Semantics in the LLM Context Window [0.0]
We show that for database queries, data model concepts pass to LLMs more effectively through representations whose vocabulary terms carry declared, machine-readable semantics.<n> NLKGQ is a working system and reusable framework that does this for data modeled in a knowledge graph.<n>We evaluate on the DBLP-QuAD 2.0 benchmark (57.6% Match under deterministic re-scoring), DBLP-QuAD 3.1 (89.9% Match on 1,000 questions), SemOpenAlex (98% Match against a published baseline's 86% on the identical test set)
arXiv Detail & Related papers (2026-09-13T16:36:40Z) - Constrained Decoding for Diffusion Language Models via Efficient Inference over Finite Automata [57.27430779838529]
We present an exact and tractable algorithm for sampling from the constrained mean-field posterior under any constraint expressible as a finite automaton.<n>The approach guarantees constraint satisfaction by construction, supports both greedy and sampling-based decoding, and is compatible with parallel and block-wise decoding.<n> Empirical evaluations on Dream-7B and LLaDA-8 show substantial accuracy gains across various tasks.
arXiv Detail & Related papers (2026-07-08T05:48:57Z) - What Predicts Correctness in Text-to-SQL? A Selective-Prediction Study [0.0]
We use AUROC to measure how well each ranks correct queries above incorrect ones.<n>On BIRD and Spider, black-box signals such as string, structural, and execution self-consistency, a schema-relevance score, and query executability all fall between about 0.61 and 0.68 AUROC.<n>We ask whether a verifier can be trained. Fine-tuned verifiers, both encoder and generative, reach about 0.77 to 0.79 AUROC in-distribution but fall to about 0.66 on unseen schemas.
arXiv Detail & Related papers (2026-07-07T20:52:58Z) - Spider 2.0-AIFunc: Extending Real-World Text-to-SQL to AI-Native SQL Workflows [54.49251107006261]
We introduce Spider 2.0-AIFunc, a benchmark of 465 verified instances across 125 real-world databases covering six types of AI functions on the Snowflake platform.<n>We find that the strongest proprietary models reach 67-70% execution accuracy while the best open-source model achieves 58.1%.
arXiv Detail & Related papers (2026-07-07T12:54:08Z) - ProSPy: A Profiling-Driven SQL-Python Agentic Framework for Enterprise Text-to-SQL [51.98164069124653]
ProSPy is a Profiling-driven framework for enterprise-scale Text-to-gnostic analysis.<n>ProSPy structures the reasoning process into four stages.<n>It first extracts fine-grained data evidence through automatic profiling.<n>It prunes large schemas into task-relevant contexts.
arXiv Detail & Related papers (2026-06-04T08:13:05Z) - Text2GQL-Bench: A Text to Graph Query Language Benchmark [Experiment, Analysis & Benchmark] [16.678372445240957]
Text-to-Graph-Query-Language (Text-to-GQL) systems act as a translator, converting natural language into executable graph queries.<n>Existing datasets are often limited in domain coverage, supported graph query languages, or evaluation scope.<n>We present Text2GQL-Bench, a unified Text-to-GQL benchmark designed to address these limitations.
arXiv Detail & Related papers (2026-02-12T09:16:44Z) - Query Carefully: Detecting the Unanswerables in Text-to-SQL Tasks [1.7781743265224403]
Text-to- systems allow non- experts to interact with databases using natural language.<n>Their tendency to generate executablesql for ambiguous, out-of-scope, or unanswerable queries introduces a hidden risk, as outputs may be misinterpreted as correct.<n>We present Query, a pipeline that integratessql generation with explicit ambiguity and handling of unanswerable inputs.
arXiv Detail & Related papers (2025-12-19T12:22:27Z) - A Multi-Language Object-Oriented Programming Benchmark for Large Language Models [61.267115598083315]
A survey of 35 existing benchmarks uncovers three major imbalances.<n>85.7% focus on a single programming language.<n>94.3% target only function-level or statement-level tasks.<n>Over 80% include fewer than ten test cases on average.
arXiv Detail & Related papers (2025-09-30T11:30:08Z) - Evaluating NL2SQL via SQL2NL [45.88028371034407]
New framework generates semantically equivalent, lexically diverse queries.<n>State-of-the-art models are far more brittle than standard benchmarks suggest.
arXiv Detail & Related papers (2025-09-04T21:03:59Z) - UNITE: A Unified Benchmark for Text-to-SQL Evaluation [72.72040379293718]
We introduce a UNIfied benchmark for Text-to-domain systems.
It is composed of publicly available text-to-domain datasets and 29K databases.
Compared to the widely used Spider benchmark, we introduce a threefold increase in SQL patterns.
arXiv Detail & Related papers (2023-05-25T17:19:52Z) - Improving Text-to-SQL Semantic Parsing with Fine-grained Query
Understanding [84.04706075621013]
We present a general-purpose, modular neural semantic parsing framework based on token-level fine-grained query understanding.
Our framework consists of three modules: named entity recognizer (NER), neural entity linker (NEL) and neural entity linker (NSP)
arXiv Detail & Related papers (2022-09-28T21:00:30Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.