Title: Are Language Models Efficient Reasoners? A Perspective from Logic Programming
Venue: NeurIPS 2025
Accepted: yes
Keywords: language model

logic programming

proof

arithmetic reasoning

math word problem

search

reasoning

efficiency
Abstract: Modern language models (LMs) exhibit strong deductive reasoning capabilities, yet standard evaluations emphasize correctness while overlooking a key aspect of reasoning: *efficiency*. In real-world reasoning scenarios, much of the available information is irrelevant, and effective deductive inference requires identifying and ignoring such distractions. We propose a framework for assessing LM reasoning efficiency through the lens of logic programming, introducing a simple method to align proofs written in natural language---as generated by an LM---with shortest proofs found by executing the logic program. Efficiency is quantified by measuring how well a model avoids unnecessary inference. Empirically, we construct a dataset of math word problems injected with various number of irrelevant axioms that vary in semantic overlap with the goal theorem. We find that current LMs show marked accuracy declines under such conditions---even with minimal, domain-consistent distractions---and the proofs they generate frequently exhibit detours through irrelevant inferences.

Are Language Models Efficient Reasoners? A Perspective from Logic Programming

Abstract

Modern language models (LMs) exhibit strong deductive reasoning capabilities, yet standard evaluations emphasize correctness while overlooking a key aspect of reasoning: efficiency . In real-world reasoning scenarios, much of the available information is irrelevant, and effective deductive inference requires identifying and ignoring such distractions. We propose a framework for assessing LM reasoning efficiency through the lens of logic programming, introducing a simple method to align proofs written in natural language-as generated by an LM-with shortest proofs found by executing the logic program. Efficiency is quantified by measuring how well a model avoids unnecessary inference. Empirically, we construct a dataset of math word problems injected with various number of irrelevant axioms that vary in semantic overlap with the goal theorem. We find that current LMs show marked accuracy declines under such conditions-even with minimal, domainconsistent distractions-and the proofs they generate frequently exhibit detours through irrelevant inferences. 2

1 Introduction

Large language models (LMs) appear capable of solving a wide range of tasks that rely on deductive reasoning, particularly when post-trained with reinforcement learning (Lightman et al., 2024; DeepSeek-AI, 2025) and scaled to use more compute at test time (Wang et al., 2024; Muennighoff et al., 2025; Snell et al., 2025). However, emerging findings suggest recent reasoning models often generate more tokens than necessary to solve problems, even for simple deductive tasks (Chen et al., 2025; Pu et al., 2025). Such findings point towards a key dimension of deductive reasoning that standard evaluations of LMs' reasoning abilities fail to systematically assessefficiency . Indeed, more abstractly, in most real-world reasoning tasks, more information is available than is necessary to solve the problem. This spurious information is not random: it often interacts with relevant information, enabling the derivation of true but irrelevant conclusions. Crucially, it is unknown a priori which pieces of information will be relevant for determining whether a desired conclusion is supported by the evidence. An efficient solution to a problem uses only necessary information and takes as few steps as possible.

To characterize efficiency, we adopt a formalization of deductive reasoning based on logic programming (Kowalski, 1974). Our perspective is that logic programming provides a clean and flexible framework for reasoning within a well-understood proof system. Given a logic program-that is, a set of inference rules and axioms-a proof of some goal theorem can be viewed as a path in a hypergraph induced by the inference rules, starting from vertices corresponding to axioms and terminating at a vertex corresponding to the goal theorem. Then, the most efficient proof is simply a shortest such path. Using this machinery, the goal of this paper is to evaluate a language model's reasoning efficiency. Thus, we require an additional mechanism to bridge the gap between reasoning

in logic programming and reasoning in natural language. To this end, we introduce the notion of a verbalized logic program, in which each theorem in the logic program is associated with a set of natural language strings. 3 Verbalized logic programs allow us to map the deductions performed by an LM-expressed as a natural language proof-onto deductions performed during the execution of a logic program. While numerous recent papers use number of generated tokens as a proxy for efficiency (Arora & Zanette, 2025; Han et al., 2025; Ma et al., 2025), doing so conflates inefficiency stemming from two separate sources: (1) unnecessary deduction steps and (2) verbosity in the natural language strings expressing those deduction steps. In contrast, our framework disentangles these two factors, with our paper's experiments emphasizing the former.

Empirically, we construct verbalized logic programs for grade school math word problems (GSM problems; Cobbe et al., 2021; Li et al., 2024; Zhang et al., 2024), adopting methods from Opedal et al. (2025). Our primary experimental manipulative is the injection of irrelevant axioms into these GSM programs, which yields many possible implications that are irrelevant to a goal theorem of interest. We experiment on problems that vary both in how much the information in the irrelevant axioms overlap with the goal theorem, as well as in how many such axioms are injected, generalizing existing datasets that only include a single irrelevant axiom (Shi et al., 2023; Mirzadeh et al., 2025). We first measure accuracy, showing that current LMs are less accurate on problems containing irrelevant axioms than on equivalent problems without them. This performance gap often persists even in the simplest cases, where a single irrelevant axiom from the same domain is introduced, and grows larger as more irrelevant axioms are added. We confirm that this reduction in accuracy is not due to longer inputs alone: LMs usually perform better on control problems of equal length but without irrelevant content.

Next, we map the reasoning performed by the LM onto theorems they correspond to when executing the logic program. We find that while the LMs predict most of the correct intermediate theorems for the problems where they correctly generate the goal, they are often inefficient. In particular, for GSM problems where about half of the axioms are irrelevant, more than half of the LM's predicted theorems are irrelevant too, i.e., not needed for proving the goal. The LMs are particularly inefficient when the irrelevant axioms overlap semantically with the query-for instance, when the question asks 'how many cats does Ryan have?' and the irrelevant axioms also mention 'Ryan' or 'cats' . On the other hand, these results also suggest that the LMs' search procedure sometimes employ a useful heuristic based on such overlap. Our results shed some light on how LMs, albeit in natural language, perform inference.

Outline. The remainder of the paper is structured as follows: §2 situates our contributions among related work. §3 provides relevant background on logic programming and discusses how reasoning efficiency is measured relative to shortest proofs. §4 introduces verbalized logic programs and the specifics of our GSM programs. §5 presents experiments and results on how LMs reason on verbalized GSM programs with irrelevant axioms. Apps. A-D give further technical details and empirical results.

2 Related Work

Evaluating Reasoning. Most studies and benchmarks on LM reasoning evaluate correctness based on the LM's final answer (Hendrycks et al., 2021; Patel et al., 2021; Rein et al., 2024; Yu et al., 2024, inter alia ). However, correctness of the final answer does not guarantee correctness of the proof (Lyu et al., 2023; Turpin et al., 2023). Some studies include more fine-grained reasoning evaluations by verifying LM-generated proofs (Gontier et al., 2020; Frieder et al., 2023; Nguyen et al., 2024; Wang et al., 2024; Petrov et al., 2025). While useful, many such evaluations rely either on manual scrutiny or heuristic measures of the proof's correctness. An alternative approach is to use proof assistants, e.g., Lean (de Moura & Ullrich, 2021), for formal verification (First et al., 2023; Tsoukalas et al., 2024); however, LMs may have been trained on less amounts of such data as compared to natural language. Weperform an automatic evaluation by parsing the LM-generated output into proofs in logic programs.

Irrelevant Information in Reasoning Tasks. Our work relates to papers that evaluate LMs' ability to correctly solve problems with irrelevant information (or missing information; Li et al., 2025). Shi et al. (2023) create such a dataset by appending a single irrelevant statement to problems taken from GSM8k (Cobbe et al., 2021). Mirzadeh et al. (2025) seem to take a similar, albeit more manual approach; however, details presented are scarce and their dataset has not yet been made publicly available. Xu et al. (2025) incorporate irrelevant statements as part of a pipeline for generating problem variations. Anantheswaran et al. (2025) use a prompting-based method for augmenting problems with sev-

eral irrelevant statements. We formalize the notion of irrelevance through logic programming and generalize previous approaches by generating problems that may have several, arbitrarily placed irrelevant axioms, which can be used together in further inference. Thus, there are many implications that are irrelevant to the goal theorem and the challenge becomes not only to generate correct proofs, but proofs that only contain steps that are necessary . By generating new problems from scratch, our approach avoids bias from memorizing the efficient solution seen during training (see, e.g., Zhang et al., 2024).

Search and Efficiency. Other studies have investigated whether and how transformers can learn search tasks (Gandhi et al., 2023, 2024; Kazemi et al., 2023; Lehnert et al., 2024; Sanford et al., 2024; Sel et al., 2024; Shah et al., 2024; Saparov et al., 2025). We are interested not only in whether a transformer-based LM can perform accurate search, but in how efficient it is. Efficiency of large (reasoning-based) LMs is a rapidly growing area of research (Sui et al., 2025), due to their often lavish use of compute (Chen et al., 2025; Pu et al., 2025). Several methods have been proposed to make reasoning more efficient (Han et al., 2025; Ma et al., 2025), e.g., by incorporating length rewards in training (Arora & Zanette, 2025; Luo et al., 2025; Team et al., 2025). While these papers focus solely on the number of tokens, we argue that it is more informative to measure efficiency based on the natural language proof, since a long output can be explained either by unnecessary inference steps or by 'verbose' verbalizations of the proof. Moreover, an LM should avoid generating redundant tokens (Xia et al., 2025), but it should also not skip necessary inference steps in favor of a shorter output.

3 Logic Programming and Deductive Reasoning

This section provides relevant background on logic programming (Kowalski, 1974). It also introduces the metric we propose for scoring a proof's efficiency in §3.2.

3.1 Typed Logic Programs with Built-ins

Basic Notions. A signature is a 3 -tuple Σ = (Σ p , Σ x , Σ X ) , where Σ p is a set of predicate (or relation ) symbols, denoted p , q , r , ... ; Σ x is a set of constants, denoted x , y , z , ... ; Σ X is a set of variables, denoted X , Y , Z , ... 4 Every predicate is associated with an arity, which we denote using the function arity ar : Σ p → N , specifying how many arguments it takes. Arguments to predicates are called terms ; they can be either constants ( ground terms) or variables ( non-ground terms). An atomic formula , called an atom , for short, is an expression of the form p( t 1 , ..., t N ) , where p ∈ Σ p is a predicate symbol of arity ar (p) = N and t 1 , ..., t N ∈ Σ x ∪ Σ X are all terms. The Herbrand base H for signature Σ is the set of all atoms that can be formed by terms in Σ x , i.e., H = { p( t 1 , ..., t N ) | p ∈ Σ p , ar (p) = N,t 1 , ..., t N ∈ Σ x } . 5 Subsets of the Herbrand base I ⊆ H are called interpretations .

Logic Programming. An inference rule is an expression of the form b 1 , ..., b N ⊢ h , where b 1 , ..., b K , h are atoms; b 1 , ..., b K is the body (or premises ) and h is the head (or conclusion ). For example,

is an inference rule that allows us to conclude that if X is a parent of Y and Y is an ancestor of Z , then X is an ancestor of Z . An inference rule is called range restricted if each variable appearing in the conclusion h also appears in at least one atom b k in the premise. For example, p( X ) ⊢ q( X ) is range restricted, while p( X ) ⊢ q( X , Y ) is not. In this paper, we require all inference rules to be range restricted. 6 Inference rules with a null premise, i.e., where K = 0 , and a ground conclusion, i.e., where h ∈ H , are called axioms . A set of axioms is denoted A . For example, ⊢ parent( abraham , isaac ) , also written parent( abraham , isaac ) , omitting the ⊢ symbol, is an axiom. A logic program P over a signature Σ is a set of inference rules in which all atoms are formed by symbols in Σ . The following is an example logic program, adapted from Sterling & Shapiro (1994, §5):

Types and Built-ins. Our notion of logic programming additionally includes types (Abiteboul et al., 1995, §21) and built-ins (Kaminski et al., 2017), which we define here. We partition Σ x and Σ X into T disjoint subsets, i.e., Σ x = Σ 1 x ⊔··· ⊔ Σ T x and Σ X = Σ 1 X ⊔··· ⊔ Σ T X , respectively, and associate each subset with a type . These subsets are paired index-wise, i.e., (Σ 1 x , Σ 1 X ) , ..., (Σ T x , Σ T X ) , ensuring that the constant and variable types match. In this paper, we consider three types: (i) natural numbers, denoted ( N x , N X ) , (ii) strings, (∆ ∗ x , ∆ ∗ X ) , and (iii) sets of strings, (2 ∆ ∗ x , 2 ∆ ∗ X ) . Our introduction of types is necessitated by our desire to add additional power to our notion of logic programming that is external to the language itself. Specifically, we will introduce built-in predicates , simply called built-ins through the exposition, that add various arithmetic and set-theoretic operations. We enumerate these operations:

The truth value of grounded atoms constructed from built-in predicates is evaluated externally to the logic program. To do so, we define the built-in evaluator eval : H → { T , F } , that maps all ground built-ins that evaluate to true to T and all ground built-ins that evaluate to false to F . Additionally, any element of H that is not a built-in evaluates to F . For example, eval ( 5 + 4 = 9 ) = T , eval ( 5 + 4 = 10 ) = F , and eval (parent( abraham , isaac )) = F . For example, to illustrate the use of built-ins in a logic program, we can extend the inference rules from the earlier example to measure the depth of the ancestor relation (e.g., parent, grandparent, great-grandparent, etc):

̸

Substitutions and Semantics. To assign semantics to a logic program, we require a bit more machinery. A substitution θ is a finite set of pairs { ( X m , t m ) } M m =1 , where X m ∈ Σ X , t m ∈ Σ x ∪ Σ X , X m = X m ′ for all m = m ′ , and X m = t m for all m (Sterling & Shapiro, 1994, p. 14). Additionally, a typed substitution is a substitution where, if X m ∈ Σ k X , then t m ∈ Σ k x ∪ Σ k X . We can apply a substitution θ to an atom b , denoted b/θ , e.g., parent( X , isaac ) / { ( X , abraham ) } = parent( abraham , isaac ) . Let Θ( P ) be the set of all typed substitutions under P . We say that b ′ 1 , ..., b ′ K ⊢ h ′ is an instantiation of b 1 , ..., b K ⊢ h if there exists a substitution θ ∈ Θ( P ) such that b ′ 1 , ..., b ′ K ⊢ h ′ = b 1 /θ, ..., b K /θ ⊢ h/θ . If an instantiation has no variables, we call it a ground instantiation . In addition, we say that an atom b unifies with b ′ if ∃ θ ∈ Θ( P ) : b/θ = b ′ /θ . If b unifies with b ′ we write b ≡ b ′ . We define a logic program P 's fixpoint operator T P : 2 H → 2 H as

̸

̸

where I ⊆ H is an interpretation. The fixpoint operator T P is inflationary , i.e., for every interpretation I ⊆ H , we have b ∈ I = ⇒ b ∈ T P ( I ) , and monotone , i.e., for every pair of interpretations I 1 , I 2 ⊆ H , we have I 1 ⊆ I 2 = ⇒ T P ( I 1 ) ⊆ T P ( I 2 ) . That T P is monotone allows us to employ least fixpoint semantics. To that end, we define the minimal Herbrand model as M = T ∗ P ( A ) def = ⋃ ∞ n =0 T n P ( A ) , where T n P denotes the n -fold application of the fixpoint operator T P , i.e., M is T P 's least fixpoint. 7 Thus, M is the subset of the Herbrand base that is true given the axioms and inference rules in the program; we call elements of M theorems . Due to our inclusion of built-ins that encompass basic arithmetic operations, it is undecidable to compute M (Dantsin et al., 2001), i.e., in general, we cannot decide whether h ∈ T ∗ P ( A ) for an arbitrary h ∈ H .

Queries. Given a logic program P , we are often interested in determining whether there exists a theorem in P that is an instantiation of a specific (possibly non-ground) atom. We refer to such atoms as queries . 8 For example, building on the running example drawn from Sterling & Shapiro (1994, §5), we may wish to ask whether there exists a theorem that instantiates the atom ancestor( X , ishmael ) .

cont({d},3,apple,2)

cont({a,b,c},25,apple,2)

"d has3 apples"

