Reasoning-as-Logic-Units: Scaling Test-Time Reasoning in Large Language Models Through Logic Unit Alignment
Authors: Cheryl Li
Tianyuan Xu
Steven Y. Guo
Venue: ICML 2025 poster (2025)
Keywords: large language models
LLMs
reasoning
code generation
Primary area: deep_learning->large_language_models
TL;DR: We propose a novel test-time scaling framework to aligning the logic between LLM-generated programs and reported reasoning steps for a more reliable reasoning path.

Abstract: Chain-of-Thought (CoT) prompting has shown promise in enhancing the reasoning capabilities of large language models (LLMs) by generating natural language (NL) rationales that lead to the final answer. However, it struggles with numerical computation, which has somehow led to the development of program-aided techniques.
Despite their potential, a persistent challenge remains: inconsistencies between LLM-reported reasoning steps and the logic in generated programs, which we term ``reasoning hallucinations." This stems from the inherent ambiguities of NL and the statistical nature of LLMs, which often lack rigorous logical coherence.
To address this challenge, we propose a novel test-time scaling framework, Reasoning-as-Logic-Units (RaLU), which constructs a more reliable reasoning path by aligning logical units between the generated program and their corresponding NL descriptions.
By decomposing the initially generated program into discrete units using static analysis, RaLU engages in an iterative dialogue with the LLM to judge, refine, and explain each unit.
A rewind-and-correct mechanism ensures alignment between code statements and task requirements in each unit, ultimately forming a cohesive reasoning path under the program's logic, from which the model reaches a final solution.
Our experiments demonstrate that RaLU significantly outperforms existing baselines in mathematical reasoning (GSM8K, MATH) and algorithmic reasoning (HumanEval+, MBPP+), underscoring its potential to advance LLM reasoning and programming by offering enhanced accuracy and interpretability.

Scaling Test-Time Reasoning in Large Language Models Through Logic Unit Alignment
Cheryl Li Tianyuan Xu Yiwen Guo
Abstract
1. Introduction
Extensive studies have shown that Chain-of- ofo--ougTThtttt (CoT) (Wei et al., 2022) prompting can improve the reasoning ca- pabilities of large language models (LLMs) (Mondorf & Plank, 2024; Fu et al., 2023; Liu et al., 2023a) by requir- ing LLMs to generate a rationale before its final decision. Complementary to CoT and its variants, program-aides tech- niques like Program-of-Thooee have emerged, which decompose complex reasoning and numerical computation by prompting LLMs generate pro- grams and external interpreters to solve mathematical problems. When combined with test-time scaling, which dynamically allocates more computational resources during inference, these methods optimize LLM performance in rea- soning tasks, particularly mathematical and algorithmic domains (Zhong et al., 2024).
Mlain-of-Thoughe (CoT) prompting has shown promise in enhancing the reasoning capabilities of large language models (LLMs) by generating natural language (NL) rationales that lead to the fi- nal answer. However, it struggles with numerical computation, which has somehow led to the de- velopment program- program-aided aided techniques. Despite their potential, a persistent challenge remains: in- consistencies between LLM-reported reasoning steps and the logic in generated programs, which we term "reasoning hallucinations." This stems from the inherent ambiguities of NL and the sta- tistical nature of LLMs, which often lack rigor- ous logical coherence. To address this challenge, we propose novel test-time scaling framework, Reasoning-as -a-unng-s-LLoee as-LLogic- Uniss Units (RaLU), which con- structs more reliable reasoning path by aligning logical units between the generated program and their corresponding NL descriptions. By decom- posing the initially generated program into dis- crete units using static analysis, RaL.U engages in iterative dialogue with the LLM judge, re- fine, and explain each unit. A eewind-and-corree mechanism ensures alignment between code state- ments and task requirements in each unit, ulti- mately forming a cohesive reasoning path un- der the program's logic, from which the model reaches a final solution. Our experiments demon- strate that RaLU significantly outperforms exist- ing baselines in mathematical reasoning (GSM8K, MATH) and algorithmic reasoning (vumanEval++ MBPP+), underscoring its potential to advance L.M reasoning and programming by offering en- hanced accuracy and interpretability.
(PoT) (Chen et al., 2023b)
Despite these advancements, both CoT and PoT face signifi- cant challenges. The inherent ambiguity and imprecision in natural language (NL) impede precise calculations in CoTT- like methods (Yu et al., 2024; Gao et al., 2023). Meanwhile, PoTs simply replace NL reasoning with programs, so they cannot improve L.LM in code generation, yet solving algo- rithmic problems is an important aspect of LLM reasoning. Plus, crafting accurate programs in single attempt remains challenging (Chen et al., 2024a), PoT can even introduce more errors than CoT sometimes (Li et al., 2024).
Furthermore, simple combinations of CoT and PoT cannot yield satisfactory outcomes. Research indicates that guiding an LLM to generate step-by-step analysis in NL before deriv- ing programs may not outperform direct prompting (Huang et al., 2024a). This underperformance can be traced to inconsistencies between reasoning steps and the logic in generated programs, which we term "Reasoning Halluci- nations." The hallucinations manifest as: 1) accurate NL step descriptions but logical errors in individual code state- ments; 2) missing key steps or inclusion of irrelevant ones; and 3) correct steps misordered or improperly connected. Examples of these three types are presented in Figure 1.
'Independent Researcher, Beijing, China "Peking Univer- sity, Beijing, China. Correspondence to: Yiwen Guo <guoyi- wen89@ gmail.com>.
These reasoning hallucinations arise from the statistical na- ture of LLMs, which generate responses based on token predictions rather than true reasoning. LLMs mimic reason-
Proceedings of the 42nd International Conference Machine Learning. Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).

---

Submission
Type 1: Accurate NL step but logical errors in the code mathematical expression
Type 2: Missing key steps in NL descriptions or mode//mttematicall expressions
Type 3: Individually correct NI. steps and
correct code/expressions but wrong connections
Question (MATHH-up up 794) Find the smallest postblee valse (y
Question (GSMBB 38), John plans sell his toys and use the them for $15 each. Ile ends up buying video for $29 cuch and los $5 lell. How many logo aets dlas le still have?
integrrs rod and the count red and blue colored balls, You have to arrnnge thow kalls to form trtangle euch that the 1st zow will have 1 ball, the 2nd zow will have 2 balls, the 3rd row will have 1 balls, and so on All the balls in a particular row
Question (1 Cade 5200): You
1c-9)
(1-370-33 where
games,
blae
o [2- 2l5s
K.y, and 2 are distinet real numbers.
(COT. Deepseck(3]; eee Step I: I:Simplify the expression Let's the expression as F.
sets, John has 13 Lego sets and be sells each one for $15, We
I. First, determine the total insorme from selling lego seta logo
Response (PoT, Llama-3.3)
have different colors Retur the maximum height of the triangle that be achieved.
shoudi be the sams colee and udjacent cows, should
need know luw much money curss in lotal.
We can resriite each term by factoring out- -I from the denominators where uncesoury.
grmme
Calculate the lotal cost video gunes: buys video find how
money
Response (CoT, Laama-3.3, truncated):
combinations: with red blue
ap
these video
bulli. hundle them
Find the lotill money from welling
sete we wdl the and the money be lis left,
Rould trinegle a looge starting-coler balls for odd-
The first term becomes:
xf
(y- 1)²
(y- xf (--yle- xii
money he spent on video
can get the total money he got from selling the Lege sets. a Calculatc the remsining Lagu setse By subieacting the
sumbered zows, different- color balls even numbered rows,
a row is buill, increment row number and try the ned.
(-- 3kc x]
-12 yll x]
LLup termitatiion: suhitaci row. coreesponling tall number from botal. If remaining - O can't build the row, get max sows by subiracing leam current numbee
number Lego sets be sold from the original number. we can find out how many Lego acts he still hus.
second term becomes
After bandling both achieved
return the max triapple height
(
-X
01 2P
total legos-
scedes
-code-
Thus, the expression simplibee to
E
1--W0-23 vity -1 Lx-
third becomes:
(y-xp*
(l--))) +) (c-aly-1)
(: (2-9F
(y-ally a4 4)
(4- (ky-a)
money left -
hotal money spent 88 video came price
Siace John sold all his sets, he should have ich.
video game. price 20
Calculate the total money John geta from selling the lego sels hotal, money, ccom 13'15
Calculate total money spends on video gumes
15
Intal money, carn
-total money, spent money_ Jefty
cam lotal, money spert
def Oriieigh red int, bluee int) int: ans 0
for (s.g) [(rod, Blue), (ldus, rall]:
while Truet (011 111
jebw:y-mi
1ify maxians 1-3), breald
1 mannians, H-1 breale
TT=1 1---1-.-0
ffi is on 1: X-
ifx 0
ify <y-u
ama maxffns, 1-1
break
maxtans, b-1
<Answers--ell Sererr//S/////////eee
ans - <rende>
<todes
return ans
beesk
Earor Analysis In Step the Al carrectly pinpoint to factor
Earor Aualysis The critical usissing step was solving
Error Amalysis:
The main
this code
logic
out I from the demormnatios to wewitt the expression as P. However, il mishaniied the sxgelive signs for the third lerm. le, the positions of and x should he exchanged This led to an crcuncous simplifiatiio where negutive siga was applied twice,
sold
checking remsining number halls Specificalle the less than
step the descciption conrectly indicates that calculating the
both the odd- me and exen now hull suht ractions This menne that after subtroction for an odd add-ommbered tow makes negattive, the code will still prosersd to cleckk y fur regativity, and vice verss. This can lcadl tn incarnect rcsullas as the loop should termiinae immedistely once ethher color runs out of sufficient ballss.
whether
placed
the leftover tadded by the spenti), Howerer, when wriling the codk, asaumed John sold all lego sets probably the problem states he "plans to sell alll" wilhoua astuaally calculating the mumber of lago scta suld. leading to a wronng final answer.
the result, eitoe propagates snower, which
instrad.
Figure 1. Motivating examples reflecting the reasoning hallucinations: In Example 1, the LLM attempts to factor out the negative sign as stated yet wrongly neglects to reverse the positions of x and y in the expression. In Example 2, the LLM overlooks the NL step that indicates using the leftover to calculate the money earned; instead, it is misled by the question description to sell all the sets, thus omitting this crucial step. In Example 3, the LLM incorrectly places the loop termination conditions after operating on both odd- and even even-numbered rows, which should be positioned individually.
ing by reproducing patterns linked to logical explanations but are trained on text that often lacks rigorous logical co- herence (Lenat & Marcus, 2023). The scarcity of detailed mapping from NL reasoning to precise, logical expressions like code or equations means LLMs struggle to capture the underlying logic patterns under former expressions, not to mention reproducing such patterns, resulting in such incon- sistencies. Moreover, previous findings suggest this mis- alignment also affects other reasoning tasks, raising doubts about the authenticity of reported reasoning steps (Li et al., 2024). Unlike factual hallucinations that can be mitigated by introducing external information, reasoning hallucinations are intrinsic to the model's internal processing and pose a unique challenge in reliable LLM reasoning.
Tree-of-Thoughe (ToT) (Yao et al., 2023) for illustration.
Specifically, our framework involves four core actions: self- reason, self-judge, self-explain, and self-correct, organized into three primary stages: 1) Logic Unit Extraction: The framework begins by directly generating a program to ad- dress the given problem. This program serves as repre- sentation of the reasoning process. Using static analysis tool, we create control flow graph (CFG) to depict the program's 's logic. RaLU traverses this CFG, dividing it into logical units based on program branches like conditional and looping statements. Each unit comprises several code statements, implementing operations for problem-son solving. 2) Logic Unit Alignment: RaL.U initiates an iterative di- alogue with the same LLM to assess the correctness of each logic unit. Beyond being judge, the LLM explains the operations within each unit to ensure alignment with the problem specification. Should errors arise, the LLM self-corrects the unit, and the dialogue will rewind to the previous round for re-evaluation on the corrected unit. The reasoning path branches out until correctness is achieved or predefined threshold is reached. 3) Solution Synthesis: A After processing all logic units, we obtain a reasoning path where each node is self-verificd or contains self-corrected version of code statements and NL explanations. Using this hybrid reasoning path as a conversation history, the LLM generates the final solution to the reasoning task.
To overcome this challenge, we propose a novel reasoning framework that leverages programs as the logical skele- tons and natural language as explanatory content. Our key insight is that if the two representations of reasoning pro- cesses, i.c., NL reasoning steps and generated programs, are aligned in the same fundamental logic, the reasoning path would be more reliable. Each reasoning step can be projected to a series of code statements, and the latter serves as the formalized implementation of the former. Hence, we introduce our test-time scaling framework, Reasoning-as- Logic-Unite Units (RaLU). Figure 2 compares its reasoning path to that of CoT, Self-consistnncy (Wang et al., 2023), and
2

---

Submission
Question
Question
Question
Question
Self-correet
Majority Vote
Solution
Solution
Solution
Solution
CoT
Self- Consistency
ToT
RaLU (Ours)
Figure Schematic depicting multiple strategies for test-time scaling frameworks with LLMs. Each rectangular shape symbolizes a distinct thought (aka. step/unit), a self-contained text sequence crucial as intermediate stage in the reasoning process. In previous studies, all the thoughts are natural language-based, based, while our RaLU uses logic units consisting of code statements and NI. deseriptions.
We evaluate RaLU four benchmarks, including two for mathematical reasoning (GSM8K (Cobbe et al., 202 lb), MATH (Hendrycks et al., 2021)) and the other two for code reasoning: Evaa (Chen et al., 2021), МЫРР (Austin et al., 20 and their plus versions (Zhong et al., 2024). The evaluation involves three L.M backbones: Deepseek- Ex-
isting studies have shown that simply mixing code and text during pre-training or instruction-tuiing stages can enhance LLM reasoning (Ma et al., 2024), but how to effectively combine them remains under explosion.
2.2. Code Reasoning with LLMs
and Qwen2.5-72BBInsstnn perimental results show that RaLU achieves significant im- provement in final answer accuracies or pass @ compared with best-performing baselines, with specific improvement of 1 1.22%, 2.07%, 6.60% and 2. 17% on these four bench- marks, respectively. It is worth noting that RaLU outper- forms the best-performing L.LM family of reasoning mod- els, ol, on HumanEval+ and MbPP+. We further perform an extensive ablation study demonstrate the contribu- tions to our key design in RaLU. Our code is available at /etps://githin com wwon/Deeppccept/Raae.
V3, 1--ama..3-70B-Inntt
Inference-side approaches for coding tasks usually focus on debugging and refining the generated code since is prone to logic errors, dead loops, and other unexpected behaviors. Many studies (Chen et al., 2023a; 2024b) generate unit tests or feedback from the same LLM score and refine the generated programs, and ChatRepair (Xia & Zhang, 2023) relies on hand-writing test cases. Another stream of studies combines traditional software engineering tools to improve code quality, including executors (Zheng et al., 2024; Ni et al., 2023) and repair tools (Fan et al., 2023). Recent studies on multi-agent frameworks (Lee et al., 2024; Hong et al., 2024) also achieve advanced performance on coding tasks. They borrow the information provided by software analysis tools and embed such information into prompts to expand the ability bounds of LLMs in code reasoning.
2. Related Works and Discussions
2.1. General Reasoning with LLMs
Prompting techniques have greatly improved the reasoning abilities of LLMs. CoT (Wei et al., 2022) is the most pop- ular paradigm, deriving large number of variants such Least-to-Most (Zhou et al., 2023) and Auto-CoT (Zhang et al., 2023). The central concept of these approaches is "divide and conquer"-prompiiie plex problems into simpler sub-tasks, systematically ad- dress each one by reporting the process and then synthesize comprehensive final answer. Some studies directly let LLMS write programs serve reasoning steps, such as PoT (Chen et al., 2023b) and Program-aided Language models (Gao et al., 2023), decoupling computation from reasoning and language understanding. However, they can- not improve the performance of LLMs in coding tasks and struggle with writing perfect programs within a single query, thus introducing more errors sometimes (Li al., 2024). Ex-
2.3. Test-Time Scaling for LLM Reasoning
Recent studies have revealed that using more test-time com- putation can enable LLMSs to improve their outputs (Snell et al., 2024). A primary mechanism is to select or vote the best CoT path from multiple independent sampling, such as Best-of-N sampling (Cobbe et al., 2021a) la) and Self- Consistency (Wang al., 2023). Innovations like ToT (Yao et al., 2023), Graph-of-Thoughh (GoT) (Besta et al., 2024), and DeAR (Xue et al., 2024) design search-based schemes to expanding the range and depth of path exploration, though they are often suitable for specific tasks (e.g., the Game of 24) as they require to pre-define fixed candidate size for each node, leading to redundancy or insufficiency.
LLMSS to deconstruct com-
Another stream of research scales inference time by en-
3

---

Submission
self-consistent reasoning path where computational va- abling models to critique and revise their answers iteratively, which has been applied in general reasoning tasks (Kamoi et al., 2024; Liu et al., 2024). Intrinsic self-correction asks LLMs to identify and fix errors based on their inner knowl- edge without any external tools or information, such as Self-Check (Miao et al., 2024), Self-Refine (Ranaldi & Fre- itas, 2024), and StepCo (Wu et al., 2024). External self- correction allows for tool usage such as code interpreters and search engines (Gou et al., 2024; Ding al., 2024). Recent studies have reported that intrinsic self-correction may strug- gle with judging or modifying their own responses (Kamoi et al., 2024; Huang et al., 2024b). Yet, a more recent em- pirical study shows that intrinsic self-correction capabili- ties are exhibited across multiple existing LLMSs under fair prompting do not directly or indirectly influence the LLM to change or maintain its initial answer (Liu et al., 2024).
lidity and conceptual clarity mutually reinforce each other. This architecture not only minimizes logical discrepancies but also provides transparent intermediate steps for error diagnosis and refinement.
3.1. Logic Unit Extraction
RaLU begins with prompting the LLM to generate an ini- tial program that serves as a reasoning scaffold for the task. While possibly imperfect, this program approximates the logical flow required to derive a solution, providing a struc- tured basis for refinement.
We apply static code analysis to construct Control Flow Graph (CFG), where nodes represent basic blocks (sequen- tial code statements), and edges denote control flow tran- sitions (e.g.. branches, loops). A CFG explicitly surfaces a program's 's decision points and iterative structures, whose details are illustrated in Appendix A.2. RaLU then parti- tions the code into atomic units by dissecting the CFG at critical
3. Keasoning-as-Loggin Units
We propose a novel structured test-time scaling framework, RaLU, which enforces alignment between NL descriptions and code logic to leverage both sides. Programs ensure rigorous logical consistency through syntax and execution constraints, whereas NL provides intuitive representations with problem semantics and human reasoning patterns.
ciniiioonnnnnniioonnlll blocks (if/else), loop bound- aries (for/while), and function entries. Each unit encapsu- lates a self-contained computational intent, such as iterating through list or evaluating a constraint.
Specifically, RaLU operationalizes this synergy through three iterative stages (as shown in Figure 3): Logic Unit Ex- traction, Logic Unit Alignment, and Solution Synthesis. The first stage decomposes an initially generated program into atomic logic units via static code analysis. Then, an iterative multi-turn dialogue engages the LLM to 1) explain each unit's 's purpose in NL, grounding code operations in problem semantics, 2) validate computational correctness and seman- tic alignment with task requirements, and 3) correct errors via a rollback-and-revise protocol, where detected incon- sistencies trigger localized unit refinement. The validated units form a cohesive, executable reasoning path. The final solution,
3.2. Logic Unit Alignment
The alignment stage iteratively validates and refines logic units through a stateful dialogue governed by:
V, = LLLMMM
S
+
① Uu + P(U)) R==
(I)
where Uf denotes the i-th unit, S is the task specification, and the operator @ represents contextual concatenation. P(44) instructs the LLM to handle the i-th unit, where each turn of interaction is responsible for judging the correctness, modifying it upon errors, and explaining it to align with the task specification. Thus, each response V; = (J,, U.) com- prises a judgment token J, E {OK, WRONG) and a refined unit U4: The refinement adheres to:
stage synthesizes this path into a ensuring the final answer inherits the program's 's logical rigor while retaining natural language fluency.
In this way, RaLU can significantly mitigate reasoning hal- lucinations. First, each unit scamlessly pairs executable code with NL explanations to address the type-one hallu- cination through explicitly aligning local logic. Second, the LLM focuses only one unit per response in case of missing a crucial step or introducing an irrelevant step, and iterative verification ensures that the LLM notices all prob- lem constraints. Third, these logic units are interconnected rigorously along the program structure, ensuring logical coherence of the reasoning path.
Ui LLM (S, h <)
if J, = OK otherwise
ú,
(2)
To prevent error cascades, corrections trigger a partial rewind: the original unit 24, is replaced by the refined ver- sion U, in the interested reasoning path. Then, U, will be re-va re-validated based previous units (24 lk < i}. This aims to construct a path P with all nodes able to pass self-judging:
Vue E P = (4I, ... 1u11) Js = OK.
(3)
In summary, by structurally enforcing bidirectional align- ment between code logic and textual justifications, we build
The correctness process terminates under two conditions:
1) fixed-point convergence, i.e., all units satisfy J; =
4

---

Submission
Itcrative dialogue
Unit 3: levels.ppendttop. level"
CFG Generation
Question: |Reasoning Task] Write code to salve this question.
WRONG: <Hicslevels. append (top (2v))"(""))) The current logic calculates the square footage of each level incorrectly.
top_ jop_level- - 16
[top level " (0.5 "1
for in (d)] average sum(levels)) len(levels) aus average
Unit appendltppp (2"")
OK: aligns with specification and ensures the correct calculation...
Question: [Reasoning Task]
Write a program to solve this problem based the history conversation.
scodes
top level=16 level-[]
levels. append(top level
levels - [top_ level ' (2 " for in range(4))
Solution
Execution
</code>
Aligned Logic Units
Figure 3. Illustrating the three-stage process of RaLUU Logic Unit Extraction, Logic Unit Alignment, and Solution Synthesis for operationalizing synergy in reasoning tasks.
OK A U. = Lii indicating that no further are refinements needed; and 2) a predefined iteration limit or confidence threshold is reached. Upon triggering the second condition, multiple candidate units will exist, and we select the optimal version 24 using normalized confidence metric. In this case, there are multiple candidates for a unit, and none of them has been judged as correct. We select the most con- fident response. The confidence score is calculated as the following equation 4, based on the log probabilities, which express token likelihoods on a logarithmic scale (-oo, O), reported by the LLM.
when serving as a judge (Thakur et al., 2024) (where a can reach 0.9+), so the above condition can be easily achieved with intelligent LLMs. Nevertheless, if the model is almost perfect (p 1), then using RaLU cannot make significant improvement even though (p' > p).
In addition to evaluating and refining the unit, the LLM is tasked with generating explanations that explicitly map the unit's behavior to the task specification. These explanations serve two critical roles. First, they help to justify whether the unit aligns with or violates the intended logic. Second, they demystify the reasoning process, exposing the LLM's thinking about execution behavior in human interppriteeeetabllee terms. By linking concrete code elements to abstract speci- fication requirements, the LLM acts as translator between implementation and intent. This dual focus on correctness and explainability ensures that both the code and its ratio- nale evolve cohesively during refinement.
Conf(i)= = Σ o (pp)), j=1
(4)
a(lp,) = min (e's + 0.005, 1) 10
where 1py denotes the log probability of the j-th token in the LLM's response, mapped to [0,1] scale via the clamping function a. For LLMs lacking log probability outputs, we employ a self-consistency checking process-pee prompptin the same L.M ranks candidates to determine U
3.3. Solution Synthesis
Through logic unit alignment, RaLU constructs a coherent sequence of self-verified operations paired with precise NL. explanations. This establishes a unified reasoning path that integrates computational logic with interpretive alignment (with problem specifications), ensuring rigorous consistency between code behavior and reasoning steps. Guided by this aligned reasoning path, the LLM synthesizes the struc- tured units into a final solution using the following prompt: "Based on the previously self-verified reasoning path, gener- ale correct program to solve the given problem."
Herein, we discuss whether ú is more likely be cor- rect than its original version U for any unit, that is P(U is correct) = p < P(K) is correct) = p'. Let's de- fine = ((J(M) = OK l/ is correct) (true positive rate) and B = ((](W)- = WRONG| is incorrect) (true nega- tive rate). Thus, we have:
p' ap + Trepaii- [(1 a)p + B(1 - -
(5)
where Trepair- P(R(U)) is correct ((U) WRONG) with R(.) representing the LLM's repair action. Then, the condi-
This dual-anchoring mechanism-enforet executable logic and specification-aligned reasoning- eliminates ambiguities for response generation. We formalize the effectiveness of RaL.U through a Bayesian inference lens, demonstrating how iterative logic unit
program-
tion of p' > is transformed as:
(6) See Appendix A.3 for the detailed derivation. Empirical studies show that modern L.MSs can achieve high accuracies
Trepair P(M is correct] = WRONG).
5

---

Submission
alignment systematically amplifies the likelihood of generating correct programs.
from (Ling et al., 2023) 1. We use the metries of the answer aceuracy and pass @ score for math- and code-reasoning, respectively. All the experiments are conducted three times independently. We report the average result in the format of j(+t) ), where jr is the mean, and a is the standard de- viation. Our focus on math- and code-reasoning is due to the availability of well-established benchmarks and the ease of evaluating outputs. RaLU can be directly applicable to other domains with minimal adjustments the prompts.
Let C' denote the event where the LLM produces a program correctly solving the task, and C its complement. Each logic unit (1 S S n) represents a self-verified reasoning step aligned with both program execution and problem semantics. By Bayes' theorem, the posterior probability of correctness, conditioned on validated units, is:
P(C O.) - PiO O,I0) P( On|C)- P(O).......II)PPP P P(O,....
Baselines. We compare RaLU against three categories of baselines without fine-tuning or external information: I) promoting methods for general purposes: Direct Prompting, Zero-Shot CoT (Wei et al., 2022). ToT (Yao et al., 2023), and Self-Consistency (SC) (Wang et al., 2023). 2) self- correction-basse approaches: Self-Calibration (Scal) (Ka- davath et al., 2022), and Self-Refine (SR) (Ranaldi & Freitas, 2024); 3) techniques specific for either task: PoT (Chen et al., 2023b), Self-Check (SCheck) (Miao et al., 2024), and rubber-duck debugging derived from Self-Debug (SD) (Chen et al., 2024b). Details of these baselines are provided in Appendix B.2.
P( On)
(7)
Note that correct program inherently exhibits logical co- herence, making its reasoning steps more likely to align with human-judged validity, so ((OI.)),,OII)))) >> P(O), ... O,ICC. This asymmetry implies:
P(O "(...... Cx(C) 21 = P(C On)) > P(C) P(O On)
Implementation. We deploy RaLU on three open-source LLMs: Deepseck-V3 V3 (Dec 2024), Qwen2.5-72B Instrucct (April 2024). To
(
(Sep 2024), and --0tma3.37----nmeee prevent breaches of anonymity, we do not deploy RaLU on commercial closed-source models such as GPT's and ol. Instead, we compare RaLU with the public results of these closed-source LLMs reported on the leaderboard maintained by (Liu et al., 2023b; Paperwithcode, 2025; Mirzadeh et al., 2024), presented in Appendix C. We set the maximum num- ber for self-correction turns as 3 and the maximum number of candidate solutions/branches as 10 for Self ceff-Consistency and ToT. The temperature parameter is set to 0.7, and the frequency penalty is 0.3 in all experiments.
Hence, RaLU's 's rewind-and-corred mechanism-by enfore- ing consistency across units-statisticalll statistically elevates the prior correctness probability P(C) (initial program quality) to a higher posterior P(C1O1... ... On). This Bayesian pro- gression quantifies how structured, self-validated reasoning suppresses hallucinations, ensuring solutions inherit rigor from aligned logic units.
Crucially, even if generating incorrect solutions, RaLU maintains granular traceability through self-contained logic units. This enables precise identification of defective compo- nents responsible for errors, rooted in the framework's 's trans- parency. By transforming black-box reasoning into more debuggable processes, RaLU accelerates error correction and enhances interpretability for human-AI collaboration.
4.2. Results
Table summarizes the performance of RaLU on math and code reasoning. Across all benchmarks and diverse LLM architectures, RaLU consistently outperforms existing base- lines, demonstrating its generalizability and robustness. We analyze the advantages through three critical comparisons:
4. Experiments
4.1. Experiment Setup
RaLU v.s. Single-Path Reasoning. Compared to direct prompting, CoT, and PoT (single reasoning path per query), RaLU achieves an average improvement of + +12.81 21%8 % and +14.85% for math and code reasoning, respectively, at- tributed to its structured decomposition of problems into logical units aligned with programmatic constraints, mitigat- ing the inconsistencies inherent in linear reasoning chains,
Benchmarks. We use five benchmarks: three for mathematical reasoning: GSM8K (Cobbe et al., 20)1b), MATH (Hendrycks et al., 2021), and AQUA (Ling et al., 2017), well as the other two for code reasoning, Hu- manEval (Chen et al., 2021) and Mbpp (Austin et al., 2021), along with their extended versions with more test cases (Liu et al., 2023b). See Appendix B.I for more details about the benchmarks. We evaluate RaLU on the whole test set except MATH. Due to resource limitation, we follow (Miao et al., 2024) to use subset of MATH (named by MATH-np) taken
lattps://gittub.ccmm///e wttp://oo..ooooccci//eeeiiio cot wwwllo//main//eeee httpaa////eetttttttttcsspp////// cttpppttttpp...oc s/natural. program/MA Mwtp///ATHT_AAg poi.npjjsoo
6

---

Submission
Table Ral.U significantly increases final scores with all the three I.L. backbones. A Gain the performance gain of RaI.U compared with the best perffornfnn baseline.
Dataset
LLM
Direct
CoT
ToT
PoT/SR*
SC
SCal
SCheck/SD*
RaLU
AGain(%)
DeepSeek V3
0.917
0.968
0.921
0.939
0.965
0.949
0.942
0.971
+0.310
GSM8K
Qwen2.5-72B 5-BBB
0,940
0.967
0.937
0,951
0,964
0.945
0.901
0.980
+1.344
Llama3.3-72B
0.826
0.944
0,904
0.876
0.945
0.928
0.881
0.964
+2.011
DeepSeek V3
0.691
0.723
0.643
0.751
0.703
0.814
0.601
0.821
+0.860
MATH-np
Qwen2.5-72B
0.706
0.708
0.689
0,753
0.780
0.726
0.693
0.791
+1.410
Llama3.3-72B 0.347
0.541
0.489
0,551
0.607
0.539
0.533
0.631
+3,954
DeepSeek V3
0.768
0.811
0.772
0.799
0.839
0.807
0,783
0.843
+0.420
AQUA
Qwen2.5-72B
0.764
0.799
0.791
0,807
0.779
0.811
0.772
0,846
+4.316
Llama3.3-72B
0.512
0.583
0.555
0.496
0.610
0.598
0.528
0.610
DeepSeek V3
0.915
0.915
0.890
0.854
0.933
0.921
0.878
0.939
+0.643
HumanEval
Qwen2.5-72B
0.841
0.872
0,841
0.707
0.738
0.787
0.774
0.909
+4.243
Llama33.-72B 0.689
0.713
0.704
0.591
0.713
0.701
0.585
0.811
+13.745
DeepSeek V3
0.878
0.878
0.835
0,805
0.884
0.866
0.799
0.902
+2.036
HvmanEval+
Qwen2.5-72B
0.793
0.793
0.823
0,659
0.707
0.750
0.738
0.860
+4.496
Lllama3.--2BB
0.628
0.652
0.653
0.512
0.671
0.646
0.543
0.768
+14.456
DeepSeek V3
0.923
0.926
0.910
0,892
0.921
0.915
0.899
0.937
+1.188
Mbpp
Qwen2.5-72B
0.921
0.894
0,910
0.862
0.921
0.918
0.902
0.926
+ 0.543
Llama3.3-72B
0.807
0.828
0.782
0.738
0.823
0.831
0.775
0.836
+0.598
DeepSeek V3
0.783
0.778
0.759
0.720
0.791
0.786
0.767
0.833
+5.310
Mbpp+
Qwen2.5-72B
0.791
0.765
0.778
0.730
0.775
0.780
0.791
0.828
+4.678
Llama3.3-72B
0.664
0.704
0.601
0.550
0.698
0.685
0.638
0.709
+0.710
Using the former method for math reasoning and using the latter method for code generation.
either represented in NL (CoT) programs (PoT). We display more cases about how RaLU reduces reasoning hallucinations of the combination of CoT and PoT in Ap- pendix D.I. RaLU enables fuller exploration in the diverse solution subspaces, resulting in optimal solution generation.
errors localized and resolved before subsequent units are processed while reducing LLM calls by about 60+%. A refined unit i directly informs the context for unit + 1, pre- venting error propagation. This enables RaLU to outperform Self-Check by 15.07% on average, achieving accuracy and efficiency through context-aware, incremental validation.
RaL. v.s. Multi-Path Exploration. Multi-pati patti-pathhhee methods like Celf-Consistency, Self-Check, and ToT aim select the optimal reasoning path over multiple samples. SC and ToT rely on sampling fixed times of independent candidates (up to 10 paths/branches), yet RaLU surpasses them by +9.55 +9.55% and +10.69% for math and code reasoning, respectively, with far fewer candidates (< per unit). This is because RaL.U reduces cascading errors by isolating and refining individual units with hybrid reasoning representations. In contrast, SC or ToT might aggregate multiple incorrect paths that share the same flawed premise.
RaLU v.s. Self-Correction Methods. Many existing selffcorrretion-biie methods (e.g., Self-Refing and Self- Debug), often degrade performance by introducing errors into initially correct responses flaw exacerbated by their assumption of imperfection existence in the initial response attempt. RaLU mitigates this via a judgmmnt stage, where LLMSs validate each unit before refinement. This proactive verification yields an average gain of 18.28% over these baselines. Though Self-Calibration applies holistic self-judgment to reduce wrong edits, it still underperforms RaLU by 6.13% and 9.1 1.11% for math and code, respectively, as end-to-end validation fails to isolate localized inconsisten- cies addressed by RaLU 's granular, unit-level verification.
While Self-Check improves robustness through weighted voting-prioritizing solutions with internally consistent steps-it suffers suffers from two critical limitations: First, its step- wise regeneration and comparison decorrelate errors but fail propagate corrected logic subsequent steps. Second, each re-generation requires 3+ LLM calls with redundant contexts, incurring high costs without guaranteeing holistic consistency. RaLU addresses these via unit-level iterative refinement. By decomposing reasoning into logical units,
In summary. RaLU outperforms baselines by combining formal correctness (via code) and interpretability (via NL). This dual approach enables precise, self-contained error correction, significantly mitigating reasoning hallucinations.
Multiple runs. Given the inherent stochastic nature of

---

Submission
Table 2. The repeated three runs of experiments using Qwen-72-Instruct on Mbpp/Mhppt+ and Math-np. In each cell in the format of - o, jt is the mean, and a is the standard deviation.
Dataset
Direct
CoT
ToT
PoT/SR*
SC
SCal
SCheck/SD
RaLU
Mbpp
0.895100.0014 0.923=0.0070
0.905=0.0045
0.860=0.0046
0.922=0.0033
0.92420.0038
0,905=:0.0038
0.957=100012
Mbpp+
0.788=0.0021
0.701=0.0052
0.772=0.0046
0.725=0.0038
0.779=0.0061
0.787=0.0122
0.750=000349
0.856=20.0017
Math-np
0.705100.0065
0.70110.0088
0.695:10.0045
0.743110.033
0.7641100014
0.72510.0065
0.6851:0.0088
0.80311000055
Table 3. Average token consumption of RaLU and baselines on MATH-np using Soven-22B-Instuvee In each cell. i/o denotes the average
input and output token consumption, respectively. RaLU consumes 15x tokens compared to CoT, while saves 10x tokens compared multi-path reasoning baselines such as Self-Check and ToT.
Task
Direct
Col
ToT
Por
SC
SCal
SCheek
RaLU
MATH-ap
8x100/xx10*
8010'555xx0' 7.5x10'1.2100
1x 1.3x10%3x10" 1.5x10"/8x00
10 10
LLMs and the absence of seed support in the official API, we conducted two extra independent runs to further validate the robustness of RaLU across different model configura- tions. To conserve computational resources, we performed additional trials on Qwen-72B 72B-IIstruce for the MATH and MBPP/MBPP benchmarks, rather than repeating the full set of experiments. The results-reoorted reported mean + stan- dard deviation in Table 2 are consistent with our findings, further confirming RaLU's s stable and reliable performance.
However, independent unit verification delays error detec- tion, requiring repetitive corrections across multiple units. In contrast, CFG-based grouping localizes errors within bounded logical scopes.
The surge in token usage is intuitive. Each line triggers sep- arate verification dialogue, multiplying interaction rounds. Moreover, the LLM repeatedly re-encounters overlapping contexts and generates similar NL descriptions across units, wasting tokens on redundant information.
Inference Cost. This section compares the inference token consumption of RaLU and baselines on MATH-np using Awvn-72B-Instruus as dataset MATH is complex enough to require the most token consumption. As shown in Table 3, RaLU consumes 15x tokens compared to CoT, while saving 10x tokens compared to multi-path reasoning baselines such as Self-Check and ToT.
1.a
RM in by Line
0.8-
0.6-
0.4
5. Ablation Studies
0.5
5.1. CFG v.s. Line-by-line
WAThin
HumanEval HumonEvaln
Mopo
Mbo0
Figure 4. Ablation study of logic unit granularity: line-by-line de- composition causes 7.04% performance decline and 37.7% more token overhead compared to the CFG method (Llama). Perfor- mance degradation reflects contextual fragmentation and error propagation in atomic units, while increased token costs are at- tributed redundant context re-verification.
To validate the influence of the granularity of the logic unit on RaLU, replace the CFG-driven decomposition with line-by-line approach, treating each code line in the origi- nally generated program as an independent logic unit. As displayed in Figure 4, results show an average performance decline of 7.04% across all benchmarks on Llama3.3, along- side a 37.7% increase token consumption.
5.2. NL Steps v.s. Logic Units
To further validate the necessity of program-guided logic units, we remove the initial program generation phase and instead treat each natural language reasoning step under the CoT prompting as an independent unit. This ablation leads to a 5.52% accuracy drop on mathematical tasks and 4.35% score drop on code reasoning, as shown in Figure 5, directly attributable to exacerbated reasoning hallucinations, The amplified decline highlights the fundamental limitations of pure natural language reasoning units.
The observed decline stems from three intrinsic limitations of line-by-line decomposition. First, programs inherently consist of interdependent code blocks (e.g., loops, condition- als). Splitting them into isolated lines disrupts contextual de- pendencies between statements. Second, while fine-grained units obscure the hierarchical structure of program logic, LLMs struggle to associate low-level symbol operations (e.g., variable updates) with high-level problem-solving goals (e.g., iterative summation). leading fragmented explanations and misaligned corrections. Third, line-by-line units amplify error accumulation. For example, a variable initialization error in line I may invalidate subsequent lines.
We find a significant number of wrong answers can be at- tributed to reasoning hallucinations. First, NL steps like "compute the average by dividing the sum by the count"
8

---

Submission
Rall NL Step
sistently high probabilities (averaging above 0.9), leading to small variations between confidence scores and perplexity. Second, qualitative analysis reveals that many generated candidates are semantically equivalent, differing only in implementation details. This explains why even random se- lection results in only minor performance drops. Although perplexity-ban -based selection slightly improves performance (+0.9%), the marginal gain suggests that the verification- revision loop already filters out most critical errors before selection takes place.
0.8
Accunryffere
0.6-
MATH-ap
HumanEvsie
Hbpp
Hepp*
Figure 5. Ablation on unit abstraction: 5.52% accuracy drop
(Math) and 4.35% score decline (Code) when replacing program- guided logic units with NL steps. Performance deterioration stems from reasoning hallucinations exacerbated by NL's lack of opera- tional specificity and weak causal dependency constraints.
Table 4. Experiments with Qwen-72B-Instruct the 89 complex cases from MATH-np, where RaLU reaches the budget limit of generating candidates. In each cell, x/yy indicates x correct cases
out of the 89 ones. The results show that the selection strategy has little impact on the final results.
often lack operational specificity. While the NL step ap- pears correct, the generated code may implement flawed logic (e.g., total / len(items) without handling empty lists). Unlike CFG units, which enforce alignment through static code analysis, the free-form language allows the LLM to hallucinate plausible-buttiicooreee implementations. More- over, the ambiguity of NL enables conceptual bundling- multiple logical operations (e.g.. loop initialization, itera- tion, termination)-may be compressed into a single step like "iterate through the list." This can lead to code with miss- ing boundary checks or redundant variables, as the LLM fails to decompose high-level descriptions into executable sub-operations. In addition, the NI narrative poorly con- strains causal dependencies. For example, a step "update the total after checking certain condition" might lead to code that evaluates the condition after modifying the total. CFG-driven units prevent such misordering by structurally embedding control flows. Appendix D.2 provides detailed case study of how reasoning hallucinations are introduced if the program-driven logic units in RaLU are replaced by NL steps generated through COT.
Confidence (Ral.U)
Random
Perplexity
Last
42/89=0.472
40/89=0.449
45/89=0.506
38/89=0.427
6. Conclusion
We present Reasoning as- -eitissss-LL-----e Lo-Lo-og---tt (RaLU), a pioneering test-time scaling framework designed to tackle the issue of reasoning hallucinations and enhance the reasoning capabil- ities of LLMs. Unlike existing methods that often encounter logical inconsistencies between reported reasoning steps and generated programs, RaL.U effectively extracts logic units from generated programs and aligns them with task requirements using natural language explanations. This method leverages the strengths of both natural language and program logic, resulting more reliable, interpretable, and transparent LLM reasoning. Experimental results demon- strate that RaLU consistently outperforms existing baselines across various LLMs, including comparisons with propri- etary close-sources models. We hope that our work will inspire further research into structural reasoning, advancing LLM problem-sol sollving across diverse domains.
5.3. Candidate Unit Selection
In some complex questions, the number of self-corrections reaches the predefined threshold, necessitating the selection of suboptimal reasoning path before all units are verified. In this paper, we use the confidence score (introduced in Sec- tion 3.2) as the selection criterion. We conducted ablation studies on Qwe on MATH-np, which contains a suffi cient number of challenging cases (89 out of 700) where the threshold reached. We compared three alternative strate- gies: random selection, selecting the candidate with the low- est perplexity (=: exp(-1 mean of token probabilities)), and selecting the last generated candidate.
Impact Statement
This paper presents work whose goal is to advance the field of machine learning by improving the reliability and accu- racy of large language models (LLMs) in complex reason- ing tasks. By addressing reasoning hallucinations through logic-aligned hybrid reasoning processes, our framework enhances LLMs' general capabilities to generate coherent and logically consistent solutions, particularly in mathemat- ical and algorithmic domains, without any fine-tuning or re- re-tinin Potential societal benefits include more trust- worthy AI systems for education, technical problem-solving and decision applications. There are many broader societal consequences of our work, none of which we feel must be specifically highlighted here.
As shown in Table 4, the impact of the selection strategy is minimal. Two factors can explain this. First, during self- correction iterations, L.LMs tend to generate tokens with con-

---

Submission
References
Chen, X., Lin, M., Schärli, N., and Zhou, D. Teaching large language models self-debug. In The Twelfth Interna- tional Conference
Austin. J., Odena, A., Nye, M. I., Bosma, M., Michalewski, H., Dohan, D., Jiang, E., Cai, C. J., Terry, M., Le, Q. V., and Sutton, C. Program symthesis with large language models. CoRR, abs/2108.07732 2021. URL https: //aaxivv.e. httpiii.orggabb/////e/
Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net, 2024h, URL ht.thttts::///t http:::///pppeeevieeeee net net//orumm forum? id Ma-KuixxIqPin
07732.
Cobbe, K., Kosaraju, V., Bavarian, M., Chen, M., Jun, H., Kaiser, L., Plappert, M., Tworek, J., Hilton, J., Nakano, R., Hesse, C., and Schulman, J. Training verifiers to solve math word problems. CoRR, 0bbs22100.14166 2021a. URL https: /awpiv.iivvv/////aa///..././.iia www..org//aba.... 22100.111...0..0 14168.
Besta, M., Blach, N., Kubicek, A., Gerstenberger, R., Pod- stawski, M., Gianinazzi, L.., Gajda, J., Lehmann, T., Niewiadomski, H., Nyczyk, P., and Hoefler, T. Graph of thoughts: Solving elaborate problems with large lan- guage models. In Thirty-Eighth AAAI Conference on Artificial Intelligene, AAAI 2024, Thirty-Sixth Confer- ence on Innovative Applications of Artificial Intelligence, IAAI 2024, Fourteenth Symposium on Educational Ad- vances in Artificial Intelligence, EAAI 2014, February 20- 27, 2024, Vancouver, Canada, pp. 17682 17690. AAAI Press, 2024. URL https::t/////mm /oi. aaai. v38i16..... 1121166240 00881..29720..
Cobbe, K., Kosaraju, V., Bavarian, M., Chen, Jun, H., Kaiser, L., Plappert, M., Tworek, J., Hilton, J., Nakano, R., Hesse, C.,, and Schulman, J. Training verifiers to solve math word problems. CoRR, abs/2110..4166. 202 URL /tR.hhcp.s//axxt..oo/////////
/atp:i/////vvvi///aa/eaaeeee org/
Ding, Y., Min, M. J., Kaiser, G. E., and Ray, B. CYCLE: learning to self-refine the code generation. Proc. ACM Program. Lang., S(0OPSLAI):392-43)) 2024, URL https: /tw..//o..///////////... org/ /00. 1wt..1144533991
Chen, B., Zhang, F., Nguyen, A., Zan, D., Lin, Z., Lou, J., and Chen, W. Codet: Code generation with gener- ated tests. In The Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023. OpenReview.net, 2023a. URL https: //openreview net forum? wtt.:iddddddtttttmteee..
Fan, Z., Gao, X., Mirchev, M., Roychoudhury, A., and Tan, S. H. Automated repair of programs from large language models. In 45th IEEE/ACM International Conference on Software Engineering, ICSE 2023, Melbourne, Aus- tralia, May 14-20, 2023, pp. 1469-1488 IEEE, 2023. URL https::///// //ooi//ooii. org/ /00 1109 SAE0///CSEE88111
Chen, J., Tang, H., Chu, Z. Chen, Q.. Wang, Z., Liu, M., and Qin, B. Divide-and-conquer meets consen- sus: Unleashing the power of functions in code gener- ation. CoRR, abs/2405.20092, 2024a. URL https: //doi. org/ 10, 48550 aat.s///rxiv.v/.. 2405.
Fu, Y., Ou, L., Chen, M., Wan, Y., Peng, H., and Khot, T. Chain-of-thoughh hub: A continuous effort to measure large language models' reasoning performance. CoRR, abs/2305. 17306, 2023. URL https: /ttp//ooooooo////////o////////1/ 4 48550/arXis 2305 17306.
Chen, M., Tworek, J., Jun, H., Yuan, Q., de Oliveira Pinto, H. P., Kaplan, J., Edwards, H., Burda, Y., Joseph, N., Brockman, G., Ray, A., Puri. R.. Krueger, G., Petrov, M.. Khlaaf, H., Sastry, G., Mishkin, P.. Chan, B., Gray, S., Ryder, N., Pavlov, M., Power, A., Kaiser, L., Bavar- ian, M., Winter, C., Tillet, P., Such, P., Cummings, D., Plappert, M. Chantzis, F., Barnes. E., Herbert- Voss, A., Guss, W. H., Nichol, A., Paino, A., Tezak, N., Tang, J., Babuschkin, I., Balaji, S., Jain, S., Saun- ders, W., Hesse, C., Carr, A. N., Leike, J., Achiam, J. Misra, V., Morikawa, E., Radford, A., Knight, M., Brundage, M., Murati, M., Mayer, K., Welinder, P., Mc- Grew, B., Amodei, D., McCandlish, S., Sutskever, I., and Zaremba, W. Evaluating large language models trained on code. CoRR, abs/2107.03374 2021. URL https:/ / aaaii.iiiv...//.v org/ abs 221701100. 03374.
Gao, I.., Madaan, A., Zhou, S., Alon, U., Liu, P., Yang, Y., Callan, J., and Neubig, G. PAL: program-aided language models. In International Conference on Ma- chine Learning, ICML. 2023, 23-29 July 2023, Hon- olulu, Hawaii, USA, volume 202 of Proceedings of Machine Learning Research, pp. 10764-10799, PMLR, 2023, URL https: wwtphhsss/pppoeeeeeeeee http///peeeenng..eeeeepe/ee mir press/ v202/ga023f. hhmmm.
Gou, 7., Shao, Z.., Gong, Y., Shen, Y., Yang, Y., Duan, N., and Chen, W. CRITIC: large language models can self- correct with -nterinteee critiquing. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenRe- view.net, 2024. URL https: http:////peeeeieieeee net/ forum? SaatmmiddSxx08@xxxx
Chen, W., Ma, X., Wang, X., and Cohen, W. W. Program of thoughts prompting: Disentangling computation from rea- soning for numerical reasoning tasks. Trans. Mach. Learn. Res., 2023, 2023b. URL https: openreview. net/ forum? d=Y2242Pt
Hendrycks, D., Burns, C., Kadavath, S., Arora, A., Basart, S., Tang, E., Song, D., and Steinhardt, J. Measuring
10

