Logic.py: Bridging the Gap between LLMs and Constraint Solvers
Not on the map. Why?
Abstract (arXiv)
We present a novel approach to formalise and solve search-based problems using large language models, which significantly improves upon previous state-of-the-art results. We demonstrate the efficacy of this approach on the logic puzzles benchmark ZebraLogicBench. Instead of letting the LLM attempt to directly solve the puzzles, our method prompts the model to formalise the problem in a logic-focused domain-specific language (DSL) called Logic.py. This formalised representation is then solved using a constraint solver, leveraging the strengths of both the language model and the solver. Our approach achieves a remarkable 65% absolute improvement over the baseline performance of Llama 3.1 70B on ZebraLogicBench, setting a new state-of-the-art with an accuracy of over 90%. This significant advancement demonstrates the potential of combining language models with domain-specific languages and auxiliary tools on traditionally challenging tasks for LLMs.
Key facts. Cited by 9 papers in the map (data through 14 Oct 2026). Builds on 4 of its 20 references that are in the map. First posted on arXiv 17 Feb 2025.
Builds on
4 of 20 references.
References · 4
- 2023Logic-LM: Empowering Large Language Models with Symbolic Solvers for Faithful Logical Reasoningcited by 391
- 2022FOLIO: Natural Language Reasoning with First-Order Logiccited by 235
- 2023SatLM: Satisfiability-Aided Language Models Using Declarative Promptingcited by 102
- 2024Solving Zebra Puzzles Using Constraint-Guided Multi-Agent Systemscited by 4
Built on by
Citing papers per year: 2025: 5; 2026: 4.
9 papers.
- 2025A Survey of Scientific Large Language Models: From Data Foundations to Agent Frontierscited by 37
- 2025VLHSA: Vision-Language Hierarchical Semantic Alignment for Jigsaw Puzzle Solving with Eroded Gapscited by 4
- 2025Towards Verified Code Reasoning by LLMscited by 4
- 2026LLM-Guided Quantified SMT Solving over Uninterpreted Functionscited by 3
- 2025Investigating Language Model Capabilities to Represent and Process Formal Knowledge: A Preliminary Study to Assist Ontology Engineeringcited by 2
- 2026VeryTrace: Verifying Reasoning Traces through Compilable Formalism and Structured Verificationcited by 1
- 2025From Benchmark Data To Applicable Program Repair: An Experience Reportcited by 0
- 2026Text2Model: Modeling Copilots for Text-to-Model Translationcited by 0
- 2026Improving Natural-Language Combinatorial-Optimization Accuracy in Resource-Constrained Language Models via Formal Abstractionscited by 0
- 2026Improving Natural-Language Combinatorial-Optimization Accuracy in Resource-Constrained Language Models via Formal Abstractions19 Aug 2026
- 2026VeryTrace: Verifying Reasoning Traces through Compilable Formalism and Structured Verification23 Jun 2026
- 2026Text2Model: Modeling Copilots for Text-to-Model Translation14 Apr 2026
- 2026LLM-Guided Quantified SMT Solving over Uninterpreted Functions8 Jan 2026
- 2025Towards Verified Code Reasoning by LLMs30 Sep 2025
- 2025VLHSA: Vision-Language Hierarchical Semantic Alignment for Jigsaw Puzzle Solving with Eroded Gaps17 Sep 2025
- 2025Investigating Language Model Capabilities to Represent and Process Formal Knowledge: A Preliminary Study to Assist Ontology Engineering12 Sep 2025
- 2025A Survey of Scientific Large Language Models: From Data Foundations to Agent Frontiers28 Aug 2025
- 2025From Benchmark Data To Applicable Program Repair: An Experience Report22 Aug 2025