cont({a},8,apple,2)

“a,b,and c together have 25 apples”

“ahas8apples”

Goal theorem

comp（{a},{d},5,apple，2)

“ahas 5 more apples than d”

cont({b},8,apple,2)

Query

“bhas8apples”

cont({c},9,apple,2)

cont({b},6,apple,1)

“chas 9 apples”

cont({a,b,c},X,apple,2)

“bhas 6 apples"

"How many apples do a, b, and c have

transfer({b},{e},2,apple,1)

together?"

“egave2applestob”

RelevantTheorems

Irrelevant Theorems

cont({f},17,apple,2)

“f has 17 apples”

cont((g},14,apple,2)

cont((h},19,apple,2)

"h has 19 apples"

cont({i},23,apple,2)

"g has 14 apples"

“ihas23apples"

comp((f},{g},3,app1e,2)

comp({h},{g},5,app1e,2)

cont((i},19,apple,1)

“f has3more apples than g"

“hhas5more applesthang”

“ihas19 apples"

transfer({i},{j},4,apple,1)

“j gave 4 apples to i”

Answering such a query amounts to finding all substitutions for X that make the atom provable from P . When X can take on infinitely many instantiations, more sophisticated inference mechanisms-most notably, unification (Robinson, 1965)-are required to perform this kind of non-ground reasoning effectively. In this paper, however, we restrict attention to queries in which each variable is known a priori to range over a fixed, finite domain, which allows us to avoid additional complexities.

3.2 Deductive Reasoning

Hypergraphs. A hypergraph G (B-hypergraph; Gallo et al., 1993) is a tuple ( V, E ) , where V is a set of vertices, and E ⊆ 2 V × V is a set of hyperedges , where a hyperedge e = T ↣ v h consists of a tail T ⊆ V , with | T | > 0 , and a head v h ∈ V . We define the size of a hypergraph as | G | def = | V | where G = ( V, E ) . 9 A subhypergraph of a hypergraph G = ( V, E ) is a hypergraph G ′ = ( V ′ , E ′ ) where V ′ ⊆ V and E ′ ⊆ E . Given S ⊆ V and v ∈ V , an ( S, v ) -hyperpath in a hypergraph G = ( V, E ) is a finite sequence of distinct hyperedges T 1 ↣ v h 1 , ..., T J ↣ v h J such that v h J = v and for every j ∈ [ J ] : T j ⊆ S ∪ { v h 1 , ..., v h j -1 } , i.e., each hyperedge's tail consists only of nodes that are either in the source set S or are heads of previous hyperedges in the sequence. A hyperpath generalizes the notion of a directed path in a graph, but allows each hyperedge to have multiple tail nodes that jointly produce a head node. Finding the shortest ( S, v ) -hyperpath in a hypergraph is analogous to context-free parsing (Klein & Manning, 2001) and can be executed in polynomial time.

Proof Forests, Proofs and Proof Efficiency. Let P be a logic program. A proof forest ( F , ℓ ) in P is a pair where F = ( E,V ) is a hypergraph and ℓ : V → H where H is P 's Herbrand base (Heijltjes, 2010). Additionally, we require that, for every hyperedge e = { t 1 , ..., t K } ↣ v h ∈ E , there exists a rule ( b 1 , ..., b K ⊢ h ) ∈ R and a substitution θ ∈ Θ( P ) such that b 1 /θ = ℓ ( t 1 ) , ..., b K /θ = ℓ ( t K ) and h/θ = ℓ ( v h ) . We call a proof forest ( F , ℓ ) an ( A,h g ) -proof if there exists a ( ℓ -1 ( A ) , ℓ -1 ( h g )) -hyperpath in ( F , ℓ ) . 10 In Fig. 1, we show an example of a proof in which h g = cont( {a,b,c} , 25 , apple , 2 ) in our custom logic program for math word problems (§4), together with some axioms in the program that do not contribute to the proof of the goal theorem h g . We call an ( A,h g ) -proof a shortest proof if it has the least number of vertices of all ( A,h g ) -proofs in P . A shortest proof can be found by forward-chaining, discussed in the subsequent paragraph. Now we turn to measuring proof efficiency. Consider an ( A,h g ) -proof P in P . We define the efficiency of P as EFFICIENCY ( P ) def = | P ⋆ | / | P | where | P ⋆ | is the number of vertices in a shortest ( A,h g ) -proof. In the remainder of the paper, we will refer to an axiom a as irrelevant if there does not exist a shortest proof P that contains a vertex v such that ℓ ( v ) = a .

Table 1: Inference rules in P W. The symbols cont , comp , transfer , rate , compeq are predicates and we use variables A A , B A , C A , C A ∈ 2 A X for agents, E ∆ ∗ , F ∆ ∗ ∈ E X for entities, X N , Y N , Z N ∈ N q X for quantities, and T N ∈ N t X for timestamps. We refer to Fig. 2 for ground instantiations of the atoms shown here with corresponding example verbalizations. The symbol p in Rule (6) is a placeholder for any predicate other than transfer ; because the predicates have different arities, we use ' ... ' to denote other arguments that may be present. Rule (6) is special since it has negation (App. A.1); it is included to treat complications resulting from the timestamp in Rules (2a) and (2b)-see footnote 11-and is not used when generating shortest proofs for our experiments (App. C).

Forward Chaining. Forward chaining (Hayes-Roth et al., 1983; Poole & Mackworth, 2017) is a meta-strategy for theorem proving in logic programming that proceeds from the axioms toward the goal theorem. The process terminates once the goal theorem is proved. Pseudocode for the forwardchaining is given in Alg. 1 in App. A.2. As a meta-strategy, each instance of forward chaining defines an ordering over proof steps. Different orderings give rise to familiar search algorithms, such as depthfirst search (DFS; Tarjan, 1972), breadth-first search (BFS; Moore, 1959), Dijkstra's (1959) algorithm, and heuristic-based search (Pearl, 1984) like A* (Hart et al., 1968). While DFS and BFS ignore information about the goal theorem, such information can guide search more efficiently, as exemplified by goal-aware strategies like Earley's (1970) algorithm for context-free parsing or its more general equivalent in logic programming-magic templates (Bancilhon et al., 1986; Ramakrishnan, 1991; Eisner & Blatz, 2007). In the spirit of using top-down information in proof search, in §5, we examine whether LMs make use of lexical overlap with the goal theorem as part of their internal search heuristic.

4 Evaluating Language Models on Grade School Math Word Problems

We are interested in reasoning that takes places in natural language , particularly as performed by LMs. To this end, we consider grade school math (GSM) word problems as empirical test domain. Such problems are commonly used for training and evaluating LMs on reasoning tasks (Cobbe et al., 2021; Patel et al., 2021). In §4.1, we introduce a family of logic programs, using the technical notions introduced in §3, that correspond to a natural class of such math word problems. We also describe a simple manner to convert text generated by an LM to a proof in such logic programs in §4.2. Finally, in §4.3 we explain how we generate problem descriptions in natural language that contain irrelevant axioms.

4.1 Modeling Math Word Problems with Verbalized Logic Programs

Logic Programming for Grade School Math Word Problems. We consider a particular family of logic programs to represent GSM problems, adapted from Opedal et al. (2023, 2025). All of the logic programs have the signature Σ W = (Σ W p , Σ W x , Σ W X ) . The set of predicate symbols Σ W p = { cont , comp , transfer , rate , compeq } corresponds to arithmetic concepts that occur in GSM word problems (Riley et al., 1983), e.g., cont for denoting how many entities an agent contains, comp for comparing the number of entities across multiple agents, or transfer for expressing one agent transfering entities to another. We partition Σ W x = 2 A x ⊔ E x ⊔ N q x ⊔ N t x and Σ W X = 2 A X ⊔ E X ⊔ N q X ⊔ N t X into the following pairs: sets of strings (2 A x , 2 A X ) called sets of agents ( who possesses), strings ( E x , E X ) called entities ( what is possessed), natural numbers ( N q x , N q X ) called quantities ( how much is possessed), and natural numbers ( N t x , N t X ) called timestamps ( time of possession). We note that 2 A x is a power set of the set of agent strings A x , which enables us to code a state where multiple agents possess the same entity jointly. The family of logic programs all share the same inference rules, which are given in Table 1. Fig. 1 shows an example proof using these inference rules, omitting built-ins. We note that possession may change over time and is governed by the transfer predicate in Rule (2). 11

̸

Axioms. The rules given in Table 1 are held constant across all logic programs in our family. Indeed, what distinguishes one program from another, then, is the choice of axioms. For example, consider the axiom cont( {ryan} , 5 , cat , 2 ) which expresses that 'Ryan has 5 cats at time step 2' ; the predicate cont represents the semantics of possession, and {ryan} ∈ 2 A x , 5 ∈ N q x , cat ∈ E x , and 2 ∈ N t x are all ground atoms of different types. Additionally, we only consider axiom sets A W ⊂ H that have the following property: We call an interpretation I ⊆ H of a logic program in our family (Table 1) numerically consistent if there do not exist two substitutions θ = { ( A A , t a ) , ( X Z , t ) , ( E ∆ ∗ , t e ) , ( T N , t t ) } and θ ′ = { ( A A , t a ) , ( X Z , t ′ ) , ( E ∆ ∗ , t e ) , ( T N , t t ) } such that t = t ′ and both cont( A A , X N , E ∆ ∗ , T N ) /θ, cont( A A , X N , E ∆ ∗ , T N ) /θ ′ ∈ T ∗ P W ( I ) . This ensures that the minimal Herbrand model does not contain contradictory pairs such as cont( {ryan} , 5 , cat , 2 ) and cont( {ryan} , 4 , cat , 2 ) . For example, the following set of axioms is numerically consistent: A W = { cont( {ryan} , 5 , cat , 2 ) , comp( {eleanor} , {ryan} , 3 , cat , 2 ) } , expressing that 'Ryan has 5 cats' and that 'Eleanor has 3 more cats than Ryan' . If we were to, e.g., include the two axioms { cont( {andreas} , 7 , cat , 2 ) , comp( {eleanor} , {andreas} , 3 , cat , 2 ) } , we would obtain a numerically inconsistent axiom set. Inference in our family of logic programs is decidable under numerically consistent axiom sets. See App. B for details.

4.2 Language Modeling and Proofs in Natural Language

Language Modeling. We give a brief formal introduction to language modeling. Let Γ be an alphabet of tokens and Γ ∗ be the set of all strings over Γ , its Kleene closure. We write w ∈ Γ ∗ for a string, w t for the token at the t th position in w = w 1 · · · w T , and | w | = T for the number of tokens in w , i.e., its length. A language model ( LM ) p is a probability distribution on Γ ∗ . Let EOS / ∈ Γ be a distinguished symbol denoting the end of a token string. The probability of a string w can be written autoregressively as p ( w ) = - → p ( EOS | w ) ∏ | w | t =1 - → p ( w t | w <t ) , where - → p ( · | c ) is a probability distribution over Γ def = Γ ∪ { EOS } conditioned on the context c ∈ Γ ∗ .

To bridge reasoning in formal proof systems to reaintroduce the idea of a verbalized logic program .

Verbalization

cont(

{

alice

}

,

3

,

apple

,

1

)

'Alice has 3 apples. '

cont(

{

alice

,

bob

}

,

8

,

apple

,

1

)

'Alice and Bob have 8 apples combined.'

comp(

{

bob

}

,

{

alice

}

,

2

,

apple

,

1

)

'Bob has 2 more apples than Alice. '

transfer(

{

alice

}

,

{

bob

}

,

2

,

apple

,

1

)

'Bob gave 2 apples to Alice. '

rate(

{

alice

}

,

4

,

basket

,

apple

,

1

)

'Each of Alice's baskets contains 4 apples. '

3

+

2

=

5

Not verbalized

Figure 2: Examples of verbalized grounded atoms, i.e., elements of ν P W ( b ) for some b ∈ H . Built-ins are not verbalized other than as part of the conclusion; App. D.2 shows how this was done in our prompt. We additionally note that time is not verbalized directly but implicitly through the use of a past form depending on context.

Verbalized Logic Programs. soning in natural language, we Given a logic program P with negation (App. A.1), let H be its extended Herbrand base. We associate each atom b ∈ H with a set of natural language strings. To that end, we define a verbalizer ν P : H → 2 Γ ∗ , where each ν P ( b ) is a disjoint set. For every b ∈ H , the set ν P ( b ) represents the various ways in which the meaning of b can be expressed in natural language. In this paper, we take a straightforward approach. For each b ∈ H , we construct a finite set G b ⊂ Γ ∗ . Moreover, we enforce disjointness, i.e., G b 2 ∩ G b 1 = ∅ for b 1 , b 2 ∈ H , and that, for all b ∈ H , each string in G b ends in a distinguished separator symbol-in our case a period '. ' -that appears nowhere else in the string. These assumptions allow for trivial linear-time parsing of natural language text into a sequence of atoms in the verbalized logic programs. In practice, we generate the strings in each G b with a series of hand-written templates. We give examples in Fig. 2.

4.3 Generating Problems with Irrelevant Axioms

Sampling Axiom Sets. We introduce a simple sampling algorithm, presented and analyzed in App. C, that samples a ground goal theorem h g ≡ cont( A A , X N , E ∆ ∗ , T N ) and a shortest proof of h g under the rules R W from Table 1. By construction, the axioms A W in the shortest proof are numerically consistent (§4.1) and all axioms in A W will be used in the proof of h g in the program P W = R W ⊔ A W; we denote this dependency by A W ( h g ) . 12 That is, A W ( h g ) contains no irrelevant frame problem (McCarthy & Hayes, 1969; Sandewall, 1972; Hanks & McDermott, 1987). To express this rule, we introduce negation into the logic program; see App. A.1 for background on negation in logic programming. The only negated predicate in Table 1 is ¬ transfer ; because ¬ transfer only appears in the body of an inference rule, the program is trivially stratified (App. A.1). That is ¬ transfer atoms can not be proved true, but we assume ¬ transfer atoms if the corresponding transfer atom is not known to be true from the axioms.

axioms. However, to produce logic programs that do contain irrelevant axioms, we do the following. We sample an additional M distinct distractor theorems { ˜ h m } M m =1 . For each distractor theorem ˜ h m , we again apply our axiom sampling procedure to generate distractor axioms ˜ A m ( ˜ h m ) . Importantly, we are able to show that A W ( h g ) remain on a shortest proof of h g even in the case that we consider the augmented logic program ˜ P W = R W ⊔ A W ( h g ) ⊔ ˜ A 1 ( ˜ h 1 ) ⊔ · · · ⊔ ˜ A M ( ˜ h M ) ; see App. C.4.

Structural Overlap. In our experiments, we vary the size of the irrelevant axiom sets ˜ A = ˜ A 1 ( ˜ h 1 ) ⊔ · · · ⊔ ˜ A M ( ˜ h M ) as follows: (i) a single irrelevant axiom ( w/ axiom ), where M = 1 , | ˜ A 1 ( ˜ h 1 ) | = 1 , and ˜ A 1 ( ˜ h 1 ) = { ˜ h 1 } (i.e., the distractor theorem is trivial); (ii) a single irrelevant tree ( w/ tree ), where M = 1 , | ˜ A 1 ( ˜ h 1 ) | > 1 , and ˜ h 1 has a non-trivial proof; (iii) multiple irrelevant trees ( w/ multiple trees ), where we set M = 3 , | ˜ A m ( ˜ h m ) | > 1 for m ∈ { 1 , 2 , 3 } , and ˜ h 1 , ˜ h 2 , ˜ h 3 all have non-trivial proofs.

Agent and Entity Overlap. We additionally control for overlap between the set of agents, i.e., elements of 2 A x , and the entities, i.e., elements of E x , of the goal theorem h g ≡ cont( A A , X N , E ∆ ∗ , T N ) , and those present in ˜ A . Intuitively, for a query asking how many telescopes 'Bernhard' has, we should make use of the information in 'telescope' and 'Bernhard' when deciding whether to take a certain deduction step. By constructing irrelevant axioms that also mention 'telescope' and/or 'Bernhard' , it becomes harder to distinguish what is relevant and what is not. We distinguish four cases: (i) neither the set of agents nor the entity occur in ˜ A ( no overlap ), (ii) the agent does not occur in ˜ A but the entity does ( entity overlap ), (iii) the entity does not occur in ˜ A but the set of agents does ( agent overlap ), and (iv) entity overlap in which the agents occurring in ˜ A have lexical overlap with the set of agents ( agent and entity overlap ), e.g., if bernhard is in h g then ˜ A contains agents like bernhard's_student or bernhard's_son . Entities that do not overlap are always made topically related, e.g., if A W contains axioms with telescope , then ˜ A may contain binocular .

