SqlLocal-Reasoning: Offline Speculative-Decoding Text-to-SQL with a Queryable Data Platform

Generating executable SQL from natural-language analytical questions against local, often messy, spreadsheet-scale data imposes a significant burden on non-programmers and introduces privacy and cost risks when delegated to cloud APIs. This paper presents SqlLocal-Reasoning, a fully offline text-to-SQL system that couples three mechanisms: (i) verification-mode speculative decoding, in which a 1.5 B-parameter draft model proposes tokens that an 8 B-parameter reasoning model verifies in a fixed sliding window, preserving target quality while cutting verifier forward passes by up to 2.96× (achieving a 3.03× mean speedup at window size 8); (ii) schema-aware retrieval, which embeds crawled schema columns and recalls only question-relevant columns, bounding prompt length for wide schemas; and (iii) a declarative quality gate that parses each proposal with SQLGlot, enforces read-only intent, and dry-runs every statement against the live engine via EXPLAIN over a bounded Least Recently Used (LRU) read-only connection pool prior to release. Distinct from prior art, the system is data-platform-first: it activates DuckDB, SQLite, and Excel workbooks at runtime—materialising sheets into a cached relational store—and provides lossless import/export across five formats (CSV, TXT, XML, JSON, and SQL), alongside self-contained HTML reports with inline SVG charts. Following an autoresearch-style empirical evaluation across seven measurement tracks (24 pass/fail gates) and remediation of six structural defects, SqlLocal-Reasoning achieves 100% text-to-SQL execution accuracy (10/10 intent classes), 100% read-only safety recall with 0.0% false positives, 5/5 lossless round-trip data transfers, and sub-5 ms median operation latencies (1.99 ms validation, 4.77 ms execution) with a 514 ms cold start on commodity laptop hardware with zero GPU or network access.

Authors

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-18
DOI
https://doi.org/10.5281/zenodo.24332155
Primary Topic
Natural Language Processing Techniques
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
NOV
article

SqlLocal-Reasoning: Offline Speculative-Decoding Text-to-SQL with a Queryable Data Platform

Shaik Raheem, SAI KARUN NANDIPATI, K Neelima
2 links
Zenodo (CERN European Organization for Nuclear Research)
Natural Language Processing Techniques
article

SqlLocal-Reasoning: Offline Speculative-Decoding Text-to-SQL with a Queryable Data Platform

Shaik Raheem, SAI KARUN NANDIPATI, K Neelima
article en

Abstract

Generating executable SQL from natural-language analytical questions against local, often messy, spreadsheet-scale data imposes a significant burden on non-programmers and introduces privacy and cost risks when delegated to cloud APIs. This paper presents SqlLocal-Reasoning, a fully offline text-to-SQL system that couples three mechanisms: (i) verification-mode speculative decoding, in which a 1.5 B-parameter draft model proposes tokens that an 8 B-parameter reasoning model verifies in a fixed sliding window, preserving target quality while cutting verifier forward passes by up to 2.96× (achieving a 3.03× mean speedup at window size 8); (ii) schema-aware retrieval, which embeds crawled schema columns and recalls only question-relevant columns, bounding prompt length for wide schemas; and (iii) a declarative quality gate that parses each proposal with SQLGlot, enforces read-only intent, and dry-runs every statement against the live engine via EXPLAIN over a bounded Least Recently Used (LRU) read-only connection pool prior to release. Distinct from prior art, the system is data-platform-first: it activates DuckDB, SQLite, and Excel workbooks at runtime—materialising sheets into a cached relational store—and provides lossless import/export across five formats (CSV, TXT, XML, JSON, and SQL), alongside self-contained HTML reports with inline SVG charts. Following an autoresearch-style empirical evaluation across seven measurement tracks (24 pass/fail gates) and remediation of six structural defects, SqlLocal-Reasoning achieves 100% text-to-SQL execution accuracy (10/10 intent classes), 100% read-only safety recall with 0.0% false positives, 5/5 lossless round-trip data transfers, and sub-5 ms median operation latencies (1.99 ms validation, 4.77 ms execution) with a 514 ms cold start on commodity laptop hardware with zero GPU or network access.

Zenodo (CERN European Organization for Nuclear Research)
Natural Language Processing Techniques
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon