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

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Xia, Yuan, Atrey, Akanksha, Khmaissia, Fadoua, Namjoshi, Kedar S.
Format: Preprint
Veröffentlicht: 2025
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866912352851460096
author Xia, Yuan
Atrey, Akanksha
Khmaissia, Fadoua
Namjoshi, Kedar S.
author_facet Xia, Yuan
Atrey, Akanksha
Khmaissia, Fadoua
Namjoshi, Kedar S.
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2504_20213
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Can Large Language Models Learn Formal Logic? A Data-Driven Training and Evaluation Framework
Xia, Yuan
Atrey, Akanksha
Khmaissia, Fadoua
Namjoshi, Kedar S.
Machine Learning
Artificial Intelligence
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.
title Can Large Language Models Learn Formal Logic? A Data-Driven Training and Evaluation Framework
topic Machine Learning
Artificial Intelligence
url https://arxiv.org/abs/2504.20213