---

Submission
mathematical problem solving with the MATH dataset. In Proceedings of the Neural Information Processing Systems Track Datasets and Benchmarks 1, NeurIPS Datasets and Benchmarks 2021, December 2021, virtual, 2021.
Li, L., He, X., Wang, H., Wang, L.., and He, L. How do humans write code? large models do it the same way too. In Proceedings of the 2024 Conference on Empiri- cal Methods in Natural Language Processing. EMNLP 2024, Miami, FI, USA, November 12-16, 2024, pp.
4638-4649, Association for Computational Linguistics,
Hong, S., Zhuge, M., Chen, J., Zheng, X., Cheng, Y., Wang, J., Zhang, C., Wang, Z., Yau, S. K. S., Lin, Z., Zhou, L., Ran, C., Xiao. L., Wu, C., and Schmidhuber. J. Metagpt: Meta programming for A multi-agent collabora- tive framework. In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net, 2024. URL https: // //openrevieieeeeeeee wwt.:/ww.eeeeeeeeeeeeeeeeeeeeeee hetprrummiiddttmt/CCCCNC
2024. URL https: wtt.hhtss///claaahhheeeeee htt////aaaaattltoooo/oo org/ 2024. ennlg-main.25
Ling, W. Yogatama, D., Dyer, C.,, and Blunsom, P. Program induction by rationale generation: Learning to solve and explain algebraic word problems. In Proceedings of the 55th Annual Meeting of the Association for Computa- tional Linguistics (Volume I: Long Papers), pp. 158-167. Association for Computational Linguistics, 2017. URL https: http:///aaaatttoooogoooo
Huang, D.. Bu, Q. Qing, Y., and Cui, H. Codecot: Tack- ling code syntax errors in cot reasoning for code gen- eration, 2024a. URL 3308.08784.
Ling, Z., Fang, Y., Li, X., Huang. 7.,, Lee, M., Memisevic, R., and Su, H. Deductive verification of chain-of-thouge reasoning. In Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023, 2023.
org/ abs/
Huang. J., Chen, X., Mishra, S., Zheng, H. S., Yu, A. W., Song, X., and Zhou, D. Large language models can- not self-correct reasoning yet. In The Twelfth Interna- tional Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net, 2024b. URL httpt: ht wtw.:erwweiie..nt/oorrrrr 1d=IkmD3 FKBPQ.
Liu, D., Nassereldine, A., Yang, Z., Xu, C., Hu, Y., Li, J., Kumar, U., Lee, C., and Xiong, J. Large language models have intrinsic self-correction ability. CoRR, abs/2406. 15673, 2024. URL https: /tttps::/di.... 48550/a
Kadavath, S., Conerly, T., Askell, A., Henighan, T., Drain, D., Perez, E., Schiefer, N., Hadfield-Dodds, 7., DasSarma, N., Tran-Johnson, E., Johnston, S., Showk, S. E., Jones, A., Elhage, N., Hume, T., Chen, A., Bai, Y., Bowman, S., Fort, S., Ganguli, D., Hernandez, D., Jacobson, J., Kernion, J., Kravec. S., Lovitt, L., Ndousse, K., Olsson, C., Ringer, S., Amodei, D., Brown, T., Clark, J., Joseph, N., Mann, B., McCandlish, S., Olah, C., and Kaplan, J. Language models (mostly) know what they know. CoRR, abs/2207 .22221,,, 2022. URL https: // 48550/arXis 2207 05221.
2406. 15673.
Liu, H., Ning, R., Teng, Z., Liu, J., Zhou, Q., and Zhang, Y. Evaluating the logical reasoning ability of chatgpt and GPT-4. CoRR, abs/2304.03439, 2023a. URL https: //doi. 48554/855558 2304 03439.
Liu, Xia, S., Wang, Y., and Zhang, L. Is your code gen- erated by chatgpt really correct? rigorous evaluation of large language models for code generation. In Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurlPS 2023, New Orleans, LA, USA, December 10 16, 2023, 2023b.
Kamoi, R., Zhang, Y., Zhang. N., Han, J., and Zhang, R. When can Ilms actually correct their own mistakes? A critical survey of self-correction of 1lms. CoRR, abs/2406.01297, 2024. URL https::pp/// http::://doi.oooog// 48550/arXivs 2406 01297.
Ma, Y., Liu, Y., Yu, Y., Zhang, Y., Jiang, Y., Wang, C.,, and Li, S. At which training stage does code data help Ilms reasoning? In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net, 2024. URL https: //openreview net
Lee, C., Xia, C. S.. Yang, L., tse Huang, J., Zhu, Z., Zhang, L.,, and Lyu, M. R. A unified debugging approach via lamedased multi-agent synergy, 2024. URL http:// arxiv. org/ / abs / 24044 17153.
Miao, N., Teh, Y. W., and Rainforth, T. Selfcheck: Us- ing llms to zero-shot check their own step-by-step rea- soning. In The Tweifth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net, 2024. URL https: / //openrevicn ew, net/ forum? d=pTH
Lenat, D. and Marcus, G. Getting from generative AI to trustworthy AL: what llms might learn from cyc. CoRR, abs/2308.08s 04405, 2023. URL https: //t.o/oooooo...../oo/oo/// 48550/ a www.v..ivvvvv 2308 04445.

