arXiv:2505.16114cs.AI2025-05被引 6

用逻辑程序增强大模型,精准解自然语言谜题

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

  • 将谜题规则转为逻辑程序,由解释器精确求解
  • 在各类网格和动作类谜题上接近完美准确率
  • 适合需要严谨推理的AI解谜任务

自然语言中的谜题求解是人工智能领域的长期挑战。尽管大语言模型(LLMs)在多项任务中表现出色,但在需要精确推理和穷尽搜索的复杂谜题上仍表现不佳。本文提出逻辑思维框架(Logot),通过将大语言模型与逻辑编程结合来解决该问题。该方法利用大语言模型将谜题规则和状态转换为答案集程序(ASPs),再由ASP解释器高效、准确地推导出解。这一混合方法融合了大语言模型对自然语言的理解能力与逻辑程序的精确推理优势。我们在多种网格谜题和涉及动作的动态谜题上进行了评估,所有任务均达到近似完美准确率。代码与数据已公开:https://github.com/naiqili/Logic-of-Thought。

原文摘要 · Abstract (English)

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.

逻辑推理大模型谜题求解

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。