ORDDAR: Observation-Driven Reasoning for Distortion-Resilient Decision, Action, and Cognitive Recovery

arXiv cs.AI Papers

Summary

ORDDAR is a reasoning framework that models cognitive state transitions to detect and repair localized distortions, enhancing AI reasoning quality and interpretability across benchmarks.

arXiv:2608.28704v1 Announce Type: new Abstract: AI agents increasingly perform long-term reasoning, planning, tool use, memory integration, and autonomous decision making, yet erroneous intermediate states can propagate and cause inconsistent decisions and unreliable outputs. Existing reasoning approaches mainly rely on iterative planning, self-reflection, augmented memory, or verification, but rarely localize and selectively repair faulty reasoning. We present ORDDAR (Observation-Driven Reasoning for Distortion-Resilient Decision, Action, and Cognitive Recovery), a reasoning framework that models reasoning as cognitive state transitions, detects localized distortions, retrieves related reasoning from prior experiences, and repairs only the affected states. ORDDAR therefore performs recovery at the local reasoning-transition level rather than regenerating the complete trajectory. Experiments across mathematical, commonsense, multi-hop, and clinical reasoning benchmarks demonstrate improved reasoning quality, recovery ability, and interpretability over multiple evaluated reasoning baselines.
Original Article
View Cached Full Text

Cached at: 09/01/26, 12:38 PM

