arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2504.20213cs.LGcs.AI
收藏

大型语言模型能学习形式逻辑吗?一个数据驱动的训练与评估框架

Can Large Language Models Learn Formal Logic? A Data-Driven Training and Evaluation Framework

University of Southern California(南加州大学);Nokia Bell Labs(诺基亚贝尔实验室)

Yuan Xia, Akanksha Atrey, Fadoua Khmaissia, Kedar S. Namjoshi

AI总结:

本文研究LLMs在布尔逻辑中构造形式化证明的能力,提出随机化合成有效证明程序与Template Transformation数据增强技术,并设计黑盒推理能力测试,实验表明模型对短证明推理能力强且随复杂度下降,而该增强技术在不同规模模型上均有效。

摘要:

本文研究了大型语言模型(LLMs)的逻辑推理能力。为了获得一个精确定义且可处理的表述形式,我们选择了在布尔逻辑中构造证明这一概念简单但技术上复杂的任务。经过训练的LLM接收一组假设和一个目标作为输入,并输出一个从假设中形式化推导出目标的证明。错误的证明会被自动证明检查器捕获。训练的一个关键障碍是真实世界证明的稀缺性。我们提出了一种高效的随机化程序来合成有效证明,并引入了Template Transformation,这是一种增强模型处理复杂逻辑表达式能力的数据增强技术。核心评估问题是LLM是否真正学会了推理。我们提出了测试来衡量黑盒LLM的推理能力。通过这些衡量标准,实验表明模型对具有短证明的断言表现出强大的推理能力,但这种能力随证明复杂度的增加而下降。值得注意的是,template transformation甚至对较小的模型也能提高准确性,表明其在不同模型规模上的有效性。

英文摘要:

This paper investigates the logical reasoning capabilities of large language models (LLMs). For a precisely defined yet tractable formulation, we choose the conceptually simple but technically complex task of constructing proofs in Boolean logic. A trained LLM receives as input a set of assumptions and a goal, and produces as output a proof that formally derives the goal from the assumptions. Incorrect proofs are caught by an automated proof checker. A critical obstacle for training is the scarcity of real-world proofs. We propose an efficient, randomized procedure for synthesizing valid proofs and introduce Template Transformation, a data augmentation technique that enhances the model's ability to handle complex logical expressions. The central evaluation question is whether an LLM has indeed learned to reason. We propose tests to measure the reasoning ability of a black-box LLM. By these measures, experiments demonstrate strong reasoning capabilities for assertions with short proofs, which decline with proof complexity. Notably, template transformation improves accuracy even for smaller models, suggesting its effectiveness across model scales.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