5 Experiments

We use proofs generated from the family of verbalized logic programs introduced in §4 to help understand how LMs reason about GSM problems. Our primary experimental manipulative is irrelevant axioms with respect to a goal theorem introduced into a logic program, which allows us to analyze how LMs fare in the face of irrelevant axioms. We generate 500 problems with varying structural, agent and entity overlap, as discussed above. See App. D.1 for more details on the make-up of the dataset. We refer to the problems without any irrelevant axioms as base problems . We additionally generate control problems that have the same number of axioms as the problems with irrelevant axioms, except that all axioms are relevant. Their shortest proofs contain the base problem's shortest proof as a subproof. This controls for the possible confounder of problem length (see, e.g., Leeb et al., 2025). We consider both non-ground queries, corresponding to questions like 'How many drones does Yanick have?' , 13 and ground queries, corresponding to questions like 'Show that Yanick has 5 drones. ' .

0

1000

2000

3000

4000

Number of tokens

0.000

0.001

0.002

0.003

0.004

0.005

0.006

Density

Meta-Llama-3.1-8B-Instruct

0

1000

2000

3000

4000

Number of tokens

Qwen2.5-Math-7B-Instruct

0

1000

2000

3000

4000

Number of tokens

QwQ-32B

0

1000

2000

3000

4000

Number of tokens

DeepSeek-R1

model tokens

annotated tokens

Language Models. We use one 'vanilla' LM and three reasoning LMs in our experiments: Llama-3.1-8B-Instruct (Llama Team, 2024), Qwen2.5-Math-7B-Instruct (Yang et al., 2024), Qwen's reasoning model QwQ-32B, and DeepSeek-R1 (DeepSeek-AI, 2025). We generate strings using ancestral sampling, restricting the context length to 4000 tokens.

Prompting. Our experimental design is based on in-context learning (Brown et al., 2020). Specifically, we use five fixed in-context examples of shortest proofs to expose the LM to proofs in our verbalized logic programs. The verbalized proofs are ordered under a DFS traversal of the theorems in the proof, such that the axioms are popped in the same order they occur in the verbalized text. See App. D.2 for the prompt.

5.1 Addition of Irrelevant Axioms and Answer Accuracy

We begin by analyzing how irrelevant axioms influence an LM's ability to generate the correct goal theorem for non-ground queries. We employ the two-step prompting strategy given by Kojima et al. (2022). In the first step, the model is prompted to produce a natural-language proof outlining its reasoning process. This natural-language process is then mapped to a proof in the verbalized logic program. In the second step, we prompted the LM a second time-conditioned on the proof it generated-to produce the goal theorem. In Table 2, we report model accuracy in generating the correct goal theorem. We observe that even a single irrelevant axiom reduces model performance, particularly for Llama-3.1 and Qwen2.5. Performance degrades further as additional irrelevant axioms are introduced. The performance of the most capable model, DeepSeek-R1, is nearly saturated at perfect accuracy, though slight decreases are still observed when irrelevant axioms are included. Across models, accuracy on problems containing irrelevant axioms is almost always lower than on the corresponding control examples, suggesting that irrelevance has a substantial effect on accuracy beyond what can be explained by longer problem statements. The only exception is Llama-3.1, whose performance on problems with one irrelevant axiom exceeds that of the corresponding control. QwQ-32B stands out as an outlier: for this model, performance on the control problems is significantly higher than on the original base problems. In Fig. 7 (App. D.4), we present results stratified by agent and entity overlap (§4.3). A consistent pattern emerges: such overlap between the goal and irrelevant axioms makes solving the problem more difficult. Compared to no overlap, performance drops with both kinds of overlap, suggesting both serve as heuristics during search. While drops are typically larger for agent overlap than for entity overlap, we note that this could be partially due to the entities being topically related (§4.3). In the following subsection, we analyze the proofs in greater detail to further illuminate these effects.

5.2 Addition of Irrelevant Axioms and Efficiency

In Fig. 3 we plot the empirical distribution over the number of tokens in the model's output and compare it to the number of tokens in the natural language annotation of the shortest proof, taking only the proofs that concluded at the correct goal theorem. This analysis, as well as those in the remainder of this section, are done on the problems with multiple irrelevant trees (i.e., the kind of structural overlap with the most axioms; §4.3). We observe that all models often use more tokens than are in the annotations, suggesting that they use more compute than necessary to prove goal theorems. This is consistent with findings on reasoning models (§2), but holds also for the Llama model. However, these results do not confirm that the models generate irrelevant theorems-they might just be more verbose than our annotations. This leads us into our efficiency analysis in line with the technical exposition in §3.2.

Efficiency Evaluation. This analysis is performed for Llama-3.1-8B-Instruct and Qwen2.5-Math7B-Instruct since only those models followed the required formatting (§4.2); 14 however, we perform a more crude analysis based on only the arithmetic expressions for the other two models in App. D.4. We report the efficiency metric presented in §3.2 for the problems where the LM generated the correct goal theorem, comparing against the shortest proof generated with our method (App. C). 15 We omit built-ins from the efficiency analysis since those are not verbalized. Additionally, we note that it might be the case that all irrelevant steps the models take are axioms; the LMs may simply be stating that some axioms are irrelevant to the query. We therefore also consider a metric in which only non-axiom theorems are counted. In App. D.4 we provide an additional analysis on search order.

Efficiency for Non-ground Queries. The main results are shown in §5.2 (non-ground queries), with scores stratified by agent and entity overlap. The efficiency scores are far from 100% , meaning that the models predict several theorems beyond the required ones present in the shortest proof. Additionally, we observe that the efficiency scores vary significantly across the type of overlap ( p < 0 . 001) , so we conclude that lexical information in the query has a substantial effect on proof planning. We finally comment on the results that only consider non-axioms, presented at the last row in §5.2. We again observe efficiency scores that are considerably below 100% , showing that the LMs prove theorems that are irrelevant to the query. App. D.3 gives an example where Llama-3.1-8B proves irrelevant theorems.

Comparison to Ground Queries. We compare the performance to the same problems when presented with ground queries. Queries tend to be non-ground in the GSM domain (Riley et al., 1983; Cobbe et al., 2021). Since LMs are heavily influenced by training data, we therefore expect them to perform better on non-ground queries. Our results on the same verbalized logic programs as before, but with ground queries, are presented on the right-hand side of §5.2. We observe lower efficiency scores, suggesting that LMs are indeed worse at proving ground theorems in this domain.

6 Conclusion

This paper provided a framework based on logic programming for studying deductive reasoning in language models, with a particular emphasis on efficiency. This framework enables us to disentangle efficiency due to generating irrelevant theorems from efficiency due to verbose natural language verbalizations of those theorems. We applied this framework to empirically investigate how language models perform reasoning on math word problems that have many irrelevant axioms. We found that introducing irrelevant axioms into reasoning problems leads to significantly lower answer accuracies for most models-even when controlling for problem length-and proofs that exhibit frequent detours through irrelevant theorems. Our work highlights the need to improve models in terms of reasoning efficiency, as well as the advantages to viewing deductive reasoning through the lens of logic programming.

Acknowledgments and Disclosure of Funding

We thank Juan Luis Gastaldi for useful discussion and criticisms. Andreas Opedal acknowledges funding from the Max Planck ETH Center for Learning Systems.

References

Serge Abiteboul, Richard Hull, and Victor Vianu. Foundations of Databases: The Logical Level . Addison-Wesley Longman Publishing Co., Inc., USA, 1st edition, 1995. ISBN 0201537710. URL https://dl.acm.org/doi/10.5555/551350 .

Ujjwala Anantheswaran, Himanshu Gupta, Kevin Scaria, Shreyas Verma, Chitta Baral, and Swaroop Mishra. Cutting through the noise: Boosting LLM performance on math word problems. In Proceedings of the ICLR 2025 Workshop on Reasoning and Planning for Large Language Models , 2025. URL https://openreview.net/forum?id=VnPYbWQjz7 .

Daman Arora and Andrea Zanette. Training language models to reason efficiently. In Proceedings of the ICML Workshop ES-FoMo III: 3rd Workshop on Efficient Systems for Foundation Models , 2025. URL https://openreview.net/forum?id=tCUGSPSZ3A .

François Bancilhon, David Maier, Yehoshua Sagiv, and Jeffrey D. Ullman. Magic sets and other strange ways to implement logic programs. In Proceedings of the 5th ACM SIGACT-SIGMOD Symposium on Principles of Database Systems (PODS) , pp. 1-15, 1986. URL https://doi. org/10.1145/6012.15399 .

Gregor Betz, Christian Voigt, and Kyle Richardson. Critical thinking for language models. In Sina Zarrieß, Johan Bos, Rik van Noord, and Lasha Abzianidze (eds.), Proceedings of the 14th International Conference on Computational Semantics (IWCS) , pp. 63-75, Groningen, The Netherlands (online), June 2021. Association for Computational Linguistics. URL https://aclanthology.org/2021.iwcs-1.7/ .

Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In Advances in Neural Information Processing Systems , volume 33, pp. 1877-1901, 2020. URL https://proceedings.neurips. cc/paper_files/paper/2020/file/1457c0d6bfcb4967418bfb8ac142f64a-Paper.pdf .

Stefano Ceri, Georg Gottlob, and Letizia Tanca. What you always wanted to know about Datalog (and never dared to ask). IEEE Transactions on Knowledge and Data Engingeering , 1(1):146-166, March 1989. URL https://doi.org/10.1109/69.43410 .

Xingyu Chen, Jiahao Xu, Tian Liang, Zhiwei He, Jianhui Pang, Dian Yu, Linfeng Song, Qiuzhi Liu, Mengfei Zhou, Zhuosheng Zhang, Rui Wang, Zhaopeng Tu, Haitao Mi, and Dong Yu. Do NOT think that much for 2+3=? On the overthinking of long reasoning models. In Forty-second International Conference on Machine Learning , 2025. URL https://openreview.net/forum? id=MSbU3L7V00 .

Peter Clark, Oyvind Tafjord, and Kyle Richardson. Transformers as soft reasoners over language. In Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence , IJCAI'20, 2021. ISBN 9780999241165. URL https://dl.acm.org/doi/abs/10.5555/ 3491440.3491977 .

Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, and John Schulman. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168 , 2021. URL https://arxiv.org/abs/2110.14168 .

Alain Colmerauer and Philippe Roussel. The birth of Prolog. SIGPLAN Not. , 28(3):37-52, March 1993. doi: 10.1145/155360.155362. URL https://doi.org/10.1145/155360.155362 .

Evgeny Dantsin, Thomas Eiter, Georg Gottlob, and Andrei Voronkov. Complexity and expressive power of logic programming. ACM Computing Surveys , 33(3):374-425, 2001. URL https: //doi.org/10.1145/502807.502810 .

Leonardo de Moura and Sebastian Ullrich. The lean 4 theorem prover and programming language. In Automated Deduction - CADE 28 , volume 12699 of Lecture Notes in Computer Science , pp. 625-635. Springer, 2021. URL https://link.springer.com/chapter/10.1007/ 978-3-030-79876-5_37 .

DeepSeek-AI. DeepSeek-R1: Incentivizing reasoning capability in LLMs via reinforcement learning. arXiv preprint arXiv:2501.12948 , 2025. URL https://arxiv.org/abs/2501.12948 .

Edsger W. Dijkstra. A note on two problems in connexion with graphs. Numerische Mathematik , 1 (1):269-271, 1959. URL https://doi.org/10.1007/BF01386390 .

Jay Earley. An efficient context-free parsing algorithm. Communications of the ACM , 13(2):94-102, 1970. doi: 10.1145/357980.358005. URL https://doi.org/10.1145/362007.362035 .

Jason Eisner and John Blatz. Program transformations for optimization of parsing algorithms and other weighted logic programs. In Proceedings of the Conference on Formal Grammar , 2007. URL http://cs.jhu.edu/~jason/papers/#eisner-blatz-2007 .

Emily First, Markus N. Rabe, Talia Ringer, and Yuriy Brun. Baldur: Whole-proof generation and repair with large language models. In Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering , ESEC/FSE 2023, pp. 1229-1241, New York, NY, USA, 2023. Association for Computing Machinery. ISBN 9798400703270. doi: 10.1145/3611643.3616243. URL https://doi.org/10.1145/3611643. 3616243 .

Simon Frieder, Luca Pinchetti, Chevalier Chevalier, Ryan-Rhys Griffiths, Tommaso Salvatori, Thomas Lukasiewicz, Philipp Petersen, and Julius Berner. Mathematical capabilities of ChatGPT. In A. Oh, T. Naumann, A. Globerson, K. Saenko, M. Hardt, and S. Levine (eds.), Advances in Neural Information Processing Systems , volume 36, pp. 27699-27744. Curran Associates, Inc., 2023. URL https://proceedings.neurips.cc/paper_files/paper/2023/ file/58168e8a92994655d6da3939e7cc0918-Paper-Datasets_and_Benchmarks.pdf .

Giorgio Gallo, Giustino Longo, Stefano Pallottino, and Sang Nguyen. Directed hypergraphs and applications. Discrete Applied Mathematics , 42(2):177-201, 1993. ISSN 0166-218X. doi: https:// doi.org/10.1016/0166-218X(93)90045-P. URL https://www.sciencedirect.com/science/ article/pii/0166218X9390045P .

Kanishk Gandhi, Dorsa Sadigh, and Noah Goodman. Strategic reasoning with language models. In NeurIPS 2023 Foundation Models for Decision Making Workshop , 2023. URL https:// openreview.net/forum?id=MUtbsFRZwI .

Kanishk Gandhi, Denise H J Lee, Gabriel Grand, Muxin Liu, Winson Cheng, Archit Sharma, and Noah Goodman. Stream of search (SoS): Learning to search in language. In First Conference on Language Modeling , 2024. URL https://openreview.net/forum?id=2cop2jmQVL .

Nicolas Gontier, Koustuv Sinha, Siva Reddy, and Chris Pal. Measuring systematic generalization in neural proof generation with transformers. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems , volume 33, pp. 22231-22242. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/ paper_files/paper/2020/file/fc84ad56f9f547eb89c72b9bac209312-Paper.pdf .

Christoph Haase. A survival guide to Presburger arithmetic. ACM SIGLOG News , 5(4):4-21, 2018. URL https://dl.acm.org/doi/10.1145/3242953.3242964 . A concise tutorial overview on decision procedures and complexity of Presburger arithmetic.

Simeng Han, Hailey Schoelkopf, Yilun Zhao, Zhenting Qi, Martin Riddell, Wenfei Zhou, James Coady, David Peng, Yujie Qiao, Luke Benson, Lucy Sun, Alexander Wardle-Solano, Hannah Szabó, Ekaterina Zubova, Matthew Burtell, Jonathan Fan, Yixin Liu, Brian Wong, Malcolm Sailor, Ansong Ni, Linyong Nan, Jungo Kasai, Tao Yu, Rui Zhang, Alexander Fabbri, Wojciech Maciej

Kryscinski, Semih Yavuz, Ye Liu, Xi Victoria Lin, Shafiq Joty, Yingbo Zhou, Caiming Xiong, Rex Ying, Arman Cohan, and Dragomir Radev. FOLIO: Natural language reasoning with first-order logic. In Yaser Al-Onaizan, Mohit Bansal, and Yun-Nung Chen (eds.), Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing , pp. 22017-22031, Miami, Florida, USA, November 2024. Association for Computational Linguistics. doi: 10.18653/v1/ 2024.emnlp-main.1229. URL https://aclanthology.org/2024.emnlp-main.1229/ .

