Natural Language to Logica: Towards Interactive and Explainable Data Analytics
- Ojaswa Garg,
- Shayan Mirjafari,
- Yilin Xia,
- ,
- Bertram Ludäscher,
- Evgeny Skvortsov(corresponding author)
- Google LLC,
- University of Illinois Urbana-Champaign,
Abstract
We propose to make data analysis more accessible and verifiable by generating Logica programs from natural language queries. Logica, a logic programming language that compiles to (embedded) SQL, combines the clarity of declarative logic rules with the scalability of robust SQL engines. We evaluate the translation of natural language to Logica using the Spider 1.0 SQL benchmark, demonstrating that Gemini 2.5 achieves accuracy comparable to the leading SQL generators. We also explore a 2-step translation via intermediate LogicLM configurations, i.e., using OLAP-style measures, dimensions, and filters. These configurations serve as another explainable intermediate layer that domain experts can easily validate, even with limited or no SQL, OLAP or logic programming experience. Our analysis reveals that approximately half of the Spider 1.0 queries can be expressed as OLAP queries with our approach. By employing Logica as an intermediate layer (rather than generating SQL directly), we create a transparent and verifiable path to database queries from natural language.
Bibliographic Information
Output type
Original language
EnglishPages from-to (Number of pages)
Pages 165-179 (15 pages)Publication milestones
- Published - 2026
Publication status
Publisher
Springer Science and Business Media Deutschland GmbHPublication series
- Publication series name: Lecture Notes in Computer Science
ISSN (Print): 0302-9743
ISSN (Electronic): 1611-3349
Volume: 16117 LNCS
ISBN (Print)
9783032048479Publication IDs
- Scopus: 105016663041
Host publication title
Logic-Based Program Synthesis and Transformation - 35th International Symposium, LOPSTR 2025, ProceedingsHost publication editors
- Santiago Escobar
- Laura Titolo
