Sandor Kruk
Data Scientist at ESA's European Space Astronomy Centre (ESAC) in Spain, where I work on AI and data science solutions for space science. I support the Euclid mission through the development of data analysis tools and science platforms.
Session
Generating database queries from natural language remains a challenging task, particularly in specialized scientific domains. In this work, we study natural language to Astronomical Data Query Language (ADQL) generation using large language models (LLMs). We curate a high-quality dataset of natural language–ADQL pairs through an LLM-assisted filtering and validation pipeline and use it to fine-tune models of varying sizes and capabilities. To enable systematic evaluation, we construct an expert-annotated benchmark of queries for the Gaia mission, spanning a range of query complexities, from simple retrieval tasks to complex joins and aggregations. Finally, we compare fine-tuned models against retrieval-augmented generation (RAG) approaches, analyzing their effectiveness in terms of query correctness and robustness. Our results provide insights into the relative strengths of fine-tuning and retrieval augmentation for domain-specific scientific query generation.