Tingxu Han, Zhenting Wang, Chunrong Fang, Shiyu Zhao, Shiqing Ma, and Zhenyu Chen. Token-budget-aware LLM reasoning. In Wanxiang Che, Joyce Nabende, Ekaterina Shutova, and Mohammad Taher Pilehvar (eds.), Findings of the Association for Computational Linguistics: ACL 2025 , pp. 24842-24855, Vienna, Austria, July 2025. Association for Computational Linguistics. ISBN 979-8-89176-256-5. doi: 10.18653/v1/2025.findings-acl.1274. URL https://aclanthology.org/2025.findings-acl.1274/ .

Steve Hanks and Drew McDermott. Nonmonotonic logic and temporal projection. Artificial Intelligence , 33(3):379-412, 1987. ISSN 0004-3702. doi: https://doi.org/10.1016/ 0004-3702(87)90043-9. URL https://www.sciencedirect.com/science/article/pii/ 0004370287900439 .

Peter E. Hart, Nils J. Nilsson, and Bertram Raphael. A formal basis for the heuristic determination of minimum cost paths. IEEE Transactions on Systems Science and Cybernetics , 4(2):100-107, 1968. doi: 10.1109/TSSC.1968.300136. URL https://doi.org/10.1109/TSSC.1968.300136 .

Frederick Hayes-Roth, Donald A. Waterman, and Douglas B. Lenat. Building expert systems . Addison-Wesley Longman Publishing Co., Inc., 1983. URL https://doi.org/10.1109/PROC. 1985.13159 .

Willem Heijltjes. Classical proof forestry. Annals of Pure and Applied Logic , 161(11):1346-1366, 2010. ISSN 0168-0072. doi: https://doi.org/10.1016/j.apal.2010.04.006. URL https://www. sciencedirect.com/science/article/pii/S0168007210000473 . Special Issue: Classical Logic and Computation (2008).

Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. Measuring massive multitask language understanding. In International Conference on Learning Representations , 2021. URL https://openreview.net/forum?id=d7KBjmI3GmQ .

Mark Kaminski, Bernardo Cuenca Grau, Egor V. Kostylev, Boris Motik, and Ian Horrocks. Foundations of declarative data analysis using limit Datalog programs. In Proceedings of the 26th International Joint Conference on Artificial Intelligence , IJCAI'17, pp. 1123-1130. AAAI Press, 2017. ISBN 9780999241103. URL https://www.ijcai.org/proceedings/2017/0156.pdf .

Mehran Kazemi, Najoung Kim, Deepti Bhatia, Xin Xu, and Deepak Ramachandran. LAMBADA: Backward chaining for automated reasoning in natural language. In Anna Rogers, Jordan BoydGraber, and Naoaki Okazaki (eds.), Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) , pp. 6547-6568, Toronto, Canada, July 2023. Association for Computational Linguistics. doi: 10.18653/v1/2023.acl-long.361. URL https://aclanthology.org/2023.acl-long.361/ .

Dan Klein and Christopher D. Manning. Parsing and hypergraphs. In Proceedings of the Seventh International Workshop on Parsing Technologies , pp. 123-134, Beijing, China, October 2001. URL https://aclanthology.org/W01-1812/ .

Takeshi Kojima, Shixiang (Shane) Gu, Machel Reid, Yutaka Matsuo, and Yusuke Iwasawa. Large language models are zero-shot reasoners. In S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho, and A. Oh (eds.), Advances in Neural Information Processing Systems , volume 35, pp. 22199-22213. Curran Associates, Inc., 2022. URL https://proceedings.neurips.cc/paper_files/paper/2022/file/ 8bb0d291acd4acf06ef112099c16f326-Paper-Conference.pdf .

Robert Kowalski. Predicate logic as programming language. In IFIP congress , volume 74, pp. 569-544, 1974. URL https://www.doc.ic.ac.uk/~rak/papers/IFIP%2074.pdf .

Keito Kudo, Yoichi Aoki, Tatsuki Kuribayashi, Shusaku Sone, Masaya Taniguchi, Ana Brassard, Keisuke Sakaguchi, and Kentaro Inui. Think-to-talk or talk-to-think? When LLMs come up with an answer in multi-step reasoning. arXiv preprint arXiv:2412.01113 , 2024. URL https: //arxiv.org/abs/2412.01113 .

Philipp Körner, Michael Leuschel, João Barbosa, Vitor Santos Costa, Veronica Dahl, Manuel V. Hermenegildo, Jose F. Morales, Jan Wielemaker, Daniel Diaz, Salvador Abreu, and Giovanni. Ciatto. Fifty years of Prolog and beyond. Theory and Practice of Logic Programming , 22(6): 776-858, 2022. URL https://doi.org/10.1017/S1471068422000102 .

Felix Leeb, Zhijing Jin, and Bernhard Schölkopf. Causality can systematically address the monsters under the bench(marks). arXiv preprint arXiv:2502.05085 , 2025. URL https://arxiv.org/ abs/2502.05085 .

Lucas Lehnert, Sainbayar Sukhbaatar, DiJia Su, Qinqing Zheng, Paul McVay, Michael Rabbat, and Yuandong Tian. Beyond A*: Better planning with transformers via search dynamics bootstrapping. In First Conference on Language Modeling , 2024. URL https://openreview.net/forum? id=SGoVIC0u0f .

Belinda Z. Li, Been Kim, and Zi Wang. QuestBench: Can LLMs ask the right question to acquire information in reasoning tasks? arXiv preprint arXiv:2503.22674 , 2025. URL https://arxiv. org/abs/2503.22674 .

Qintong Li, Leyang Cui, Xueliang Zhao, Lingpeng Kong, and Wei Bi. GSM-plus: A comprehensive benchmark for evaluating the robustness of LLMs as mathematical problem solvers. In Lun-Wei Ku, Andre Martins, and Vivek Srikumar (eds.), Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) , pp. 2961-2984, Bangkok, Thailand, August 2024. Association for Computational Linguistics. doi: 10.18653/v1/2024. acl-long.163. URL https://aclanthology.org/2024.acl-long.163/ .

Hunter Lightman, Vineet Kosaraju, Yuri Burda, Harrison Edwards, Bowen Baker, Teddy Lee, Jan Leike, John Schulman, Ilya Sutskever, and Karl Cobbe. Let's verify step by step. In The Twelfth International Conference on Learning Representations , 2024. URL https://openreview.net/ forum?id=v8L0pN6EOi .

Llama Team. The llama 3 herd of models. arXiv preprint arXiv:2407.21783 , 2024. URL https: //arxiv.org/abs/2407.21783 .

Haotian Luo, Li Shen, Haiying He, Yibo Wang, Shiwei Liu, Wei Li, Naiqiang Tan, Xiaochun Cao, and Dacheng Tao. O1-pruner: Length-harmonizing fine-tuning for o1-like reasoning pruning. In 2nd AI for Math Workshop @ ICML 2025 , 2025. URL https://openreview.net/forum?id= ioYybCRcyW .

Qing Lyu, Shreya Havaldar, Adam Stein, Li Zhang, Delip Rao, Eric Wong, Marianna Apidianaki, and Chris Callison-Burch. Faithful chain-of-thought reasoning. In Jong C. Park, Yuki Arase, Baotian Hu, Wei Lu, Derry Wijaya, Ayu Purwarianti, and Adila Alfa Krisnadhi (eds.), Proceedings of the 13th International Joint Conference on Natural Language Processing and the 3rd Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics (Volume 1: Long Papers) , pp. 305-329, Nusa Dua, Bali, November 2023. Association for Computational Linguistics. doi: 10. 18653/v1/2023.ijcnlp-main.20. URL https://aclanthology.org/2023.ijcnlp-main.20/ .

Xinyin Ma, Guangnian Wan, Runpeng Yu, Gongfan Fang, and Xinchao Wang. CoT-valve: Lengthcompressible chain-of-thought tuning. In Wanxiang Che, Joyce Nabende, Ekaterina Shutova, and Mohammad Taher Pilehvar (eds.), Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) , pp. 6025-6035, Vienna, Austria, July 2025. Association for Computational Linguistics. ISBN 979-8-89176-251-0. doi: 10.18653/v1/2025. acl-long.300. URL https://aclanthology.org/2025.acl-long.300/ .

David Maier, Jeffrey D. Ullman, and Moshe Y. Vardi. On the foundations of the universal relation model. ACM Trans. Database Syst. , 9(2):283-308, June 1984. ISSN 0362-5915. doi: 10.1145/329. 318580. URL https://doi.org/10.1145/329.318580 .

John McCarthy and Patrick Hayes. Some philosophical problems from the standpoint of artificial intelligence. In B. Meltzer and Donald Michie (eds.), Machine Intelligence 4 , pp. 463-502. Edinburgh University Press, 1969. URL https://philpapers.org/rec/MCCSPP .

Seyed Iman Mirzadeh, Keivan Alizadeh, Hooman Shahrokhi, Oncel Tuzel, Samy Bengio, and Mehrdad Farajtabar. GSM-symbolic: Understanding the limitations of mathematical reasoning in large language models. In The Thirteenth International Conference on Learning Representations , 2025. URL https://openreview.net/forum?id=AjXkRZIvjB .

Edward F. Moore. The shortest path through a maze. Proceedings of an International Symposium on the Theory of Switching , pp. 285-292, 1959. URL https://books.google.ch/books?id= IVZBHAAACAAJ .

Terufumi Morishita, Gaku Morio, Atsuki Yamaguchi, and Yasuhiro Sogawa. Learning deductive reasoning from synthetic corpus based on formal logic. In Andreas Krause, Emma Brunskill, Kyunghyun Cho, Barbara Engelhardt, Sivan Sabato, and Jonathan Scarlett (eds.), Proceedings of the 40th International Conference on Machine Learning , volume 202 of Proceedings of Machine Learning Research , pp. 25254-25274. PMLR, 23-29 Jul 2023. URL https://proceedings. mlr.press/v202/morishita23a.html .

Niklas Muennighoff, Zitong Yang, Weijia Shi, Xiang Lisa Li, Li Fei-Fei, Hannaneh Hajishirzi, Luke Zettlemoyer, Percy Liang, Emmanuel Candes, and Tatsunori Hashimoto. s1: Simple test-time scaling. In Workshop on Reasoning and Planning for Large Language Models , 2025. URL https://openreview.net/forum?id=LdH0vrgAHm .

Minh-Vuong Nguyen, Linhao Luo, Fatemeh Shiri, Dinh Phung, Yuan-Fang Li, Thuy-Trang Vu, and Gholamreza Haffari. Direct evaluation of chain-of-thought in multi-hop reasoning with knowledge graphs. In Lun-Wei Ku, Andre Martins, and Vivek Srikumar (eds.), Findings of the Association for Computational Linguistics: ACL 2024 , pp. 2862-2883, Bangkok, Thailand, August 2024. Association for Computational Linguistics. URL https://aclanthology.org/2024. findings-acl.168/ .

Andreas Opedal, Niklas Stoehr, Abulhair Saparov, and Mrinmaya Sachan. World models for math story problems. In Anna Rogers, Jordan Boyd-Graber, and Naoaki Okazaki (eds.), Findings of the Association for Computational Linguistics: ACL 2023 , pp. 9088-9115, Toronto, Canada, July 2023. Association for Computational Linguistics. doi: 10.18653/v1/2023.findings-acl.579. URL https://aclanthology.org/2023.findings-acl.579/ .

Andreas Opedal, Haruki Shirakami, Bernhard Schölkopf, Abulhair Saparov, and Mrinmaya Sachan. MathGAP: Out-of-distribution evaluation on problems with arbitrarily complex proofs. In The Thirteenth International Conference on Learning Representations , 2025. URL https: //openreview.net/forum?id=5ck9PIrTpH .

Arkil Patel, Satwik Bhattamishra, and Navin Goyal. Are NLP models really able to solve simple math word problems? In Kristina Toutanova, Anna Rumshisky, Luke Zettlemoyer, Dilek Hakkani-Tur, Iz Beltagy, Steven Bethard, Ryan Cotterell, Tanmoy Chakraborty, and Yichao Zhou (eds.), Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies , pp. 2080-2094, Online, June 2021. Association for Computational Linguistics. URL https://aclanthology.org/2021.naacl-main.168 .

Judea Pearl. Heuristics: Intelligent Search Strategies for Computer Problem Solving . AddisonWesley, Reading, MA, 1984. ISBN 0-201-05594-5. URL https://dl.acm.org/doi/book/10. 5555/525 .

Ivo Petrov, Jasper Dekoninck, Lyuben Baltadzhiev, Maria Drencheva, Kristian Minchev, Mislav Balunovic, Nikola Jovanovi´ c, and Martin Vechev. Proof or bluff? Evaluating LLMs on 2025 USA math olympiad. In 2nd AI for Math Workshop @ ICML 2025 , 2025. URL https://openreview. net/forum?id=3v650rMO5U .

David L. Poole and Alan K. Mackworth. Artificial Intelligence: Foundations of Computational Agents . Cambridge University Press, USA, 2nd edition, 2017. ISBN 110719539X. URL https: //doi.org/10.1017/9781009258227 .

Moj˙ zesz Presburger. Über die Vollständigkeit eines gewissen Systems der Arithmetik ganzer Zahlen, in welchem die Addition als einzige Operation hervortritt. In Comptes Rendus du I er congrès de Mathématiciens des pays Slaves, Varsovie 1929 , pp. 92-101, 1929. URL https://books. google.ch/books?id=7agKHQAACAAJ . In German.

Xiao Pu, Michael Saxon, Wenyue Hua, and William Yang Wang. ThoughtTerminator: Benchmarking, calibrating, and mitigating overthinking in reasoning models. In Second Conference on Language Modeling , 2025. URL https://openreview.net/forum?id=oHR862dpMC .

Raghu Ramakrishnan. Magic templates: A spellbinding approach to logic programs. The Journal of Logic Programming , 11(3&4):189-216, 1991. URL https://doi.org/10.1016/ 0743-1066(91)90026-L .

David Rein, Betty Li Hou, Asa Cooper Stickland, Jackson Petty, Richard Yuanzhe Pang, Julien Dirani, Julian Michael, and Samuel R. Bowman. GPQA: A graduate-level google-proof q&a benchmark. In First Conference on Language Modeling , 2024. URL https://openreview.net/forum? id=Ti67584b98 .

Mary Riley, James Greeno, and Joan Heller. Development of Children's Problem-Solving Ability in Arithmetic , pp. 153-196. Learning Research and Development Center, University of Pittsburgh, 01 1983. ISBN 978-0122847806. URL https://eric.ed.gov/?id=ED252410 .

John Alan Robinson. A machine-oriented logic based on the resolution principle. Journal of the ACM , 12(1):23-41, 1965. doi: 10.1145/321250.321253. URL https://doi.org/10.1145/ 321250.321253 .

Erik Sandewall. An approach to the frame problem and its implementation. Machine intelligence , 7 (195-204):11-19, 1972. URL https://www.ida.liu.se/ext/caisor/archive/1972/001/ caisor-1972-001.pdf .

Clayton Sanford, Bahare Fatemi, Ethan Hall, Anton Tsitsulin, Mehran Kazemi, Jonathan Halcrow, Bryan Perozzi, and Vahab Mirrokni. Understanding transformer reasoning capabilities via graph algorithms. In The Thirty-eighth Annual Conference on Neural Information Processing Systems , 2024. URL https://openreview.net/forum?id=AfzbDw6DSp .

Abulhair Saparov and He He. Language models are greedy reasoners: A systematic formal analysis of chain-of-thought. In The Eleventh International Conference on Learning Representations , 2023. URL https://openreview.net/forum?id=qFVVBzXxR2V .

Abulhair Saparov, Srushti Ajay Pawar, Shreyas Pimpalgaonkar, Nitish Joshi, Richard Yuanzhe Pang, Vishakh Padmakumar, Mehran Kazemi, Najoung Kim, and He He. Transformers struggle to learn to search. In The Thirteenth International Conference on Learning Representations , 2025. URL https://openreview.net/forum?id=9cQB1Hwrtw .

