LLMs as ASP Programmers: Self-Correction Enables Task-Agnostic Nonmonotonic Reasoning

arXiv cs.AI / 5/1/2026

📰 NewsSignals & Early TrendsIdeas & Deep AnalysisModels & Research

Key Points

  • The paper introduces “LLM+ASP,” a framework that converts natural-language inputs into Answer Set Programming (ASP) to support nonmonotonic reasoning, which better matches defeasible (default-with-exception) human-like logic than monotonic approaches.
  • Unlike earlier LLM+ASP methods that depend on manually crafted knowledge modules, domain-specific prompts, or narrow evaluation, this approach aims to work task-agnostically with no per-task engineering.
  • The system’s key mechanism is an automated self-correction loop: structured feedback from an ASP solver iteratively guides the LLM to refine its outputs.
  • Experiments across six benchmarks indicate that stable model semantics improve performance on nonmonotonic tasks versus SMT-based baselines, and that self-correction is the main contributor to gains.
  • The results also find that compact in-context reference guides outperform long, verbose documentation due to a “context rot” effect where excessive context reduces adherence to constraints.

Abstract

Recent large language models (LLMs) have achieved impressive reasoning milestones but continue to struggle with high computational costs, logical inconsistencies, and sharp performance degradation on high-complexity problems. While neuro-symbolic methods attempt to mitigate these issues by coupling LLMs with symbolic reasoners, existing approaches typically rely on monotonic logics (e.g., SMT) that cannot represent defeasible reasoning -- essential components of human cognition. We present "LLM+ASP," a framework that translates natural language into Answer Set Programming (ASP), a nonmonotonic formalism based on stable model semantics. Unlike prior "LLM+ASP" approaches that require manually authored knowledge modules, domain-specific prompts, or evaluation restricted to single problem classes, our framework operates without any per-task engineering and applies uniformly across diverse reasoning tasks. Our system utilizes an automated self-correction loop where structured feedback from the ASP solver enables iterative refinement. Evaluating across six diverse benchmarks, we demonstrate that: (1) stable model semantics allow LLMs to naturally express default rules and exceptions, outperforming SMT-based alternatives by significant margins on nonmonotonic tasks; (2) iterative self-correction is the primary driver of performance, effectively replacing the need for handcrafted domain knowledge; (3) compact in-context reference guides substantially outperform verbose documentation, revealing a "context rot" phenomenon where excessive context hinders constraint adherence.