---

Submission
Mirzadeh, S., Alizadeh, K., Shahrokhi, H., Tuzel, O., Bengio, S., and Farajtabar, M. Gsm-symbolic: Un- derstanding the limitations of mathematical reasoning in large language models. CoRR, abs/2410.05229, 2024. URL arXiv. 2410.05229.
Systems 35: Annual Conference on Neural Information Processing Systems 2022, NeurlPS 2022, New Orleans, LA, USA, November 28 December 9, 2022, 2022.
Wu, Z., Zeng. Q., Zhang. Z., Tan, Z.,, Shen, C., and Jiang, M. Enhancing mathematical reasoning in llms by stepwise correction. CoRR, abs/2410. 12934, 2024, URL https: / // //dbi. (1888550/aaXaa 2410 12934.
ottoo...rr/1...5500000 48550/
Mondorf, P. and Plank, B. Beyond accuracy: Evaluating the reasoning behavior of large language models A survey. CoRR, abs/2404.0186) 2024. URL https: (oloi.org/100 00..48555axiii 2404. 01869.
Xia, C. S. and Zhang. I.. Keep the conversation going: Fixing 162 out of 337 bugs for $0.42 each using chatgpt. CoRR, abs/2304.00385, 2023. URL https: /doi.
Ni, A., Iyer, S., Radev, D., Stoyanov, V., Yih, W., Wang, S. I., and Lin, X. V. LEVER: learning to verify language- to-code generation with execution. In International Con- ference on Machine Learning, ICML. 2023, 23-29 July 2023, Honolulu, Hawaii, USA, volume 202 of Proceed- ings of Machine Learning Research, pp. 26106-26122 PMLR, 2023. URL https: http////oooeeen.../e.e/ mlr. press/v202/e nwwpl//nnnnb...m html.
org/10. 48550/ http//raivv.//. 2t.iii..33000 2304. 00385.
Xue, S., Huang. Z., Liu, J., Lin, X., Ning, Y., Jin, B., Li, X., and Liu, Q. Decompose, analyze and rethink: Solving intricate problems with human-like reasoning cycle. In The Thirry-eghth Annual Conference Neural Information Processing Systems, 2024. URL https: / //ppreeveeew net/ Coorum?id-NPKA WDjZ.
Yao, S., Yu, D., Zhao, J., Shafran, I., Griffiths, T., Cao. Y., and Narasimhan, K. Tree of thoughts: Deliberate problem solving with large language models. In Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023. NeurlPS 2023, New Orleans, LA, USA, December 10 16, 2023, 2023.
Paperwithcode. Gsmök, 2025.
URL https://
paperswithcode com/ dataset////aaaaaaaaaaaaaaaaaa pattaset/gss8kk gsmBk.
Ranaldi, L. and Freitas, A. Self-refine instruction-tuning for aligning reasoning in language models. In Proceed- ings of the 2024 Conference on Empirical Methods in Natural Language Processing, EMNLP 2024, Miami, FL., USA, November 12-16, 2024, pp- 3325-2347, Association for Computational Linguistics, 2024. URL https:// aclanthology
Yu, F., Zhang, H., Tiwari, P., and Wang, B. Natural language reasoning, A survey, ACM Comput. Surv. 56 36:11))304:11 304:39, 2024. URL https: /ttp::::/dooooo////////// /00 1145/ 3664194.
www.2244.mmmmpmmammammmm 139.
Snell, C., Lee, J., Xu, K., and Kumar, A. Scal- ing LLM test-time compute optimally can be more effective than scaling model parameters. CoRR, abs/2408.03314, 2024. URL https: /ttp:://////i..o////// 48550/ wwwpxxiv..00... 2408.03314.
Zhang. Z., Zhang, A., Li, M., and Smola, A. Automatic chain of thought prompting in large language models. In The Eleventh International Conference on Learning Rep- resentations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023. OpenReview.net. 2023. URL http::/ /ttpt:ss///ppeeeeiewww net htrmfformmmiim wiwerrummi----tttt-t JUHHE.
Thakur, S., Choudhary, K., Ramayapally, S., Vaidyanathan, S., and Hupkes, D. Judging the judges: Evaluating alignment and vulnerabilities in llms-as- judges. CoRR, abs/2406. 12624, 2024. URL https: //doi.org// wtt.i//////..../////... 48550/arxii 2406.12624.
Zheng, T., Zhang, G., Shen, T., Liu, X., Lin, B. Y., Fu, J., Chen, W., and Yue, X. Opencodeinter- preter: Integrating code generation with execution and refinement. In Findings of the Association for Computational Linguistics, ACL 2024, Bangkok, Thai- land and virtual meeting, August 11-16. 2024, pp. 22834-12559 Association for Computational Linguis- tics, 2024. URL https: //doi. doi. org/10. v1/2024. 21/2024.findings-aad 762.
Wang, X.. Wei, J. Schuurmans, D., Le, Q. V., Chi, E. H., Narang, S., Chowdhery, A., and Zhou, D. Self-consistency improves chain of thought reason- ing in language models. In The Eleventh Interna- tional Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023. OpenReview.net, 2023. URL pectps://opereee ew, net/ forum? Id=1PLINIMMrW.
Zhong, T., Liu, Z., Pan, Y., Zhang, Y., Zhou, Y., Liang, S., Wu, 7., Lyu, Y., Shu, P., Yu, X., Cao, C., Jiang, H., Chen, H., Li, Y., Chen, J., Hu, H., Liu, Y., Zhao, H., Xu, S., Dai, H., Zhao, L.., Zhang, R., Zhao W., Yang, Z., Chen, J., Wang, P., Ruan, W., Wang, H., Zhao, H., Zhang, J., Ren, Y., Qin, S., Chen, T., Li, J., Zidan, A. H., Jahin, A.,
Wei, J., Wang, X., Schuurmans, D., Bosma, M., Ichter, B., Xia, F., Chi, E. H., Le, Q. V., and Zhou, D. Chain-of- thought prompting elicits reasoning in large language models. Advances in Neural Information Processing
12