Bilgehan Sel, Ahmad Tawaha, Vanshaj Khattar, Ruoxi Jia, and Ming Jin. Algorithm of thoughts: Enhancing exploration of ideas in large language models. In Proceedings of the 41st International Conference on Machine Learning , 2024. URL https://proceedings.mlr.press/ v235/sel24a.html .

Kulin Shah, Nishanth Dikkala, Xin Wang, and Rina Panigrahy. Causal language modeling can elicit search and reasoning capabilities on logic puzzles. In The Thirty-eighth Annual Conference on Neural Information Processing Systems , 2024. URL https://openreview.net/forum?id= i5PoejmWoC .

Freda Shi, Xinyun Chen, Kanishka Misra, Nathan Scales, David Dohan, Ed Huai hsin Chi, Nathanael Scharli, and Denny Zhou. Large language models can be easily distracted by irrelevant context. In International Conference on Machine Learning , 2023. URL https://openreview.net/ forum?id=JSZmoN03Op .

Charlie Victor Snell, Jaehoon Lee, Kelvin Xu, and Aviral Kumar. Scaling LLM test-time compute optimally can be more effective than scaling parameters for reasoning. In The Thirteenth International Conference on Learning Representations , 2025. URL https://openreview.net/ forum?id=4FWAwZtd2n .

Leon Sterling and Ehud Shapiro. The Art of Prolog: advanced programming techniques . MIT Press, Cambridge, MA, USA, 2nd edition, 1994. ISBN 0262193388. URL https://cliplab.org/ ~logalg/doc/The_Art_of_Prolog.pdf .

Yang Sui, Yu-Neng Chuang, Guanchu Wang, Jiamu Zhang, Tianyi Zhang, Jiayi Yuan, Hongyi Liu, Andrew Wen, Shaochen Zhong, Na Zou, Hanjie Chen, and Xia Hu. Stop overthinking: A survey on efficient reasoning for large language models. Transactions on Machine Learning Research , 2025. ISSN 2835-8856. URL https://openreview.net/forum?id=HvoG8SxggZ .

Hisao Tamaki and Taisuke Sato. Unfold/Fold transformation of logic programs. In Proceedings of the International Conference on Logic Programming , 1984. URL https://ci.nii.ac.jp/naid/ 10000035006/ .

Robert Tarjan. Depth-first search and linear graph algorithms. SIAM Journal on Computing , 1(2): 146-160, 1972. doi: 10.1137/0201010. URL https://doi.org/10.1137/0201010 .

Alfred Tarski. A lattice-theoretical fixpoint theorem and its applications. Pacific Journal of Mathematics , 5(2):285-309, 1955. URL https://msp.org/pjm/1955/5-2/pjm-v5-n2-p11-s.pdf .

Kimi Team, Angang Du, Bofei Gao, Bowei Xing, Changjiu Jiang, Cheng Chen, Cheng Li, Chenjun Xiao, Chenzhuang Du, Chonghua Liao, Chuning Tang, Congcong Wang, Dehao Zhang, Enming Yuan, Enzhe Lu, Fengxiang Tang, Flood Sung, Guangda Wei, Guokun Lai, Haiqing Guo, Han Zhu, Hao Ding, Hao Hu, Hao Yang, Hao Zhang, Haotian Yao, Haotian Zhao, Haoyu Lu, Haoze Li, Haozhen Yu, Hongcheng Gao, Huabin Zheng, Huan Yuan, Jia Chen, Jianhang Guo, Jianlin Su, Jianzhou Wang, Jie Zhao, Jin Zhang, Jingyuan Liu, Junjie Yan, Junyan Wu, Lidong Shi, Ling Ye, Longhui Yu, Mengnan Dong, Neo Zhang, Ningchen Ma, Qiwei Pan, Qucheng Gong, Shaowei Liu, Shengling Ma, Shupeng Wei, Sihan Cao, Siying Huang, Tao Jiang, Weihao Gao, Weimin Xiong, Weiran He, Weixiao Huang, Wenhao Wu, Wenyang He, Xianghui Wei, Xianqing Jia, Xingzhe Wu, Xinran Xu, Xinxing Zu, Xinyu Zhou, Xuehai Pan, Y. Charles, Yang Li, Yangyang Hu, Yangyang Liu, Yanru Chen, Yejie Wang, Yibo Liu, Yidao Qin, Yifeng Liu, Ying Yang, Yiping Bao, Yulun Du, Yuxin Wu, Yuzhi Wang, Zaida Zhou, Zhaoji Wang, Zhaowei Li, Zhen Zhu, Zheng Zhang, Zhexu Wang, Zhilin Yang, Zhiqi Huang, Zihao Huang, Ziyao Xu, and Zonghan Yang. Kimi k1.5: Scaling reinforcement learning with LLMs. arXiv preprint arXiv:2501.12599 , January 2025. URL https://doi.org/10.48550/arXiv.2501.12599 .

George Tsoukalas, Jasper Lee, John Jennings, Jimmy Xin, Michelle Ding, Michael Jennings, Amitayush Thakur, and Swarat Chaudhuri. PutnamBench: Evaluating neural theorem-provers on the Putnam Mathematical Competition. In The Thirty-eight Conference on Neural Information Processing Systems Datasets and Benchmarks Track , 2024. URL https://openreview.net/ forum?id=ChKCF75Ocd .

Miles Turpin, Julian Michael, Ethan Perez, and Samuel R. Bowman. Language models don't always say what they think: Unfaithful explanations in chain-of-thought prompting. In Thirty-seventh Conference on Neural Information Processing Systems , 2023. URL https://openreview.net/ forum?id=bzs4uPLXvi .

Moshe Y. Vardi. The complexity of relational query languages. In Proceedings of the Fourteenth Annual ACM Symposium on Theory of Computing , STOC '82, pp. 137-146. Association for Computing Machinery, 1982. ISBN 0897910702. doi: 10.1145/800070.802186. URL https: //doi.org/10.1145/800070.802186 .

Peiyi Wang, Lei Li, Zhihong Shao, Runxin Xu, Damai Dai, Yifei Li, Deli Chen, Yu Wu, and Zhifang Sui. Math-Shepherd: Verify and reinforce LLMs step-by-step without human annotations. In Lun-Wei Ku, Andre Martins, and Vivek Srikumar (eds.), Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers) , pp. 9426-9439, Bangkok, Thailand, August 2024. Association for Computational Linguistics. doi: 10.18653/v1/ 2024.acl-long.510. URL https://aclanthology.org/2024.acl-long.510/ .

Edwin B. Wilson. Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association , 22(158):209-212, 1927. doi: 10.1080/01621459.1927.10502953. URL https://www.tandfonline.com/doi/abs/10.1080/01621459.1927.10502953 .

Wilson Wu, John Xavier Morris, and Lionel Levine. Do language models plan ahead for future tokens? In First Conference on Language Modeling , 2024. URL https://openreview.net/ forum?id=BaOAvPUyBO .

Shijie Xia, Xuefeng Li, Yixin Liu, Tongshuang Wu, and Pengfei Liu. Evaluating mathematical reasoning beyond accuracy. Proceedings of the AAAI Conference on Artificial Intelligence , 39: 27723-27730, 04 2025. doi: 10.1609/aaai.v39i26.34987. URL https://ojs.aaai.org/index. php/AAAI/article/view/34987 .

Xinnuo Xu, Rachel Lawrence, Kshitij Dubey, Atharva Pandey, Risa Ueno, Fabian Falck, Aditya V. Nori, Rahul Sharma, Amit Sharma, and Javier Gonzalez. RE-IMAGINE: Symbolic benchmark synthesis for reasoning evaluation. In Forty-second International Conference on Machine Learning , 2025. URL https://openreview.net/forum?id=QJPl0DWajD .

An Yang, Beichen Zhang, Binyuan Hui, Bofei Gao, Bowen Yu, Chengpeng Li, Dayiheng Liu, Jianhong Tu, Jingren Zhou, Junyang Lin, Keming Lu, Mingfeng Xue, Runji Lin, Tianyu Liu, Xingzhang Ren, and Zhenru Zhang. Qwen2.5-Math technical report: Toward mathematical expert model via self-improvement. arXiv preprint arXiv:2409.12122 , 2024. URL https: //arxiv.org/abs/2409.12122 .

Longhui Yu, Weisen Jiang, Han Shi, Jincheng YU, Zhengying Liu, Yu Zhang, James Kwok, Zhenguo Li, Adrian Weller, and Weiyang Liu. MetaMath: Bootstrap your own mathematical questions for large language models. In The Twelfth International Conference on Learning Representations , 2024. URL https://openreview.net/forum?id=N8N0hgNDRt .

Hugh Zhang, Jeff Da, Dean Lee, Vaughn Robinson, Catherine Wu, William Song, Tiffany Zhao, Pranav Vishnu Raja, Charlotte Zhuang, Dylan Z Slack, Qin Lyu, Sean M. Hendryx, Russell Kaplan, Michele Lunati, and Summer Yue. A careful examination of large language model performance on grade school arithmetic. In The Thirty-eight Conference on Neural Information Processing Systems Datasets and Benchmarks Track , 2024. URL https://openreview.net/forum?id= RJZRhMzZzH .

NeurIPS Paper Checklist

1. Claims

Question: Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?

Answer: [Yes]

Justification: Compare the claims with the results presented in §5.

Guidelines:

The answer NA means that the abstract and introduction do not include the claims made in the paper.

The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or NA answer to this question will not be perceived well by the reviewers.

The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings.

It is fine to include aspirational goals as motivation as long as it is clear that these goals are not attained by the paper.

2. Limitations

Question: Does the paper discuss the limitations of the work performed by the authors?

Answer: [Yes]

Justification: Limitations are discussed in an ad-hoc manner throughout the paper.

Guidelines:

The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.

The authors are encouraged to create a separate "Limitations" section in their paper.

The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.

The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.

The authors should reflect on the factors that influence the performance of the approach. For example, a facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon.

The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.

If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness.

While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren't acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.

3. Theory assumptions and proofs

Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?

Answer: [Yes]

Justification: See App. B and App. C.4 for proofs.

Guidelines:

The answer NA means that the paper does not include theoretical results.

All the theorems, formulas, and proofs in the paper should be numbered and crossreferenced.

All assumptions should be clearly stated or referenced in the statement of any theorems.

The proofs can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide a short proof sketch to provide intuition.

Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.

Theorems and Lemmas that the proof relies upon should be properly referenced.

4. Experimental result reproducibility

Question: Does the paper fully disclose all the information needed to reproduce the main experimental results of the paper to the extent that it affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided or not)?

Answer: [Yes]

Justification: We have included as much relevant details in the main text as possible. Further details on data generation can be found in App. C and details on the experiments in App. D.

Guidelines:

The answer NA means that the paper does not include experiments.

If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.

If the contribution is a dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.

Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make it possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g., in the case of a large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed.

While NeurIPS does not require releasing code, the conference does require all submissions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example

(a) If the contribution is primarily a new algorithm, the paper should make it clear how to reproduce that algorithm.

(b) If the contribution is primarily a new model architecture, the paper should describe the architecture clearly and fully.

(c) If the contribution is a new model (e.g., a large language model), then there should either be a way to access this model for reproducing the results or a way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset).

(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reproducibility. In the case of closed-source models, it may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers to have some path to reproducing or verifying the results.

5. Open access to data and code

Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material?

Answer: [Yes]

Justification: All code is available on our GitHub repository.

Guidelines:

The answer NA means that paper does not include experiments requiring code.

Please see the NeurIPS code and data submission guidelines ( https://nips.cc/ public/guides/CodeSubmissionPolicy ) for more details.

While we encourage the release of code and data, we understand that this might not be possible, so 'No' is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for a new open-source benchmark).

The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines ( https: //nips.cc/public/guides/CodeSubmissionPolicy ) for more details.

The authors should provide instructions on data access and preparation, including how to access the raw data, preprocessed data, intermediate data, and generated data, etc.

The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only a subset of experiments are reproducible, they should state which ones are omitted from the script and why.

At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).

Providing as much information as possible in supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted.

6. Experimental setting/details

Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?

Answer: [Yes]

Justification: We have specified everything we believe to be relevant, along with all details reviewers identified as missing.

Guidelines:

The answer NA means that the paper does not include experiments.

The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them.

The full details can be provided either with the code, in appendix, or as supplemental material.

7. Experiment statistical significance

Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?

Answer: [Yes]

Justification: Please refer to the tables and figures.

Guidelines:

The answer NA means that the paper does not include experiments.

The authors should answer "Yes" if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper.

The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions).

The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)

The assumptions made should be given (e.g., Normally distributed errors).

It should be clear whether the error bar is the standard deviation or the standard error of the mean.

It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have a 96% CI, if the hypothesis of Normality of errors is not verified.

For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g. negative error rates).

If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.

8. Experiments compute resources

Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?

Answer: [No]

Justification: The compute required to reproduce our experiments is not outside of the ordinary typically accessed by academic labs. Inference on all models we consider is also available through APIs.

Guidelines:

The answer NA means that the paper does not include experiments.

The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage.

The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute.

The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn't make it into the paper).

9. Code of ethics

Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines ?

Answer: [Yes]

Justification: We foresee no ethical concerns about our work.

Guidelines:

The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.

If the authors answer No, they should explain the special circumstances that require a deviation from the Code of Ethics.

The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction).

10. Broader impacts

Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?

Answer: [No]

Justification: Foundational research that is not tied to particular applications.

Guidelines:

The answer NA means that there is no societal impact of the work performed.

If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact.

Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.

The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.

The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.

If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML).

11. Safeguards

Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?

Answer: [NA]

Justification:

Guidelines:

The answer NA means that the paper poses no such risks.

Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.

Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.

We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort.

12. Licenses for existing assets

Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?

Answer: [Yes]

Justification: All assets are properly cited and used according to license.

Guidelines:

The answer NA means that the paper does not use existing assets.

The authors should cite the original paper that produced the code package or dataset.

The authors should state which version of the asset is used and, if possible, include a URL.

The name of the license (e.g., CC-BY 4.0) should be included for each asset.

For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided.

If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswithcode.com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset.

For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided.

If this information is not available online, the authors are encouraged to reach out to the asset's creators.

13. New assets

Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?

Answer: [Yes]

Justification: We provide the data and code that generated it on GitHub.

Guidelines:

The answer NA means that the paper does not release new assets.

Researchers should communicate the details of the dataset/code/model as part of their submissions via structured templates. This includes details about training, license, limitations, etc.

The paper should discuss whether and how consent was obtained from people whose asset is used.

At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.

14. Crowdsourcing and research with human subjects

Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)?

Answer: [NA]

Justification:

Guidelines:

The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.

Including this information in the supplemental material is fine, but if the main contribution of the paper involves human subjects, then as much detail as possible should be included in the main paper.

According to the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.

15. Institutional review board (IRB) approvals or equivalent for research with human subjects

Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?

Answer: [NA]

Justification:

Guidelines:

The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.

Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.

We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution.

For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.

16. Declaration of LLM usage

Question: Does the paper describe the usage of LLMs if it is an important, original, or non-standard component of the core methods in this research? Note that if the LLM is used only for writing, editing, or formatting purposes and does not impact the core methodology, scientific rigorousness, or originality of the research, declaration is not required.

Answer: [NA]

Justification:

Guidelines:

The answer NA means that the core method development in this research does not involve LLMs as any important, original, or non-standard components.

