ICASSP 2025accepted0 citations

VisQ2SQL: Towards SQL-Driven Data Visualization via LLMs-Grounded Preference Learning

Shengze Shi, Tao Ren, Jun Hu

Abstract

Text-to-Visualization (Text2Vis) aims to democratize data insights for non-expert users by transforming natural language query (NLQ) into visualization specification (VS). In view of the high dependence of rule-based methods on predefined VS templates and poor NLQ understanding ability of small data-driven methods, recent works resort to leveraging pre-trained LLMs to perform NLQ-understanding and VS-generating in Text2Vis tasks via prompt-guided in-context learning. However, existing LLM-based methods still fall short of satisfactory end-to-end Text2Vis performances primarily owing to the limited ability of pre-trained LLMs in directly retrieving and operating NLQ-intended tabular data. Inspired by the SQL generating ability born with latest LLMs, this paper proposes the idea of harnessing LLMs for SQL-driven visualization data retrieval and operation. Nonetheless, there remains a nonneglectable gap between data visualization queries in Text2Vis tasks and SQL retrieving queries in LLM corpus. To fill the gap, this paper proposes a Visualization Query to SQL (VisQ2SQL) framework to obtain NLQ-intended data, primarily by fine-tuning LLMs through preference learning data-retrieval SQLs induced from VS and those generated by LLMs. We conduct extensive experiments to demonstrate the superiority of VisQ2SQL over SOTA methods, and various ablation studies to verify the efficacy of VisQ2SQL.

BibTeX
@inproceedings{icassp2025_visq2sqltowardss,
  title = {VisQ2SQL: Towards SQL-Driven Data Visualization via LLMs-Grounded Preference Learning},
  author = {Shengze Shi and Tao Ren and Jun Hu},
  booktitle = {ICASSP 2025},
  year = {2025}
}
VisQ2SQL: Towards SQL-Driven Data Visualization via LLMs-Grounded Preference Learning · ICASSP 2025