---

Submission
Chen, M., Xia, S., Holmes, J., Zhuang, Y., Wang, J., Xu, B., Xia, W., Yu, J., Tang, K., Yang. Y., Sun, B., Yang. T., Lu, G., Wang, X., Chai, L., Li, H., Lu, J., Sun, L., Zhang, X., Ge, B., Hu, X., Zhang, L.,, Zhou, H., Zhang, L., Zhang, S., Liu, N., Jiang, B., Kong, I.., Xiang, Z.., Ren, Y., Liu, J., Jiang, X., Bao, Y., Zhang, W., Li, X., Li, G., Liu, W. Shen, D., Sikora, A., Zhai, X., Zhu, D., and Liu, T. Evaluation of openai ol: Opportunities and challenges of AGI. CORR, abs/2409. 1 1848,, 2024. URL https: 2409 2409.18486
//doi.
Zhou, D., Schärli, N., Hou, L., Wei, J., Scales, N., Wang, X., Schuurmans, D., Cui, C., Bousquet, O., Le, Q. V., and Chi, E. H. Least-to-most prompting enables complex reasoning in large language models. In The Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023. OpenRe- view.net, 2023. URL httptps://oeneeviee..... net/ fo Forum? i d=WZH7 (AA.HH79999ggg 9M.
13

---

Submission
A. Illustrations of RaLU
A.1. A Complete Example
This section showcases how RaLU solves a code generation task using an LLM (c.g.. deepseek V3 in this example). The question comes from Mbpp 77. In the initial response, RaLU simply uses direct prompting ask the LLM to write program for the given specification.
Original Attempt. [User] You are expert in Python coding. Wrap your program in <code> </code> block. No more test cases any other contents.
Specification: Write a function to find the Eulerian number a(n, m), the entry point is "eulerian num".
assert eulerian eulerian.num(3, I) ==
[AT] <code>>
1 def eulerian m):
2
if m < 0 or m >= n:
3
return 0
4
n n===00 0:
return
6
return m) culerian num(n 1, m- 1) + (m culerian num(n 1, m)
</code>
Afterward, we extract Control Flow Graph (CFG) from the initial program, and then we transverse the CFG to transform it into text by describing the logic flow of the code statements. Therefore, we obtain list of logic units:
#ENTER FUNCTION# culerian num
#BRANCH# Condition 'if m or >= is satisfied, then RUN 'return
#BRANCH# Otherwise, when Condition 'if m < 0 or m >= n' not satisfied, then #BRANCH# Condition 'if 0' satisfied, then RUN 'return l'
#BRANCH# Otherwise, when Condition 'if 0' not satisfied, then RUN 'return - m) eulerian_num((1 m 1) + (m + 1)* * eulerian eulerian_num(n num(n m)'
#EXIT FUNCTION#
Then, RaLU initializes continuous dialogue with the same LLM. In each turn of interaction, the LLM is promoted to judge the correctness of the current logic unit. If this unit is determined as wrong, the LLM will generate the fixed version simultaneously.
U1-L [User] ## Process
Unit #ENTER FUNCTION# eulerian num
#BRANCH# If Condition 'if < 0 or >= n' satisfied, then RUN 'return 0'
[AI] (confidence: 96.50) OK
Analysis: This step correctly handles the edge case where 'm' is less than or greater than or equal to 'n'. According to the specification, the Eulerian number 'a(n, m)' should return O such cases. The logic aligns with the requirement, so this step correct.
The correctness of unit is checked by the LLM.
U2-I. [User] Unit 2: #BRANCH# Otherwise, when Condition 'if m 0 >= n' is not satisfied, then #BRANCH# If Condition 'if = 0' is satisfied, then RUN 'return 1'
[AI] (confidence: 98.96) WRONG
<Fix>>
#BRANCH# Otherwise, when Condition 'if m < or m >= n' not satisfied, then #BRANCH# Condition m == 0' satisfied, then RUN 'return
14

---

Submission
</Fix>
Analysis: This unit incorrectly checks for the condition 'if 0'. According the specification and the logic of Eulerian numbers, when 'm == 0', the function should return 1. The condition should be checking if 'm = 0', not 'n 10=00 0'. This correction aligns with the requirement.
Herein, the reasoning path branches off by fixing the original logic unit. Then we rewind and replace unit 2 with the fixed one:
U2-II [User] Unit 2: #BRANCH# Otherwise, when Condition 'if j or m &= n' is not satisfied, then #BRANCH Condition 'if m == 0' is satisfied, then RUN 'return 1'
[AI] (confidence: 97.61) OK
Analysis: This unit correctly handles the case where 'm == O', According to the specification, when 'm == 0', the Eulerian number "a(n, m)' should return The logic aligns with the requirement, so this unit is correct.
U3-I [User] Unit 3: #BRANCH# Otherwise, when Condition 'if n is not satisfied, then RUN 'return (n m) * culerian num(n 1, 1) + (m + 1) * culerian num(n m) #EXIT FUNCTION#
[AI] (confidence: 98.70) WRONG
<Fix>>
#BRANCH# Otherwise, when Condition 'if m == 0' is not satisfied, then RUN 'return (n - m) eulerian nummmn - 1, m 1)
(m 1) eulerian culerian_nummn I,, m)
#EXIT FUNCTION#
</Fix>
Analysis:
The unit incorrectly checks for 'if = 0', which already handled in the first branch ('if m Or >= n'). Instead, it should proceed to calculate the Fulerian number using the recursive formula when 'm !'. The corrected step
ensures that the recursive calculation is performed only when 'm != 0', aligning with the specification.
In the dialogue round for unit 3, given that the previous historical conversation could serve as priori conditions for the
LLM, it successfully carried forward the modifications made to unit 1, thus ensuring the consistency of the context.
U3-II. [User] Unit 3: #BRANCH# Otherwise, when Condition 'if m == is not satisfied, then RUN 'return (n - m) * 1) + (m + 1) * gulerian_numfe
mulerian_num(n
m)' #EXIT FUNCTION#
[AT] (confidence: 98.71) OK Analysis: This unit correctly implements the recursive formula for calculating the Eulerian number 'a(n, m)' when neither of the previous conditions ('m < 0 or >= n' or 'm == 0') is satisfied. The logic aligns with the requirement, as it uses the correct recurrence relation:
'(n - m) eulerian eulerian_num(n 1, m 1) (m 1) gulerian_num(f 1, m)'
This step is logically correct and adheres to the specification.
After generating self-checked and celf-corrected reasoning path, we take it as history conversation. Note that the original program is not included in case of confusion.
Final Synthesis. [User] You are an expert in Python coding. Your task is write a correct program to meet the given specification based on the previous conversation. Your program can contain several functions, but make sure the main entry point is eulerian num.
Strict Requirement: Ensure to return the complete function wrapped in a <code> </code> block! No test cases!
Specification: Write a function find the Eulerian number a(n, m), the entry point is "culerian num".
assert eulerian _3mm, 4
[AT] <code>
1 def sulerian_num(n, m):
2 if m < or m >= n:
3 return 0
4 elif m == 0:
5 return 1
6 return (n m) calerian_numón 1, 1- +)+ (m 1) culeriann 11, m)
15

---