Please refer to our LLM policy ( https://neurips.cc/Conferences/2025/LLM ) for what should or should not be described.

A Further Background

A.1 Negation in Logic Programming

It is also useful to introduce a notion of negation into logic programming. We denote negation by ¬ . To accommodate negation, we introduce the extended Herbrand base H def = H ∪ {¬ h | h ∈ H } . We call an interpretation I ⊆ H consistent iff b ∈ I = ⇒ ¬ b ̸∈ I . Furthermore, a logic program P is called consistency-preserving if I is consistent implies T P ( I ) is consistent. One simple way to check whether a logic program is consistency-preserving is to inspect the program's dependency structure. Construct the predicate dependency graph G as follows. Create a vertex p for every distinct predicate symbol p appearing in P . For each rule r = ( b 1 , ..., b K ⊢ h ) ∈ P and each predicate p appearing among r 's premises, add a directed edge p → q where q is h 's predicate symbol. Then, label the edge -if p is negated and + otherwise. We say that G has a negative cycle if there exists a directed cycle that contains at least one negatively labeled edge. Logic programs that do not have negative cycles are called stratified (Abiteboul et al., 1995, §15.2). It is easy to see that any stratified logic program has a consistency-preserving fixpoint operator.

A.2 Forward Chaining

We give background details and pseudocode for the forward chaining algorithm; see Alg. 1. The algorithm takes a logic program P = R⊔ A with a set of ground goal theorems H g and returns T (true) if all goal theorems in H g can be proved. It uses a priority queue Q and a set C . The priority queue Q is called the agenda . It keeps track of theorems that are to be used to prove new theorems. The order in which the axioms are pushed to Q will determine the order in which they are popped and Q may implement any arbitrary priority policy. For example, a last-in first-out (LIFO) policy yields a depth-first search (DFS) order, while a first-in first-out (FIFO) policy yields a breadth-first search (BFS) order. The set C is called a chart . The chart keeps track of theorems that have been proved. Theorems are added to C after they have been popped from Q .

When a theorem is popped, it is used to prove new theorems if applicable. The algorithm iterates over all rules in the program and proves all conclusions that can be proved from the popped premise together with theorems that have previously been added to C . For a conclusion to be proved, there must exist an instantiation of the rule for which the premises in the instantiated ground rule are in C . The algorithm iteratively removes theorems from H g as they are proved, and terminates with the result T when H g has been emptied. If all theorems that could be proved have been popped and H g remains non-empty, the algorithm returns F (false). The algorithm may not terminate, however, if the minimal Herbrand model is infinitely large.

B Decidability of GSM Programs

Proposition 1 (Decidability) . Let P W = R W ⊔ A W be a logic program where R W is specified in Table 1 and A W is a numerically consistent subset of R W's extended Herbrand base H . Then, inference in P W is decidable, i.e., it is decidable to determine whether h ∈ T ∗ P ( A W ) for an arbitrary h ∈ H .

Proof sketch. First, observe that the extended Herbrand base H of P W is countably infinite due to the unbounded sets of quantity constants N q x and timestamp constants N t x . However, since the axioms A W were chosen to be numerically consistent and the sets Σ W p , 2 A x , and E x are all finite, it follows that T ∗ P ( A W ) -or equivalently M -contains only finitely many theorems for each element of N t x . Consequently, reasoning in P W reduces to Presburger arithmetic, as the only built-in predicate that applies to timestamps is T N + 1 , present in Rule (2) in Table 1. Since Presburger arithmetic is famously decidable (Presburger, 1929; Haase, 2018), it follows that inference in P W is decidable. ■

C Data Generation

We adapt and apply Opedal et al.'s (2025) method for generating shortest proofs with axioms that are numerically consistent. App. C.2 introduces and discusses pseudocode (Alg. 2), App. C.3 explains how we use the algorithm to generate a proof along with irrelevant axioms, and App. C.4 shows that the algorithm indeed returns a shortest proof. To do so, we define a class of logic programs of which P W is a member, and we will present a generalization of Opedal et al.'s (2025) method

Algorithm 1 Generic forward chaining

̸

that generates shortest proofs under any program in this class. We start by defining this class of logic programs in App. C.1 below.

C.1 Additional Definitions

We define the expanded Herbrand base containing all ground and non-ground atoms-including negation (App. A.1)-as ˜ H def = { p( t 1 , ..., t N ) | p ∈ Σ p , ar (p) = N,t 1 , ..., t N ∈ Σ x ∪ Σ X } ∪ {¬ p( t 1 , ..., t N ) | p ∈ Σ p , ar (p) = N,t 1 , ..., t N ∈ Σ x ∪ Σ X } . We let C : ˜ H ↦→ 2 Σ x ∪ Σ X be a function that selects a set of terms from an input atom. We refer to C ( b ) as the C -terms of b . One example of such a function in R W is to return the set of agent terms from a given atom, e.g., C (cont( A , 5 , boat , 1 )) = { A } and C (comp( A , {haruki} , 2 , boat , 1 )) = { A , {haruki} } . In the following, we will also define C of an inference rule. Indeed, r = b 1 , ..., b K ⊢ h , we define C ( r ) def = ⋃ K k =1 C ( b k ) as the union of the C -terms in the premises of the inference rule r . We similarly define C of a hyperedge: Given a hyperedge e = { b 1 , ..., b K } ↣ h , C ( e ) def = ⋃ K k =1 C ( b k ) .

̸

Definition 1. We say a set of inference rules R is C -conserving if, for every inference rule b 1 , ..., b K ⊢ h , we have C ( b k ) = {} for all k , C ( h ) = {} , and one of the following conditions holds:

̸

The rule is an introduction rule for a predicate p , and can be written as

̸

Here, we require the premises to be nonp atoms. We require the C -terms in the conclusion appear in the premises: C (p( t 1 , ..., t N )) = ⋃ K k =1 C ( b k ) . We also require that the C -terms of the premises are disjoint: C ( b k ) ∩ C ( b j ) = ∅ for all k = j . We require that R have at most one introduction rule for each predicate.

The rule is an elimination rule for a predicate p , and can be written as

̸

Here, we require that the C -term of the conclusion is distinct from that of the premises: b 1 , ..., b K -1 , C ( h ) ∩ C ( b k ) = ∅ for all k = 1 , ..., K -1 . We also require that the C -term of the premise p( t 1 , ..., t N ) contains the C -terms of all other premises and the conclusion: C ( h ) ∪ ⋃ K -1 k =1 C ( b k ) ⊆ C (p( t 1 , ..., t N )) . Finally, we require the C -terms of the other premises are disjoint: C ( b k ) ∩ C ( b j ) = ∅ for all 0 < k, j < K and k = j .

The rule is a union rule , where there is a built-in premise requiring the C -terms of the conclusion be equal to the union of the C -terms of the premises: C ( h ) = ⋃ K k =1 C ( b k ) . This rule must be unique in R .

The rule is an unused rule : it contains premises that do not unify with the conclusion of any rule.

̸

Finally, if R has multiple elimination rules for a predicate p , we require that those rules be distinct in the following way: For any two such rules, written b 1 , ..., b K -1 , p( t 1 , ..., t N ) ⊢ h and b ′ 1 , ..., b ′ K -1 , p( t ′ 1 , ..., t ′ N ) ⊢ h ′ , for any θ such that h/θ = h ′ , p( t 1 , ..., t N ) /θ = p( t ′ 1 , ..., t ′ N ) .

Given a C -conserving set of inference rules R , we will use the following short-hand notation to refer to specific subsets of rules:

R I is the set of introduction rules in R .

R E is the set of elimination rules in R .

R U is the set of union rules in R .

Definition 2. Let E : ˜ H ↦→ 2 Σ x ∪ Σ X be a function. We say a set of inference rules R is E -monotonic if, for every inference rule b 1 , ..., b K ⊢ h , we have E ( b k ) = {} for all k , E ( h ) = {} , and one of the following conditions holds:

The rule is an introduction rule; see above.

The rule is an elimination rule; see above.

The rule preserves E -terms: E ( b 1 ) = · · · = E ( b K ) = E ( h ) .

̸

To prove the optimality of our generated proofs, we need additional constraints on the relationship between introduction and elimination rules. Let C : ˜ H ↦→ 2 Σ x ∪ Σ X be a function. Consider each elimination rule b 1 , ..., b K -1 , p( t 1 , ..., t N ) ⊢ h , and let C b def = ⋃ K -1 k =1 C ( b k ) and C h def = C ( h ) . Construct a hypergraph using the following procedure: Start by mapping the atom p( t 1 , ..., t N ) to a vertex v 0 , i.e., we set ℓ ( v 0 ) = (p( t 1 , ..., t N )) . Repeat the following: For any vertex v that contains C -terms in both C b and C h (i.e., C ( ℓ -1 ( v )) ∩ C b = ∅ and C ( ℓ -1 ( v )) ∩ C h = ∅ ), and for any introduction rule b ′ 1 , ..., b ′ K ⊢ h ′ ∈ R , add a vertex for each unified premise b k /θ where ℓ ( h ′ /θ ) = v and a hyperedge from { ℓ -1 ( b k /θ ) } to ℓ -1 ( v ) . We say the elimination rule is C -locally reducible if either: (1) the hypergraph contains no edges, or (2) there exists a vertex in this hypergraph that identifies with the conclusion of the elimination rule h . If all elimination rules in R are locally reducible, we say R is in harmony . One consequence of harmony is that, in any proof P containing a proof step with an elimination rule, if the subproof of the premise p( t 1 , ..., t N ) does not contain any axioms with C -terms from both C b and C h , which is true of any proof generated by the procedure in App. C, then the conclusion of the elimination rule must be an axiom of the subproof. Therefore, P is not optimal.

̸

We note that R W is agent-conserving , i.e., R W is C -conserving where C is the function that returns the agents of any atom. In particular, if we inspect the rules in Table 1, we observe that (1a) and (1b) are elimination rules for comp , and (1c) is the corresponding introduction rule. Rules (2a) and (2b) are elimination rules for transfer . Rule (4) is an elimination rule for rate . There are no corresponding introduction rules for transfer and rate . (5a) is an elimination rule for compeq and (5b) is the corresponding introduction rule. Rule (3) is a union rule. Rule (6) is an unused rule. R W is also entity-monotonic with (4) being the elimination rule for rate . R W is also in harmony, with respect to both agents and entities: (1a) and (1b) are each locally reducible with (1c). (5a) is locally reducible with a combination of (5b) and (1c).

A ground substitution { ( X m , t m ) } M m =1 is a typed substitution where t m ∈ Σ k x , for all m ∈ [ M ] . We define Θ G ( P ) to be the set of all ground substitutions under the logic program P .

C.2 Applying Opedal et al.'s (2025) Method

Opedal et al. (2025) provide a method to generate the shortest proof for a goal h g , i.e., the shortest ( ℓ -1 ( A W ) , ℓ -1 ( h g )) -hyperpath that exists in a proof forest over the Herbrand base; see §3.2. We present the pseudocode in Alg. 2. The method takes any logic program P with C -conserving rules, e.g., P W as described in Table 1, a goal theorem h g , a set of forbidden ground theorems A × , and a

̸

̸

Algorithm 2

̸

maximum depth D . The set A × becomes relevant when generating irrelevant axioms, which will be discussed in App. C.3. For now, we assume that A × = ∅ . The algorithm will terminate and return a proof of depth D . In our experiments with P W, we use the following arguments: We sample the goal h g to be a ground atom of the form cont( A , Q , E , T ) /θ for some θ ∈ Θ( P W ) . For the agent set we make an arbitrary choice, sampling an agent set with cardinality { 1 , 2 , 3 , 4 } with probabilities { 1 ↦→ 1 / 2 , 2 ↦→ 1 / 6 , 3 ↦→ 1 / 6 , 4 ↦→ 1 / 6 } . We restrict the cardinality to 4 in order avoid generating GSM problems that are too large; see App. D.1 for dataset statistics. The timestamp is set to an arbitrary value larger than the value of D , which ensures that the timestamps remain in N t x throughout the generation procedure. We sample D uniformly at random from { 1 , 2 , 3 } for every generated proof.

Sampling proceeds recursively in a top-down manner. We then sample an inference rule b 1 , ..., b K ⊢ h , i.e., where h is the conclusion. This yields a tree. We then repeat the procedure recursively for each leaf node until the stopping criterion, i.e., required depth, has been reached. Importantly, all premises are sampled without replacement; this ensures that any individual theorem will not be used more than once in the generated proof, i.e., the proof is acyclic. For example, suppose we have cont( {haruki} , 5 , boat , 1 ) and sample an instantiation of Rule (1a) in Table 1. We generate two new premises, cont( {abu} , 3 , boat , 1 ) and comp( {haruki} , {abu} , 2 , boat , 1 ) , where the agent {abu} is a new agent that does not appear elsewhere in the proof. In Alg. 2, this is handled by maintaining a set SET of generated non-ground atoms, and by restricting the substitutions such that new C -terms are mapped to new objects. We only sample atoms that are not in SET.

We comment on two more details of Alg. 2. First, whenever we sample an elimination rule b 1 , ..., b K -1 , p( t 1 , ..., t N ) ⊢ h , we require the last premise, p( t 1 , ..., t N ) , to be an axiom, i.e., we do not recursively apply the algorithm on this premise. This is due to the fact that the rules in P are in harmony, and so the addition of introduction rules preceding elimination rules could result in locally-reducible regions in the output proof, and so the proof would not be shortest. Second, if we

̸

̸

sample a union rule, we always require the C -terms of the premises to be singleton sets. Otherwise, a shorter proof could have been obtained by several instantiations of the union rule. 16

Throughout the algorithm, we sample substitutions from Θ G ( P ) . By substituting under the constraints laid out by the arithmetic built-ins we ensure numerical consistency. However, numerical substitutions may fail due to unsatisfiable constraints, i.e., Θ ′ in Alg. 2 may become empty before we sample from it. We therefore perform rejection sampling until a successful substitution has been found. In a few cases, this may run prohibitively long. We therefore retry a maximum of 1000 times before rejecting the candidate proof and sampling a new one.

C.3 Generating Math Word Programs with Irrelevant Axioms

We apply Alg. 2 described in the previous subsection to generate irrelevant axioms. As mentioned in §4.3, we augment a logic program P W = R W ⊔ A W-as sampled by the method described abovewith M additional sets of irrelevant axioms ˜ A 1 ⊔···⊔ ˜ A M . In simple terms, we do so by applying the sampling procedure again, once for every ˜ A m , with additional restrictions to not generate duplicate axioms. As we will show later, this procedure for generating irrelevant axioms requires the additional constraint that the inference rules R in the logic program P be E -monotonic. With each application of the sampling procedure, we provide a perturbed goal argument h g . At least one C -term or E -term of the original goal will be replaced with a new value (e.g., in P W, either the agent, the entity, or both will be perturbed). Precisely which term is perturbed depends on the experimental setting (see §4.3). The set of forbidden theorems A × is initialized to be the theorems in the shortest proof (including the axioms) from P W = R W ⊔ A W, thus, avoiding generating those theorems. The same is done incrementally for the irrelevant axioms as they are generated, guaranteeing disjoint sets.

Moreover, for practical reasons, the distribution from which we sample is slightly modified. In particular, we restrict cont predicates to have singleton agent sets; otherwise, the number of irrelevant axioms could get very large. Furthermore, we exclude the rate predicate, as we found that overlapping agents and entities could sometimes be hard to instantiate with a rate atom, since it requires a particular semantic relationship between the two entity terms in the atom, e.g., 'apples' per 'basket' . Enforcing these restrictions led to substantially more efficient rejection sampling during the substitution part of Alg. 2.

When ordering the axioms in natural language, it is undesirable to have a predictable ordering of relevant and irrelevant axioms, e.g., appending all irrelevant axioms to follow the relevant ones. We therefore randomly reorder them in a manner that respects the ordering of the values of the timestamp.

C.4 Uniqueness and Optimality of Generated Proofs

Here, we will show that the above procedure for generating proofs produces a shortest proof-a proof from axioms A to a goal h g for which there does not exist a shorter proof of h g from A . Furthermore, we will show that each generated proof is unique : There are no other shortest proofs with the same axioms and goal theorem.

C -conservation, monotonicity, and harmony of the inference rules alone is insufficient to guarantee that the proofs generated by the procedure described in App. C are shortest. We need additional properties of the generated proofs, as well as a few additional definitions.

A linear chain is a sequence of hyperedges e 1 , ..., e M where the head of every edge is in the tail of the next edge (except for the last edge). More precisely, for all m , we have e m = { b m, 1 , ..., b m,K } ↣ h m , and for all 0 < m < M , h m ∈ { b m +1 , 1 , b m +1 , 2 , ... } .

Given an ( A,h g ) -proof P = (( V, E ) , ℓ ) , and an atom x ∈ H in the extended Herbrand base H (App. A.1) where ℓ -1 ( x ) ∈ V , a subproof of x is an ( A,x ) -proof P x = (( V x , E x ) , ℓ ) where V x ⊆ V and E x ⊆ E . Using this, we can define the subproof relation: If P x is a subproof of some atom in P , we write P x ⪯ P . We say a subproof P x of x contains an atom y , or similarly, y is in P x , if there is an ( A,x ) -hyperpath where ℓ -1 ( y ) is in the head or tail of any edge in the hyperpath. Similarly, we say a subproof P x of x contains a C -term t , or t is in P x , if there is some y such that P x contains y and t ∈ C ( y ) .

Theorem 1 (Generated proofs are shortest and unique) . Let R be a set of inference rules that are C -conserving, E -monotonic, and in harmony, 17 let P be an ( A,h g ) -proof in R⊔ A generated by the procedure in App. C.3, and let ˜ A be the set of irrelevant axioms generated by App. C.3. There does not exist an ( A ′ , h g ) -proof P ′ in R⊔ A ⊔ ˜ A such that | P ′ | ≤ | P | .

To prove Thm. 1 we introduce two lemmas. First, in Lemma 1, we show that the shortest proofs (without irrelevant axioms) are unique. That is, for a given goal theorem and set of axioms, there is no shortest proof that is different than the one we generate. Then, we show that the irrelevant axioms generated in App. C.3 generated through Alg. 2 can not be used to yield another shortest proof of the goal theorem; this is done in Lemma 2. Taken together, these lemmas imply Thm. 1.

Lemma 1. Let R be a C -conserving set of inference rules, and let A be a set of axioms. Then, for all theorems h g in R⊔ A such that ( A,h g ) -proof P could be generated by Alg. 2, we have that P is h g 's unique shortest proof in R⊔ A .

Proof. We perform structural induction on the subproof relation ⪯ .

We first observe that P can not have cycles: By definition, a cycle contains several vertices labeled with the same theorem. This is not possible since Alg. 2 maintains a set of already sampled theorems SET that can never be sampled again: Specifically, line 16 excludes theorems in SET from being sampled and line 24 adds generated theorems to SET.

Base Case. The base case is the smallest possible proof containing a single axiom that is also the goal theorem, i.e., an ( A,h g ) -proof P of h g with | P | = 1 . This is clearly the unique shortest proof in this case.

̸

Inductive Case. Consider the last hyperedge { ℓ -1 ( b 1 ) , ..., ℓ -1 ( b K ) } ↣ ℓ -1 ( h ) , i.e., the hyperedge for which the head is labeled with the goal theorem h of the subproof. The inductive hypothesis states that for any atom x = h in P , the subproof of x in P is the unique shortest ( A,x ) -proof in R⊔ A . We consider the various cases of inference rules in the logic program for the last hyperedge and show that the unique shortest proof of the conclusion is obtained by combining the unique shortest proofs of the premises under the inference rule corresponding to that hyperedge.

We now consider four cases.

Case 1: (Introduction) . The inference rule corresponding to the last hyperedge is an instantiation of an introduction rule:

Because there are no other introduction rules for p , C (p( t 1 , ..., t N )) = ⋃ K k =1 C ( b k ) , and the atoms in the subproofs of the premises are disjoint, the above introduction rule is the only way to prove p( t 1 , ..., t N ) . Thus, we conclude that P is the unique shortest proof of p( t 1 , ..., t N ) .

Case 2: (Elimination) . The inference rule corresponding to the last hyperedge is an instantiation of an elimination rule: b 1 , ..., b K -1 , p( t 1 , ..., t N ) ⊢ h . Due to the restriction in the generative process-see App. C.2-the premise p( t 1 , ..., t N ) is not expanded when generating P because it is an axiom. Furthermore, since C ( h ) ∩ C ( b k ) = ∅ for all premises b k , it is impossible to prove h using only the atoms in the subproofs of the premises b 1 , ..., b K -1 . In fact, since C ( h ) ⊆ C (p( t 1 , ..., t N )) , the axiom p( t 1 , ..., t N ) must appear in any proof of h . The logic program may have other elimination rules for the same predicate p , but since such rules are distinct due to C -conservation, those other rules cannot be used to derive h from b 1 , ..., b K -1 , p( t 1 , ..., t N ) . Therefore, we conclude that P is the unique shortest proof of h .

̸

Case 3: (Union) . The inference rule corresponding to the last hyperedge is an instantiation of a union rule: b 1 , ..., b K ⊢ h . Since the generation procedure in App. C.2 only generates hyperedges corresponding to union rules where the premises have disjoint C -terms, i.e., C ( b k ) ∩ C ( b j ) = ∅ for all k = j , and there is no way to prove h other than the union rule, this case is identical to Case 1 above.

Case 4: (Unused) . The inference rule corresponding to the last hyperedge is an instantiation of an unused rule. But the procedure in App. C.2 never includes such inference rules, so this is impossible.

■

̸

Lemma 2. Let R be a set of inference rules that is C -conserving, E -monotonic, and in harmony, let ( A,h g ) -proof P be the proof in R⊔ A generated by App. C.3, and let ˜ A be the set of irrelevant axioms generated by App. C.3. Then, there does not exist an ( A ′ , h g ) -proof P ′ in R⊔ A ⊔ ˜ A such that A ′ = A and | P ′ | ≤ | P | .

̸

̸

Proof. We offer a proof by contradiction. By way of contradiction, assume there exists an ( A ′ , h g ) -proof P ′ in R⊔ A ⊔ ˜ A such that A ′ = A and | P ′ | ≤ | P | . Take P ′ to be the shortest such proof. Because, by construction of the algorithm, the proof P consists of a single hyperpath starting from A . Thus, A ′ = A implies there exists an a ∈ A ′ where a ̸∈ A . Recall that P = (( V, E ) , ℓ ) is itself a proof forest. Let C ( P ) def = ⋃ e ∈ E C ( e ) be the set of C -terms in P , i.e., the relevant C -terms . Similarly, let E ( P ) def = ⋃ e ∈ E E ( e ) be set of E -terms in P , i.e., the relevant E -terms. We now consider two cases.

Case 1: C ( a ) ⊆ C ( P ) (The irrelevant axiom only has relevant C -terms). The generation procedure described in App. C.3 can only generate an irrelevant atom with relevant C -terms when generating proof trees that have E -terms that are distinct from those in the relevant proof. Therefore, the E -terms in P ′ , i.e., the irrelevant E -terms, are disjoint from those in P , i.e., the relevant E -terms. Take the linear chain e 1 , ..., e M ∈ P ′ such that a is in the tail of e 1 and h g is the head of e M . Let h m be the head of edge e m . Select the first e m such that E ( h m ) contains an E -term that is not relevant and E ( h m +1 ) has only relevant E -terms. There must be at least one such edge since h g has only relevant E -terms but a does not. Because R is E -monotonic, only elimination rules allow an E -term from a premise to be absent from the conclusion, and so e m +1 must be an instantiation of an elimination rule

and E ( h ) ∪ E ( b k ) = E (p( t 1 , ..., t N )) , for any k . The E -terms of h m and h m +1 are included in E (p( t 1 , ..., t N )) . Thus, the premise p( t 1 , ..., t N ) must contain both relevant and irrelevant E -terms. Note that in the generation procedure described in App. C.3, no axiom is generated that contains both relevant and irrelevant E -terms. Therefore, p( t 1 , ..., t N ) must be derived from axioms other than a . However, because R is in harmony, the subproof of this premise must contain h , and so the proof P ′ is not shortest, which is a contradiction.

Case 2 C ( a ) ⊈ C ( P ) (The irrelevant axiom has an irrelevant C -term). Take the linear chain e 1 , ..., e M ∈ P ′ such that a is in the tail of e 1 and h g is the head of e M . Let h m be the head of edge e m . Select the first e m such that C ( h m ) ⊈ C ( P ) and C ( h m +1 ) ⊆ C ( P ) . There must be at least one such edge since h g has only relevant C -terms but a does not. Since the R is C -conserving, only elimination rules allow a C -term from a premise to be absent from the conclusion, and so e m +1 must be an instantiation of an elimination rule

and C ( h ) ∪ ⋃ K -1 j =1 C ( b j ) ⊆ C (p( t 1 , ..., t N )) . That is, the C -terms of h m and h m +1 are included in C (p( t 1 , ..., t N )) . Thus, the premise p( t 1 , ..., t N ) must contain both relevant and irrelevant C -terms. Note that in the generation procedure described in App. C.3, no axiom is generated that contains both relevant and irrelevant C -terms. Therefore, p( t 1 , ..., t N ) must be derived from other axioms. However, since R is in harmony, the subproof of this premise must contain h , and so the proof P ′ is not shortest, which is a contradiction. ■

We can now prove Thm. 1 using the above lemmas.

Theorem 1 (Generated proofs are shortest and unique) . Let R be a set of inference rules that are C -conserving, E -monotonic, and in harmony, 18 let P be an ( A,h g ) -proof in R⊔ A generated by the procedure in App. C.3, and let ˜ A be the set of irrelevant axioms generated by App. C.3. There does not exist an ( A ′ , h g ) -proof P ′ in R⊔ A ⊔ ˜ A such that | P ′ | ≤ | P | .

Proof. By Lemma 1, there exists one unique shortest proof P of a goal theorem from a set of relevant axioms and this is the proof we generate as the ground-truth proof. By Lemma 2, there will be no additional proofs P ′ where | P ′ | ≤ | P | when generating irrelevant axioms through our procedure. Therefore, all our generated proof systems have a unique shortest proof, which is identical to the ground-truth proof that is generated through our procedure. ■

2

3

4

5

6

7

8

9

10

11

12

13

# Steps

0

20

40

60

80

100

120

# Problems

Base Problem Length

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

0

10

20

30

40

50

60

70

80

# Problems

Number of Axioms

Complexity

Base

w/ Axiom

w/ Tree

w/ Multiple Trees

D More Details on Experiments

D.1 Dataset Statistics

Here, we present more statistics on the datasets used in our experiments (§5). Fig. 4 shows the distribution of the number of edges in the proofs in the base problems, which is equivalent to the number of non-axiom theorems. The numbers range from 2 to 13. 19 The distribution is skewed towards shorter problems. This was done by design in order to prevent saturation when evaluating models with different levels of capabilities.

Fig. 5 shows the number of axioms the GSM problems contain, including irrelevant ones. As expected, adding one irrelevant axiom (w/ axiom) yields a distribution that is shifted by exactly one additional axiom as compared to the base distribution. When adding a single irrelevant tree (w/ tree), the distribution shifts further and spreads out. This trend is further amplified when adding multiple irrelevant trees (w/ multiple trees).

D.2 Prompt

See Fig. 6 for the prompt used in our experiments.

[PROMPT 1]

You are a helpful assistant tasked with solving math word problems. You follow the formatting of the problems and the solutions as given in the examples below.

Q: Lib possesses 20 puzzles. Shanna has 4 puzzles more than Lib. Shanna then donates 5 puzzles to Costa. Shanna has 6 puzzles more than Valeria. Valeria has 11 puzzles more than Clementius. How many puzzles does Clementius have totaled?

A: Let's think step by step.

Lib possesses 20 puzzles.

Shanna has 4 puzzles more than Lib.

So Shanna has 20 + 4 = 24 puzzles.

Shanna then donates 5 puzzles to Costa.

So Shanna has 24 - 5 = 19 puzzles.

Shanna has 6 puzzles more than Valeria.

So Valeria has 19 - 6 = 13 puzzles.

Valeria has 11 puzzles more than Clementius.

So Clementius has 13 - 11 = 2 puzzles.

Therefore, the answer (arabic numerals) is 2.

[...repeat...]

Q: Stacee owns 18 necklaces. Stacee then gets 14 more necklaces from Felic. Valencia has 11 necklaces less than Stacee. How many necklaces does Valencia have?

A: Let's think step by step.

[GENERATION 1]

Stacee owns 18 necklaces.

Stacee then gets 14 more necklaces from Felic.

So Stacee has 18 + 14 = 32 necklaces.

Valencia has 11 necklaces less than Stacee.

So Valencia has 32 - 11 = 21 necklaces.

[PROMPT 2]

Therefore, the answer (arabic numerals) is

[GENERATION 2]

21

D.3 Example Proof

In this section we give an example proof in natural language. Consider the following problem, with the irrelevant axioms marked in bold :

Anatola has 67 keys. Ichabod has 23 packets. Clayborne has 55 crayons. Pieter has 20 parrots. Ichabod has 30 packets less than Winnah. Pieter then gives Yorgos 6 parrots. Clayborne has 96 crayons less than Imogene. Anatola has 55 keys less than Rahel. Dennie has 19 parrots. Dianna owns 4 parrots. The number of parrots that Edgar has more than Pieter is the same as the difference between the number of parrots that Dennie has compared to Dianna. Edgar has 3 parrots more than Eddie. How many parrots does Eddie have in all?

Note that the only axioms that are relevant are the ones containing information about parrots. The shortest proof for this problem requires the application of four inference rules and can be written in natural language as follows:

Pieter has 20 parrots.

Pieter then gives Yorgos 6 parrots.

So Pieter has 20 - 6 = 14 parrots.

Dennie has 19 parrots.

Dianna owns 4 parrots.

So the difference between the number of parrots Dennie and Dianna have is 19 - 4 = 15.

The number of parrots that Edgar has more than Pieter is the same as the difference between the number of parrots that Dennie has compared to Dianna.

So Edgar has 14 + 15 = 29 parrots.

Edgar has 3 parrots more than Eddie.

So Eddie has 29 - 3 = 26 parrots.

In this case, employing a best-first search heuristic based on lexical overlap with the query (i.e., prioritizing theorems that contain information about parrots) will yield the above shortest proof. Llama-3.1-8B-Instruct did not opt for that strategy. Instead, it generated the following, inefficient solution to this problem:

Anatola has 67 keys.

Anatola has 55 keys less than Rahel.

So Rahel has 67 + 55 = 122 keys.

Ichabod has 30 packets less than Winnah.

So Winnah has 23 + 30 = 53 packets.

Clayborne has 96 crayons less than Imogene.

So Imogene has 55 + 96 = 151 crayons.

Pieter has 20 parrots.

Pieter then gives Yorgos 6 parrots.

So Pieter has 20 - 6 = 14 parrots.

The number of parrots that Edgar has more than Pieter is the same as the difference between the number of parrots that Dennie has compared to Dianna.

Dennie has 19 parrots and Dianna has 4 parrots.

The difference between Dennie and Dianna is 19 - 4 = 15.

So Edgar has 15 more parrots than Pieter.

Edgar has 15 + 14 = 29 parrots.

Edgar has 3 parrots more than Eddie.

So Eddie has 29 - 3 = 26 parrots.

Therefore, the answer (arabic numerals) is 26.

D.4 Further Empirical Results

Accuracy Stratified by Agent and Entity Overlap. Fig. 7 shows further stratified results that were mentioned in §5.1. We briefly note that these results suggest that the models might make use of a heuristic based on such overlap. (Recall that the problem sets are otherwise identical.) One could reasonably expect that a model could learn such a heuristic, based on previous work suggesting that models may derive the conclusion to a proof step greedily within a forward pass before initiating the step in the output tokens (Kudo et al., 2024; Wu et al., 2024).

Parsing Reasoning Model Outputs. Since QwQ-32B and DeepSeek-R1 did not generate output corresponding to strings in our verbalized program, we performed a separate, more crude analysis for those two models. Rather than matching the full generated token sequence, we match only the arithmetic expressions. They are matched with the ground-truth expressions from the built-ins of the corresponding inference rules. This can only be done for theorems that are not axioms, since only those require an arithmetic built-in (i.e, arithmetic expression) to prove. Arithmetic expressions are extracted flexibly, accounting for formatting irregularities and natural language that may be interleaved. The parser may also predict no match for a particular model output if no matches are found.

We manually verified parsing accuracy (macro-average) on model outputs over 20 randomly selected example problems. The parser predicted the correct match (or correctly predicted no match) in 94.4% of cases for QwQ-32B and 94.8% of cases for DeepSeek-R1.

Table 4 displays the results. We observe results that are overall consistent with the main conclusions of the paper; even state-of-the-art models like DeepSeek-R1-despite performing well in terms of accuracy (Table 2)-appear to generate theorems that are irrelevant to the goal theorem. As with the two models discussed in the main text, the efficiency scores decrease when there is agent and/or entity overlap between the irrelevant axioms and the goal theorem.

w/ Axiom

w/ Tree

w/ Multiple Trees

Complexity

0.0

0.2

0.4

0.6

0.8

1.0

Meta-Llama-3.1-8B-Instruct

w/ Axiom

w/ Tree

w/ Multiple Trees

Complexity

Qwen2.5-Math-7B-Instruct

w/ Axiom

w/ Tree

w/ Multiple Trees

Complexity

QwQ-32B

w/ Axiom

w/ Tree

w/ Multiple Trees

Complexity

DeepSeek-R1

no overlap

entity overlap

agent overlap

agent and entity overlap

Search Order. While our results in §5.2 suggest that LMs make use of information in the query to prove goals, they also reveal that LMs generate irrelevant theorems. Thus, LMs appear to use some heuristic, albeit an imperfect one, in their reasoning. Here, we present a limited analysis on whether this heuristic could be in combination with either DFS or BFS. We do so by examining the order in which intermediate theorems, both relevant and irrelevant, are generated by the LM, and comparing this order to the respective reference orders. Furthermore, we compare the LM's ordering to the theorems in the shortest proof as visited in DFS order as a control.

Before presenting the results, we make note of a few limitations of this analysis. First, the only irrelevant theorems we consider in the DFS and BFS orderings are those that are generated by Alg. 2 when sampling the axioms for the irrelevant goal theorems ˜ h 1 ... ˜ h M (§4.3). In addition, we note that the in-context examples were ordered according to DFS; see §5. However, the examples were chosen so that the ordering of theorems that are not axioms would be the same under both DFS and BFS. We therefore ignore the axioms as we compare the orderings.

Concretely, the DFS and BFS orderings correspond to the order in which atoms are popped from the chart C in Alg. 1, where: (i) C is implemented as a stack for DFS and a queue for BFS, (ii) the axioms are popped from the agenda Q in the order in which they are presented (i.e., pushed) to the model in natural language (as described in §5), and (iii) we do not include pops of axioms.

As our metric, we compute the Levenshtein distance between the sequence of indices produced by the LM and the ground truth reference ordering under the different search orders, normalized by the longest of the two sequences. The results are shown in Fig. 8. We observe that the models' search orders are closer to DFS than to BFS across all types of query overlap. Furthermore, for Llama-3.1, they are closer to the DFS-based ordering required for the shortest proof than DFS when there is no agent or entity overlap between the goal and the irrelevant axioms. Qwen2.5-Math appears to be less efficient however, consistent with the results in §5.2. These findings suggest that LMs tend to follow a depth-first exploration of the proof space in combination with the superficial heuristic. However, future work should perform a more rigorous analysis to confirm these preliminary findings.

none

entity

agent

agent and entity

Overlap

0.0

0.2

0.4

0.6

0.8

1.0

Levenshtein distance

Meta-Llama-3.1-8B-Instruct

none

entity

agent

agent and entity

Overlap

Qwen2.5-Math-7B-Instruct

DFS

BFS

Efficient DFS

Peer reviews:
comments: SUMMARY:
The paper studies a very basic question: "Is it true that LLM performance degrades when irrelevant facts are provided". In particular, the paper investigates the question whether the reasoning gets worse (unnecessary steps are performed). 

In order to do this, the paper uses word problems since smallest proofs for them are unique (this allows measuring non-optimality of the proof generated by LLM). It compares proofs generated by three open-source models with different amount of irrelevant facts and showed that with the amount of irrelevant information increasing the performance is decreasing.

STRENGTHS AND WEAKNESSES:
The paper is interesting and written well; however, the answer that the paper shows is expected and the paper doesn't give any guidance on how this result could be applied in practice. In addition, the problem studied is very far from real-life examples.

QUESTIONS:
1. It would be good to add variance to the plots on Figure 1. 
2. line 231: It would be good to explain why smallest proof is a tree-like proof; for many proof systems the difference between tree- and proof-like proofs is big.
3. line 164: it would be good to mention algorithms such as A* here.

LIMITATIONS:
yes
TITLE: Official Review
CLARITY: 3
IMPACT: 3
ORIGINALITY: 3
DATE: 2025-07-03

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThis paper explores the efficiency of large language models (LLMs) when solving arithmetic reasoning problems, particularly when faced with irrelevant information. The authors introduce a formal proof system for grade-school math problems, allowing for precise definitions of efficiency and irrelevance through the concept of a \"normal form\" for proofs. Their experiments reveal that LLMs' answer accuracy significantly drops when problems include irrelevant facts, even if seemingly related, and that these models often generate inefficient proofs by taking unnecessary steps. The analysis suggests that LLMs tend to employ a depth-first search strategy, partially guided by lexical overlap with the query, but this heuristic isn't always effective in filtering out noise.\n\nSTRENGTHS AND WEAKNESSES:\n### Strengths\n\n*   Strong Theoretical Framing and Formalization: The paper establishes a well-defined theoretical framework for reasoning and introducing irrelevant axioms. It formally defines a proof system as a 3-tuple (L, A, R) and provides precise characterizations of concepts like efficiency and irrelevance. This formalization, including the property of confluence that ensures a unique, most efficient normal form for proofs, is a key strength that allows for rigorous evaluation.\n*   Novel Evaluation Methodology: The study introduces a new dataset specifically designed to evaluate Language Models (LMs) in the presence of many irrelevant facts, a setting that more closely mirrors real-world reasoning challenges than typical evaluation paradigms. The method for generating problems with irrelevant axioms, sourced from other normal-form proofs and controlling for complexity and lexical overlap, is a new perspective to me.\n*   Comprehensive Proof Verification: Unlike many studies that only verify the final answer, this paper evaluates the full proof generated by the LM, comparing it to the most efficient ground-truth proof. This is done via an automatic evaluation based on semantic parsing, which is a more fine-grained approach to assessing reasoning.\n\n### Weaknesses\n\n*   Limited Impact of Irrelevance on Advanced Models' Accuracy: While the paper concludes that irrelevant axioms lead to significantly lower answer accuracies, this finding appears less pronounced for the most capable models like DeepSeek-R1, where performance is \"nearly saturated\" with only \"slight decreases\". The observation that LMs use more test-time compute than necessary might be an expected behavior for complex models, and similar overthinking has been noted in other models. This slightly weakens the claim that these LMs are easily \"distracted\" in terms of *accuracy*, though their *efficiency* is clearly impacted.\n*   Informal Definitions for Problem Generation Properties: Despite a strong theoretical framework for proof systems, the definitions of \"complexity\" (Axiom, Tree, Multiple Trees) and \"lexical overlap\" (entity, agent) in the irrelevant fact generation process are described conceptually rather than with the same level of formal rigor. More formal definitions or references would enhance the clarity and robustness of these experimental parameters.\n*   Lack of Concrete Natural Language Examples: The paper describes the generation of natural language annotations for problems and proofs. However, it does not provide full natural language examples of the augmented problems given to the LMs. This makes it difficult for readers to intuitively grasp the actual complexity and reasonableness of the tasks from an LM's perspective (Table 1 shows only templates).\n*   Potential Scalability and Generalizability Concerns of \"Most Efficient Proof\": The reliance on a \"provably unique normal form\" for the \"most efficient ground-truth proof\" is a strength for the specific arithmetic proof system studied. However, this concept of a single \"most efficient proof\" might not generalize well to more complex or open-ended reasoning problems where multiple valid proofs exist, or where trial-and-error is an inherent part of the problem-solving process, and an \"efficient\" path is not always guaranteed or even discoverable upfront.\n\nQUESTIONS:\n1.  Clarify the \"Distraction\" Conclusion for Advanced Models:\n    *   Question/Suggestion: The paper's conclusion states that irrelevant axioms lead to \"significantly lower answer accuracies\". However, for the most capable model, DeepSeek-R1, Table 2 indicates performance is \"nearly saturated\" with only \"slight decreases\" in accuracy. While Figure 2 shows LMs, including DeepSeek-R1, use more tokens (indicating efficiency loss), this may be an expected behavior for complex models. Could the authors refine their conclusion to clearly differentiate between the impact on *accuracy* vs. *efficiency*, particularly for advanced reasoning models, and provide a more nuanced discussion of what \"distraction\" entails in this context for state-of-the-art LLMs?\n    *   Criteria for Score Change: A revised or more detailed analysis that precisely delineates how irrelevance affects accuracy versus efficiency across different model capabilities would significantly enhance the paper's clarity and the empirical robustness of its claims, positively impacting the evaluation of its significance and quality.\n\n2.  Distinguish Novelty from Prior Work (e.g., GSM-Logic/GSM-NoOp):\n    *   Question/Suggestion: The paper states it \"extends their method to generate proofs with irrelevant axioms\" and creates \"problems with many irrelevant axioms\". Please explicitly clarify the significant differences and novelties of your irrelevant fact generation methodology and proof evaluation approach compared to existing benchmarks that incorporate irrelevant information or provide programmatic/proof-based evaluation, specifically addressing works such as \"GSM-Logic\" (e.g., GSM-NoOp), which might also specify programs as proofs. Does your generation of irrelevant axioms from other *normal-form proofs* and control over \"complexity\" and \"lexical overlap\" offer distinct advantages?\n    *   Criteria for Score Change: A clear articulation of the methodological advancements and empirical distinctions from relevant prior work (like GSM-Logic's approach to irrelevant information or structured proofs) would greatly enhance the paper's perceived originality and contribution, leading to a higher evaluation of its significance.\n\n3.  Formalize \"Complexity\" and \"Lexical Overlap\" Definitions:\n    *   Question/Suggestion: While the paper provides a robust theoretical framework for proof systems, the \"Complexity\" (Axiom, Tree, Multiple Trees) and \"Lexical overlap\" (entity, agent) properties used to generate irrelevant facts are described conceptually. To align with the paper's formal emphasis, could the authors provide more formal definitions or cite specific references for these terms and their quantification?\n    *   Criteria for Score Change: Introducing more formal definitions or appropriate academic references for \"Complexity\" and \"Lexical Overlap\" would enhance the paper's rigor and clarity in its experimental design, improving its overall quality.\n\n4.  Provide a Complete Natural Language Problem Example:\n    *   Question/Suggestion: The paper describes generating natural language annotations for problems with irrelevant axioms but does not show a complete example of such an augmented problem (i.e., the actual input given to the LLM). Table 1 only provides templates for inference rules. To help readers intuitively assess task complexity and the reasonableness of the generated questions, could the authors include at least one full natural language example of a problem augmented with interleaved irrelevant axioms?\n    *   Criteria for Score Change: Presenting a concrete, end-to-end natural language example of an augmented problem would significantly improve the clarity and practical understanding of the experimental setup, positively impacting the evaluation of the paper's clarity and quality.\n\n5.  Discuss Scalability of \"Most Efficient Proof\" for Harder Reasoning:\n    *   Question/Suggestion: The paper's evaluation relies on comparing LM outputs to a \"provably unique normal form\" of the \"most efficient ground-truth proof\". While this is a strength for the arithmetic proof system studied due to its confluence, the paper also notes that \"Proving all possible facts... is computationally intractable in general\". Could the authors discuss the generalizability and scalability of this \"most efficient proof\" concept and evaluation methodology to more complex or open-ended reasoning problems where a unique normal form might not exist, finding it is intractable, or where trial-and-error is an inherent and normal part of the problem-solving process? How might this framework adapt or be limited in such scenarios?\n    *   Criteria for Score Change: A thoughtful discussion acknowledging the limitations of the \"most efficient proof\" concept for more challenging and open-ended reasoning domains, and exploring how their methodology might need to be adapted or its claims re-contextualized for such scenarios, would strengthen the paper's overall significance and provide a more comprehensive assessment of its applicability.\n\nLIMITATIONS:\nyes", "TITLE": "Official Review", "RECOMMENDATION": 4, "REVIEWER_CONFIDENCE": 3, "CLARITY": 2, "IMPACT": 2, "ORIGINALITY": 3, "DATE": "2025-07-03"}

