A Solver-in-the-Loop Framework for Improving LLMs on Answer Set Programming for Logic Puzzle Solving

Publikation: Beitrag in Buch/Konferenzbericht/Sammelband/GutachtenBeitrag in KonferenzbandBeigetragenBegutachtung

Beitragende

Abstract

The rise of large language models (LLMs) has sparked interest in coding assistants. While general-purpose programming languages are well supported, generating code for domainspecific languages remains a challenging problem for LLMs. In this paper, we focus on the LLM-based generation of code for Answer Set Programming (ASP), a particularly effective approach for finding solutions to combinatorial search problems. The effectiveness of LLMs in ASP code generation is currently hindered by the limited number of examples seen during their initial pre-training phase. In this paper, we introduce a novel ASP-solver-in-the-loop approach for solver-guided instruction-tuning of LLMs to addressing the highly complex semantic parsing task inherent in ASP code generation. Our method only requires problem specifications in natural language and their solutions. Specifically, we sample ASP statements for program continuations from LLMs for unriddling logic puzzles. Leveraging the special property of declarative ASP programming that partial encodings increasingly narrow down the solution space, we categorize them into chosen and rejected instances based on solver feedback. We then apply supervised fine-tuning to train LLMs on the curated data and further improve robustness using a solver-guided search that includes best-of-N sampling. Our experiments demonstrate consistent improvements in two distinct prompting settings on two datasets.

Details

OriginalspracheEnglisch
TitelProceedings of the AAAI Conference on Artificial Intelligence
Redakteure/-innenSven Koenig, Chad Jenkins, Matthew E. Taylor
Herausgeber (Verlag)Association for the Advancement of Artificial Intelligence
Seiten25226-25234
Seitenumfang9
PublikationsstatusVeröffentlicht - März 2026
Peer-Review-StatusJa

Publikationsreihe

ReiheProceedings of the AAAI Conference on Artificial Intelligence
Nummer30
Band40
ISSN2159-5399

Konferenz

Titel40th AAAI Conference on Artificial Intelligence
KurztitelAAAI 2026
Veranstaltungsnummer40
Dauer20 - 27 Januar 2026
Webseite
OrtSingapore EXPO
StadtSingapore
LandSingapur

Externe IDs

ORCID /0000-0002-5410-218X/work/215836166

Schlagworte

ASJC Scopus Sachgebiete