Submission
</code>
By changing the condition from 'if == O" to 'elif m == 0", the program is successfully corrected. Through fine- ine-grained aligmment (among the requirement in natural language, step descriptions, and the generated program), RaLU can effectively correct subtle logical errors. Moreover, by taking the previous conversations as conditions, it can better prevent the propagation of errors from previous steps.
The trajectories will be made publically available as soon the end of anonymity, where all the cases using RaLU can be shown directly.
A.2. CFG-Driven Logic Units of Code
Figure displays an example of transforming a program into CFG and how RaLU organizes the graph to obtain linear sequence of logic units. To enhance interpretability, units annotated with human-readable descriptors (e.g.. "L.OOP BEGIN: Process each item in list X"). These labels bridge low-level code operations with high-level problem-solving intent, priming subsequent alignment stages.
Original Program
CFG
Logic Units
def parse_ musssemusiccmiiccccccmo string: str): note to beats {f 'o: 4, 'oo: 2:11: 1] notes music string string.split( split() beats [note_ to [nte] for note in notes]
#ENTER FUNCTION parse music
to0e to. beils (VV 4, A (T:
RUN
lntes wusic sxaggspin)
note to beats I'o 4, 'f'' qp: beals
|I
music string.split)
return beats
in sotes
#LOOP BEGIN looping Condition for note in notes" is satistied, then enter the
bustcspaanniii Jeat
beats.appendfnooe to beats[note])
eLOOP ENDs not satisfying the looping Condition for note in poles' Uhen jump out of the
"return
#EXIT FUNCTIONs
Figure 6. This figure depicts what CFG looks like and how it is transformed into units. Nodes and edges in the CFG represent code blocks and control flow transitions, respectively. Ral. U divides the CFG into atomic logic units key points, with each unit labeled for better understanding.
A.3. Condition of Applying Self-Repair
The correctness of unit 24 involves two conditions: First, the LLM believes 1/ is correct and U/ is actually correct, then we have:
P(ū is correct]. J OK) ap.
(9)
Second, the probability o/ being judged as wrong is (true negative rate plus false positive rate):
P(J = WRONG) = (1 axp + 3(1 - pp)
(10)
Then, the probability of correctly repairing the unit is:
P(u is correct]J- WRONG) Trepair (11-a)p+ 3(1 pp],
(11)
Thus, we can rewrite p' as:
p' = ap + Trepair
- [[1 +31 p)].
(12)
To compare p' and we have:
p' p -p(1 - a) + Trepair
[1- + ++.311 11--))) p)]
= [11 -a)p + 3(1 p)] ( (Trepair
(1 a)p
(13)
(1 11-a0pp + 3(1 pp)
P(J=WBONG)
16

---

Submission
Note that the first term is the probability of judging the unit as WRONG so that it is always positive. The condition of p' p 0 is then transformed to:
(1 a)p
Trepair >
(14)
(1- a)p + 3(1 p)
Note that P(4 is correct] = WRONG) P(U is comeatAJ=RRCNN that is:
P(J=WRONG)
a1-app
P(u is correct|J- WRONG) = (1 app + B(1 pp)
(15)
equal to the right part of equation 14, so the condition of p' > is Trepair
P(U is correct|] WRONG).
B. Details of Experiment Setup
B.1. Benchmarks
GSM8K (Cobbe et al., 2021b) is a widely recognized benchmark to evaluate the reasoning and soolin capabilitiess of LLMs, whose name stands for "Grade School Math 8K," reflecting its focus on grade school-level math problems. The dataset contains approximately 8,500 carefully crafted math problems. Each problem in GSM8K is presented as a word problem, typically involving basic arithmetic operations (addition, subtraction, multiplication, and division) and sometimes simple algebraic concepts.
MATH (Hendrycks et al., 2021) is proposed as comprehensive benchmark designed assess the mathematical reasoning capabilities of L.Mss. It comprises 12,500 competition mathematics problems, which are carefully curated to cover wide range of mathematical concepts and varying levels of difficulty. We use subset taken from (Ling et al., 2023) named MATH-op, specifically tailored assess the deductive reasoning skills of LLMs. It includes problems that require multi-step reasoning and the application of mathematical concepts in structured manner.
HumanEval (Chen al., 2021) is benchmark dataset evaluate the code generation capabilities of LLMs, introduced by OpenAI. It consists of 164 hand-written Python programming problems, each with problem specification (prompt), predefined function signature, and set of test cases. The primary metric used to evaluate model performance is the pass @+ k metric, which measures the percentage of tasks for which at least one of the i generated code samples passes all the test cases. Note that we only report pass@1. 1.
AQUA (Ling al., 2017) is an algebraic word problem dataset collected by DeepMind, designed to evaluate the mathematical reasoning capabilities of L.MSs. The questions are mainly algebraic word problems described in natural language, covering basic to medium-complettt
scenarios such as profit calculation, proportion distribution, speed-time relationship, etc. There are 254 questions in the test set, and all of them are manually screened to ensure diversity and logical rigor, and their annotation quality is cross-validated.
Mbpp (Austin et al., 2021), or Mostly Basic Python Problems, is a benchmark designed to evaluate the program synthesis capabilities of LLMs, consisting of over 900 Python programming tasks, whose problems share the same structure with that of HumenEval. It covers a wide range of basic to moderately complex Python programming problems.
HumanEval+/MMpp- (Liu et al., 2023b) come from EvalPlus, rigorous evaluation framework designed to assess the performance of L.MSs in code generation by expanding the test cases of well-known benchmarks such as HumanEval and MBPP. It also maintains a leaderboard to track and compare the performance of various LLMs.
B.2. Baselines
In our experiments, we reproduce the baselines strictly following their released code and prompts.
Chain-of- Chain-of-Thought (CoT) (Wei et al.. 2022) involves instructing the model to "think step by step" before arriving at a final answer. It enhances the reasoning capabilities of LLMs by explicitly guiding them to break down complex problems into a series of logical, intermediate steps. This approach mimics human reasoning by decomposing a problem into smaller, manageable sub-problems and solving them sequentially.
17

---

Submission
Thee-of-Thought (ToT) (Yao al., 2023) enhances LLM reasoning capabilities by simulating human problem-solving strategies. ToT breaks down the problem-solving process into smaller, manageable, intermediate steps called "thoughts." For each state in the thought tree, the LLM generates multiple potential next thoughts. Each generated thought is evaluated for its potential to lead to solution. Then, it employs search algorithms such as Breadth-Fing Search (BFS) or Depth-First Search (DFS) to explore the thought tree systematically. The structured nature of the thought tree makes the reasoning process more transparent and interpretable.
Program-ofe of Thought (PoT) (Chen et al., 2023b) or its similar approach Program- Aided Language Model (PAL) (Gao et al., 2023) both represent a novel approach that combines the strengths of L.LMs with the precision of programming languages. The LLM reads a natural language problem and generates a program as the intermediate reasoning step. They aim to decompose reasoning and computing by offloading the solution step to symbolic interpreter, which leverages the LLM's reasoning abilities while mitigating its weaknesses in logical and arithmetic operations. PoT or PAL will degrade direct prompting in the face of program generation tasks.
Coffsssssstteeyy (SC) (Wang et al., 2023) is a decoding strategy designed to improve the accuracy and reliability of reasoning processes. involves generating multiple reasoning paths for given problem and selecting the most consistent answer among them (majority voting). The consistency can be directly computed (for numerical calculation tasks) or determined by LLMs (either the same LLM or another LLM).
Self- Calf-Calibration (SCal) (Kadavath et al., 2022) an advanced prompting technique designed to enhance the accuracy and reliabilliy of LLMs by enabling them evaluate their own outputs. The LLM generates an initial answer to given question, and it is prompted to assess the correctness of its own response.
Self-Refine (SR) (Ranaldi & Freitas, 2024) an iterative refinement technique designed to enhance the output quality of LLMs by incorporating self-generated feedback. Specifically, the LLM generates initial response to given prompt, and the same LLM evaluates the initial output and provides actionable feedback, identifying areas for improvement. With the feedback, the same LLM refines the initial output, aiming to improve its quality. This wew.oonse--eedbac--rfiieee pipeline can be repeated multiple times until the output meets a predefined stopping criterion.
Self-Debugging (SD) (Chen et al., 2024b) is an innovative technique designed to enable LLMs to identify and correct errors in the code they generate without requiring additional model training or human intervention. This method is inspired by the "rubber duck debugging" technique used by human programmers, where explaining code line-by-line in natural language helps identify and fix errors. Since targets program bugs, it cannot be directly applied to mathematical reasoning tasks.
Self-Check (SCheck) (Miao et al., 2024) is a prompting technique that enables LLMS to evaluate their own reasoning and identify errors in their step-by-step solutions. It first provides several step-by-step solutions through CoT prompting. Then, it identifies the relevant context and target for each step in its reasoning process. Afterward, the LLM generates an independent alternative step based on the extracted context. The original step is compared with the regenerated alternative. If they match, the original step is deemed correct. The reasoning path with the most "correct" steps will be selected (weighted majority voting).
C. Additional Comparisons
C.1. RaLU v.s. Closed-Source LLMs
As shown in Table 5, in cross-domain benchmarks (mathematical reasoning and code generation), RaLU exhibits better reasoning capabilities to mainstream closed-source models (i.e., GPT-4o, GPT-4-Turbo, and Claude-Sonnet-3.5) and significantly outperforms GPT-3.5-Turbo (438.16% on average).
RaLU achieves the highest scores the extended versions of code generation benchmarks (HumanEval+//bppa) despite its slightly lower performance on original HumanEval/MBPP (A=-2.24%). This inversion reveals a critical insight that unit-level correction benefits to solving multi-constraint tasks, since the augmented test suites introduced by the plus version of benchmarks require models to simultaneously satisfy competing constraints. While closed-source models often overfit to dominant patterns in pretraining data, RaLU's unit-level rewind mechanism enables iterative constraint alignment. This explains the 9.46% improvement on mathematical reasoning benchmarks where L.MMs struggle with numerical computation.
18

---

Submission
Table RaL.U using open-soureed L.LMs (DeepSeck- Qwen2.5-72B) even outperform statc-of-the-ard closed-source I.I L.MMs, whose results are reported by previous studies. It achieves SoTA results both mathematical reasoning benchmarks by making an improvement 9.46% though there are results on models so we have to them. RaLU also enhances code generation by 2.61% on the plus versions of benchmarks compared to ol -preview, despite the slight decline (-2.24%) the standard benchmarks.
Dataset
ol Preview ol Mini
GPT-4o
GPT-4-Turbo Glaude33.5-Some GPT-3.5-Turho Ours (RaLU)
GSM8K
0.969
0.951
0.948
0.926
0.950
0.822
0.980
MATH-np
0.697
0.590
0.623
0.347
0.821
HumanEval
0.963
0.963
0.927
0.902
0.872
0.835
0.939
Hvaa+Eval+
0.890
0.890
0.872
0.866
0.817
0.707
0.902
Mbpp
0.955
0.931
0.876
0.857
0.894
0.825
0,937
Mbpp+ 0.802
0.788
0.722
0.733
0.743
0.697
0.833
C.2. RaLU smaller model
To demonstrate the effectiveness of RaLU on smaller model, supplemented experiments with Qwen2.5-14B on MATH and Mbpp//bpppt. As shown in Table 6, RaLU still provides significant improvements for smaller yet capable models.
Table 6. RaLU achieves the best performance with Qwen- Swen-14B-Innee 14B- Mhpp/Mbpp+ and MATH-np, showing its generalizations
among different scales LLMss
Dataset
Direct
CoT
ToT
PoT/SR*
SC
SCal
SCheck/SD
RaLU
Aaain(%)
Mhpp
0.840
0.860
0.831
0.804
0.868
0.852
0.852
0.902
+3.917
Mbpp+
0.725
0.733
0.720
0.698
0.754
0.706
0.714
0.839
+11.273
MATH-np
0.603
0.691
0.651
0.731
0.751
0.710
0.593
0.784
+4.394
D. Case Studies
D.1. Reasoning hallucinations in CoT-PoT-innegratee method (single reasoning path)
[User] You are an expert in coding. Your goal is to write a program to meet the given specification. Let's think step by step. Show your thinking process explicitly. Example Response:
<code>>
def add nums(a, b):
return a+b
</code>
Analysis: Using operation '+' to directly implement the requirement of returning the sum of two numbers.
**Strict Requirement** Ensure to return the complete function wrapped in a <code> </code> block! No test cases!
Specification: In this task, you will be given string that represents number of apples and oranges that are dis- tributed in a basket of fruit this basket contains apples, oranges, and mango fruits. Given the string that represents the total number of the oranges and apples and an integer that represent the total number of fruits in the basket. Return the number of the mango fruits in the basket.
For example:
fruit "rii apples and 6 oranges", 19) -19 6-6
fruit ditiiiisttrbuionn"" apples and 1 oranges",,3 -3300-1=2
fruit "ruitddistrbbttion"2 apples and 3 oranges", 100) - 95
fruit distribution("100 apples and oranges", 1220) -+120 100
19
[AI (Deepseek V3)] Let's break down the problem step by step: Input *nalysis**:
19

---

Submission
TThe input is string 's' that contains the number of apples and oranges in the format 'X apples and Y oranges'.
The second input is an integer "n' representing the total number of fruits in the basket.
2. **Objettvv***:
We need to extract the number of apples ('X') and oranges ("Y" from the string 's'.
Then, calculate the number of mangoes by subtracting the sum of apples and oranges from the total number fruits 'n'.
** *Appoocch*:
Use string manipulation extract 'X' (apples) and "Y" (oranges) from the string.
Convert these extracted values to integers.
Subtract the sum of apples and oranges from 'n' to get the number of mangoes.
** *#Implmmetaaton
Split the string into parts using spaces or specific keywords like "apples" and "oranges".
Extract numerical values corresponding to apples and oranges.
Perform arithmetic operations find mangoes.
Here's how we can implement this: <code>>
1 def fruit distributionss, n):
Split the string into parts
2 parts = s.split()
# Extract apple count
3 apple count int(parts(O))
# Extract orange count
4
orange_comm countt = (nt(
# Calculate mango count
_contt n apple_count. orange.count return mango_coure
</code>
Analysis:
The function splits the input string into parts using spaces.
It extracts apple count as an integer from index 0.
It extracts orange count as an integer from index 2.
Finally, calculates mango count by subtracting apple and orange counts from total fruits 'n'.
The NL reasoning correctly emphasizes extracting numerical values for apples (X) and oranges (Y) from the input string. However, the code fails to parse the string correctly. For example, for input "5 apples and 6 orange" in standard test case, splitting by spaces produces list of [5, apples, and, 6, oranges]. The code erroneously takes parts[2] (value "and"" for oranges, which is not a numerical value. This causes a ValueError when converting "and" to an integer.
Instead, RaLU correctly fixes this error during the self-judging and self-correcting by responding with:
[AI (Deepseek V3)] WRONG
<Fix>
RUN [
parts s.split)
apples = int(parts(0))
oranges = int(parts(3))
mangoes n appless - oranges
return mangoes
Fix
20

---

Submission
Analysis: The step incorrectly assumes that the oranges count is always index 2 of the split string. However, in the input string format, the oranges count is at index 3. The correction adjusts the index to 3 to correctly extract the number of oranges. This aligns with the specification, which requires extracting the number of apples and oranges from the string and calculating the number of mangoes.
D.2. Reasoning hallucinations in CoT-step--rrien RaLU (ablation study)
[User] You are an expert in solving math questions. Your goal is to return the final answer to solve the given question and show your thinking process explicitly. Let's think it step by step. For example:
Question: John has 10 apples. He gives away 4 and then receives 5 more. How many apples does he have?
Response:
<Step>1: 1: John starts with 10 apples.</Steps
2tepp>2 He gives away 4, so 10 4 6. </Step>>
Step>>3 He then receives 5 more apples, so 6 5 = 11. </Sepp
<Answr>>11</AAswar
Question: Find the integer that lies between V 45 and V 101.""
[AI (Llama3.3))
<Step>1: The expression V 45 equal -3, because =-27. Therefore, -4 V- <S.</St
Step>>2 The expression 10101 is equal to 5, because (-5) = 125. Therefore, - < 10 < -5.5555.0 </tepp
<tep.>3: Comparing the two intervals, -5 < -4, we can see that the integer that lies between 45 and V - 101 is -4
and -5.</Step>
< Answer:-44 or >nnswrr
After several turns of self-checking and self-correcting the steps, this LLM writes a program to solve this problem:
[AI (Llama3.3)] <code>>
# We know that -45 and -101 are both negative, their cube roots will also be negative.
# To find the integer between these two cube roots, first need to find the cube roots themselves.
# Calculate the cube root of -45 and -101
1 root45 = round(-45 (1/3.0)
2 root101 = r001 ** (1/3.0)
Now, we need to find the integer between these two roots.
# Since both roots are negative, we can use the min function to get the one that's closer zero
3 ans max(root45, root101)
4 print(ans)
</code>
Given the execution result of its written program, the LLM responds as follows:
[AI (Llama3.3)] Based on the given program and the calculated 'ans', I will show my thinking process explicitly. Since we are trying to find the integer between 4445 and 1011, we first calculated the cube roots themselves using the program. The results are 'root45 -3' and 'root101= -5. Now, we need find the integer between these two roots. Since both roots negative, can the 'max' function get the one that's closer to zero. The program calculated "ans max(root45, root101) max(-3, -5) = -3', However, we need to find the integer that lies between 4-45 and III. Since *-3' is the cube root of '-55', we need to add to it to get the integer that lies between the two cube roots. Therefore, the final answer is:< 1s:<<nsser>>-3 + <2//Anwer>>>
Though the generated code correctly calculates V/445 ~ 3356 and rounds to -4, and 3/1 -4.66 rounded to -5, it still misinterprets the code's output as -3 leading to an invalid adjustment -3 + -2. This because in the original CoT steps, the LLM incorrectly state that 4/445 -3, which is mathematically flawed. In the final response, it conflates the code's 's output (-4) with the incorrect initial NL reasoning (-3), creating disjointed argument. This misconnection invalidates the final answer. Additionally, the final NI. explanation introduces extraneous step: "we need to add 1 to it." This is not mathematically justified, as the correct answer has already been computed by "ans max(root45, root101)", The addition of 1 is a hallucinated step.
21


Reviews:
[{"review_id": "feT42ZR2EH", "reviewer": "Reviewer_4xYr", "summary": "The paper proposes a novel prompting/structured reasoning technique method (RaLU) that mitigates reasoning inconsistencies within the generated LLM output by proposing an alignment (alignment between the task and the generated code) and self-refinement (decomposing code into logical units and iteratively refining in context with LLM judges) modules for structures and decomposable reasoning. The results of the paper show a SOTA performance with increases on 4 math and algorithmic reasoning tasks. Further empirical proofs show that structuring the reasoning process with initial code and decomposing the code with CFG is essential for achieving strong performance.", "questions": "", "limitations": "", "rating": 4, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We are grateful for your valuable comments and hope this response can address your questions.\n\n# Questions\n1. We select the latest models from three renowned open-source families. The effectiveness of RaLU is not directly tied to the model's size but rather depends on the model's reasoning capabilities and the ability to follow detailed instructions. We supplemented experiments with Qwen-14B on MATH and Mbpp/Mbpp+. As shown in the Table, RaLU still provides significant improvements for smaller yet capable models. \n|Benchmark|Direct|CoT|ToT|PoT/SR\\*|SC|SCal|SCheck/SD|RaLU|\n|-|-|-|-|-|-|-|-|-|\n|Mbpp|0.840|0.860|0.831|0.804|0.868|0.852|0.852|**0.902**|\n|Mbpp+|0.725|0.733|0.720|0.698|0.754|0.706|0.714|**0.839**|\n|MATH-np|0.603|0.691|0.651|0.731|0.751|0.710|0.593|**0.784**|\n\n2. Due to the limited space, please refer to our response to **Reviewer jMQo, Strengths And Weaknesses**\n\n3. We have added AQUA on Qwen-72B-Instruct. Impressively, our RaLU framework continues to achieve the best performance. We agree that more benchmarks would further validate RaLU's robustness and plan to include AQUA in our revised version.\n\n|Benchmark|Direct|CoT|ToT|PoT|SC|SCal|SCheck|RaLU|\n|-|-|-|-|-|-|-|-|-|\n|AQUA|0.764|0.799|0.791|0.807|0.779|0.811|0.772|**0.846**|\n\n# Claims\n1. Thank you for your insights on \"reasoning hallucinations.\" Here, they primarily refer to the logic mismatch between code- and NL-based reasoning—the key challenge RaLU addresses. We do not cover traditional logical inconsistencies (e.g., reasoning-final answer mismatch) and will clarify this in the revised paper.\n\nGiven the difficulty in exhaustively categorizing reasoning errors, we adopt a top-down approach: abstracting reasoning hallucinations as disruptions to one-to-one sequence mappings (e.g., \"12345\"$\\leftrightarrow$ \"abcde\"). These fall into three core types:\n- Element errors\n- Missing/redundant elements\n- Sequence misordering\nOther errors can be viewed as combinations of these. (Note: We’ll add \"or vice versa\" to \"1) accurate NL step…\").\n\nWe acknowledge the theoretical challenge of covering all error types due to real-world complexity. If they are hallucinations independent of the three types, we'll supplement experiments to further analyze whether RaLU can mitigate the new type. Our classification aims to guide technical improvements—even if marginal types exist, solving these three significantly boosts reliability, with extensible methodology.\n\n2. We will replace \"verified\" with \"self-verified\" to enhance the rigor of the text, emphasizing that this is an internal validation process only relying on the LLM itself to prevent such ambiguity.\n\n3. Although the LLM in RaLU may misjudge a unit, this is not a self-preference bias. Self-preference bias occurs when the LLM favors answers aligned with its training distribution, deviating from human preferences [1]. In RaLU, self-judgment only assesses correctness—misclassifying an incorrect unit as correct is an error (not a bias), affecting its final accuracy, not human-aligned processes.\nA more relevant issue might be confidently incorrect predictions, where the LLM overestimates its answers' correctness. To mitigate this, RaLU separates program generation and judgment/refinement into different dialogues, obscuring the units' source. Additionally, units are extracted from generated programs with modified indicators, reducing overconfidence in familiar distributions.\n[1] S. Dhuliawala, et. al, \"A Diachronic Perspective on User Trust in AI under Uncertainty”\n\n4. The questions are around alignment: cross-unit alignment, inter-statement alignment, and unit-to-program alignment. RaLU employs conditional generation. Though it doesn’t guarantee absolute consistency, its strength lies in dynamic context modeling and flexible dependency capture, avoiding the rigidity of hard constraints.\n\n- Corss-Unit: Units are constrained by prior ones during refinement, aided by Transformer’s self-attention for implicit semantic linking. For example, variable name changes in earlier units propagate to later ones. Hard constraints risk inconsistencies if dependencies are incomplete.\n- Code: Theoretically feasible, but RaLU prioritizes logic over syntax. Forced concatenation imposes rigid boundaries, whereas LLM regeneration dynamically optimizes interfaces (e.g., auto-completing variables) and adheres to syntax rules via pre-trained knowledge.\n- Synthesis: Conditional generation may introduce minor misalignment, but RaLU’s verification units steer the LLM toward valid solutions. Hard constraints risk overfitting to rules at the expense of semantics (e.g., redundant type conversions). Key logic (e.g., boundary handling) is preserved via attention weights, while non-critical parts are optimized—mimicking human programming cognition.\n\n5. The decision is not made by the LLM. Each node in CFG has <= 2 children (if, else); We traverse CFG using depth-first search, organizing the nodes along the way into units to be entered in the order.", "claims_and_evidence": "All of the empirical claims are well supported by evaluating the method vs diverse benchmarks that include CoT reasoning or variations (ToT), structured reasoning (PoT) and self-refinement. The method shows performance gains across 3 different models compared to all of the tested techniques. Further ablations are also consistent, showing that key components of the method (Decomposition with CFG and writing code) are necessary for the reasoning paradigm.\n\nWith this said, the theoretical explanation and claims seem either to be overstating the contribution components of the method or are handwavy (Section 3 mainly):\n\n1) While the identified three types of reasoning inconsistencies seem correct, how can we be sure that those modes are exhaustive or cover the majority of reasoning inconsistency types? Is there any analysis w.r.t. the identified/presented error types?\n\n2) Across the method explanation (both in the intro and section 3), the authors repeatedly mention that the solution synthesis (final step) results in \"verified\" (each node is verified) reasoning paths. However, as all of the units are judged and refined with an LLM and are not deterministically confirmed to be true, the statement seems to be a tad strong. (Further questions and concerns can be explored in the Theoretical claims section)\n\n3) While the LLM-judge approach has shown some performance yields, it has also been shown [1,2,3] that there is a self-preference bias within LLMs, which is amplified during the process of self-refinement. How do the self-refinement and self-judging modules of RaLU stack against this phenomenon? Has it been tested?\n\n4) After Judging and refining all of the segmented units, they are recombined (final synthesis) into a new program. However, after individual refinement, the units are aligned with the task, yet are they aligned and consistent with respect to each other? Can we just concatenate the refined chunks of code and obtain an executable program? Does the code after the final synthesis step explicitly and verifiably include all of the chunks from the refined units?\n\n5) How does the written CFG heuristic segment deeply nested loops and branches? How can varying levels of nesting be recombined after refinement? Are those decisions left to the LLM?\n\n\n[1] Panickssery, A., Bowman, S.R., Feng, S. (2024). LLM Evaluators Recognize and Favor Their Own Generations. arXiv preprint arXiv:2404.13076.\n\n[2] Xu, W., Zhu, G., Zhao, X., Pan, L., Li, L., Wang, W.Y. (2024). Pride and Prejudice: LLM Amplifies Self-Bias in Self-Refinement. arXiv preprint arXiv:2402.11436.\n\n[3] Wataoka, K., Takahashi, T., Ri, R. (2024). Self-Preference Bias in LLM-as-a-Judge. arXiv preprint arXiv:2410.21819.", "methods_and_evaluation_criteria": "The chosen datasets, benchmarked methods and evaluations are relevant to the task explored in the paper. Although the choice of the models and the datasets is not explicitly systematic or weel justified. (2 additional questions w.r.t. this are in the questions section)", "theoretical_claims": "The main theoretical claim of the paper is a \"Bayesian\" argument about the generated self-refined (self-repair) unit (and subsequently a solution) is more likely to be correct than the unrefined counterpart. Both of these arguments (Section 3.2-3.3) rest heavily on the assumptions of optimality of the LLM judge and the LLM refinement process. The Bayesian argument only works in case the expected performance of the Judge is not random and is even much better than the judgement/generation of the model that outputted the initial program. Given that the Judge and the initial generator are the same LLM with different contexts, I cannot really consider the Bayesian lens argument to have full mathematical rigour.", "experimental_designs_or_analyses": "The ablations and experimental designs are sound.", "relation_to_broader_scientific_literature": "The paper contributes a novel prompting/structured reasoning method for tackling complex reasoning tasks with controllable modules for decomposition, task alignment and self referential improvement.", "essential_references_not_discussed": "N/A", "other_strengths_and_weaknesses": "N/A", "other_comments_or_suggestions": "The Bayesian explanation/argument (both in the main paper and appendix) seems rather handwavy and makes very strong assumptions w.r.t. the self-judging and self-refinement processes (Questions and concerns above). Please either add more mathematical rigour and mention the assumptions explicitly or replace the section.", "questions_for_authors": "1) Why are these sets of varying models chosen exactly? How does the idea scale for models <=30B and 100B+ (outside of deepseek)\n2) Can the authors mention what is the average token (amount) difference between CoT, PoT and RaLU? How efficient is it to use RaLU? \n3) Can the authors provide additional benchmarks that would show the consistency of the method? GSM8k, MATH and HumanEval well-saturated benchmarks. Benchmarks such as AQUA, ProofWriter, AR-LSAT etc. might be better suited for testing the method.", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "Nt387EbcL5", "reviewer": "Reviewer_KWVa", "summary": "This paper introduces a novel prompt engineering-based approach, Reasoning-as-Logic-Units (RaLU), which consists of three key components:1) Logic Unit Extraction, 2) Logic Unit Alignment, and 3) Solution Synthesis, to enhance the reasoning capability of the LLMs. \nRaLU decomposes the task into multiple logic units, by aligning the code statements within each logic unit with the natural language task specification, it mitigates reasoning hallucinations in the model, and then it synthesizes all the logic units to generate the final solution. \nExperimental results have demonstrated that RaLU outperforms existing baselines on benchmarks for both mathematical and code generation tasks", "questions": "", "limitations": "", "rating": 3, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "Thank Reviewer KWVa for your constructive feedback on our work. We have carefully considered all comments and hope our point-by-point response can address your questions.\n\n## Questions\n\n1. **Multiple runs of experiments**: Thank you for your feedback! Given the inherent stochastic nature of LLMs and the absence of seed support in the official API, we additionally conducted two independent trials on Qwen-72-Instruct for MATH and Mbpp/Mbpp+ benchmarks (temperature=0.7, identical prompting strategies) to further validate the robustness of RaLU under different model configurations. While these preliminary results (reported as mean ± std in Table 2) align with our prior findings, we will finalize three full replications across all models and datasets before publication to ensure statistical rigor. This iterative process strengthens our confidence in RaLU's consistent performance across varying model architectures and task domains.\n| Benchmark | Direct       | CoT          | ToT          | PoT/SR\\*     | SC           | SCal         | SCheck/SD    | RaLU             |\n| - | - | - | - | - | - | - | - | - |\n| Mbpp      | 0.923±0.0070 | 0.895±0.0014 | 0.905±0.0045 | 0.860±0.0046 | 0.922±0.0033 | 0.924±0.0038 | 0.905±0.0038 | **0.957±0.0012** |\n| Mbpp+     | 0.788±0.0021 | 0.761±0.0052 | 0.772±0.0046 | 0.725±0.0038 | 0.779±0.0061 | 0.787±0.0122 | 0.750±0.0349 | **0.856±0.0017** |\n| Math-np   | 0.705±0.0065 | 0.701±0.0085 | 0.695±0.0045 | 0.743±0.0223  | 0.764±0.014  | 0.725±0.0065 | 0.685±0.0088 | **0.803±0.0085** |\n\n2. **Ablation Study of Candidate Unit Selection**: Thank you for your insightful suggestion. We conducted ablation experiments using Qwen-72B-Instruct on MATH,  which is sufficiently complex with enough cases (89/700) where the branch reaches the threshold. We used three comparison strategies: random selection, choosing the candidate with the minimum perplexity, and choosing the last one. The accuracy results are as follows.\n\n| Confidence (original) | Random      | Perplexity      | Last        |\n| - | - | - | - |\n| 42/89=0.472           | 40/89=0.449 | 45/89=**0.506** | 38/89=0.427 |\n\nThe results revealed that the impact of the selection strategy is marginal. During self-correction iterations, LLMs tend to produce tokens with high probabilities. This results in minimal variance between the average probability (confidence) and perplexity (geometric mean equivalent) metrics. Through qualitative analysis, we observed that many candidate units generated within budget limits are functionally equivalent variants differing only in implementation details. This semantic equivalence explains why random selection only causes minor performance degradation. \n\nDue to the limited space, we provide a more detailed description in our response to Reviewer jMQo, Question Part, for your reference.\n\n3. **ChatRepair Comparison**: Thank you for your suggestion. We will discuss the differences between ours and ChatRepair-like approaches more comprehensively. As you mentioned, the core design concepts of the two are distinct. Our approach relies entirely on the model's intrinsic reasoning capabilities, whereas ChatRepair depends on external feedback for corrections. \nIn practice, it is challenging to obtain comprehensive test cases. ChatRepair also struggles with complex mathematical reasoning and may cause overfitting and data leakage using test data. As a feedback-based correction method, ChatRepair does not sufficiently align with our method in terms of problem assumptions, input constraints, and evaluation metrics. Our method has been comprehensively compared with relevant baselines for test-time reasoning enhancement. The baseline papers also did not compare against ChatRepair. Also,  ChatRepair is an Automated Program Repair tool that aims to generate patches for buggy programs instead of code generation or reasoning.\n\n## Claims\n1. **RaLU v.s. Self-Correction Methods**: We appreciate the reviewer's insightful feedback regarding our analysis of self-correction methods. We will make the expressions more rigorous by changing it to “Many existing self-correction-based methods (e.g., Self-Refine, Self-Debug) implicitly encourage differences between self-corrected responses and initial responses, which can potentially introduce errors into initially correct responses.”\nAccording to their original papers, Self-Refine and Self-Debug prompt the LLM to fix the response based on self-generated or external feedback and adopt the newly generated response as the final result. On the other hand, Self-Check generates multiple candidate steps after information extraction and other procedures. It then decides on step-through voting, maintaining the possibility of retaining the original response. In Self-Check, different candidate responses are treated equally. Our method also allows retaining the original response to mitigate the issue of introducing errors into a correct response.", "claims_and_evidence": "1. Most of the claims are well evaluated. However, there is a little concern in Section 4.2, RaLU v.s. Self-Correction Methods. “Many existing self-correction-based methods (e.g., Self-Refine and SelfDebug), often degrade performance by introducing errors into initially correct responses–a flaw exacerbated by their assumption of imperfection existence in the initial response attempt.” I am not sure whether this assumption is correct, more evidence should be given. Additionally, does the baseline (SCheck/SD⋆) used in this paper also adopt this assumption?\n\n2. The initially generated program largely determines the quality of the final result, as all logic units are extracted from it. Therefore, experiments should be conducted multiple times to reduce the impact of randomness.\n\n3. In the process of judging the correctness of each logic unit, if the limit budget is reached, the method chooses the candidate with highest confidence score as the correct one.  There should be an experiment by comparing it with another strategy, e.g., choosing a candidate randomly.", "methods_and_evaluation_criteria": "Yes. The methods make sense for enhancing the reasoning ability for LLMs to perform better on both mathematical and code generation tasks.", "theoretical_claims": "The theoretical claims in this paper are reasonable.", "experimental_designs_or_analyses": "Overall, the experimental design is reasonable. However, some issues remain, such as the design of the ablation study, the validation of the effectiveness of certain procedures, and the impact of randomness.", "relation_to_broader_scientific_literature": "This paper presents an effective approach to enhance model reasoning capabilities by decomposing a task into multiple parts or breaking it down into several sub-tasks and solving them sequentially. This approach can be considered a general framework that can be applied to a wide range of code-related tasks.", "essential_references_not_discussed": "The paper ‘ChatRepair’ has been referred to in this paper, but the discussion about it is not enough. The method proposed in this paper relies entirely on the model's intrinsic reasoning ability, whereas ChatRepair serves as a representative approach that leverages external feedback to guide reasoning. On the benchmark of code generation, it would be beneficial to include ChatRepair as a baseline for comparative evaluation. Otherwise, a more detailed discussion should be provided.", "other_strengths_and_weaknesses": "The approach is novel by integrating the CFG and extracting the logic units from it to align the code statements within each logic unit with the natural language task specification. And experimental results have demonstrated that RaLU outperforms existing baselines on the chosen benchmarks.\n \nPotential Weakness:\n1. Experiments should be conducted with multiple random seeds.\n2. No specific experiments can demonstrate the effectiveness of selecting the candidate with the highest confidence score.", "other_comments_or_suggestions": "N.A.", "questions_for_authors": "1. Can you show the performance with running multiple times to remove the potential risk of randomness?\n2. Can you conduct specific experiments to demonstrate the effectiveness of selecting a candidate with the highest confidence score? e.g., comparing with the random selection.\n3. How about the performance of ChatRepair on the benchmarks of code generation?", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "lJxpQ2GOIH", "reviewer": "Reviewer_jMQo", "summary": "This paper presents a novel test-time scaling framework, Reasoning-as-Logic-Units (RaLU), which consists of three main steps: Logic Unit Extraction (directly generating a program to address the given problem, and using static analysis tools to create a control flow graph to decompose the program into logic units),  Logic Unit Alignment (iteratively judge and refine each unit), and Solution Synthesis (generate the final answer according to the conversation history). The authors compare their RaLU with other previous methods on several benchmarks in mathematical reasoning (GSM8K, MATH) and algorithmic reasoning (HumanEval+, MBPP+) across different open-sourced base models (DeepSeekV3,  Llama3.3-70B-Instruct and Qwen2.5-72B-Instruct), and RaLU achieves consistently the best accuracy. They also conducted ablation studies, comparing with line-by-line and NL-step, to demonstrate the effectiveness of decomposing the program into logic units and using program-aided techniques.", "questions": "", "limitations": "", "rating": 4, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We are sincerely grateful for your recognition of RaLU’s contributions. Many thanks to your constructive comments to enhance our work.\n\n# Questions\nWe appreciate the reviewer's insightful question. \nLet’s use perplexity=exp(-1* Mean(token probabilities)) as another metric using “multiplying”. We have supplemented an ablation study, which revealed that the impact of the selection strategy is marginal. Specifically, we conducted experiments using Qwen-72B-Instruct on the MATH dataset because the MATH dataset is complex enough, and there are enough cases (89/700) where the branch reaches the threshold, and different selection strategies may have a relatively significant impact on the final result.\nWe used three comparison strategies: random selection, choosing the candidate with the minimum perplexity, and choosing the last one. The accuracy results with the 89 cases are as follows.\n\n|Confidence(original)|Random|Perplexity|Last|\n|-|-|-|-|\n|42/89=0.472|40/89=0.449|45/89=**0.506**|38/89=0.427|\n\nThis can be attributed to two key factors:\n- During self-correction iterations, the LLM tends to produce tokens with consistently high probabilities (the average probability >0.9 for most responses in our analysis). This results in minimal variance between the average probability (our confidence score) and perplexity (geometric mean equivalent) metrics - their Pearson correlation reaches 0.93. Essentially, both metrics reflect similar confidence patterns.\n- Through qualitative analysis, we observed that many candidate units generated within budget limits are functionally equivalent variants differing only in implementation details. This semantic equivalence explains why random selection only causes minor performance degradation. \n\nWhile perplexity-based selection slightly outperforms our original strategy (+0.9%), the limited gain suggests that the verification-revision loop in Stage 2 already filters out most critical errors before selection occurs. It also indicates that multiplying can be a insightful metric and deserves consideration. In the revised appendix, we will add relevant discussions and provide different candidate selection strategies in the code to accommodate various scenarios. Thank you again for helping us enhance this work.\n\n# Strengths And Weaknesses\n**Inference cost**: We appreciate the reviewer's insightful comment. We list the average token consumption of RaLU and baselines on MATH-np using Qwen-72B-Instruct. RaLU consumes 15x tokens compared to CoT, while saving 10x tokens compared to multi-path reasoning baselines such as Self-Check and ToT. We will include the information about token cost in Appendix.\n| Token | Direct   | CoT   | ToT     | PoT | SC    | SCal  | SCheck     | RaLU  |\n| -  | - | - | - | - | - | - | - | - |\n| Input | $8 \\times 10^{4}$ | $8 \\times 10^{4}$ | $7.5 \\times 10^{7}$ | $2 \\times 10^{5}$ | $1.3 \\times 10^{6}$ | $1.5 \\times 10^{5}$ | $2 \\times 10^{7}$ | $4.8 \\times 10^{6}$ |\n|Output| $7 \\times 10^{4}$ | $1.5 \\times 10^{5}$ | $1.2 \\times 10^{7}$ | $9 \\times 10^{4}$ | $3 \\times 10^{6}$ | $8 \\times 10^{4}$ | $1.4 \\times 10^{6}$ | $7 \\times 10^{5}$\n| -  | - | - | - | - | - | - | - | - |\n\n# Other Comments\n1. Thanks for pointing out the error of equation (4). We correct it as $\\text{Conf}(\\tilde{\\mathcal{U}}) = \\frac{1}{n}\\sum_{j=1}^{n} \\sigma(lp_j) $\n\n2. Thank you very much for pointing out our clerical error. In the Appendix, $1-\\beta$ also needs to be replaced with $\\beta$, and the rest of the derivation process and conclusions remain unchanged. Thank you very much for your meticulous review.", "claims_and_evidence": "Yes", "methods_and_evaluation_criteria": "Yes", "theoretical_claims": "N/A", "experimental_designs_or_analyses": "I checked the details in the main text, which look sound to me.", "relation_to_broader_scientific_literature": "The paper presents a pioneering test-time scaling framework designed to tackle reasoning hallucinations and enhance the reasoning capabilities of LLMs.", "essential_references_not_discussed": "No", "other_strengths_and_weaknesses": "Strengths:\n\n1. RaLU achieves great performance in several benchmarks such as GSM8k, MATH, HumanEval+, MBPP+.\n\n2. The ideas of decomposing complex reasoning into unit steps,  using both program and natural languages to reduce reasoning hallucinations, and enforcing more rigorous and interpretable reasoning steps, and using external tools (creating CFG) are all great and effective.\n\n3. The paper is well written and structured and the ideas and methods are clearly presented.\n\nWeaknesses:\n\n1. Since RaLU is a test-time scaling method, it would be better to also compare the inference cost (e.g., total time cost, token consumptions) with previous methods to see the computation-accuracy tradeoff.", "other_comments_or_suggestions": "1. The format of equation (4) is wrong.\n2. In (6), should $1-\\beta$ be replaced with $\\beta$?", "questions_for_authors": "Why in (4) and (5), the probabilities of each token are added instead of multiplied (or equivalently, the log of probabilities are added)?", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "DYsD8N7XNk", "reviewer": "Reviewer_dezw", "summary": "This paper introduces Reasoning-as-Logic-Units (RaLU), a novel test-time reasoning framework designed to address hallucinations in LLM reasoning and enhance their performance in mathematical and coding reasoning tasks. \n\nSpecially, RaLU consistes of three parts.\nLogic Unit Extraction: begins by generating an initial program and constructing a Control Flow Graph (CFG) using static code analysis. The CFG is then decomposed into discrete logic units, each representing a self-contained computational intent. This decomposition allows for structured refinement of the program's logic.\n\nLogic Unit Alignment: engages in iterative dialogue with the LLM to judge, explain, and correct each logic unit. If a unit is incorrect, it is refined and re-evaluated. This process continues until all units are validated or a predefined threshold is reached.\n\nSolution Synthesis: synthesizes them into a coherent reasoning path and generates the final solution. This ensures that the final solution inherits the logical rigor of the program while retaining the interpretability of natural language.\n\nThe authors conduct experiments on several mathematical reasoning and code generation datasets.", "questions": "", "limitations": "", "rating": 3, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "Thank you for the review. To ensure we address your concerns with precision, could you kindly clarify your suggestions? We are delighted to address any questions you may have and refine our paper accordingly. We look forward to your feedback and reassessment.", "claims_and_evidence": "RaLU significantly reduces reasoning hallucinations\n- RaLU outperforms existing baseline methods\n- The authors give error analysis where the proposed method identifies and corrects the errors.\n- It also give a theoratical explanation.\n\nRaLU enhances the accuracy and interpretability\n- It achieves good performance on each benchmark.\n- It can generate readable explanations, improving transparent and interpretability.", "methods_and_evaluation_criteria": "Yes", "theoretical_claims": "Yes, I have checked", "experimental_designs_or_analyses": "The experimental designs is reasonable.", "relation_to_broader_scientific_literature": "The main focus of this paper is to organize and plan the sub-steps of multi-step reasoning through prompt engineering. From this perspective, the proposed method is relatively similar to previous approaches.\n\nThe difference lies in the fact that this paper uses logical units as interpretable and verification units for reasoning, thereby introducing new elements to the control flow of reasoning.", "essential_references_not_discussed": "No", "other_strengths_and_weaknesses": "See above", "other_comments_or_suggestions": "See above", "questions_for_authors": "No", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}]

Author rebuttal:

Meta-review: The paper presents a novel prompting/structured reasoning approach to tackle complex reasoning tasks by aligning a set of logical units between the generated program and their corresponding NL descriptions. 

Reviewers consider this idea is novel. It shows very solid improvements on several different benchmarks in the experiments. 

Please update the paper for camera ready according to the review comments, e.g., provide the inference cost.
Decision: Accept (poster)