{"IS_META_REVIEW": false, "comments": "SUMMARY:\nThe work \"Language Models Are Inefficient Reasoners\" investigates how current large language models handle reasoning in the presence of many irrelevant axioms within grade‑school arithmetic word problems. The paper argues that language models are inefficient reasoners when tasks contain many distractor facts, with the example of achieving normal form efficiency in formal proof systems. The authors adapt the GSM arithmetic generator to insert irrelevant axioms while preserving consistency, varying the complexity (single axiom / single tree / three trees) and lexical overlap (none/entity/agent/both).\n\nThe paper finds that the answer accuracy falls sharply with irrelevance (e.g. Llama‑3 drops from 65% to 41% when three irrelevant trees are added). Parsed proof steps reveal high recall but low precision, indicating many superfluous inferences, while search‑order distance analysis shows traces are closer to DFS than BFS. The authors conclude that LMs employ a depth‑first style strategy guided by a weak lexical heuristic.\n\nSTRENGTHS AND WEAKNESSES:\nStrengths:\n* [*originality*] as far as I know, this is the first systematic study of irrelevant‑fact noise on LM proof search; the work introduces a novel confluence‑based efficiency metric;\n* [*quality*] the formal proofs are correct, and dataset construction algorithms are clear;\n* [*structure*] the paper is easy to read and understand, and illustrative examples are helpful;\n* [*significance*] dataset and metrics may be introduced into standard benchmarking for researchers working on reasoning, search and CoT evaluation; the paper also promises to release the code for data generation which is always helpful.\n\nWeaknesses:\n* [*originality*] the work deals with arithmetic domain only and relies on an existing GSM generator;\n* [*quality*] there are only four models in the comparison, and 500 samples per condition may be insufficient; \n* [*quality*] the semantic parser is imperfect (94-95% accuracy) which could bias precision/recall;\n* [*significance*] the work is limited to short arithmetic proofs, so it is unclear whether the conclusions transfer to other domains (e.g., logical or commonsense reasoning).\n\nQUESTIONS:\n1. Significance: can you add statistical tests (confidence intervals or McNemar/paired bootstrap tests) for accuracy and precision to support claims of significant degradation?\n2. Model diversity: can you include at least one closed‑weight frontier model (e.g. GPT‑4o) via API to check whether scaling or RLHF reduces inefficiency?\n3. Semantic parser reliability: please provide an error analysis of the 5–6% unmatched proof steps; could systematic misses from the parser distort the results?\n\nLIMITATIONS:\nMostly adequately addressed in the paper. Some additional points:\n* reliance on template parsing restricts coverage;\n* proofs are limited to depth ≤ 3.", "TITLE": "Official Review", "RECOMMENDATION": 4, "REVIEWER_CONFIDENCE": 3, "CLARITY": 3, "IMPACT": 2, "ORIGINALITY": 3, "DATE": "2025-07-03"}

