Logic-of-Thought: Empowering Large Language Models with Logic Programs for Solving Puzzles in Natural Language

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Li, Naiqi, Liu, Peiyuan, Liu, Zheng, Dai, Tao, Jiang, Yong, Xia, Shu-Tao
Formato: Preprint
Publicado: 2025
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866912386662793216
author Li, Naiqi
Liu, Peiyuan
Liu, Zheng
Dai, Tao
Jiang, Yong
Xia, Shu-Tao
author_facet Li, Naiqi
Liu, Peiyuan
Liu, Zheng
Dai, Tao
Jiang, Yong
Xia, Shu-Tao
contents Solving puzzles in natural language poses a long-standing challenge in AI. While large language models (LLMs) have recently shown impressive capabilities in a variety of tasks, they continue to struggle with complex puzzles that demand precise reasoning and exhaustive search. In this paper, we propose Logic-of-Thought (Logot), a novel framework that bridges LLMs with logic programming to address this problem. Our method leverages LLMs to translate puzzle rules and states into answer set programs (ASPs), the solution of which are then accurately and efficiently inferred by an ASP interpreter. This hybrid approach combines the natural language understanding of LLMs with the precise reasoning capabilities of logic programs. We evaluate our method on various grid puzzles and dynamic puzzles involving actions, demonstrating near-perfect accuracy across all tasks. Our code and data are available at: https://github.com/naiqili/Logic-of-Thought.
format Preprint
id arxiv_https___arxiv_org_abs_2505_16114
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Logic-of-Thought: Empowering Large Language Models with Logic Programs for Solving Puzzles in Natural Language
Li, Naiqi
Liu, Peiyuan
Liu, Zheng
Dai, Tao
Jiang, Yong
Xia, Shu-Tao
Artificial Intelligence
Solving puzzles in natural language poses a long-standing challenge in AI. While large language models (LLMs) have recently shown impressive capabilities in a variety of tasks, they continue to struggle with complex puzzles that demand precise reasoning and exhaustive search. In this paper, we propose Logic-of-Thought (Logot), a novel framework that bridges LLMs with logic programming to address this problem. Our method leverages LLMs to translate puzzle rules and states into answer set programs (ASPs), the solution of which are then accurately and efficiently inferred by an ASP interpreter. This hybrid approach combines the natural language understanding of LLMs with the precise reasoning capabilities of logic programs. We evaluate our method on various grid puzzles and dynamic puzzles involving actions, demonstrating near-perfect accuracy across all tasks. Our code and data are available at: https://github.com/naiqili/Logic-of-Thought.
title Logic-of-Thought: Empowering Large Language Models with Logic Programs for Solving Puzzles in Natural Language
topic Artificial Intelligence
url https://arxiv.org/abs/2505.16114