Are Diffusion Language Models Good Database Analysts?

Peixian Ma, Xialie Zhuang, Jiantao Tan, Changlun Li, Ruirui Chen, Chengwei Qin · 2026

Read Are Diffusion Language Models Good Database Analysts? by Peixian Ma, Xialie Zhuang, Jiantao Tan, Changlun Li, Ruirui Chen, Chengwei Qin (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-27791.txt.

Introduction

Peixian Ma and colleagues study whether diffusion language models make good database analysts for natural language to SQL. Their SQL-D1 system joins database-aware lookup, multi-path denoising, run-guided checks, and choice by run results. Strong diffusion models rival some open-source autoregressive models and trade speed against quality at will, though they trail the strongest autoregressive systems on hard queries.

Catalog record

CREATORPeixian Ma, Xialie Zhuang, Jiantao Tan, Changlun Li, Ruirui Chen, Chengwei Qin
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE53912
LICENSEhttp://creativecommons.org/licenses/by-sa/4.0/
RIGHTSCC BY SA
SOURCEarXiv

Source: https://arxiv.org/abs/2605.27791

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

Are Diffusion Language Models Good Database Analysts? Peixian Ma, Xialie Zhuang, Jiantao Tan, Changlun Li, Ruirui Chen, Chengwei Qin Abstract Recent advancements in large language models (LLMs) have significantly improved Natural Language to SQL (NL2SQL) tasks, yet most NL2SQL systems continue to rely on the autoregressive (AR) paradigm. The highly structured nature of SQL makes AR models susceptible to sequential error propagation due to their rigid left-to-right decoding process. Diffusion Language Models (DLMs) have recently emerged as a promising alternative, replacing unidirectional decoding with iterative denoising to enable global sequence refinement. Nevertheless, the adoption of DLMs in NL2SQL is constrained by a fragmented ecosystem and the absence of a standardized evaluation framework, which obscures their true capabilities and impedes fair comparison with AR baselines. In this paper, we propose a unified evaluation framework that standardizes both generation and execution environments across various DLM architectures. To further improve the performance of DLMs-based NL2SQL systems, we propose SQL-D1 , a novel agentic framework that integrates database-aware context engineering, test-time scaling and interactive optimization. Through extensive empirical studies on scaling properties, post-training stability, and primary failure modes, we demonstrate that DLMs offer distinct advantages in structural robustness and facilitate flexible trade-offs between efficiency and accuracy. By distilling these insights into structured takeaways, our work provides a systematic understanding of DLMs-based NL2SQL and lays the foundation for future database analysis agents. 1 Introduction Figure 1: Demonstration of our work. Unlike AR models that suffer from sequential error propagation and cumulative latency, DLMs utilize iterative denoising to globally refine SQL sequences, enabling flexible efficiency-accuracy trade-offs for database reasoning. Natural Language to SQL (NL2SQL) serves as a crucial bridge for evaluating the database analysis capabilities of language models ( 23 ; 12 ) . While recent progress driven by large language models (LLMs) has significantly enhanced generation accuracy and schema comprehension ( 9 ; 17 ; 35 ; 25 ) , these systems primarily rely on the autoregressive (AR) paradigm. Given that SQL is a highly structured and non-linear language, the rigid left-to-right decoding process of AR models makes them particularly susceptible to sequential error propagation. Errors introduced early in the generation process often accumulate throughout the sequence. The lack of mechanisms for global structural revision ultimately limits the effectiveness of AR models in performing complex database analysis tasks. Recently, diffusion language models (DLMs) have emerged as a promising paradigm that addresses the sequential limitations inherent in AR models ( 21 ; 1 ; 33 ) . As shown in Figure 1 , DLMs replace unidirectional decoding with an iterative denoising process, enabling global refinement of sequence representations through multiple parallelizable steps. This generation mechanism aligns with the structural requirements of NL2SQL by allowing models to simultaneously identify and correct semantic inconsistencies and structural grounding errors across the entire query. Leading DLMs ( 32 ; 22 ; 52 ; 3 ; 2 ) have demonstrated performance comparable to LLMs in mathematics and code generation. Consequently, a systematic investigation into whether these models can effectively address structural challenges in database reasoning represents a significant research direction. Despite this considerable potential, the application of DLMs to the NL2SQL domain is currently hindered by the absence of a standardized evaluation infrastructure. The DLM ecosystem remains highly fragmented, encompassing divergent methodologies such as discrete diffusion, continuous diffusion, and mask reconstruction. These approaches are associated with different training objectives, decoding procedures, and sampling strategies. This heterogeneity creates a substantial methodological gap, preventing equitable and quantitative comparisons among various diffusion architectures and traditional AR baselines. It also impedes the direct adaptation of established AR-centric enhancement techniques to the diffusion paradigm. Therefore, without unified evaluation protocols and a specialized integration framework, the true capability boundaries and practical viability of DLMs for structured database analysis remain unclear. To address these challenges and research gaps, we aim to answer the following research questions: • Q1: How do DLMs perform relative to LLMs in NL2SQL tasks? • Q2: How can we improve performance of DLMs in NL2SQL tasks? • Q3: What are the distinctive failure modes and scaling behaviors of DLMs in structured generation? Takeaways. In summary, our work makes the following contributions and provides takeaways: (i) DLMs demonstrate highly competitive performance and structural robustness in database analysis tasks. Advanced DLM models, such as LLaDA2.1-mini, achieve state-of-the-art execution accuracy among non-autoregressive models, surpassing comparable autoregressive baselines. (ii) DLMs demonstrate significant performance improvements through test-time scaling and provide a flexible balance between computational efficiency and accuracy. (iii) Agentic coordination effectively unleashes the latent potential of DLMs, driving substantial accuracy gains across primary benchmarks. (iv) Supervised fine-tuning methods exhibit instability when applied to DLMs on NL2SQL tasks, leading to inconsistent performance gains. (v) Scaling up model size substantially reduces grounding errors in conditions and tables. However, structural errors in complex clauses and query nesting persist across various diffusion architectures. Contributions. In summary, our work makes the following contributions and provides takeaways: (i) Unified NL2SQL evaluation framework across diverse DLMs: We establish a unified evaluation framework for DLM-based NL2SQL, defining rigorous protocols for cross-benchmark comparison. This standardization enables a systematic, quantitative assessment of DLM capability boundaries in structured database analysis under consistent generation and execution environments. (ii) Agentic DLM-based NL2SQL system: We introduce SQL-D1 , a novel synthesis framework that integrates database-aware context engineering, test-time scaling, and agentic optimization to enable more robust and effective NL2SQL reasoning with DLMs. (iii) Empirical analysis and takeaways of DLM-based NL2SQL: We provide critical insights into the test-time scaling potential, post-training instability, and primary failure modes of DLMs, formalizing structured takeaways that characterize the efficiency-accuracy trade-offs and structural robustness of diffusion architectures. 2 Methodology Figure 2: Overview of our work. We propose a unified evaluation framework for DLMs-based NL2SQL systems, which consists three main modules. Notably, we propose two main generation strategies in inference pipeline: (i) model-based generation; (ii) agentic generation ( SQL-D1 ). 2.1 Overview As illustrated in Figure 2 , the unified evaluation framework standardizes interactions among users, databases, and heterogeneous DLM architectures through three integrated modules. The system employs a dual-track inference pipeline supporting both direct model-based generation and a structured agentic workflow comprising retrieval, generation, verification, and selection. The process concludes with a comprehensive evaluation engine that performs functional verification via SQL execution and provides fine-grained diagnostic analysis of error typologies. 2.2 SQL-D1 : Agentic NL2SQL with DLMs The design of SQL-D1 draws inspiration from the recent success of agentic architectures in LLM-based systems ( 35 ; 43 ; 44 ) , which demonstrate that multi-agent coordination can overcome the limitations of monolithic inference. This paradigm is extended to DLMs by integrating database-specific context techniques, such as database content retrieval, to assess whether agentic enhancements can effectively ground diffusion dynamics in structured data environments. SQL-D1 is organized as a four-stage pipeline that decomposes the NL2SQL task into specialized modules for retrieval, generation, verification, and selection. This framework enables systematic exploration of the SQL solution space while maintaining semantic precision through iterative refinement and robust aggregation. Retriever A_{r} . The Retriever serves as the primary interface between the natural language questions and the structured database. Its core responsibility is to organize the database schema and perform content retrieval to extract relevant column values, thereby constructing a high-fidelity input context. By

Read the complete text