comments: SUMMARY:
The paper evaluates how efficiently language models perform arithmetic proof search when faced with irrelevant information. Using a formal proof system and uniquely defined efficient proofs, the authors show that even strong LMs often include unnecessary steps, especially when irrelevant facts overlap with the query. The models tend to follow depth-first-like search guided by imperfect heuristics, revealing a gap between getting correct answers and reasoning efficiently.

STRENGTHS AND WEAKNESSES:
Strengths
- Well-controlled experiments using a clearly defined proof system.

Weaknesses
- While the controlled setup is appreciated, it may be overly simplistic and may not generalise well to real-world reasoning tasks.
- The negative impact of irrelevant premises is a known issue, even outside rigorously defined proof systems, which may limit the novelty of the conclusions.
- The claim that LLM proof search follows a DFS-like ordering is interesting, but the experimental evidence supporting it is not entirely convincing.

QUESTIONS:
- In Table 2, for Llama-3.1-8B under “w/ Axiom”, why is the accuracy with irrelevant axioms (60.8%) higher than the control (54.0%)? Does this suggest that irrelevant information improves performance, or is it a typo?
- Could you clarify the results in Table 3? It’s unclear how the experiments demonstrate that LMs are empirically worse at proving ground theorems.

LIMITATIONS:
yes
TITLE: Official Review
CLARITY: 2
IMPACT: 3
ORIGINALITY: 2
DATE: 2025-07-08