# ORDDAR: Observation-Driven Reasoning for Distortion-Resilient Decision, Action, and Cognitive Recovery
Source: [https://arxiv.org/html/2608.28704](https://arxiv.org/html/2608.28704)
Anant NawalgariaAffiliation:Google Research, GermanyShyamal Kumar Das MandalAffiliation:Indian Institute of Technology Kharagpur, India

###### Abstract

AI agents increasingly perform long\-term reasoning, planning, tool use, memory integration, and autonomous decision making, yet erroneous intermediate states can propagate and cause inconsistent decisions and unreliable outputs\. Existing reasoning approaches mainly rely on iterative planning, self\-reflection, augmented memory, or verification, but rarely localize and selectively repair faulty reasoning\. We present ORDDAR \(Observation\-Driven Reasoning for Distortion\-Resilient Decision, Action, and Cognitive Recovery\), a reasoning framework that models reasoning as cognitive state transitions, detects localized distortions, retrieves related reasoning from prior experiences, and repairs only the affected states\. ORDDAR therefore performs recovery at the local reasoning\-transition level rather than regenerating the complete trajectory\. Experiments across mathematical, commonsense, multi\-hop, and clinical reasoning benchmarks demonstrate improved reasoning quality, recovery ability, and interpretability over multiple evaluated reasoning baselines\.

## 1Introduction

Agentic AI is becoming the next computational paradigm where agents are able to perceive their environments, plan for future actions, use tools from the external world, remember things, and perform elaborate workflows without any human intervention\([Xu et al\., 2026](https://arxiv.org/html/2608.28704#bib.bib1)\)\. Nevertheless, robust reasoning still poses a challenge\. Mistakes made at some stage of reasoning can cause errors like context drift, inconsistent memory usage, conflicting observations, and bad decisions\. Recent benchmarking also indicates that even today’s state\-of\-the\-art agentic models fail to reason with complicated instructions and multiple constraints in realistic settings\([Qi et al\., 2026](https://arxiv.org/html/2608.28704#bib.bib2)\)\.

Several reasoning paradigms have been proposed to improve autonomous agent reasoning\. ReAct integrates reasoning with environment interaction\([Yao et al\., 2022](https://arxiv.org/html/2608.28704#bib.bib3)\), Tree of Thoughts \(ToT\) explores multiple reasoning branches through deliberate search\([Yao et al\., 2023](https://arxiv.org/html/2608.28704#bib.bib4)\), and Reflexion enhances reasoning via self\-reflection and episodic memory without model retraining\([Shinn et al\., 2023](https://arxiv.org/html/2608.28704#bib.bib5)\)\. Despite these advances, reasoning stability remains a major challenge, as errors in intermediate reasoning states can propagate through subsequent reasoning trajectories\([Yeo et al\., 2025](https://arxiv.org/html/2608.28704#bib.bib6);[Gan et al\., 2025](https://arxiv.org/html/2608.28704#bib.bib7)\)\. Existing approaches mainly rely on iterative self\-correction by repeatedly refining or regenerating reasoning\([Madaan et al\., 2023](https://arxiv.org/html/2608.28704#bib.bib8)\), yet their effectiveness varies across models, tasks, and feedback settings\([Kamoi et al\., 2024](https://arxiv.org/html/2608.28704#bib.bib9)\)\. Furthermore, although modern AI agents demonstrate strong planning, tool\-use, and memory capabilities, current architectures lack mechanisms for diagnosing localized reasoning failures and selectively repairing only corrupted reasoning states without regenerating the entire reasoning trajectory\([Wang et al\., 2024](https://arxiv.org/html/2608.28704#bib.bib10)\)\. Consequently, a principled framework for reasoning distortion detection, reasoning\-state diagnosis, and selective cognitive recovery remains absent\. To address this gap, we propose ORDDAR \(Observation\-Driven Reasoning for Distortion\-Resilient Decision, Action, and Cognitive Recovery\)\.

![Refer to caption](https://arxiv.org/html/2608.28704v1/Figure/8.jpg)Figure 1:Overview of ORDDAR\. The framework detects reasoning distortions, retrieves recovery complements through the Cognitive Mirror, selectively repairs corrupted reasoning states, and predicts the final decision\.To address these limitations, we propose ORDDAR \(Observation\-Driven Reasoning for Distortion\-Resilient Decision, Action, and Cognitive Recovery\), a novel observation\-driven reasoning system which considers reasoning as a series of cognitive state transitions \(Fig\.[1](https://arxiv.org/html/2608.28704#S1.F1)\)\. The system identifies local reasoning distortions, analyzes the failure in the reasoning state with a Cognitive Mirror by combining distortion memory with complementary reasoning, and repairs only the faulty reasoning transitions without having to reconstruct the whole reasoning path\. The key contributions of our study can be summarized as follows: First, we propose the ORDDAR model that treats reasoning as cognitive state transition and defines localized reasoning distortion\. Second, we propose a Cognitive Mirror that integrates distortion memory and complementary reasoning retrieval to identify reasoning failures and recover only corrupted reasoning transition states\. Third, we design an end\-to\-end reasoning pipeline that comprises of reasoning distortion detection, reasoning\-state diagnosis, complementary reasoning retrieval, and selective cognitive recovery\.

## 2Related Work

With the fast progress in large language models, agents can now perform reasoning, planning, tool usage, integration of memory, and decision\-making in changing environments\([Wang et al\., 2024](https://arxiv.org/html/2608.28704#bib.bib10);[Xu et al\., 2026](https://arxiv.org/html/2608.28704#bib.bib1)\)\. However, recent benchmarking efforts, such as AgentBench, TheAgentCompany, and AGENTIF, reveal that despite significant improvements, state\-of\-the\-art agents still experience difficulties in following instructions, satisfying constraints, and performing consistent decision\-making\([Liu et al\., 2024](https://arxiv.org/html/2608.28704#bib.bib11);[Xu et al\., 2026](https://arxiv.org/html/2608.28704#bib.bib1);[Qi et al\., 2026](https://arxiv.org/html/2608.28704#bib.bib2)\)\. Additionally, frameworks like OpenHands, AutoGen, and MetaGPT augment the capabilities of agents with techniques from software engineering, tool cooperation, and multi\-agent coordination\([Wang et al\., 2025](https://arxiv.org/html/2608.28704#bib.bib13);[Wu et al\., 2024](https://arxiv.org/html/2608.28704#bib.bib14);[Hong et al\., 2024](https://arxiv.org/html/2608.28704#bib.bib15)\)\. Meanwhile, domain\-specific benchmarks including MLAgentBench and ScienceAgentBench evaluate autonomous agents on machine learning and scientific discovery tasks, highlighting persistent challenges in reasoning robustness and consistency\([Huang et al\., 2023](https://arxiv.org/html/2608.28704#bib.bib12);[Chen et al\., 2025](https://arxiv.org/html/2608.28704#bib.bib16)\)\.

Iterative planning and self\-correction have greatly contributed to the improvement of reasoning\. ReAct combines reasoning with environment interactions, ToT explores various paths of reasoning, Reflexion and Self\-Refine improve reasoning by reflecting and refining it\([Yao et al\., 2022](https://arxiv.org/html/2608.28704#bib.bib3);[Yao et al\., 2023](https://arxiv.org/html/2608.28704#bib.bib4);[Shinn et al\., 2023](https://arxiv.org/html/2608.28704#bib.bib5);[Madaan et al\., 2023](https://arxiv.org/html/2608.28704#bib.bib8)\)\. However, recently, researchers have found that longer reasoning paths do not always enhance reliability because intermediate reasoning errors tend to propagate and eventually contaminate subsequent reasoning steps\([Yeo et al\., 2025](https://arxiv.org/html/2608.28704#bib.bib6);[Gan et al\., 2025](https://arxiv.org/html/2608.28704#bib.bib7)\)\. In addition, current self\-correction methods are extremely sensitive to the models, tasks, and feedback\([Kamoi et al\., 2024](https://arxiv.org/html/2608.28704#bib.bib9)\)\. As a result, most self\-correction methods either generate or refine an entire reasoning path instead of fixing corrupted reasoning paths\. Distortion of reasoning can be described as the presence of an unusual semantic shift between successive stages of cognition\. Reasoning distortion does not preserve semantic integrity while introducing new information, but valid reasoning does so\. Hence, semantic disparity is used as an indicator of localized reasoning distortion\. The ORDDAR framework specifically identifies reasoning distortions and repairs corrupted reasoning paths instead of generating an entire reasoning path\.

## 3Methodology

A lot of advances have been made by autonomous AI agents in the areas of long\-horizon planning, tool utilization, decision making, and lifelong learning, spanning a wide range of areas from embodied agents to web agents, software engineering to autonomous data science\([Zhou et al\., 2024](https://arxiv.org/html/2608.28704#bib.bib22);[Zhang et al\., 2025](https://arxiv.org/html/2608.28704#bib.bib20);[Xie et al\., 2024](https://arxiv.org/html/2608.28704#bib.bib21);[Park et al\., 2023](https://arxiv.org/html/2608.28704#bib.bib18);[Luo et al\., 2025](https://arxiv.org/html/2608.28704#bib.bib19);[Wang et al\., 2023](https://arxiv.org/html/2608.28704#bib.bib17)\)\. But their reasoning is prone to local errors that cause damage along their reasoning trajectories and compromise the ultimate decisions\. In order to compensate for this weakness, ORDDAR proposes a new transition\-based cognitive repair approach\.

![Refer to caption](https://arxiv.org/html/2608.28704v1/Figure/5.png)Figure 2:Overall mathematical workflow of ORDDAR\. Starting from an input query, ORDDAR constructs observation\-driven reasoning states, detects localized reasoning distortions, encodes compact distortion signatures, retrieves the most relevant recovery complement from the Cognitive Mirror using the proposed weighted similarity rule, selectively repairs distorted reasoning states, updates memory with successful recovery patterns, and performs the final prediction\.### 3\.1Problem Formulation

Autonomous AI agents solve complex tasks through sequential reasoning, where observations are progressively transformed into cognitive states before decision making\. Errors arising during these transitions propagate through subsequent reasoning and degrade final decisions\. ORDDAR addresses this problem by recovering localized reasoning errors instead of regenerating the entire reasoning trajectory\.

Given an input queryq∈𝒬q\\in\\mathcal\{Q\}, an autonomous AI agent generates an outputy∈𝒴y\\in\\mathcal\{Y\}through sequential reasoning\. ORDDAR models this process as a sequence of cognitive state transitions, where observations are progressively transformed into intermediate reasoning states\. Rather than regenerating the entire reasoning trajectory after failure, ORDDAR identifies and selectively repairs localized reasoning distortions\.

The input query is first transformed into a structured observation set

O=ϕ⁡\(q\)=\{o1,o2,…,om\},O=\\phi\(q\)=\\\{o\_\{1\},o\_\{2\},\\ldots,o\_\{m\}\\\},\(1\)whereϕ⁡\(⋅\)\\phi\(\\cdot\)denotes the observation extraction function andoio\_\{i\}represents theii\-th reasoning observation extracted from the input\. Based on the observation sequence, the reasoning engine constructs a trajectory of cognitive states

R=\{s1,s2,…,sT\},R=\\\{s\_\{1\},s\_\{2\},\\ldots,s\_\{T\}\\\},\(2\)where each cognitive state is recursively updated as

st=f⁡\(st−1,ot\),s\_\{t\}=f\(s\_\{t\-1\},o\_\{t\}\),\(3\)
withf⁡\(⋅\)f\(\\cdot\)denoting the reasoning transition function\. The objective of ORDDAR is to learn a recovery function

ℱ:R→R^,\\mathcal\{F\}:R\\rightarrow\\hat\{R\},\(4\)WhereR^\\hat\{R\}represents the recovered reasoning path\. Reasoning is defined as cognitive state changes driven by observations \(Eqs\. \(2\)–\(3\)\)\. Intermediate reasoning can be captured and detected for distortion recovery by detecting reasoning distortions, acquiring complementary reasoning, and repairing cognitive states for prediction\. For localized reasoning analysis, ORDDAR defines a cognitive windowWt=\{st,st\+1\}W\_\{t\}=\\\{s\_\{t\},s\_\{t\+1\}\\\}around the reasoning transition currently under inspection\. The window moves sequentially along the trajectory, enabling distortion detection and recovery at the level of an individual transition while preserving the remaining reasoning states\.

### 3\.2Reasoning Distortion Detection and Signature Encoding

ORDDAR detects localized reasoning failures by measuring the joint displacement of consecutive cognitive states in both semantic embedding space and cognitive\-anchor space\. Each cognitive statests\_\{t\}is represented by a semantic embeddingE⁡\(st\)E\(s\_\{t\}\)and a normalized cognitive\-anchor distributionψt\\psi\_\{t\}\. For each transitionet=\(st,st\+1\)e\_\{t\}=\(s\_\{t\},s\_\{t\+1\}\), the semantic transition distance is defined as

dtsem=1−cos⁡\(E⁡\(st\),E⁡\(st\+1\)\),d\_\{t\}^\{\\mathrm\{sem\}\}=1\-\\cos\\left\(E\(s\_\{t\}\),E\(s\_\{t\+1\}\)\\right\),\(5\)
whereE⁡\(⋅\)E\(\\cdot\)denotes the semantic embedding produced by a pretrained sentence encoder\. We evaluate three off\-the\-shelf sentence encoders, namely MPNet, all\-MiniLM\-L6\-v2, and BAAI/bge\-base\-en\-v1\.5, without task\-specific fine\-tuning\. MPNet is adopted as the primary encoder based on its best preliminary retrieval performance, while MiniLM and BGE are evaluated to assess the robustness of the proposed distortion representation to the choice of semantic embedding space\.

dtanchor=‖ψt−ψt\+1‖2\.d\_\{t\}^\{\\mathrm\{anchor\}\}=\\left\\\|\\psi\_\{t\}\-\\psi\_\{t\+1\}\\right\\\|\_\{2\}\.\(6\)
Because these two distances capture complementary aspects of a reasoning transition, they are normalized within the trajectory and combined using a root\-sum\-of\-squares formulation:

Dt=\(d~tsem\)2\+\(d~tanchor\)2,D\_\{t\}=\\sqrt\{\\left\(\\tilde\{d\}\_\{t\}^\{\\mathrm\{sem\}\}\\right\)^\{2\}\+\\left\(\\tilde\{d\}\_\{t\}^\{\\mathrm\{anchor\}\}\\right\)^\{2\}\},\(7\)
whered~tsem\\tilde\{d\}\_\{t\}^\{\\mathrm\{sem\}\}andd~tanchor\\tilde\{d\}\_\{t\}^\{\\mathrm\{anchor\}\}denote the normalized semantic and anchor\-space distances, respectively\. The resulting joint distortion scoreDtD\_\{t\}captures changes in both the semantic content and the reasoning structure of consecutive cognitive states\. For each reasoning trajectory, we define a trajectory\-adaptive distortion threshold as the mean joint distortion score across its consecutive state transitions:

τR=1T−1​∑t=1T−1Dt\.\\tau\_\{R\}=\\frac\{1\}\{T\-1\}\\sum\_\{t=1\}^\{T\-1\}D\_\{t\}\.\(8\)
A transition is considered distorted when

zt=\{1,Dt\>τR,0,otherwise\.z\_\{t\}=\\begin\{cases\}1,&D\_\{t\}\>\\tau\_\{R\},\\\\ 0,&\\text\{otherwise\}\.\\end\{cases\}\(9\)
Here,τR\\tau\_\{R\}denotes the trajectory\-adaptive distortion threshold, andztz\_\{t\}indicates whether the transition is identified as distorted\. Only transitions withzt=1z\_\{t\}=1are forwarded for signature encoding\. Each detected distortion is encoded as

kt=\{ψshift,Again,Aloss\},k\_\{t\}=\\\{\\psi^\{\\mathrm\{shift\}\},A^\{\\mathrm\{gain\}\},A^\{\\mathrm\{loss\}\}\\\},\(10\)
whereψshift\\psi^\{\\mathrm\{shift\}\}denotes the semantic transition shift,AgainA^\{\\mathrm\{gain\}\}represents newly introduced reasoning anchors, andAlossA^\{\\mathrm\{loss\}\}denotes discarded reasoning anchors\. The Shift–Gain–Loss signature characterizes the nature of the detected distortion and supports recovery\-complement retrieval\. The resulting signature enables efficient retrieval and cognitive recovery \(Fig\.[2](https://arxiv.org/html/2608.28704#S3.F2)\)\. An alternative design is to employ an additional drafter or verifier LLM to assess the correctness of intermediate reasoning states, similar in spirit to verifier\-based speculative decoding\. We considered this possibility but do not introduce an additional LLM verifier into ORDDAR\. Unlike speculative decoding, where a drafter proposes candidate tokens for subsequent verification, ORDDAR operates at the reasoning\-state transition level and aims to provide a lightweight, model\-independent signal for localizing reasoning distortions\. Introducing an additional verifier LLM would add another model\-dependent correctness signal and could confound the contribution of the proposed distortion detector\. Instead, ORDDAR separates distortion localization from correctness evaluation and evaluates the detector independently using ground\-truth reasoning\-transition annotations\.

### 3\.3Cognitive Mirror Memory

To support efficient reasoning recovery, ORDDAR maintains a*Cognitive Mirror*that stores compact distortion signatures and their corresponding recovery complements, enabling efficient retrieval without preserving complete reasoning trajectories\. The Cognitive Mirror is represented as

ℳ=\{\(ki,ci\)\}i=1N,\\mathcal\{M\}=\\left\\\{\(k\_\{i\},c\_\{i\}\)\\right\\\}\_\{i=1\}^\{N\},\(11\)wherekik\_\{i\}denotes the encoded distortion signature of theii\-th reasoning failure andcic\_\{i\}denotes its associated reasoning complement\. The Cognitive Mirror stores reusable distortion signatures and recovery complements for efficient indexing and cross\-task reuse\. Unlike conventional retrieval\-augmented reasoning, retrieval in ORDDAR is conditioned on a localized distortion signature and is used specifically to repair the corresponding reasoning transition rather than to augment the entire input context\. Each memory entry is created from a detected distorted transition\. For a distorted transitionete\_\{t\}, ORDDAR encodes its distortion signaturektk\_\{t\}and associates it with a recovery complementctc\_\{t\}\. The signaturektk\_\{t\}serves as the retrieval index, whilectc\_\{t\}represents the reusable recovery pattern\. Thus, the Cognitive Mirror stores compact distortion–recovery pairs rather than complete reasoning trajectories\.

### 3\.4Complement Retrieval

At runtime, the current cognitive window is encoded using the same distortion\-signature representation\. When a distortion is detected, its signature is used to retrieve the most compatible recovery complement from the Cognitive Mirror, which is applied only to the affected reasoning state\. For a distortion signaturektk\_\{t\}, ORDDAR retrieves the most relevant recovery complement from the Cognitive Mirror by computing similarity with stored signatures:

S⁡\(kt,ki\)=α1​Sshift\+α2​Sgain\+α3​Sloss,α1\+α2\+α3=1,αj≥0\.S\(k\_\{t\},k\_\{i\}\)=\\alpha\_\{1\}S\_\{\\mathrm\{shift\}\}\+\\alpha\_\{2\}S\_\{\\mathrm\{gain\}\}\+\\alpha\_\{3\}S\_\{\\mathrm\{loss\}\},\\qquad\\alpha\_\{1\}\+\\alpha\_\{2\}\+\\alpha\_\{3\}=1,\\quad\\alpha\_\{j\}\\geq 0\.\(12\)The weights are constrained to be non\-negative and sum to one, whereα1\\alpha\_\{1\},α2\\alpha\_\{2\}, andα3\\alpha\_\{3\}control the relative contributions of transition shift, gain, and loss similarities respectively\. Sensitivity analysis identifies\(α1,α2,α3\)=\(0\.6,0\.2,0\.2\)\(\\alpha\_\{1\},\\alpha\_\{2\},\\alpha\_\{3\}\)=\(0\.6,0\.2,0\.2\)as the best\-performing configuration, achieving the highest average signature matching score\. We therefore adopt the 60–20–20 configuration for all subsequent experiments\.

c∗=arg⁡max\(ki,ci\)∈ℳ⁡S⁡\(kt,ki\),c^\{\*\}=\\arg\\max\_\{\(k\_\{i\},c\_\{i\}\)\\in\\mathcal\{M\}\}S\(k\_\{t\},k\_\{i\}\),\(13\)wherec∗c^\{\*\}is the retrieved recovery complement\.

### 3\.5Localized Reasoning Recovery

ORDDAR repairs the distorted state using the retrieved complement while preserving the rest of the reasoning trajectory, enabling localized recovery instead of complete regeneration\. The restored reasoning state can be obtained as

s^t=ℛ⁡\(st,c∗\),\\hat\{s\}\_\{t\}=\\mathcal\{R\}\(s\_\{t\},c^\{\*\}\),\(14\)wherests\_\{t\}denotes the distorted reasoning state,c∗c^\{\*\}is the retrieved reasoning complement obtained from the Cognitive Mirror, andℛ⁡\(⋅\)\\mathcal\{R\}\(\\cdot\)denotes the complement\-guided recovery operator\.

The recovered reasoning trajectory is

R^=\{s1,…,s^t,…,sT\},\\hat\{R\}=\\\{s\_\{1\},\\ldots,\\hat\{s\}\_\{t\},\\ldots,s\_\{T\}\\\},\(15\)where only the distorted reasoning state is replaced while the remaining reasoning trajectory is preserved\. This localized recovery avoids unnecessary regeneration of valid reasoning states\.

### 3\.6Prediction and Cognitive Mirror Update

The recovered reasoning trajectory is used for final prediction:

y^=P⁡\(R^\),\\hat\{y\}=P\(\\hat\{R\}\),\(16\)whereR^\\hat\{R\}denotes the recovered reasoning trajectory andP⁡\(⋅\)P\(\\cdot\)is the prediction function\. Following localized recovery, the recovered trajectory is validated before the Cognitive Mirror is updated:

ℳ←ℳ∪\{\(kt,c∗\)\},\\mathcal\{M\}\\leftarrow\\mathcal\{M\}\\cup\\\{\(k\_\{t\},c^\{\*\}\)\\\},\(17\)wherektk\_\{t\}is the current distortion signature andc∗c^\{\*\}is the retrieved recovery complement\. Only validated recovery patterns are eligible for online memory updates\. During evaluation, the current test instance is queried against the existing Cognitive Mirror and is not inserted into memory before prediction, preventing evaluation\-time contamination\. To prevent data contamination, evaluation trajectories are not inserted into the Cognitive Mirror before prediction; only validated recovery patterns are eligible for subsequent memory updates\. The complete Cognitive Mirror workflow, including memory construction and indexing, local cognitive\-window formation, distortion\-signature retrieval, localized reasoning recovery, and validated online memory update, is summarized in Algorithm[1](https://arxiv.org/html/2608.28704#alg1)\.

Algorithm 1Cognitive Mirror Construction, Trace\-Guided Retrieval, and Recovery1:Validated trajectories

𝒟\\mathcal\{D\}, query

qq, threshold

τℛ\\tau\_\{\\mathcal\{R\}\}, weights

α1,α2,α3\\alpha\_\{1\},\\alpha\_\{2\},\\alpha\_\{3\}
2:Prediction

y^\\hat\{y\}
3:Initialize Cognitive Mirror

ℳ←∅\\mathcal\{M\}\\leftarrow\\emptyset
4:Memory Construction

5:foreach validated trajectory

ℛj=\{s1,…,sT\}∈𝒟\\mathcal\{R\}\_\{j\}=\\\{s\_\{1\},\\ldots,s\_\{T\}\\\}\\in\\mathcal\{D\}do

6:for

t=1t=1to

T−1T\-1do

7:

Wt←\{st,st\+1\}W\_\{t\}\\leftarrow\\\{s\_\{t\},s\_\{t\+1\}\\\}; compute joint distortion

DtD\_\{t\}
8:if

Dt\>τℛjD\_\{t\}\>\\tau\_\{\\mathcal\{R\}\_\{j\}\}then

9:

kt←\{ψshift,Again,Aloss\}k\_\{t\}\\leftarrow\\\{\\psi\_\{\\mathrm\{shift\}\},A\_\{\\mathrm\{gain\}\},A\_\{\\mathrm\{loss\}\}\\\}
10:Store validated pair

\(kt,ct\)\(k\_\{t\},c\_\{t\}\)in

ℳ\\mathcal\{M\}
11:endif

12:endfor

13:endfor

14:Runtime Detection and Recovery

15:Generate

ℛ=\{s1,…,sT\}\\mathcal\{R\}=\\\{s\_\{1\},\\ldots,s\_\{T\}\\\}from

qq
16:for

t=1t=1to

T−1T\-1do

17:

Wt←\{st,st\+1\}W\_\{t\}\\leftarrow\\\{s\_\{t\},s\_\{t\+1\}\\\}; compute joint distortion

DtD\_\{t\}
18:if

Dt\>τℛD\_\{t\}\>\\tau\_\{\\mathcal\{R\}\}then

19:Encode distortion trace

kt←\{ψshift,Again,Aloss\}k\_\{t\}\\leftarrow\\\{\\psi\_\{\\mathrm\{shift\}\},A\_\{\\mathrm\{gain\}\},A\_\{\\mathrm\{loss\}\}\\\}
20:Search

ℳ\\mathcal\{M\}for a compatible distortion trace and retrieve its complement

c∗c^\{\*\}using

α1​Sshift\+α2​Sgain\+α3​Sloss\\alpha\_\{1\}S\_\{\\mathrm\{shift\}\}\+\\alpha\_\{2\}S\_\{\\mathrm\{gain\}\}\+\\alpha\_\{3\}S\_\{\\mathrm\{loss\}\}
21:ifa compatible trace–complement pair existsthen

22:

s^t←R⁡\(st,c∗\)\\hat\{s\}\_\{t\}\\leftarrow R\(s\_\{t\},c^\{\*\}\)
23:Replace only the affected state

24:else

25:Preserve the current reasoning trajectory

26:endif

27:endif

28:endfor

29:

ℛ^←\\hat\{\\mathcal\{R\}\}\\leftarrowrecovered reasoning trajectory

30:

y^←P⁡\(ℛ^\)\\hat\{y\}\\leftarrow P\(\\hat\{\\mathcal\{R\}\}\)
31:Validated Memory Update for Future Queries

32:ifrecovery is validated and memory updating is permittedthen

33:

ℳ←ℳ∪\{\(kt,c∗\)\}\\mathcal\{M\}\\leftarrow\\mathcal\{M\}\\cup\\\{\(k\_\{t\},c^\{\*\}\)\\\}
34:endif

35:return

y^\\hat\{y\}

The workflow is task\-agnostic: although representations and validation may vary across tasks, cognitive\-window construction, distortion\-trace encoding, complement retrieval, and recovery remain unchanged\. The Cognitive Mirror is initialized from validated trajectories; recovery occurs only when a compatible validated complement exists, otherwise the trajectory is preserved\. Successful recovery may update memory for future queries, while evaluation instances are excluded before prediction\.

## 4Experimental Setup

Experiments are conducted on four reasoning benchmarks: GSM8K, HotpotQA, StrategyQA, and CKDQA, covering mathematical, multi\-hop, commonsense, and clinical reasoning, respectively\. All datasets are publicly available except CKDQA, which was constructed from hospital cases following ethical clearance\. For fair comparison, all methods use Qwen2\.5\-7B\-Instruct with its standard tokenizer and chat template, deterministic greedy decoding \(do\_sample=False\), and a maximum generation length of 512 tokens\. Each evaluation uses 100 test instances sampled with random seed 42\. For semantic retrieval, ORDDAR evaluates MPNet, all\-MiniLM\-L6\-v2, and BAAI/bge\-base\-en\-v1\.5, with MPNet selected based on preliminary retrieval performance; independent ablations evaluate the contributions of the individual ORDDAR components\.

## 5Results

### 5\.1Overall Performance

Comparison of ORDDAR with CoT, Self\-Refine, Reflexion, Tree of Thoughts \(ToT\), and ProCo is provided in Table[1](https://arxiv.org/html/2608.28704#S5.T1)\. ORDDAR achieves the highest reported performance among the compared methods\. The difference between the baselines suggests that the reasoning refinement process is highly dependent on task\-specific features and intermediate errors\. Whereas CoT and Self\-Refine depend on a consistent reasoning flow, Reflexion, ToT, and ProCo may still be influenced by intermediate errors or ineffective corrections\. ORDDAR identifies reasoning distortions and retrieves complementary reasoning patterns to repair the affected reasoning state\.

The higher performance on CKDQA suggests that localized errors in clinical findings or staging criteria can have a significant influence on the final decision\. In contrast, HotpotQA features multi\-hop evidence dependencies, resulting in more distributed reasoning errors\. This indicates that refinement effectiveness depends on both the error type and the nature of the reasoning task\. ORDDAR addresses these inconsistencies through localized state detection and recovery\.

Table 1:Performance comparison of CoT, Self\-Refine, Reflexion, ToT, ProCo, and ORDDAR\. Values denote accuracy \(%\) unless otherwise indicated\. For HotpotQA, both EM and F1 are reported\.Table 2:Comparison of embedding models used for Cognitive Mirror retrieval\. Values denote accuracy \(%\) unless otherwise indicated\. For HotpotQA, F1 is reported\.
### 5\.2Ablation Study

The contributions of the Complement Memory \(CM\), Distortion Memory \(DM\), and Recovery Memory \(RM\) are evaluated through independent ablations \(Table[3](https://arxiv.org/html/2608.28704#S5.T3)\)\. Removing any component consistently degrades performance, confirming their complementary roles\. On GSM8K, removing DM causes the largest drop \(92%→\\rightarrow85%\), highlighting the importance of accurate distortion localization\. On StrategyQA, removing CM or DM reduces accuracy from 86% to 81%, while removing RM yields 83\.3%\. Similarly, on HotpotQA, removing CM reduces EM from 67% to 65%, DM reduces F1 from 79\.22% to 79\.0%, and RM produces the lowest EM \(62\.5%\)\. The largest degradation occurs on CKDQA, where removing CM, DM, and RM reduces performance from 94\.38% to 81%, 78\.05%, and 79\.79%, respectively\. These results show that complement retrieval, distortion localization, and localized recovery each contribute to ORDDAR’s effectiveness\.

Table 3:Ablation study of the Complement \(CM\), Distortion \(DM\), and Recovery \(RM\) mechanisms\. Values denote accuracy \(%\) unless otherwise indicated\. For HotpotQA, both EM and F1 are reported\.
### 5\.3Ground\-Truth Validation of Similarity\-Based Distortion Detection

To validate the proposed distortion representation, we examine the relative contribution of transition similarity, logical gain, and logical loss\. Sensitivity analysis identifies the 60–20–20 weighting as the best\-performing configuration, assigning 60% to transition similarity and 20% each to gain and loss, as shown in Fig\.[3](https://arxiv.org/html/2608.28704#S5.F3)\(a\)\. We evaluate embedding\-based distortion detection on an independently labeled GT set across GSM8K, HotpotQA, StrategyQA, and Clinical\-CKD\. Table[4](https://arxiv.org/html/2608.28704#S5.T4)reports precision, recall, and F1 for MPNet Semantic, Cognitive Anchor, and ORDDAR Joint\. The cross\-benchmark results in Fig\.[3](https://arxiv.org/html/2608.28704#S5.F3)\(b\) show that similarity provides a meaningful distortion signal, with anchor\-based representations providing complementary evidence\.

![Refer to caption](https://arxiv.org/html/2608.28704v1/Figure/11.jpg)\(a\) Validation of the 60–20–20 weighting\.
![Refer to caption](https://arxiv.org/html/2608.28704v1/Figure/111.png)\(b\) Ground\-truth distortion detection\.

Figure 3:Validation of the proposed distortion representation and its ground\-truth detection performance\.Table 4:Ground\-truth validation of reasoning distortion detection\. P, R, and F1 denote precision, recall, and F1\-score, respectively\.
### 5\.4Qualitative Case Study and Retrieval Analysis

![Refer to caption](https://arxiv.org/html/2608.28704v1/Figure/1.jpg)\(a\) Clinical\-CKD reasoning recovery case\.
![Refer to caption](https://arxiv.org/html/2608.28704v1/Figure/7.png)\(b\) Cognitive Mirror retrieval space\.

Figure 4:Qualitative analysis of localized reasoning recovery and Cognitive Mirror retrieval\.A representative Clinical\-CKD recovery case is shown in Fig\.[4](https://arxiv.org/html/2608.28704#S5.F4)\(a\)\. For a patient with creatinine 3\.6 mg/dL and eGFR 16\.6 mL/min/1\.73m2, the initial reasoning incorrectly assigns G3, whereas 15–29 corresponds to G4 under KDIGO\([Stevens et al\., 2024](https://arxiv.org/html/2608.28704#bib.bib23)\)\. ORDDAR localizes the distortion \(0\.874\), retrieves a Cognitive Mirror complement \(0\.940\), and repairs only the erroneous transition, consistent with prior findings on intrinsic self\-correction limitations\([Tyen et al\., 2024](https://arxiv.org/html/2608.28704#bib.bib24);[Kamoi et al\., 2024](https://arxiv.org/html/2608.28704#bib.bib9)\)\. The corresponding UMAP visualization in Fig\.[4](https://arxiv.org/html/2608.28704#S5.F4)\(b\) shows that retrieved complements remain semantically close to detected distortions, suggesting that distortion signatures preserve useful information for recovery\-pattern retrieval\.

## 6Conclusion

ORDDAR was introduced as an observation\-based framework for detecting localized reasoning distortions and performing cognitive recovery\. By representing reasoning as a sequence of cognitive state transitions, ORDDAR detects distorted transitions, retrieves their complements from the Cognitive Mirror, and recovers only the affected states while preserving correct reasoning\. Experiments across mathematical, commonsense, multi\-hop, and clinical reasoning consistently demonstrate the superiority of ORDDAR over the evaluated reasoning baselines, particularly on CKDQA\. Ablation results confirm that distortion detection, complement retrieval, and recovery each contribute to the final performance\. Retrieval analysis further demonstrates that distortion signatures can identify relevant recovery patterns\. Overall, the results show that targeted cognitive recovery can provide an effective alternative to complete reasoning regeneration, while handling higher\-order multi\-hop dependencies remains an important direction for future research\. In the current clinical setting, recovery complements incorporate locally provided KDIGO knowledge\. Future work will extend this design to a hybrid recovery scheme combining Cognitive Mirror retrieval with dynamically retrieved clinical knowledge for broader and more adaptive domain\-specific recovery\.

### AI use statement

Generative AI tools were used to assist with language editing and limited code assistance during the preparation of this manuscript\. These tools were not used to generate experimental results, figures, perform the reported evaluations, or make final scientific decisions\. All AI\-assisted outputs were reviewed and verified by the authors\. The authors take full responsibility for the final content of this work, including all claims, analyses, results, and artifacts produced with the aid of generative AI\.

### Ethics statement

The clinical data used in this study were collected under the appropriate institutional and hospital ethical approvals\. The study procedures followed the ethical requirements and guidelines of the participating institution and hospital\. Appropriate measures were taken to protect patient privacy and confidentiality, and no personally identifiable information is reported in the manuscript or supplementary materials\. The CKDQA dataset is private and is therefore not publicly released\.

### Reproducibility statement

We provide the implementation and configuration details for reproducing the ORDDAR framework and the reported evaluation\. The source code covers the ORDDAR framework, reasoning distortion detection, Cognitive Mirror retrieval, localized recovery, and the evaluation procedures across GSM8K, HotpotQA, StrategyQA, and CKDQA\. The accompanyingREADME\.txtandrequirements\.txtdocument the required environment, dependencies, dataset access, model configuration, and execution procedure\. The implementation and reproducibility materials are provided as anonymous supplementary material; CKDQA requires authorized access to the underlying private clinical data\.

#### Author Contributions

The authors contributed to the conceptualization, methodology, experiments, analysis, and preparation of the manuscript\.

#### Acknowledgments

We sincerely thank the clinicians and doctors who supported this work by providing the clinical data and valuable domain expertise required for the CKDQA experiments\. We also gratefully acknowledge the AI research community for valuable knowledge, insights, and discussions on AI agents that contributed to the development of the ideas explored in this work\. We further thank everyone who provided helpful discussions and feedback during the development of this research\.

## References

- Chenet al\.\(2025\)Z\. Chen, S\. Chen, Y\. Ning, Q\. Zhang, B\. Wang, B\. Yu, Y\. Li, Z\. Liao, C\. Wei, Z\. Lu,et al\.Scienceagentbench: toward rigorous assessment of language agents for data\-driven scientific discovery\.InInternational Conference on Learning Representations,Vol\.2025,pp\. 96934–96990\.Cited by:[§2](https://arxiv.org/html/2608.28704#S2.p1.1)\.
- Ganet al\.\(2025\)Z\. Gan, Y\. Liao, and Y\. LiuRethinking external slow\-thinking: from snowball errors to probability of correct reasoning\.arXiv preprint arXiv:2501\.15602\.Cited by:[§1](https://arxiv.org/html/2608.28704#S1.p2.1),[§2](https://arxiv.org/html/2608.28704#S2.p2.1)\.
- Honget al\.\(2024\)S\. Hong, M\. Zhuge, J\. Chen, X\. Zheng, Y\. Cheng, J\. Wang, C\. Zhang, S\. Yau, Z\. Lin, L\. Zhou,et al\.MetaGPT: meta programming for a multi\-agent collaborative framework\.InInternational Conference on Learning Representations,Vol\.2024,pp\. 23247–23275\.Cited by:[§2](https://arxiv.org/html/2608.28704#S2.p1.1)\.
- Huanget al\.\(2023\)Q\. Huang, J\. Vora, P\. Liang, and J\. LeskovecMlagentbench: evaluating language agents on machine learning experimentation\.arXiv preprint arXiv:2310\.03302\.Cited by:[§2](https://arxiv.org/html/2608.28704#S2.p1.1)\.
- Kamoiet al\.\(2024\)R\. Kamoi, Y\. Zhang, N\. Zhang, J\. Han, and R\. ZhangWhen can llms actually correct their own mistakes? a critical survey of self\-correction of llms\.Transactions of the Association for Computational Linguistics12,pp\. 1417–1440\.Cited by:[§1](https://arxiv.org/html/2608.28704#S1.p2.1),[§2](https://arxiv.org/html/2608.28704#S2.p2.1),[§5\.4](https://arxiv.org/html/2608.28704#S5.SS4.p1.1)\.
- Liuet al\.\(2024\)X\. Liu, H\. Yu, H\. Zhang, Y\. Xu, X\. Lei, H\. Lai, Y\. Gu, H\. Ding, K\. Men, K\. Yang,et al\.Agentbench: evaluating llms as agents\.InInternational Conference on Learning Representations,Vol\.2024,pp\. 52989–53046\.Cited by:[§2](https://arxiv.org/html/2608.28704#S2.p1.1)\.
- Luoet al\.\(2025\)X\. Luo, Y\. Zhang, Z\. He, Z\. Wang, S\. Zhao, D\. Li, L\. K\. Qiu, and Y\. YangAgent lightning: train any ai agents with reinforcement learning\.arXiv preprint arXiv:2508\.03680\.Cited by:[§3](https://arxiv.org/html/2608.28704#S3.p1.1)\.
- Madaanet al\.\(2023\)A\. Madaan, N\. Tandon, P\. Gupta, S\. Hallinan, L\. Gao, S\. Wiegreffe, U\. Alon, N\. Dziri, S\. Prabhumoye, Y\. Yang,et al\.Self\-refine: iterative refinement with self\-feedback\.Advances in neural information processing systems36,pp\. 46534–46594\.Cited by:[§1](https://arxiv.org/html/2608.28704#S1.p2.1),[§2](https://arxiv.org/html/2608.28704#S2.p2.1)\.
- Parket al\.\(2023\)J\. S\. Park, J\. O’Brien, C\. J\. Cai, M\. R\. Morris, P\. Liang, and M\. S\. BernsteinGenerative agents: interactive simulacra of human behavior\.InProceedings of the 36th annual acm symposium on user interface software and technology,pp\. 1–22\.Cited by:[§3](https://arxiv.org/html/2608.28704#S3.p1.1)\.
- Qiet al\.\(2026\)Y\. Qi, H\. Peng, X\. Wang, A\. Xin, Y\. Liu, B\. Xu, L\. Hou, and J\. LiAGENTIF: benchmarking large language models instruction following ability in agentic scenarios\.Advances in Neural Information Processing Systems38\.Cited by:[§1](https://arxiv.org/html/2608.28704#S1.p1.1),[§2](https://arxiv.org/html/2608.28704#S2.p1.1)\.
- Shinnet al\.\(2023\)N\. Shinn, F\. Cassano, A\. Gopinath, K\. Narasimhan, and S\. YaoReflexion: language agents with verbal reinforcement learning\.Advances in neural information processing systems36,pp\. 8634–8652\.Cited by:[§1](https://arxiv.org/html/2608.28704#S1.p2.1),[§2](https://arxiv.org/html/2608.28704#S2.p2.1)\.
- Stevenset al\.\(2024\)P\. E\. Stevens, S\. B\. Ahmed, J\. J\. Carrero, B\. Foster, A\. Francis, R\. K\. Hall, W\. G\. Herrington, G\. Hill, L\. A\. Inker, R\. Kazancıoğlu,et al\.KDIGO 2024 clinical practice guideline for the evaluation and management of chronic kidney disease\.Kidney international105\(4\),pp\. S117–S314\.Cited by:[§5\.4](https://arxiv.org/html/2608.28704#S5.SS4.p1.1)\.
- Tyenet al\.\(2024\)G\. Tyen, H\. Mansoor, V\. Cărbune, Y\. P\. Chen, and T\. MakLLMs cannot find reasoning errors, but can correct them given the error location\.InFindings of the Association for Computational Linguistics: ACL 2024,pp\. 13894–13908\.Cited by:[§5\.4](https://arxiv.org/html/2608.28704#S5.SS4.p1.1)\.
- Wanget al\.\(2023\)G\. Wang, Y\. Xie, Y\. Jiang, A\. Mandlekar, C\. Xiao, Y\. Zhu, L\. Fan, and A\. AnandkumarVoyager: an open\-ended embodied agent with large language models, 2023\.URL https://arxiv\. org/abs/2305\.162912\(11\)\.Cited by:[§3](https://arxiv.org/html/2608.28704#S3.p1.1)\.
- Wanget al\.\(2024\)L\. Wang, C\. Ma, X\. Feng, Z\. Zhang, H\. Yang, J\. Zhang, Z\. Chen, J\. Tang, X\. Chen, Y\. Lin,et al\.A survey on large language model based autonomous agents\.Frontiers of Computer Science18\(6\),pp\. 186345\.Cited by:[§1](https://arxiv.org/html/2608.28704#S1.p2.1),[§2](https://arxiv.org/html/2608.28704#S2.p1.1)\.
- Wanget al\.\(2025\)X\. Wang, B\. Li, Y\. Song, F\. F\. Xu, X\. Tang, M\. Zhuge, J\. Pan, Y\. Song, B\. Li, J\. Singh,et al\.Openhands: an open platform for ai software developers as generalist agents\.InInternational Conference on Learning Representations,Vol\.2025,pp\. 65882–65919\.Cited by:[§2](https://arxiv.org/html/2608.28704#S2.p1.1)\.
- Wuet al\.\(2024\)Q\. Wu, G\. Bansal, J\. Zhang, Y\. Wu, B\. Li, E\. Zhu, L\. Jiang, X\. Zhang, S\. Zhang, J\. Liu,et al\.Autogen: enabling next\-gen llm applications via multi\-agent conversations\.InFirst conference on language modeling,Cited by:[§2](https://arxiv.org/html/2608.28704#S2.p1.1)\.
- Xieet al\.\(2024\)T\. Xie, D\. Zhang, J\. Chen, X\. Li, S\. Zhao, R\. Cao, T\. J\. Hua, Z\. Cheng, D\. Shin, F\. Lei,et al\.Osworld: benchmarking multimodal agents for open\-ended tasks in real computer environments\.Advances in Neural Information Processing Systems37,pp\. 52040–52094\.Cited by:[§3](https://arxiv.org/html/2608.28704#S3.p1.1)\.
- Xuet al\.\(2026\)F\. F\. Xu, Y\. Song, B\. Li, Y\. Tang, K\. Jain, M\. Bao, Z\. Wang, X\. Zhou, Z\. Guo, M\. Cao,et al\.Theagentcompany: benchmarking llm agents on consequential real world tasks\.Advances in Neural Information Processing Systems38\.Cited by:[§1](https://arxiv.org/html/2608.28704#S1.p1.1),[§2](https://arxiv.org/html/2608.28704#S2.p1.1)\.
- Yaoet al\.\(2023\)S\. Yao, D\. Yu, J\. Zhao, I\. Shafran, T\. Griffiths, Y\. Cao, and K\. NarasimhanTree of thoughts: deliberate problem solving with large language models\.Advances in neural information processing systems36,pp\. 11809–11822\.Cited by:[§1](https://arxiv.org/html/2608.28704#S1.p2.1),[§2](https://arxiv.org/html/2608.28704#S2.p2.1)\.
- Yaoet al\.\(2022\)S\. Yao, J\. Zhao, D\. Yu, N\. Du, I\. Shafran, K\. Narasimhan, and Y\. CaoReact: synergizing reasoning and acting in language models\.arXiv preprint arXiv:2210\.03629\.Cited by:[§1](https://arxiv.org/html/2608.28704#S1.p2.1),[§2](https://arxiv.org/html/2608.28704#S2.p2.1)\.
- Yeoet al\.\(2025\)E\. Yeo, Y\. Tong, M\. Niu, G\. Neubig, and X\. YueDemystifying long chain\-of\-thought reasoning in llms\.arXiv preprint arXiv:2502\.03373\.Cited by:[§1](https://arxiv.org/html/2608.28704#S1.p2.1),[§2](https://arxiv.org/html/2608.28704#S2.p2.1)\.
- Zhanget al\.\(2025\)S\. Zhang, J\. Fan, M\. Fan, G\. Li, and X\. DuDeepanalyze: agentic large language models for autonomous data science\.arXiv preprint arXiv:2510\.16872\.Cited by:[§3](https://arxiv.org/html/2608.28704#S3.p1.1)\.
- Zhouet al\.\(2024\)S\. Zhou, F\. F\. Xu, H\. Zhu, X\. Zhou, R\. Lo, A\. Sridhar, X\. Cheng, T\. Ou, Y\. Bisk, D\. Fried,et al\.Webarena: a realistic web environment for building autonomous agents\.InInternational Conference on Learning Representations,Vol\.2024,pp\. 15585–15606\.Cited by:[§3](https://arxiv.org/html/2608.28704#S3.p1.1)\.

Similar Articles

Orc (working name) - auditable and declarative AI workflow

Reddit r/LocalLLaMA

The developer is seeking feedback on "ORC," an early-stage orchestration-as-code tool that uses a declarative DSL to define, validate, and version control LLM workflows. Aimed at users combining local and cloud models, it replaces complex Python scripts with auditable, Terraform-like definitions for agents and tool execution.