paper-with-me

Papers

How Transformers Solve Propositional Logic Problems: A Mechanistic Analysis

2024-11-06 · Guan Zhe Hong, Nishanth Dikkala, Enming Luo, Cyrus Rashtchian, Xin Wang, Rina Panigrahy

Large language models (LLMs) have shown amazing performance on tasks that require planning and reasoning. Motivated by this, we investigate the internal mechanisms that underpin a network's ability to perform complex logical reasoning. We first construct a synthetic propositional logic problem that serves as a concrete test-bed for network training and evaluation. Crucially, this problem demands nontrivial planning to solve. We perform our study on two fronts. First, we pursue an understanding of precisely how a three-layer transformer, trained from scratch and attains perfect test accuracy, solves this problem. We are able to identify certain "planning" and "reasoning" mechanisms in the network that necessitate cooperation between the attention blocks to implement the desired logic. Second, we study how pretrained LLMs, namely Mistral-7B and Gemma-2-9B, solve this problem. We characterize their reasoning circuits through causal intervention experiments, providing necessity and sufficiency evidence for the circuits. We find evidence suggesting that the two models' latent reasoning strategies are surprisingly similar, and human-like. Overall, our work systemically uncovers novel aspects of small and large transformers, and continues the study of how they plan and reason.

📄 PDF Abstract BibTeX arXiv:2411.04105

Code (0)

등록된 구현이 없습니다.

Tasks

Logical Reasoning

Methods 이 논문이 사용한 방법론

Softmax The Softmax output function transforms a previous layer's output into a vector of probabilities. It is commonly used for multiclass classification. Given an input vector $x$…
Attention 설명 없음

Similar Papers 제목 키워드 기반

Towards a Mechanistic Understanding of Propositional Logical Reasoning in Large Language Models

2026-01-07 · Danchun Chen, Qiyao Yan, Liangming Pan arxiv

Understanding how Large Language Models (LLMs) perform logical reasoning internally remains a fundamental challenge. While prior mechanistic studies focus on identifying taskspecific circuits, they leave open the questio…

Logical Reasoning

To See the Unseen: on the Generalization Ability of Transformers in Symbolic Reasoning

2026-04-23 · Nevena Lazić, Liam Fowl, András György, Csaba Szepesvári arxiv

We investigate the ability of decoder-only transformer models to perform abstract symbolic reasoning; specifically solving propositional logic reasoning problems given in-context. Previous work demonstrated that models f…

Stable Model Counting and Its Application in Probabilistic Logic Programming

2014-11-20 · Rehan Abdul Aziz, Geoffrey Chu, Christian Muise, Peter Stuckey

Model counting is the problem of computing the number of models that satisfy a given propositional theory. It has recently been applied to solving inference tasks in probabilistic logic programming, where the goal is to …

Graph Neural Networks for Reasoning 2-Quantified Boolean Formulas

2019-09-25 · Fei Wang, Zhanfu Yang, Ziliang Chen, Guannan Wei 외

It is valuable yet remains challenging to apply neural networks in logical reasoning tasks. Despite some successes witnessed in learning SAT (Boolean Satisfiability) solvers for propositional logic via Graph Neural Netwo…

Logical Reasoning

Twist your logic with TouIST

2015-07-14 · Khaled Skander Ben Slimane, Alexis Comte, Olivier Gasquet, Abdelwahab Heba 외

SAT provers are powerful tools for solving real-sized logic problems, but using them requires solid programming knowledge and may be seen w.r.t.\ logic like assembly language w.r.t.\ programming. Something like a high le…