Paper deep dive
DenoiseFlow: Uncertainty-Aware Denoising for Reliable LLM Agentic Workflows
Yandong Yan, Junwei Peng, Shijie Li, Chenxi Li, Yifei Shang, Can Deng, Ruiting Dai, Yongqiang Zhao, Jiaqi Zhu, Yu Huang
Intelligence
Status: succeeded | Model: Gemma-4-26B-A4B | Prompt: intel-v1 | Confidence: 91%
Last extracted: 7/20/2026, 5:23:52 AM
Summary
The paper introduces DenoiseFlow, a closed-loop framework for reliable LLM agentic workflows that addresses 'accumulated semantic ambiguity' in long-horizon tasks. It models reasoning as a Noisy MDP and employs three stages: Sensing (estimating semantic uncertainty via Monte Carlo sampling), Regulating (adaptive branching based on confidence), and Correcting (root-cause localization). The system uses online self-calibration to align decision boundaries with verifier feedback, achieving state-of-the-art accuracy and reducing computational costs by 40-56% across mathematical reasoning, code generation, and multi-hop QA benchmarks.
Entities (12)
Relation Signals (12)
DenoiseFlow → consistsof → Sensing
confidence 98% · DenoiseFlow... through three coordinated stages: (1)Sensing... (2)Regulating... (3)Correcting
DenoiseFlow → consistsof → Regulating
confidence 98% · DenoiseFlow... through three coordinated stages: ... (2)Regulating...
DenoiseFlow → consistsof → Correcting
confidence 98% · DenoiseFlow... through three coordinated stages: ... (3)Correcting...
DenoiseFlow → addresses → Accumulated Semantic Ambiguity
confidence 95% · DenoiseFlow... performs progressive denoising... to mitigate this failure mode accumulated semantic ambiguity.
DenoiseFlow → reducescostby → 40--56%
confidence 95% · reducing cost by 40--56% through adaptive branching
Regulating → implements → Adaptive Branching
confidence 92% · Regulating adaptively allocates computation by routing between fast single-path execution and parallel exploration
Correcting → performs → Root-Cause Localization
confidence 90% · Correcting performs targeted recovery via influence-based root-cause localization
Sensing → uses → Semantic Entropy
confidence 90% · Stage 1 (Sensing) ... estimates semantic uncertainty ut via clustering-based entropy
Cypher Suggestions (0)
No Cypher suggestions yet.
Abstract
Abstract:Autonomous agents are increasingly entrusted with complex, long-horizon tasks, ranging from mathematical reasoning to software generation. While agentic workflows facilitate these tasks by decomposing them into multi-step reasoning chains, reliability degrades significantly as the sequence lengthens. Specifically, minor interpretation errors in natural-language instructions tend to compound silently across steps. We term this failure mode accumulated semantic ambiguity. Existing approaches to mitigate this often lack runtime adaptivity, relying instead on static exploration budgets, reactive error recovery, or single-path execution that ignores uncertainty entirely. We formalize the multi-step reasoning process as a Noisy MDP and propose DenoiseFlow, a closed-loop framework that performs progressive denoising through three coordinated stages: (1)Sensing estimates per-step semantic uncertainty; (2)Regulating adaptively allocates computation by routing between fast single-path execution and parallel exploration based on estimated risk; and (3)Correcting performs targeted recovery via influence-based root-cause localization. Online self-calibration continuously aligns decision boundaries with verifier feedback, requiring no ground-truth labels. Experiments on six benchmarks spanning mathematical reasoning, code generation, and multi-hop QA show that DenoiseFlow achieves the highest accuracy on every benchmark (83.3% average, +1.3% over the strongest baseline) while reducing cost by 40--56% through adaptive branching. Detailed ablation studies further confirm framework-level's robustness and generality. Code is available at this https URL.
Tags
Links
- Source: https://arxiv.org/abs/2603.00532v1
- Canonical: https://arxiv.org/abs/2603.00532v1
Trouble viewing inline? Open PDF directly →
Full Text
98,062 characters extracted from source content.
Expand or collapse full text
DenoiseFlow: Uncertainty-Aware Denoising for Reliable LLM Agentic Workflows Yandong Yan ai˙yan@stu.pku.edu.cn School of Computer Science, Peking UniversityBeijingChina , Junwei Peng junweipeng@stu.pku.edu.cn School of Electronics Engineering and Computer Science, Peking UniversityBeijingChina , Shijie Li lisj6@im.csg China Southern Power GridGuangzhouChina , Chenxi Li chenxi.crystal@foxmail.com SKLCCSE, School of Computer Science and Engineering, Beihang UniversityBeijingChina , Yifei Shang syf@stu.pku.edu.cn School of Electronics Engineering and Computer Science, Peking UniversityBeijingChina , Can Deng dengcan@mails.tsinghua.edu.cn Tsinghua UniversityBeijingChina , Ruiting Dai rtdai@uestc.edu.cn University of Electronic Science and Technology of ChinaChengduChina , Yongqiang Zhao yongqiangzhao@stu.pku.edu.cn Key Laboratory of High Confidence Software Technologies(PKU), MOEBeijingChina , Jiaqi Zhu zhujq@ios.ac.cn Institute of Software, Chinese Academy of SciencesBeijingChina and Yu Huang hy@pku.edu.cn National Engineering Research Center for Software Engineering, Peking UniversityBeijingChina (2026) Abstract. Autonomous agents are increasingly entrusted with complex, long-horizon tasks, ranging from mathematical reasoning to software generation. While agentic workflows facilitate these tasks by decomposing them into multi-step reasoning chains, reliability degrades significantly as the sequence lengthens. Specifically, minor interpretation errors in natural-language instructions tend to compound silently across steps. We term this failure mode accumulated semantic ambiguity. Existing approaches to mitigate this often lack runtime adaptivity, relying instead on static exploration budgets, reactive error recovery, or single-path execution that ignores uncertainty entirely. We formalize the multi-step reasoning process as a Noisy MDP and propose DenoiseFlow, a closed-loop framework that performs progressive denoising through three coordinated stages: (1) Sensing estimates per-step semantic uncertainty; (2) Regulating adaptively allocates computation by routing between fast single-path execution and parallel exploration based on estimated risk; and (3) Correcting performs targeted recovery via influence-based root-cause localization. Online self-calibration continuously aligns decision boundaries with verifier feedback, requiring no ground-truth labels. Experiments on six benchmarks spanning mathematical reasoning, code generation, and multi-hop QA show that DenoiseFlow achieves the highest accuracy on every benchmark (83.3% average, +1.3% over the strongest baseline) while reducing cost by 40–56% through adaptive branching. Detailed ablation studies further confirm framework-level’s robustness and generality. Code is available at https://anonymous.4open.science/r/DenoiseFlow-21D3/. Large Language Models, Agentic Workflows, Uncertainty Quantification, Self-Calibration, Reasoning under Uncertainty †copyright: acmlicensed†journalyear: 2026†doi: X.X†conference: Proceedings of the 32nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining; August 9–13, 2026; Jeju, Korea†booktitle: Proceedings of the 32nd ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD ’26), August 9–13, 2026, Jeju, Korea†isbn: 978-1-4503-X-X/2026/08†ccs: Computing methodologies Artificial intelligence†ccs: Computing methodologies Natural language processing†ccs: Computing methodologies Reasoning about belief and knowledge 1. Introduction Complex workflow automation aims to translate natural language requirements into precise execution sequences across massive and heterogeneous data repositories (Shen et al., 2024; Liang et al., 2023; Xi et al., 2023a), for applications including data analysis (Fang et al., 2024; Li et al., 2023) and decision support (Tupayachi, 2024). LLM-based agents drive these workflows via multi-step reasoning and tool invocation (Yao et al., 2022; Schick et al., 2023); however, as the reasoning depth extends, accumulated semantic ambiguity inevitably triggers error cascades (Dziri et al., 2023; Zhang et al., 2023), rendering the reliability of long-horizon chains the primary bottleneck for large-scale data insights. The landscape of LLM-based workflow automation bifurcates into heuristic interaction patterns and automated architecture optimization. The former, exemplified by ReAct (Yao et al., 2022), interleaves reasoning with action execution to enable dynamic planning, while Reflexion (Shinn et al., 2024) augments this via verbal reinforcement to induce self-correction through trajectory critique. To mitigate individual cognitive bias, DatawiseAgent (You and others, 2025) scales this paradigm to multi-agent collaboration, filtering hallucinations through role-based peer review. Conversely, optimization frameworks shift focus to offline structure search: DSPy (Khattab et al., 2023) abstracts workflows into programmable modules with learnable prompt parameters, and AFlow (Zhang et al., 2024) utilizes Monte Carlo Tree Search to discover and freeze task-optimal execution graphs. Despite progress in stabilizing long-horizon reasoning chains, current paradigms remain fundamentally predicated on static execution graphs, lacking the runtime adaptability to intercept semantic ambiguity before it cascades into irreversible failures. In practice, these approaches operate via reactive error correction, where intervention is contingent upon explicit, post-hoc signals (e.g., code exceptions in Self-Refine (Madaan et al., 2024)). This reactive paradigm leaves agents vulnerable to logical soft errors—covert deviations that degrade reasoning quality without triggering immediate crashes. The resulting inability to counteract the real-time accumulation of semantic ambiguity motivates the core question: How can an LLM-based agent transform from a passive executor of static plans into a closed-loop regulator capable of active runtime denoising? To address this problem, we recast long-horizon workflow automation as a stochastic control process within a Noisy Markov Decision Process (Noisy MDP), where reasoning steps are modeled as stochastic state transitions rather than fixed deterministic instructions. This stochastic representation enables dynamic intervention against error accumulation, fundamentally shifting the paradigm from passive execution to active denoising. To this end, we propose DenoiseFlow, a closed-loop framework designed to minimize semantic divergence through uncertainty-aware progressive denoising. Concretely, DenoiseFlow operates through three coordinated stages: (1) a Sensing stage that quantifies state uncertainty and models its propagation across the graph; (2) a Regulating stage that optimizes computational allocation by dynamically switching between fast execution for low-entropy nodes and branching exploration for ambiguous ones; and (3) a Correcting stage that performs influence-based root-cause localization to identify and correct the source of error without global restarts. To ensure sustained adaptation, DenoiseFlow incorporates online self-calibration, continuously aligning uncertainty thresholds with verifier feedback to remain robust against shifting data distributions. Our contributions are as follows: • We propose the Noisy MDP formulation to recast workflow automation as a Markov stochastic control process, establishing DenoiseFlow—which orchestrates Sensing, Regulating, and Correcting stages—to fundamentally shift the paradigm from fragile open-loop instruction following to resilient closed-loop denoising. • We devise an uncertainty-aware allocation strategy (within the Sensing and Regulating stages) that utilizes entropy estimates to optimally switch between fast execution and targeted branching exploration for efficient resource usage. • We introduce influence-based root-cause localization to correct the source of error over dependency graphs, complemented by online self-calibration to continuously align decision boundaries with verifier feedback for robust adaptation. • Extensive experiments on six benchmarks spanning mathematical reasoning, code generation, and multi-hop QA demonstrate that DenoiseFlow achieves state-of-the-art performance across all task categories while reducing computational cost by 40–56% compared to fixed exploration strategies. 2. Related Work Agentic Workflows and Semantic Uncertainty. Agentic workflows and autonomous agents are two complementary paradigms for applying LLMs to complex tasks (Xi et al., 2023b). Agentic workflows execute tasks via multi-step processes that are often engineered from human domain knowledge and refined iteratively (Wei et al., 2022), while autonomous agents reason and act in open-ended environments with flexible decision policies (Park et al., 2023). Existing workflows span general-purpose patterns for reasoning and tool use (Yao et al., 2022) and domain-specific pipelines for code generation (Yang et al., 2024), data analysis (Hong et al., 2024), mathematics (Lewkowycz et al., 2022), and question answering (Khattab et al., 2023). These systems show strong performance, but typically assume that natural-language instructions are sufficiently clear: semantic ambiguities are rarely made explicit, and there is little modeling of how such ambiguity accumulates and propagates through long-horizon workflows. Semantic entropy (Kuhn et al., 2023) clusters LLM outputs into equivalence classes for single-turn hallucination detection, yet does not address multi-step propagation or prescribe execution-time actions. Our work focuses on semantic uncertainty—the diversity of plausible interpretations induced by underspecified instructions—and how it should be sensed, propagated, and controlled during execution. Automated Workflow Optimization and Control. Recent work automates aspects of agentic workflows through prompt optimization (Zhou et al., 2022) or hyperparameter tuning (Yang et al., 2023), which improves performance but still relies on manually specified structures and does not reason about uncertainty propagation. Structural approaches search over graphs, programs, or modular building blocks to discover effective workflows (Hu et al., 2024): AFlow (Zhang et al., 2024) uses Monte Carlo Tree Search to discover effective workflow structures offline, MermaidFlow (Zheng and others, 2025) employs evolutionary search, and JudgeFlow (Ma et al., 2026) introduces block-level blame attribution to guide the optimizer toward the most problematic component. These methods achieve strong offline performance but largely treat execution as a deterministic black box—the workflow structure is fixed after optimization, unable to adapt to individual problem characteristics at runtime. DenoiseFlow is complementary: given an initial workflow (potentially discovered by such methods), it targets reliable execution under semantic ambiguity by using semantic entropy and dependency structure to quantify and propagate uncertainty online. Execution Strategies and Error Recovery. Single-shot execution ignores uncertainty entirely, while fixed branching strategies such as Tree-of-Thoughts (Yao et al., 2024) and Self-Consistency (Wang et al., 2022) allocate exploration uniformly, wasting computation on high-confidence cases and under-exploring ambiguous ones. Error-recovery methods like Reflexion (Shinn et al., 2024) improve robustness via reflection but often regenerate large parts of the plan, discarding informative intermediate states; localized repair in code or tool-use agents (Madaan et al., 2024) rarely exploits explicit semantic dependencies. Calibration methods (Guo et al., 2017; Platt and others, 1999) adjust LLM confidence scores but require held-out labeled data, limiting their applicability during autonomous execution. In contrast, DenoiseFlow adapts exploration to each problem’s confidence landscape, performs slot-level root-cause tracing over a dependency graph, and maintains label-free online calibration via verifier feedback—converting open-loop execution into closed-loop denoising. A detailed capability comparison is provided in Table 15 (Appendix K). DenoiseFlow framework diagram showing three stages: Stage 1 (Sensing) with Monte Carlo sampling and uncertainty estimation, Stage 2 (Regulating) with Direct/Branch/Refine routing based on confidence, and Stage 3 (Correcting) with influence-based tracing for root cause localization. Figure 1. DenoiseFlow architecture overview. Given a problem, Stage 1 (Sensing) generates N Monte Carlo samples to estimate semantic uncertainty utu_t via clustering-based entropy, then propagates risk through the dependency graph to obtain u~t u_t. Stage 2 (Regulating) computes execution confidence ct=1−rtc_t=1-r_t and routes to one of three modes: Direct (high confidence, single path), Branch (medium confidence, K parallel paths with consensus selection), or Refine (low confidence, trigger Stage 3). Stage 3 (Correcting) performs influence-based tracing to localize the root cause k∗k^*, applies asymmetric calibration to boost uncertainty at k∗k^*, and re-executes from the corrected state. The online calibration module continuously adjusts temperature T based on verifier feedback. 3. Methodology 3.1. Problem Formulation To counteract accumulated semantic ambiguity and achieve reliable LLM workflows, we model long-horizon agent interaction as a Noisy MDP ℳ=⟨,,,ℛ,ξ⟩M= ,A,T,R,ξ . Here, st∈s_t denotes the workflow state (encoding history, context, and intermediate artifacts), at∈a_t is an instruction or tool invocation, T is the transition function with stochasticity induced by the semantic noise process ξt _t, and ℛR is derived from the success specification (e.g., task constraints or verifier signals). Transitions are perturbed by ξt _t, i.e., st+1∼(⋅∣st,at;ξt)s_t+1 (· s_t,a_t; _t), causing execution trajectories to progressively drift from the intended task specification. Noise Characterization. We treat ξt _t as an abstract noise process representing semantic ambiguity in LLM outputs. Since LLM-induced uncertainty arises from discrete token sampling over a complex, task-dependent output space, we adopt a distribution-free approach: we empirically estimate the noise magnitude via Monte Carlo sampling and semantic clustering (Section 3.3), obtaining a bounded surrogate ut∈[0,1]u_t∈[0,1] for the latent noise intensity. This non-parametric treatment aligns with the robust control paradigm, where empirical bounds replace distributional assumptions when the true noise model is unknown. Accumulated Semantic Divergence. We quantify reliability gaps via Accumulated Semantic Divergence Δt _t, which evolves according to: (1) Δt=ϵt+∑k∈Pred(t)Φ(st,sk)Δk, _t= _t+ _k (t) (s_t,s_k)\, _k, where ϵt∈[0,1] _t∈[0,1] is the local noise at step t, Pred(t)Pred(t) is the set of predecessors explicitly referenced by step t in its context or parameters, and Φ(st,sk)∈[0,1] (s_t,s_k)∈[0,1] captures the semantic coupling strength from k to t. Since Φ∈[0,1] ∈[0,1], each step attenuates rather than amplifies individual upstream contributions; however, the summation over Pred(t)Pred(t) means that Δt _t can still grow with the depth and width of the dependency graph (see Appendix §M for the formal propagation bound). In practice, even moderate ϵt _t compounds along dependency chains, progressively degrading workflow reliability. We therefore seek a closed-loop policy π(at∣st,Δ^t)π(a_t s_t, _t) that maximizes task reliability under a fixed inference budget: (2) maxππ[ℛ(τ)]s.t.Usage(τ)≤C, _π\;E_π [R(τ) ] .t. (τ)≤ C, where ℛ(τ)R(τ) is the task success indicator for trajectory τ, and Usage(τ)Usage(τ) is measured by compute proxies (e.g., LLM calls/tokens and verifier invocations). This requires an online mechanism to estimate the latent divergence Δt _t via a surrogate Δ^t _t and actively suppress it during execution. 3.2. Framework Overview To suppress the unobservable Δt _t, we propose DenoiseFlow, a closed-loop architecture that implements Progressive Denoising across three stages (Figure 1). Stage 1: Sensing (§3.3) acts as a state estimator, constructing an observable surrogate Δ^t _t by estimating local ambiguity and recovering dependency couplings. Stage 2: Regulating (§3.4) acts as a risk-sensitive controller, increasing branching and verification only for uncertain steps. Stage 3: Correcting (§3.5) closes the loop: upon verification failure, it localizes the root cause k∗k^* and applies targeted correction to reshape subsequent risk estimates. Two design principles cut across all three stages: budget-aware execution, which allocates computation proportionally to estimated uncertainty subject to C (Eq. 2); and online self-calibration, which adapts uncertainty thresholds via verifier feedback without ground-truth labels, ensuring effective resource allocation across diverse task distributions. 3.3. Sensing: Online Semantic Anchoring The accumulation dynamics rely on latent variables, local noise ϵt _t and coupling coefficients Φ , that remain unobservable during open-loop execution. To enable the closed-loop policy π(at∣st,Δ^t)π(a_t s_t, _t), this stage functions as a state estimator: it constructs the observable proxy Δ^t _t by quantifying local ambiguity via Monte Carlo sampling and modeling its propagation through the dependency graph. Semantic Anchoring (Estimating ϵt _t). We generate N Monte Carlo samples t=xt(1),…,xt(N)X_t=\x_t^(1),…,x_t^(N)\ in parallel (concurrent API calls) and cluster them into semantic interpretations tC_t. The Normalized Semantic Entropy serves as the observable proxy utu_t for local noise: (3) ut=−∑c∈tp^(c)logp^(c)logN∈[0,1],u_t= - _c _t p(c) p(c) N∈[0,1], where p^(c)=|c|/N p(c)=|c|/N. A high utu_t indicates significant divergence in interpretation, serving as a direct proxy for ϵt _t. We form tC_t by agglomerative clustering with a cosine-similarity threshold τsim=0.85−0.05⋅min(nstep,3) _sim=0.85-0.05· (n_step,3), where nstepn_step is the number of reasoning steps inferred from the problem via lightweight feature extraction (Appendix §E.2). This yields τsim∈[0.70,0.85] _sim∈[0.70,0.85], relaxing the threshold for multi-step problems to permit more interpretation diversity while keeping it strict for simple tasks. We similarly compute slot-level uncertainty ut(s)u_t^(s) for critical parameters. Note that semantic clustering is used solely for uncertainty estimation (guiding execution strategy), not for final correctness verification—for code tasks, we verify via unit test execution; for math tasks, via numerical answer extraction. Probabilistic Graphing (Recovering Φ ). To reconstruct the dependency structure Pred(t)Pred(t) robustly, we build a Probabilistic Dependency Graph G. We define Pred(t)Pred(t) as the set of upstream steps whose intermediate outputs are referenced by step t. For each edge k→tk→ t, we estimate an activation probability pkt∈[0,1]p_kt∈[0,1] as the frequency of observing such a reference across the N sampled rollouts. Combined with a semantic compatibility term γkt∈[0,1] _kt∈[0,1] (cosine similarity between the embedding of the consumed input at t and the produced output at k), we derive the Effective Coupling Coefficient: (4) wkt=pkt⋅γkt,w_kt=p_kt· _kt, which serves as the computational proxy for Φ(st,sk) (s_t,s_k). Intuitively, risk should propagate strongly only when two conditions hold: the dependency is structurally stable (high pktp_kt) and the content is semantically coupled (high γkt _kt). The product naturally enforces this “AND” semantics, attenuating propagation when either condition is weak. Risk Propagation and Online Calibration. We instantiate the accumulated divergence surrogate Δ^t _t as a propagated risk signal u~t u_t via a dual-channel recurrence: (5) u~t=clip[0,1](ut+λ⋅maxk∈Pred(t)(wktu~k)+β⋅k∈Pred(t)[wktu~k]). u_t\!=\!clip_[0,1] (\!u_t\!+\!λ\!·\!\!\! _k (t)(w_kt u_k)\!+\!β\!·\!E_k (t) [w_kt u_k ]\!\! ). Here, the Bottleneck channel (λ) captures critical-path risk where a single high-uncertainty ancestor dominates, while the Aggregation channel (β) captures cumulative degradation from many mildly noisy predecessors. We use λ=0.5,β=0.3λ=0.5,\;β=0.3 by default (see Appendix §C for sensitivity analysis). In the base case where Pred(t)=∅Pred(t)= , the propagation terms vanish, yielding u~t=ut u_t=u_t. However, raw entropy estimates may be miscalibrated, being overconfident on ambiguous problems or underconfident on clear ones. We therefore apply temperature scaling before propagation, so that both local and propagated uncertainties benefit from calibrated inputs. For any raw uncertainty u, the calibrated value is: (6) ucal=σ((u−0.5)/T),u^cal=σ ((u-0.5)/T ), where σ(⋅)σ(·) is the sigmoid function and T is the calibration temperature. After every Δ observations, we update T based on verifier feedback: (7) T←T⋅1.1if Accu<τl<θacc0.9if Accu>τh>θacc1.0otherwiseT← T· cases1.1&if Acc_u< _l< _acc\\ 0.9&if Acc_u> _h> _acc\\ 1.0&otherwise cases where Accu<τAcc_u<τ denotes the verifier pass rate on problems with uncertainty below τ. If low-uncertainty problems frequently fail verification, we increase T to correct overconfidence; conversely, if high-uncertainty problems frequently pass, we decrease T to correct underconfidence. This self-calibration loop enables the system to adapt to distribution shifts across task domains without ground-truth labels. 3.4. Regulating: Budget-Aware Adaptive Branching This stage resolves the tension between efficiency and robustness. Uniform branching is wasteful (O(K)O(K) cost for every step), while single-path execution cannot mitigate uncertain decisions. We therefore branch only when confidence is low, routing each step to an appropriate execution mode based on its estimated risk. Confidence-Based Routing. We synthesize a unified risk metric rtr_t that combines the propagated systemic risk u~tcal u_t^cal (from §3.3) with local slot-level ambiguities. If any individual parameter slot exhibits high entropy, or if multiple slots are simultaneously uncertain, the compound risk dominates: (8) rt=max(u~tcal,fslot(t(s))),r_t= \! ( u_t^cal,\;f_slot(u_t^(s)) ), where fslotf_slot aggregates slot-level uncertainties t(s)u_t^(s) via a weighted combination of worst-case and average entropy over high-uncertainty slots (details in Appendix §E.3). The Execution Confidence ct=1−rtc_t=1-r_t partitions the policy into three regimes: (9) π(at)=agreedyif ct>θhigh(Direct)a(k)k=1Ktif θlow≤ct≤θhigh(Branch)Escalateif ct<θlow(Refine)π(a_t)= casesa^greedy&if c_t> _high (Direct)\\ \a^(k)\_k=1^K_t&if _low≤ c_t≤ _high (Branch)\\ Escalate&if c_t< _low (Refine) cases Thresholds θhigh _high and θlow _low are set adaptively from the running confidence distribution: θhigh=Q3() _high=Q_3(c) and θlow=Q1()−0.5⋅IQR() _low=Q_1(c)-0.5·IQR(c), with fallback (0.7,0.3)(0.7,0.3) when fewer than 10 problems have been processed. In the Branching regime, a(k)\a^(k)\ are medoid actions—the most central member of each of the top-KtK_t semantic clusters tC_t (§3.3)—ensuring semantic diversity without synthesizing artificial responses. The branch count scales continuously with uncertainty: Kt=min(⌈κ(1−ct)⌉,Kmax)K_t= ( κ(1-c_t) ,K_ ). Importantly, branching reuses the Monte Carlo candidates from Stage 1; the incremental cost is limited to executing and verifying additional candidates. Consensus-Based Selection. When executing KtK_t branches in parallel, we select a representative output via semantic consensus. Branch outputs are embedded, clustered into groups C, and scored: (10) Score(C)=η⋅Valid(C)+(1−η)⋅Cohesion(C)+log|C|,Score(C)=η·Valid(C)+(1-η)·Cohesion(C)+ |C|, where Valid(C)∈[0,1]Valid(C)∈[0,1] is the fraction of verifier-passing outputs, Cohesion(C)∈[0,1]Cohesion(C)∈[0,1] is the mean intra-cluster cosine similarity, and log|C| |C| is a size bonus favoring clusters with broader agreement. We select C∗=argmaxCScore(C)C^*= _CScore(C) and return Medoid(C∗)Medoid(C^*). If no valid cluster exists, execution escalates to Stage 3: Correcting (§3.5). 3.5. Correcting: Closed-Loop Refinement When execution enters the Refine regime (§3.4) or fails verification, accumulated divergence Δt _t has exceeded the correction capacity of local branching. Rather than blind retries that discard informative intermediate states, this stage functions as a feedback loop: it traces influence through the dependency graph to localize root causes and injects corrective signals for targeted re-execution. Influence-Based Root-Cause Localization. We formalize root-cause localization as identifying nodes with high influence on the failure. Operating on the discrete dependency graph G, we approximate the influence of an upstream node k on the failure set SfailS_fail via chain-rule-style propagation over graph edges, analogous to backpropagation in neural networks but over symbolic dependency structures: (11) Ik≈u~k⋅maxρ∈k↝Sfail(∏(i,j)∈ρwij),I_k≈ u_k· _ρ∈ k S_fail ( _(i,j)∈ρw_ij ), where u~k u_k is the propagated risk at node k and the maximization identifies the most active dependency path ρ transmitting error signals. The root cause is localized as k∗=argmaxkIkk^*=argmax_kI_k—the node maximizing the product of inherent ambiguity and transmission bandwidth. To enable targeted correction, we apply Asymmetric Calibration that deterministically boosts uncertainty at the identified root cause: (12) uk∗←1.0(Boost)uSfail←max(uSfail,τenf)(Enforce) splitu_k^*&← 1.0 (Boost)\\ u_S_fail&← (u_S_fail,\, _enf ) (Enforce) split This increases the estimated uncertainty at the inferred root cause k∗k^* to its maximum value, forcing the control policy (Eq. (9)) to shift from Direct to Branching at that node, thereby enabling targeted local re-generation. Setting uk∗=1.0u_k^*=1.0 reflects a deliberate “explore-on-doubt” design: since the node has already contributed to a verified failure, aggressive re-exploration incurs less waste than a missed root cause would. We additionally enforce a minimum sensitivity τenf _enf at the failure set to prevent premature acceptance of downstream results. After calibration, execution rolls back to sk∗s_k^* and re-enters the pipeline with updated uncertainty estimates. To guarantee termination, we cap the number of refinement cycles at R (default R=2R=2); if the budget C is exhausted or R retries fail, the system returns the best result seen so far. Algorithm 1 DenoiseFlow Execution Pipeline 1:Problem P, Budget C, Base LLM ℳM, Task Config C, Horizon H 2:Initialize state s0s_0, graph ←∅G← , risk u←u 0, temp T←1.0T← 1.0 3:while t<Ht<H and not Solved and Usage<CUsage<C do 4: // Stage 1: Sensing 5: Generate Monte Carlo samples tX_t from ℳ(st)M(s_t) 6: Compute utu_t (Eq. 3), calibrate utcalu_t^cal (Eq. 6) 7: Update G, propagate risk u~t u_t (Eq. 5) 8: // Stage 2: Regulating 9: Compute confidence ct←1−rtc_t← 1-r_t (Eq. 8) 10: needCorrect←falseneedCorrect 11: if ct>θhighc_t> _high then 12: result←result← Direct: greedy decode from ℳ(st)M(s_t) 13: else if ct≥θlowc_t≥ _low then 14: result←result← Branch: Consensus(t,Kt)Consensus(X_t,K_t) 15: else 16: needCorrect←trueneedCorrect ⊳ Escalate to Stage 3 17: end if 18: // Stage 3: Correcting 19: if not needCorrectneedCorrect then 20: Verify resultresult via task-specific verifier 21: needCorrect←needCorrect← verification failed 22: end if 23: if needCorrectneedCorrect then 24: k∗←argmaxkIkk^* _kI_k (Eq. 11) 25: Asymmetric Calibration (Eq. 12), rollback to sk∗s_k^* 26: else 27: st+1←Transition(st,result)s_t+1 (s_t,result); t←t+1t← t+1 28: end if 29: if tmodΔ=0t =0 then ⊳ Online Calibration 30: Update temperature T via verifier history (Eq. 7) 31: end if 32:end while 33:return Final result 4. Experiments We evaluate DenoiseFlow on diverse reasoning and code generation tasks. Our evaluation emphasizes reliability under semantic uncertainty, measured by task success, robustness, and cost under matched inference budgets. Single-agent Hand-crafted Multi-agent Autonomous Multi-agent Category Benchmark IO CoT CoT SC Self-Ref. Debate Blender DyLAN GPTSwarm ADAS AFlow MaAS Mermaid. Judge. Ours Math Reason. GSM8K 87.8 87.0 86.9 85.5 89.5 88.4 90.0 89.1 88.4 90.1 91.5 92.4 93.0 93.9 MATH 48.6 48.8 50.4 46.1 48.6 46.9 48.5 47.9 43.2 52.8 52.2 55.4 58.5 61.4 Code Gen. MBPP 73.9 74.2 73.3 71.8 70.3 77.1 77.3 77.4 77.1 81.7 82.2 82.3 83.8 84.9 HumanEval 87.0 88.6 91.6 87.8 88.8 88.7 90.4 89.3 84.2 90.1 91.6 92.9 93.4 93.9 Multi-hop QA (F1) HotpotQA 68.1 67.9 68.9 60.8 70.2 72.3 74.1 73.2 64.5 73.5 75.3 77.2 77.4 77.5 DROP 68.3 78.5 78.8 70.2 78.1 80.4 82.2 81.0 76.6 80.6 83.1 85.5 86.1 87.9 Average 72.3 74.2 75.0 70.4 74.3 75.6 77.1 76.3 72.3 78.1 79.3 81.0 82.0 83.3 Table 1. Performance comparison on six benchmarks. All methods use GPT-4o-mini as the backbone LLM. All results are reproduced under our unified evaluation protocol. DenoiseFlow results are averaged over three independent runs (std << 0.5%). Best in bold, second best underlined. Self-Ref. = Self-Refine; Debate = LLM-Debate; Blender = LLM-Blender; Mermaid. = MermaidFlow; Judge. = JudgeFlow. 4.1. Experimental Setup Benchmarks. We follow standard evaluation protocols and evaluate on six benchmarks covering three task categories. (1) Mathematical Reasoning: GSM8K (Cobbe et al., 2021) contains 1,319 grade-school math problems (we use the test split), and MATH (Hendrycks et al., 2021) contains 5,000 competition-level problems (we evaluate on 500 problems sampled from the test set following common practice); both report accuracy. (2) Code Generation: MBPP (Austin et al., 2021) contains 500 basic Python programming problems, and HumanEval (Chen et al., 2021) contains 164 hand-written programming problems; both report pass@1 accuracy. (3) Multi-hop Question Answering: HotpotQA (Yang et al., 2018) requires multi-step reasoning over Wikipedia paragraphs, and DROP (Dua et al., 2019) requires discrete reasoning over text; both report F1 score (see Appendix §A.4 for evaluation details). Model Configuration. Following prior work on agentic workflow optimization (Zhang et al., 2024; Zhang and others, 2025), we use GPT-4o-mini (gpt-4o-mini-2024-07-18) as the backbone LLM for DenoiseFlow and all reproduced baselines to ensure a controlled comparison. We use temperature =0=0 for deterministic greedy decoding and verifier calls; for Stage 1 Monte Carlo sampling, we use temperature =0.7=0.7 to obtain diverse semantic interpretations for uncertainty estimation. Implementation Details. For semantic embedding in uncertainty estimation, we use all-MiniLM-L6-v2 (384 dimensions) with cosine similarity for clustering. Default hyperparameters are: Monte Carlo samples N=5N=5, similarity threshold τsim=0.85 _sim=0.85, maximum branches Kmax=7K_ =7, and maximum refinement retries R=2R=2 (see §4.4 for sensitivity analysis). DenoiseFlow results are averaged over three independent runs. Baselines. We compare against three categories of methods: Single-agent Systems: (1) IO: Direct input-output prompting. (2) CoT (Wei et al., 2022): Chain-of-thought prompting. (3) CoT SC (Wang et al., 2022): CoT with self-consistency via majority voting. Hand-crafted Multi-agent Systems: (4) Self-Refine (Madaan et al., 2024): Iterative self-refinement. (5) LLM-Debate (Du et al., 2023): Multi-agent debate. (6) LLM-Blender (Jiang et al., 2023): Ensemble of multiple LLM outputs. (7) DyLAN (Liu et al., 2023): Dynamic LLM-agent network. Autonomous Multi-agent Systems: (8) GPTSwarm (Zhuge et al., 2024): Graph-based agent swarm optimization. (9) ADAS (Hu et al., 2024): Automated design of agentic systems. (10) AFlow (Zhang et al., 2024): Automated workflow via MCTS. (11) MaAS (Zhang and others, 2025): Multi-agent as a system. (12) MermaidFlow (Zheng and others, 2025): Workflow with mermaid diagrams. (13) JudgeFlow (Ma et al., 2026): Block-level judge-guided optimization. 4.2. Main Results To evaluate whether runtime denoising translates into consistent accuracy gains across diverse tasks, we compare DenoiseFlow against 13 baselines on all six benchmarks (Table 1) Overall Performance. DenoiseFlow achieves the highest average score of 83.3% on all six benchmarks, outperforming the strongest baseline JudgeFlow (82.0%) by +1.3% and AFlow (78.1%) by +5.2%. The consistent improvement across diverse task types suggests that uncertainty-aware denoising provides a general-purpose mechanism rather than a task-specific trick. Mathematical Reasoning. The advantage of DenoiseFlow is most pronounced on the challenging MATH benchmark (+2.9% over JudgeFlow, +8.6% over AFlow), where competition-level problems admit multiple valid solution strategies with high intermediate ambiguity. Adaptive branching allows parallel exploration of these strategies, while semantic anchoring helps disambiguate structurally similar but semantically distinct solution paths. On the easier GSM8K, gains are more modest (+0.9% over JudgeFlow) as most problems can be reliably solved with less exploration. Code Generation. On both MBPP (84.9%) and HumanEval (93.9%), DenoiseFlow outperforms all baselines. The key enabler here is the closed-loop refinement with external code verification: unlike natural language tasks where correctness is approximate, code execution provides a binary pass/fail signal that the online calibration module can exploit to rapidly adjust confidence thresholds. This is reflected in MBPP’s high Direct-mode ratio (40.7%, see §4.5), indicating that the system learns to confidently bypass branching for straightforward problems. Multi-hop Question Answering. On DROP, DenoiseFlow achieves 87.9 F1, outperforming JudgeFlow by +1.8 and MermaidFlow by +2.4. On HotpotQA, the margin is narrower (77.5 vs. 77.4 for JudgeFlow; note that our std across three runs is <<0.5%, so this difference is within one standard deviation). Multi-hop QA tasks require chaining multiple retrieval and reasoning steps, where errors in early steps propagate downstream. Root-cause tracing (§4.3) proves particularly valuable here: by localizing and correcting the source of error rather than re-executing entire chains, DenoiseFlow achieves strong performance while maintaining efficiency. 4.3. Ablation Study To investigate the mechanisms underlying DenoiseFlow’s effectiveness, we conduct comprehensive ablation experiments on three representative benchmarks: GSM8K (mathematical reasoning), MBPP (code generation), and HotpotQA (multi-hop QA). Table 2 summarizes the results. Component Ablations Strategy Variants Metric w/o SA w/o AB w/o CLR w/o OC Fixed K=7K=7 Full Rest. Local Ret. Full GSM8K (%) 91.67 93.94 93.94 93.18 93.18 94.70 94.32 93.94 MBPP (%) 81.40 79.07 84.88 80.23 84.88 84.88 84.88 84.88 HotpotQA (F1) 77.89 71.71 77.75 76.32 77.25 74.86 74.39 76.48 Avg. 83.65 81.57 85.52 83.24 85.10 84.81 84.53 85.10 Cost 0.43× 0.05× 1.13× 1.03× 2.25× 1.15× 1.12× 1.00× Table 2. Ablation study on three representative benchmarks. Columns show ablation variants; rows show metrics. Bold marks the full DenoiseFlow (proposed method). Cost is normalized relative to the full model. SA = Semantic Anchoring, AB = Adaptive Branching, CLR = Closed-Loop Refinement, OC = Online Calibration, Full Rest. = Full Restart (Reflexion-style), Local Ret. = Local Retry. Component Contribution Analysis. We evaluate each core stage by removing it individually. The results reveal a clear hierarchy of importance: Adaptive Branching (AB) is the most impactful component, whose removal causes the largest average degradation (−-3.87%), with severe drops on both MBPP (−-5.81%) and HotpotQA (−-5.79 F1). This validates that uncertainty-guided exploration is essential for tasks with genuine solution ambiguity. Online Calibration (OC) ranks second (−-2.20% average), with its impact most pronounced on MBPP (−-4.65%) and HotpotQA (−-1.18 F1), where runtime feedback is critical for accurate confidence estimation. Semantic Anchoring (SA) provides complementary value (−-1.79% average), particularly for GSM8K (−-2.27%) where structured slot-level understanding helps disambiguate multi-step solution plans. Notably, removing SA also yields the largest cost reduction (0.43×), indicating that fine-grained uncertainty sensing drives heavier but more targeted resource allocation. Closed-Loop Refinement (CLR) has minimal accuracy impact (Avg. even slightly improves to 85.52% vs. 85.44%), but increases cost by 13%, suggesting that CLR’s primary role is efficiency enhancement: by diagnosing and surgically correcting failures, it avoids the need for wasteful global re-exploration. Adaptive vs. Fixed Execution Strategies. We compare three execution paradigms to validate the efficiency of adaptive branching. Fixed Branching (K=7K=7) allocates maximum resources uniformly and achieves comparable average accuracy (85.10% vs. 85.44% for the full model), but at 2.25× the cost—a 125% overhead for only marginal accuracy difference. This confirms that branching is valuable for genuinely uncertain cases, not as a universal strategy. Conversely, adaptive routing achieves the same accuracy while concentrating resources where they are most needed. Root-Cause Tracing vs. Alternative Recovery. We compare root-cause-guided refinement against two common alternatives: Full Restart (Reflexion-style global regeneration) and Local Retry (re-executing only the failing step). Both alternatives slightly exceed the full model on GSM8K (Full Rest. 94.70%, Local Ret. 94.32% vs. Full 93.94%), because GSM8K problems are relatively self-contained and rarely involve cross-step error propagation, so the overhead of dependency-graph analysis provides no benefit; however, on HotpotQA, where errors propagate through multi-hop reasoning chains, root-cause tracing outperforms full restart by +2.64 F1 and local retry by +3.11 F1, while reducing cost by 13% relative to full restart. This validates the “surgical” correction principle: influence-based localization preserves valid intermediate states, concentrating re-computation on the actual source of error. Online Calibration Impact. Removing online calibration degrades all three benchmarks (GSM8K: −-0.76%, MBPP: −-4.65%, HotpotQA: −-1.18 F1). The disproportionate impact on MBPP (−-4.65%) is notable: code generation produces binary pass/fail verification signals that are ideal for temperature adaptation (Eq. 7), enabling the system to rapidly correct overconfident or underconfident uncertainty estimates. For QA tasks where verification signals are softer (F1-based), the calibration benefit is more modest but still positive. Task-Specific Patterns. Beyond aggregate trends, we observe that each task type has a distinct “bottleneck component”: • Code generation (MBPP): Most sensitive to AB (−-5.81%) and OC (−-4.65%). Diverse implementation strategies require exploration, and binary test feedback enables effective calibration. We note that several strategy variants (w/o CLR, Fixed K=7K=7, Full Rest., Local Ret.) yield the same pass@1 as the full model on MBPP; this is because pass@1 is a coarse-grained metric on a 500-problem set, where one-problem differences (≈ 0.2%) are below rounding resolution. • Mathematical reasoning (GSM8K): Most sensitive to SA (−-2.27%). Structured slot-level analysis disambiguates multi-step arithmetic plans, reducing early-stage errors that would otherwise compound. • Multi-hop QA (HotpotQA): Most sensitive to AB (−-5.79 F1). Context-dependent reasoning creates genuine interpretation ambiguity that requires parallel exploration. Root-cause tracing provides additional recovery for complex reasoning chains. These patterns confirm that DenoiseFlow’s components are complementary: each addresses a distinct failure mode, and their joint operation achieves the best cost-accuracy trade-off. 4.4. Hyperparameter Sensitivity Analysis We analyze the sensitivity of DenoiseFlow to key hyperparameters across all six benchmarks. To enable efficient sweeps over multiple hyperparameter configurations, we use a random subset of 30 problems per dataset; absolute accuracy values therefore differ from the full-dataset results in Table 1, but relative trends remain consistent. Figure 2 summarizes the results; detailed tables are in Appendix H.6. Four subplots showing hyperparameter sensitivity: (a) accuracy vs sample size N, (b) accuracy vs similarity threshold, (c) accuracy vs max branches, (d) accuracy vs max retries. The dark solid line with star markers shows the average across all benchmarks, with red stars indicating optimal values. Individual benchmarks are shown as dashed lines. Figure 2. Hyperparameter sensitivity analysis across six benchmarks. The dark solid line shows average accuracy; red ⋆ marks the optimal value. Individual benchmarks shown as dashed lines. (a) N=5N=5 achieves the best average; (b) τsim=0.85 _sim=0.85 balances sensitivity; (c) KmaxK_ significantly impacts QA tasks; (d) R is relatively insensitive. (a) Monte Carlo Sample Size N. We vary N∈3,5,7,10N∈\3,5,7,10\. N=5N=5 achieves the best average accuracy (81.0%), while N=10N=10 slightly underperforms (78.4%). We attribute this to entropy overestimation: with more samples, minor surface-level variations inflate the cluster count, leading to systematically higher uncertainty estimates that cause the system to over-allocate resources to Branch mode on problems that do not require heavy exploration. We select N=5N=5 as the default, which provides sufficient semantic diversity for reliable entropy estimation. (b) Clustering Similarity Threshold τsim _sim. We conduct experiments under τsim∈0.7,0.8,0.85,0.9 _sim∈\0.7,0.8,0.85,0.9\. Lower thresholds yield fewer clusters (coarser semantic grouping), potentially underestimating uncertainty; higher thresholds yield more clusters (finer grouping), risking overestimation. τsim=0.85 _sim=0.85 achieves the best average (81.0%), providing a balanced trade-off between sensitivity and noise reduction. We use it as the default. (c) Maximum Branches KmaxK_ . We vary Kmax∈3,5,7K_ ∈\3,5,7\. Larger KmaxK_ enables broader exploration of the solution space, which is particularly beneficial for multi-hop reasoning tasks. On QA benchmarks (HotpotQA, DROP), Kmax=7K_ =7 outperforms Kmax=3K_ =3 by 8–12 F1 points, demonstrating that complex reasoning benefits from sufficient branching capacity. We use Kmax=7K_ =7 as the default; the adaptive mechanism ensures efficient routing for simpler cases. (d) Maximum Refinement Retries R. We vary R∈1,2,4R∈\1,2,4\. All values perform similarly (≈ 80–81%), indicating that root-cause-guided refinement is effective even with minimal retries. We use R=2R=2 as a cost-effective default. Summary. DenoiseFlow exhibits reasonable robustness to hyperparameter variations, though KmaxK_ significantly impacts performance on reasoning-intensive tasks. The optimal settings (N=5N=5, τsim=0.85 _sim=0.85, Kmax=7K_ =7, R=2R=2) achieve strong performance across all benchmarks while balancing accuracy and computational cost. 4.5. Efficiency Analysis A key claim of our framework is that adaptive branching can match fixed-budget exploration at substantially lower cost. To verify this, we measure per-problem cost and API call statistics under default settings (Table 3). Dataset Acc/F1 Avg Cost Avg Calls Retry % GSM8K 93.9 $0.194 7.87 3.4 MATH 61.4 $1.012 9.82 0.8 MBPP 84.9 $0.195 9.76 0.0 HumanEval 93.9 $0.049 9.22 0.0 HotpotQA 77.5 $0.490 7.58 3.5 DROP 87.9 $0.298 7.73 3.0 Table 3. Efficiency metrics with default settings (N=5N=5, Kmax=7K_ =7). Avg Calls: average LLM calls per problem, including Monte Carlo samples for uncertainty estimation plus KtK_t execution branches. Retry %: percentage of problems triggering Stage 3 refinement. Cost-Performance Trade-off. Compared to fixed branching, DenoiseFlow’s adaptive mechanism achieves equivalent accuracy while reducing average cost by approximately 40–56% (depending on the fixed branch budget). For example, against fixed K=5K=5, the average cost per problem drops to $0.194 on GSM8K (vs. $0.32) and $1.012 on MATH (vs. $1.69), yielding ≈ 40% savings. Against fixed K=7K=7, we observe up to ∼ 56% savings at matched accuracy (Table 2). The overhead of Stage 1 Monte Carlo sampling is offset by reduced branching on high-confidence problems: MBPP achieves 40.7% Direct execution with average K=2.02K=2.02, while only GSM8K requires heavier exploration (average K=3.98K=3.98). This validates that uncertainty-based routing effectively allocates computation where it is most needed. 4.6. Uncertainty Calibration Analysis The entire DenoiseFlow pipeline hinges on one assumption: the estimated uncertainty must be rank-consistent with actual task difficulty, so that runtime decisions (Direct vs. Branch vs. Refine) are well-founded. To verify this, we plot estimated risk scores against actual success rates (Figure 3). The strong negative correlation (binned Spearman ρ=−0.782ρ=-0.782) confirms that higher estimated uncertainty indeed corresponds to lower success, validating the reliability of our noise estimates as a decision signal. Further analyses on strategy distribution, refinement recovery rates, and error categorization are provided in Appendix H. Calibration curve showing a negative relationship between estimated uncertainty (risk score) and success rate on GSM8K and MATH. Error bars indicate standard deviation across three runs. Figure 3. Uncertainty calibration: risk score r vs. success rate on GSM8K and MATH. The negative correlation confirms rank consistency. Error bars: std over three runs. Similar trends on other benchmarks (Appendix H.5). 5. Conclusion In this paper, we addressed the challenge of accumulated semantic ambiguity in long-horizon reasoning tasks by formalizing the agentic workflow as a Noisy MDP. Based on this formulation, we presented DenoiseFlow, a closed-loop framework that mitigates error propagation through a Sensing–Regulating–Correcting architecture. A key innovation of our approach is the ability to perform runtime self-calibration and targeted refinement without relying on ground-truth labels. By dynamically allocating exploration budgets based on estimated uncertainty, DenoiseFlow achieves state-of-the-art accuracy (83.3%) across six benchmarks while reducing computational overhead by 40–56%. These results demonstrate that principled, uncertainty-aware execution is essential for building robust autonomous agents. Future work will extend this label-free calibration paradigm to multi-agent systems and explore cross-task transfer to minimize cold-start latency. References J. Austin, A. Odena, M. Nye, M. Bosma, H. Michalewski, D. Dohan, E. Jiang, C. Cai, M. Terry, Q. Le, et al. (2021) Program synthesis with large language models. arXiv preprint arXiv:2108.07732. Cited by: §A.1, §4.1. M. Chen, J. Tworek, H. Jun, Q. Yuan, H. P. d. O. Pinto, J. Kaplan, H. Edwards, Y. Burda, N. Joseph, G. Brockman, et al. (2021) Evaluating large language models trained on code. arXiv preprint arXiv:2107.03374. Cited by: §A.1, §4.1. K. Cobbe, V. Kosaraju, M. Bavarian, M. Chen, H. Jun, L. Kaiser, M. Plappert, J. Tworek, J. Hilton, R. Nakano, et al. (2021) Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168. Cited by: §A.1, §4.1. Y. Du, S. Li, A. Torralba, J. B. Tenenbaum, and I. Mordatch (2023) Improving factuality and reasoning in language models through multiagent debate. arXiv preprint arXiv:2305.14325. Cited by: Table 5, §4.1. D. Dua, Y. Wang, P. Dasigi, G. Stanovsky, S. Singh, and M. Gardner (2019) DROP: a reading comprehension benchmark requiring discrete reasoning over paragraphs. arXiv preprint arXiv:1903.00161. Cited by: §A.1, §4.1. N. Dziri, X. Lu, M. Sclar, X. L. Li, L. Jian, B. Y. Lin, P. West, C. Bhagavatula, R. Le Bras, J. D. Hwang, et al. (2023) Faith and fate: limits of transformers on compositional tasks. In Advances in Neural Information Processing Systems (NeurIPS), Cited by: §1. X. Fang, W. Xu, F. A. Tan, J. Zhang, Z. Hu, et al. (2024) Large language models (llms) on tabular data: prediction, generation, and understanding–a survey. arXiv preprint arXiv:2402.17944. Cited by: §1. C. Guo, G. Pleiss, Y. Sun, and K. Q. Weinberger (2017) On calibration of modern neural networks. In International conference on machine learning, p. 1321–1330. Cited by: §2. D. Hendrycks, C. Burns, S. Kadavath, A. Arber, S. Basart, T. Tang, D. Song, and J. Steinhardt (2021) Measuring mathematical problem solving with the math dataset. arXiv preprint arXiv:2103.03874. Cited by: §A.1, §4.1. S. Hong, Y. Lin, B. Liu, B. Liu, B. Wu, D. Li, et al. (2024) Data interpreter: an llm agent for data science. arXiv preprint arXiv:2402.18679. Cited by: §2. S. Hu, C. Lu, and J. Clune (2024) Automated design of agentic systems. arXiv preprint arXiv:2408.08435. Cited by: Table 5, §2, §4.1. D. Jiang, X. Ren, and B. Y. Lin (2023) LLM-blender: ensembling large language models with pairwise ranking and generative fusion. arXiv preprint arXiv:2306.02561. Cited by: Table 5, §4.1. O. Khattab, K. Santhanam, X. L. Li, D. Hall, P. Liang, C. Potts, and M. Zaharia (2023) DSPy: compiling declarative language model calls into self-improving pipelines. arXiv preprint arXiv:2310.03714. Cited by: §1, §2. L. Kuhn, Y. Gal, and S. Farquhar (2023) Semantic uncertainty: linguistic invariances for uncertainty estimation in natural language generation. arXiv preprint arXiv:2302.09664. Cited by: §2. A. Lewkowycz, A. Andreassen, D. Dohan, E. Dyer, H. Michalewski, V. Ramasesh, A. Slone, C. Anil, I. Schlag, T. Gutman-Solo, et al. (2022) Solving quantitative reasoning problems with language models. Advances in Neural Information Processing Systems 35, p. 3843–3857. Cited by: §2. H. Li, L. Zhang, S. Hu, Y. Wang, Y. Shao, and Z. Zhang (2023) SheetCopilot: bringing software productivity to the next level through large language models. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (ACL), Cited by: §1. Y. Liang, C. Wu, T. Song, W. Wu, Y. Xia, Y. Liu, Y. Ou, S. Lu, L. Ji, S. Mao, et al. (2023) Taskmatrix.ai: completing tasks by connecting foundation models with millions of apis. arXiv preprint arXiv:2303.16434. Cited by: §1. Z. Liu, Y. Zhang, P. Li, Y. Liu, and D. Yang (2023) Dynamic llm-agent network: an llm-agent collaboration framework with agent team optimization. arXiv preprint arXiv:2310.02170. Cited by: Table 5, §4.1. Z. Ma, Z. Zhao, C. Hua, F. Berto, and J. Park (2026) JudgeFlow: agentic workflow optimization via block judge. arXiv preprint arXiv:2601.07477. Cited by: Table 5, Table 15, Appendix K, §2, §4.1. A. Madaan, N. Tandon, P. Gupta, S. Hallinan, L. Gao, S. Wiegreffe, U. Alon, N. Dziri, S. Prabhumoye, Y. Yang, et al. (2024) Self-refine: iterative refinement with self-feedback. Advances in Neural Information Processing Systems 36. Cited by: Table 5, Table 15, §1, §2, §4.1. J. S. Park, J. C. O’Brien, C. J. Cai, M. R. Morris, P. Liang, and M. S. Bernstein (2023) Generative agents: interactive simulacra of human behavior. p. 1–22. Cited by: §2. J. Platt et al. (1999) Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods. In Advances in large margin classifiers, Vol. 10, p. 61–74. Cited by: §2. T. Schick, J. Dwivedi-Yu, R. Dessì, R. Raileanu, M. Lomeli, L. Zettlemoyer, N. Cancedda, and T. Scialom (2023) Toolformer: language models can teach themselves to use tools. In Advances in Neural Information Processing Systems (NeurIPS), Cited by: §1. Y. Shen, K. Song, X. Tan, D. Li, L. Weiqi, and Y. Zhuang (2024) Hugginggpt: solving ai tasks with chatgpt and its friends in hugging face. In Advances in Neural Information Processing Systems (NeurIPS), Cited by: §1. N. Shinn, F. Cassano, A. Gopinath, K. Narasimhan, and S. Yao (2024) Reflexion: language agents with verbal reinforcement learning. Advances in Neural Information Processing Systems 36. Cited by: Table 15, §1, §2. H. Tupayachi (2024) Decision support systems. Cited by: §1. X. Wang, J. Wei, D. Schuurmans, Q. Le, E. Chi, S. Narang, A. Chowdhery, and D. Zhou (2022) Self-consistency improves chain of thought reasoning in language models. arXiv preprint arXiv:2203.11171. Cited by: Table 15, §2, §4.1. J. Wei, X. Wang, D. Schuurmans, M. Bosma, F. Xia, E. Chi, Q. V. Le, D. Zhou, et al. (2022) Chain-of-thought prompting elicits reasoning in large language models. Advances in neural information processing systems 35, p. 24824–24837. Cited by: §2, §4.1. Z. Xi, W. Chen, X. Guo, W. He, Y. Ding, B. Hong, M. Zhang, J. Wang, S. Jin, E. Zhou, et al. (2023a) The rise and potential of large language model based agents: a survey. arXiv preprint arXiv:2309.07864. Cited by: §1. Z. Xi, W. Chen, X. Guo, W. He, Y. Ding, B. Hong, M. Zhang, J. Wang, S. Jin, E. Zhou, et al. (2023b) The rise and potential of large language model based agents: a survey. arXiv preprint arXiv:2309.07864. Cited by: §2. C. Yang, X. Wang, Y. Lu, H. Liu, Q. V. Le, D. Zhou, and X. Chen (2023) Large language models as optimizers. arXiv preprint arXiv:2309.03409. Cited by: §2. J. Yang, C. E. Jimenez, A. Wettig, K. Liber, K. Narasimhan, and O. Press (2024) SWE-agent: agent-computer interfaces enable automated software engineering. arXiv preprint arXiv:2405.15793. Cited by: §2. Z. Yang, P. Qi, S. Zhang, Y. Bengio, W. W. Cohen, R. Salakhutdinov, and C. D. Manning (2018) HotpotQA: a dataset for diverse, explainable multi-hop question answering. arXiv preprint arXiv:1809.09600. Cited by: §A.1, §4.1. S. Yao, D. Yu, J. Zhao, I. Shafran, T. Griffiths, Y. Cao, and K. Narasimhan (2024) Tree of thoughts: deliberate problem solving with large language models. Advances in Neural Information Processing Systems 36. Cited by: Table 15, §2. S. Yao, J. Zhao, D. Yu, N. Du, I. Shafran, K. Narasimhan, and Y. Cao (2022) ReAct: synergizing reasoning and acting in language models. arXiv preprint arXiv:2210.03629. Cited by: §1, §1, §2. W. You et al. (2025) DatawiseAgent: enhancing data science agents with reinforcement learning. arXiv preprint. Cited by: §1. J. Zhang, J. Xu, S. Jiang, Q. Fang, S. Chen, Z. Jiang, J. Liu, X. Yan, Z. Liu, Z. Zhang, et al. (2024) AFlow: automating agentic workflow generation. arXiv preprint arXiv:2410.10762. Cited by: §A.2, Table 5, Appendix J, Table 15, §1, §2, §4.1, §4.1. M. Zhang, O. Press, W. Merrill, A. Liu, and N. A. Smith (2023) How language model hallucinations snowball. arXiv preprint arXiv:2305.13534. Cited by: §1. Y. Zhang et al. (2025) Multi-agent as a service: a unified framework for ai agent collaboration. arXiv preprint. Cited by: §A.2, Table 5, Appendix J, §4.1, §4.1. Y. Zheng et al. (2025) MermaidFlow: agentic workflow optimization via mermaid diagram evolution. arXiv preprint. Cited by: Table 5, Table 15, §2, §4.1. Y. Zhou, A. I. Muresanu, Z. Han, K. Paster, S. Pitis, H. Chan, and J. Ba (2022) Large language models are human-level prompt engineers. arXiv preprint arXiv:2211.01910. Cited by: §2. M. Zhuge, W. Wang, L. Kirsch, F. Faccio, D. Khizbullin, and J. Schmidhuber (2024) GPTSwarm: language agents as optimizable graphs. arXiv preprint arXiv:2402.16823. Cited by: Table 5, §4.1. Appendix A Experimental Details A.1. Datasets Table 4 summarizes the benchmarks used in our experiments. Dataset Size Task Type Metric GSM8K 1,319 Math (grade school) Accuracy MATH 5,000 Math (competition) Accuracy MBPP 500 Code generation Pass@1 HumanEval 164 Code generation Pass@1 HotpotQA 7,405 Multi-hop QA F1 DROP 9,536 Discrete reasoning F1 Table 4. Benchmark datasets used in experiments. GSM8K (Cobbe et al., 2021): Grade-school math word problems requiring multi-step arithmetic reasoning. We use the test split (1,319 problems). MATH (Hendrycks et al., 2021): Competition mathematics problems spanning algebra, geometry, number theory, etc. We use 500 problems sampled from the test set. MBPP (Austin et al., 2021): Basic Python programming problems with natural language descriptions and test cases. We use the sanitized test split (500 problems). HumanEval (Chen et al., 2021): Hand-written Python programming problems with docstrings and unit tests (164 problems). HotpotQA (Yang et al., 2018): Multi-hop question answering requiring reasoning over multiple Wikipedia paragraphs. We use the distractor setting. Each instance includes a question, an answer string, and a list of context paragraphs in the form [[title, [sentences]], ...]; we concatenate all sentences to form the context input (Context + Question). DROP (Dua et al., 2019): Reading comprehension requiring discrete reasoning operations (counting, sorting, arithmetic) over text. Each instance provides a context string and one or more gold answers (stored as ref_text with |-separated references); we score a single predicted answer against all references and take the maximum F1. A.2. Model Configuration We use the same backbone LLM for DenoiseFlow and all reproduced baselines to ensure a controlled comparison, following the experimental protocol established in prior work (Zhang et al., 2024; Zhang and others, 2025). • Backbone LLM: GPT-4o-mini (gpt-4o-mini-2024-07-18), accessed via OpenAI API • Temperature: 0 for deterministic greedy decoding and verifier calls; Monte Carlo sampling uses temperature =0.7=0.7 to generate diverse interpretations • Max tokens: 4,096 for all generation calls • Embedding model: all-MiniLM-L6-v2 (384 dimensions) for semantic similarity computation • API version: OpenAI API v1 Reproducibility. DenoiseFlow and reproduced baselines use fixed random seeds (42, 123, 456) across three runs. We report mean results; standard deviations are typically within ± 0.5 percentage points for accuracy metrics. Code, configuration files, and experiment logs are available at https://anonymous.4open.science/r/DenoiseFlow-X for review, and will be de-anonymized upon acceptance. A.3. Baseline Configurations Table 5 lists the baseline configurations. Method Key Parameters LLM Source Single-agent Systems IO - GPT-4o-mini Our impl. CoT zero-shot GPT-4o-mini Our impl. CoT SC K=5K=5 samples GPT-4o-mini Our impl. Hand-crafted Multi-agent Systems Self-Refine max_iter=3 GPT-4o-mini (Madaan et al., 2024) LLM-Debate rounds=2, agents=3 GPT-4o-mini (Du et al., 2023) LLM-Blender top-k=3 GPT-4o-mini (Jiang et al., 2023) DyLAN layers=3 GPT-4o-mini (Liu et al., 2023) Autonomous Multi-agent Systems GPTSwarm swarm_size=5 GPT-4o-mini (Zhuge et al., 2024) ADAS iterations=30 GPT-4o-mini (Hu et al., 2024) AFlow MCTS rounds=20 GPT-4o-mini (Zhang et al., 2024) MaAS supernet GPT-4o-mini (Zhang and others, 2025) MermaidFlow EP rounds=20 GPT-4o-mini (Zheng and others, 2025) JudgeFlow block-level judge GPT-4o-mini (Ma et al., 2026) Table 5. Baseline configurations. All methods are reproduced under the same backbone (GPT-4o-mini) using our unified evaluation protocol. Baseline Results Source. All baseline results are reproduced under our unified evaluation protocol using GPT-4o-mini as the backbone LLM. We re-implement each method following the configurations described in the original papers (listed above) to ensure a controlled and fair comparison. A.4. Evaluation Protocol Mathematical Reasoning (GSM8K, MATH). We extract the final numerical answer and compare against the ground truth. For MATH, we use sympy for symbolic equivalence checking when applicable. Code Generation (MBPP, HumanEval). We execute generated code against provided test cases and report Pass@1. Multi-hop QA (HotpotQA, DROP). We compute token-overlap F1 between predicted and gold answers after standard normalization (lowercasing, article removal, punctuation removal). For DROP, which may contain multiple gold references, we report the maximum F1 over all references while treating the prediction as a single answer string (i.e., we do not split the prediction into multiple guesses). A.5. Compute Resources Experiments were conducted using: • API: OpenAI GPT-4o-mini via official API endpoint • Local embedding: sentence-transformer inference on a single commodity GPU/CPU for sentence embeddings • Total API cost: approximately $150 for all experiments (including ablations) • Wall-clock time: depends on API throughput and batching; scripts and logs for reproducing runtime are provided in the anonymous repository A.6. Statistical Analysis Variance Across Runs. We run DenoiseFlow and reproduced baselines three times with different random seeds (42, 123, 456). The standard deviation across runs is typically within ± 0.5 percentage points for accuracy metrics (Accuracy/Pass@1) and within ± 0.3 F1 points for multi-hop QA, indicating stable results. Significance Testing. While we do not perform formal significance tests due to the high computational cost of multiple runs, our improvements over baselines (e.g., +2.6% on MBPP over MermaidFlow) exceed the observed variance by a substantial margin (5× the standard deviation), suggesting reliable improvements. Comparison Fairness. All baselines are reproduced under identical conditions using GPT-4o-mini, following the configurations and hyperparameters specified in their original papers. This ensures a controlled comparison where performance differences reflect algorithmic merits rather than backbone or implementation discrepancies. Appendix B Broader Impact As LLM-based systems transition from experimental demos to high-stakes real-world applications, reliability becomes paramount. DenoiseFlow contributes to the development of Trustworthy AI by providing a mechanism to quantify knowing vs. not knowing. By enabling agents to explicitly detect ambiguity and recover from errors, we move closer to systems that fail gracefully rather than silently. We hope this work inspires further exploration into principled uncertainty management, ensuring that autonomous systems remain safe, predictable, and aligned with human intent even in complex, ambiguous environments. A detailed discussion of limitations and future directions is provided in Appendix J. Appendix C Hyperparameter Settings Table 6 lists all hyperparameters used in DenoiseFlow with their default values and descriptions. Parameter Default Description Stage 1: Semantic Anchoring N 5 Monte Carlo sample size τsim _sim 0.85 Base similarity threshold (adapted per problem; see §3.3) τslot _slot 0.4 Slot-level high-uncertainty threshold Stage 1: Risk Propagation λ 0.5 Bottleneck channel weight β 0.3 Aggregation channel weight Stage 1: Online Calibration T0T_0 1.0 Initial calibration temperature Δ 20 Calibration update interval τl _l 0.3 Low uncertainty threshold for calibration τh _h 0.7 High uncertainty threshold for calibration θacc _acc 0.7 Target accuracy for calibration Stage 2: Adaptive Branching α 0.6 Slot-level risk aggregation weight θhigh _high Q3()Q_3(c) High confidence threshold (adaptive) θlow _low Q1−0.5⋅IQRQ_1-0.5·IQR Low confidence threshold (adaptive) κ 3 Branch count scaling factor KmaxK_ 7 Maximum branches per task Stage 3: Closed-Loop Refinement τenf _enf 0.5 Enforcement threshold for calibration R 2 Maximum refinement retries Table 6. Hyperparameter settings for DenoiseFlow. Propagation Weights (λ, β). The dual-channel weights balance bottleneck risk (single critical failure) vs. aggregation risk (cumulative degradation). We set λ>βλ>β to prioritize critical-path failures, which are more common in agentic workflows. We searched over (λ,β)∈(0.3,0.2),(0.5,0.3),(0.7,0.4)(λ,β)∈\(0.3,0.2),(0.5,0.3),(0.7,0.4)\ on held-out subsets (20 samples each from GSM8K, HotpotQA, and MBPP, covering math/QA/code); (0.5,0.3)(0.5,0.3) achieved the best average cost-accuracy trade-off across all three. We found performance stable within ±0.1± 0.1 of these values. Threshold Selection. For workflows with n≥5n≥ 5 tasks, confidence thresholds are derived adaptively from the distribution: θhigh=Q3() _high=Q_3(c) (75th percentile) and θlow=Q1()−0.5⋅IQR() _low=Q_1(c)-0.5·IQR(c). For small workflows (n<5n<5), we use fixed thresholds (0.7,0.3)(0.7,0.3). Appendix D Online Calibration Details D.1. Temperature Scaling Mechanism The online calibration mechanism adjusts uncertainty estimates to correct for systematic overconfidence or underconfidence. Given raw uncertainty utu_t, the calibrated uncertainty is: (13) utcal=σ(ut−0.5T),u_t^cal=σ ( u_t-0.5T ), where σ(⋅)σ(·) is the sigmoid function and T is the calibration temperature. D.2. Temperature Update Rule After every Δ observations, we update T based on verifier feedback: (14) T←T⋅1.1if Accu<τl<θacc0.9if Accu>τh>θacc1.0otherwiseT← T· cases1.1&if Acc_u< _l< _acc\\ 0.9&if Acc_u> _h> _acc\\ 1.0&otherwise cases where Accu<τAcc_u<τ denotes the verifier pass rate on problems with uncertainty below τ. Intuition. • If low-uncertainty problems frequently fail verification (Accu<τl<θaccAcc_u< _l< _acc), the system is overconfident. We increase T to raise uncertainty estimates. • If high-uncertainty problems frequently pass verification (Accu>τh>θaccAcc_u> _h> _acc), the system is underconfident. We decrease T to lower uncertainty estimates. D.3. Temperature Bounds To prevent extreme calibration, we bound the temperature: T∈[0.5,2.0]T∈[0.5,2.0]. This ensures that uncertainty estimates remain in a reasonable range. Appendix E Implementation Details E.1. Semantic Anchoring Details Slot Definition. We decompose tasks into semantic slots—atomic requirement units (e.g., input_format, output_type, answer_form). For mathematical reasoning tasks, common slots include: • goal: the quantity to compute • constraints: conditions that must be satisfied • answer_form: expected format (number, expression, etc.) • units: measurement units if applicable Clustering Procedure. For N LLM samples x1,…,xN\x_1,…,x_N\: (1) Embed each sample using a sentence encoder (we use all-MiniLM-L6-v2) (2) Build a similarity graph with edges where cos(i,j)≥τsim (e_i,e_j)≥ _sim (3) Extract connected components as semantic clusters C (4) Compute normalized semantic entropy (Eq. 3) The canonical response is the medoid of the largest cluster. Adaptive Threshold. We adapt the similarity threshold based on inferred structural complexity: (15) τsim=0.85−0.05⋅min(nstep, 3), _sim=0.85-0.05· (n_step,\,3), where nstepn_step is the number of reasoning steps inferred from the problem (see §E.2). This yields τsim∈[0.70,0.85] _sim∈[0.70,0.85], relaxing the threshold for multi-step problems to permit more interpretation diversity while keeping it strict for simple tasks. E.2. Problem Complexity Features We estimate problem complexity using the following features: • Length score: min(1,word_count/200) (1,word\_count/200) • Math score: presence of math keywords (equation, solve, prove, etc.) • Multi-step score: presence of sequential cues (first, then, finally, etc.) • Constraint score: presence of constraint patterns (at least, at most, etc.) • Numeric score: min(1,number_count/8) (1,number\_count/8) • Multi-hop score: presence of comparison/relation cues (for QA tasks) The composite complexity score is a weighted sum with weights (0.1,0.25,0.2,0.2,0.1,0.15)(0.1,0.25,0.2,0.2,0.1,0.15). E.3. Slot-Level Risk Aggregation For each workflow step t, we compute per-slot uncertainty ut(s)u_t^(s) using the same semantic entropy procedure (§E.1) applied to each slot independently. The slot-level risk aggregator fslotf_slot combines these into a single scalar: (16) fslot(t(s))=α⋅maxsut(s)+(1−α)⋅1|ℋt|∑s∈ℋtut(s),f_slot(u_t^(s))=α· _su_t^(s)+(1-α)· 1|H_t| _s _tu_t^(s), where ℋt=s∣ut(s)>τslotH_t=\s u_t^(s)> _slot\ is the set of high-uncertainty slots (we use τslot=0.4 _slot=0.4), and α=0.6α=0.6 balances the worst-case channel (a single highly ambiguous slot can dominate) with the average channel (multiple moderately uncertain slots compound). If ℋt=∅H_t= , the average term defaults to zero and fslotf_slot reduces to the single worst-case slot. This design reflects two failure modes: (1) a single critically ambiguous slot (e.g., misinterpreted output format) can derail the entire step even if other slots are clear; (2) several mildly uncertain slots can jointly create compounding ambiguity. The compound risk metric rt=max(u~tcal,fslot(t(s)))r_t= ( u_t^cal,f_slot(u_t^(s))) (Eq. 8) ensures that both systemic propagated risk and local slot-level ambiguity are captured. E.4. Branching Strategy Details For tasks in the branching regime (θlow≤ct≤θhigh _low≤ c_t≤ _high), we construct KtK_t paths: • Primary: medoid of the largest cluster C1C_1 • Alternative: medoid of the second-largest cluster C2C_2 (if |C2|≥2|C_2|≥ 2) • Conservative: variant with only low-uncertainty slots retained Consensus Selection. When multiple branches complete, we select the output using: (17) Score(C)=η⋅Valid(C)+(1−η)⋅Cohesion(C)+log|C|,Score(C)=η·Valid(C)+(1-η)·Cohesion(C)+ |C|, where Valid(C)Valid(C) is the fraction of verifier-passing outputs and Cohesion(C)Cohesion(C) is average intra-cluster similarity. We use η=0.6η=0.6. E.5. Root Cause Tracing Details Influence Computation. The influence of upstream node k on failure set SfailS_fail is: (18) Ik≈u~k⋅maxρ∈k↝Sfail∏(i,j)∈ρwij,I_k≈ u_k· _ρ∈ k S_fail _(i,j)∈ρw_ij, where the path product measures transmission bandwidth. We select the root cause as k∗=argmaxkIkk^*= _kI_k. Asymmetric Calibration. Upon identifying k∗k^*: • Boost: Set uk∗←1.0u_k^*← 1.0 (maximum uncertainty) • Enforce: Set uSfail←max(uSfail,τenf)u_S_fail← (u_S_fail, _enf) This steers the next iteration to use Branching mode at k∗k^* instead of Direct mode. Appendix F Operator Definitions Table 7 defines the core operators in DenoiseFlow. Each operator encapsulates a reusable computation pattern that can be composed into workflows. Operator Description Stage 1: Semantic Anchoring Sample(N) Generate N diverse LLM responses via Monte Carlo sampling with temperature >0>0 Embed Compute semantic embeddings using sentence encoder Cluster(τ) Group responses by similarity threshold τ; extract clusters Entropy Compute normalized semantic entropy from cluster distribution Propagate Propagate slot-level uncertainty through dependency graph Stage 2: Adaptive Branching Confidence Aggregate slot uncertainties into task-level confidence Route(θh,θl _h, _l) Select execution mode: Direct/Branch/Refine based on thresholds Branch(K) Execute K parallel solution paths Consensus(η) Select best output via validity and cohesion scoring (η=0.6η=0.6) Stage 3: Closed-Loop Refinement Verify Check answer correctness via LLM or external validator Trace Identify root cause via influence-based propagation Refine Re-execute from root cause with boosted uncertainty Calibrate Update temperature based on verifier feedback Table 7. Core operators in DenoiseFlow. Operators are composable building blocks that implement the three-stage denoising pipeline. Appendix G Prompt Templates We provide the complete prompt templates used in DenoiseFlow. All prompts use a structured format to ensure consistent LLM responses. G.1. Stage 1: Structured Understanding Prompt Understanding Prompt (Math/Code) You are analyzing a problem to extract its semantic structure. Problem: problem_text Analyze and respond in JSON format: "goal": "What quantity/output is requested", "constraints": ["List of conditions to satisfy"], "inputs": ["Given values and their meanings"], "outputs": "answer_form": "number|expression|code|text", "units": "unit if applicable, else null", "format": "Expected output format" , "plan": ["Step 1", "Step 2", ...], "complexity": "low|medium|high" Be precise and exhaustive in listing constraints. Understanding Prompt (Multi-hop QA) You are analyzing a question that requires multi-step reasoning over the given context. Context: context Question: question Analyze and respond in JSON format: "question_type": "factoid|yesno|comparison|count", "answer_form": "entity|number|yes/no|list", "required_hops": [ "hop": 1, "info": "What to find first", "hop": 2, "info": "What to find next" ], "key_entities": ["Entity mentions to track"], "reasoning_chain": "Brief logical chain" G.2. Stage 2: Solution Generation Prompts Math Reasoning Prompt Solve the following math problem step by step. Problem: problem_text Requirements: - Show all calculation steps clearly - State any assumptions made - Final answer format: answer_form Think through the problem systematically, then provide your solution. Code Generation Prompt Write a Python function to solve the task. Task: problem_text Requirements: - Function signature: function_signature - Handle edge cases appropriately - Code should be clean and efficient ‘python function_signature # Your implementation here ‘ Multi-hop QA Prompt Answer the question based on the context. Context: context Question: question Instructions: - Find relevant evidence in the context - Chain the evidence logically - Provide a concise answer - Answer format: answer_form Evidence and reasoning: G.3. Stage 3: Verification Prompts Verification Prompt (Math) Verify if the answer is correct. Problem: problem_text Candidate Answer: answer Expected Format: answer_form Verification checklist: 1. Does the answer match the expected format? 2. Are all calculations mathematically correct? 3. Does the answer satisfy all constraints? 4. Is the final value reasonable? Respond in JSON: "verdict": "PASS" or "FAIL", "checks": "format_ok": true/false, "math_ok": true/false, "constraints_ok": true/false, "reasonable": true/false , "reason": "Brief explanation", "confidence": 0.0-1.0 Verification Prompt (QA) Verify if the answer is supported by context. Context: context Question: question Candidate Answer: answer Verification checklist: 1. Is the answer directly supported by context? 2. Does it answer what was asked? 3. Is the answer complete (not partial)? 4. Quote supporting evidence if found. Respond in JSON: "verdict": "PASS" or "FAIL", "evidence": "Quoted text from context", "reason": "Brief explanation", "confidence": 0.0-1.0 G.4. Stage 3: Refinement Prompt Root-Cause Guided Refinement The previous solution failed verification. Problem: problem_text Previous Attempt: previous_answer Failure Analysis: - Verdict: verdict - Reason: failure_reason - Root Cause: root_cause - Affected Step: step_description Instructions: 1. Focus on fixing the identified root cause 2. Do NOT repeat the same mistake 3. Re-derive from the problematic step 4. Verify your fix addresses the issue Corrected solution: Appendix H Additional Results H.1. Cross-Model Generalization To validate that DenoiseFlow generalizes beyond GPT-4o-mini, we evaluate on two additional backbone LLMs: GPT-4o (a stronger model) and DeepSeek-V2.5 (an open-weight model). We test on GSM8K and MATH as representative benchmarks. Model Method GSM8K MATH GPT-4o-mini CoT 87.0 48.8 DenoiseFlow 93.9 61.4 GPT-4o CoT 98.0 62.0 DenoiseFlow 99.5 68.5 DeepSeek-V2.5 CoT 82.0 43.0 DenoiseFlow 88.8 55.5 Table 8. Cross-model generalization on GSM8K and MATH. DenoiseFlow consistently outperforms CoT across all three backbone LLMs, demonstrating framework-level generality. All experiments use the same evaluation protocol. Discussion. DenoiseFlow yields consistent gains across all three backbone LLMs. On GPT-4o, the improvement is +1.5% on GSM8K and +6.5% on MATH; on DeepSeek-V2.5, the gains are +6.8% and +12.5%, respectively. Notably, the relative improvement is largest on weaker models (DeepSeek-V2.5), suggesting that uncertainty-aware denoising is especially beneficial when the base model produces noisier intermediate steps. Even on GPT-4o, where CoT already achieves 98.0% on GSM8K, DenoiseFlow pushes accuracy to 99.5%, demonstrating that our framework extracts additional gains even from strong backbones. H.2. Strategy Distribution by Dataset Table 9 shows the distribution of execution strategies across datasets. Crucially, adaptivity operates at two levels: (1) routing between Direct/Branch/Refine modes, and (2) within Branch mode, varying the number of parallel paths K based on problem uncertainty. Dataset Direct (%) Branch (%) Refine (%) Avg K Total GSM8K 0.8 99.2 3.4 3.98 120 MATH 14.3 85.7 12.6 2.53 119 MBPP 40.7 59.3 0.0 2.02 86 HumanEval 12.1 87.9 0.0 2.82 33 HotpotQA 11.0 89.0 2.0 2.62 200 DROP 13.0 87.0 11.5 2.50 200 Table 9. Strategy distribution and adaptive branching (based on a representative analysis subset; see “Total” column for subset sizes). Direct and Branch show the initial routing decision based on confidence thresholds (Eq. 9); they are mutually exclusive and sum to 100%. Refine (%) shows the fraction of problems that ultimately trigger Stage 3 refinement—either due to very low initial confidence or after Branch execution fails verification—and is therefore a (non-exclusive) subset of Branch. Note that Refine (%) here may differ from the full-dataset Retry % in Table 3 due to sampling variation. Avg K shows the average branch count within Branch mode. H.3. Refinement Recovery Analysis Table 10 shows the recovery rate of Stage 3 refinement. Dataset Triggered Recovered Rate (%) Avg Retries GSM8K 9 4 44.4 1.0 MATH 1 0 0.0 1.0 HotpotQA 7 3 42.9 1.0 DROP 6 2 33.3 1.0 Table 10. Stage 3 refinement recovery analysis. Triggered: number of problems entering refinement. Recovered: problems successfully corrected after refinement. H.4. Error Analysis We manually categorize a random sample of 50 failure cases across all benchmarks. On reasoning tasks, the most common failure modes are calculation errors (≈ 45%) and logical reasoning errors (≈ 35%), with the remainder involving problem misinterpretation. On code generation, failures stem primarily from edge case handling (≈ 50%) and incorrect algorithm selection (≈ 30%). The closed-loop refinement is most effective at correcting calculation and edge case errors, which have clear verifiable signals; logical reasoning errors prove more challenging, as they often require fundamentally different solution strategies rather than localized corrections. H.5. Uncertainty Estimation Quality Our uncertainty estimates are designed to be rank-consistent: problems with lower estimated uncertainty should achieve higher success rates. This property enables effective resource allocation—the system uses Direct mode for low-uncertainty cases while allocating more branches to high-uncertainty ones. As shown in Figure 3, this rank consistency holds across all datasets, validating the effectiveness of our uncertainty quantification approach. H.6. Hyperparameter Sensitivity Details We provide detailed sensitivity analysis results for all key hyperparameters across six benchmarks. Each experiment uses 30 randomly sampled problems per dataset. N GSM8K MATH HotpotQA DROP HumanEval MBPP Avg 3 90.2 51.3 65.8 82.4 87.9 80.2 76.3 5⋆ 93.2 55.5 73.8 87.9 90.9 84.9 81.0 7 91.8 52.1 70.2 85.3 90.9 82.6 78.8 10 92.4 53.8 69.1 84.2 90.9 80.2 78.4 Table 11. Sensitivity to Monte Carlo sample size N. Accuracy/F1 (%) reported. ⋆ denotes the optimal value. Contrary to the intuition that more samples improve estimation, N=5N=5 achieves the best performance (81.0% avg), suggesting moderate sampling provides sufficient semantic diversity without introducing redundant noise. τsim _sim GSM8K MATH HotpotQA DROP HumanEval MBPP Avg 0.7 91.3 52.9 68.5 82.1 90.9 81.4 77.9 0.8 92.4 53.8 70.8 84.8 90.9 82.6 79.2 0.85⋆ 93.2 55.5 73.8 87.9 90.9 84.9 81.0 0.9 92.0 54.6 71.2 85.6 90.9 83.7 79.7 Table 12. Sensitivity to similarity threshold τsim _sim. ⋆ denotes the optimal value. τ=0.85τ=0.85 achieves the best balance: lower values may merge semantically distinct answers, while higher values may over-fragment similar responses, both leading to suboptimal uncertainty estimates. KmaxK_ GSM8K MATH HotpotQA DROP HumanEval MBPP Avg 3 92.4 53.8 61.6 79.7 90.9 77.9 76.1 5 92.8 54.6 68.9 84.2 90.9 82.6 79.0 7⋆ 93.2 55.5 73.8 87.9 90.9 84.9 81.0 Table 13. Sensitivity to maximum branches KmaxK_ . Larger KmaxK_ significantly benefits multi-hop reasoning tasks: HotpotQA improves by 12.2 F1 points and DROP by 8.2 F1 points from K=3K=3 to K=7K=7. This demonstrates that complex reasoning requires sufficient exploration capacity. We use Kmax=7K_ =7 (⋆) as the default; the adaptive mechanism ensures efficient routing on simpler tasks. R GSM8K MATH HotpotQA DROP HumanEval MBPP Avg 1 92.8 54.6 72.1 86.5 90.9 83.7 80.1 2⋆ 93.2 55.5 73.8 87.9 90.9 84.9 81.0 4 92.4 54.6 73.2 87.1 90.9 84.9 80.5 Table 14. Sensitivity to maximum retries R. All values perform similarly (≈ 80–81%), indicating that root-cause-guided refinement is effective even with minimal retries. We use R=2R=2 (⋆) as a cost-effective default. Appendix I Case Studies We provide qualitative examples illustrating how DenoiseFlow handles different scenarios. I.1. Case 1: Successful Uncertainty-Guided Branching (GSM8K) Problem: “Janet has 3 times as many marbles as Tom. Tom has 2 more marbles than Lucy. If Lucy has 5 marbles, how many marbles does Janet have?” Stage 1 Analysis: • Semantic uncertainty ut=0.12u_t=0.12 (low, single-cluster consensus) • Structure signal: multi-step arithmetic detected • Confidence ct=0.88c_t=0.88 (high) Stage 2 Decision: Direct execution (high confidence) Result: Correct answer (21 marbles) on first attempt. I.2. Case 2: Refinement Recovery (MATH) Problem: “Find all values of x such that |x−3|+|x+2|=7|x-3|+|x+2|=7.” Stage 1 Analysis: • Semantic uncertainty ut=0.45u_t=0.45 (medium, two interpretation clusters) • Cluster 1: case analysis approach • Cluster 2: geometric interpretation • Confidence ct=0.55c_t=0.55 Stage 2 Decision: Branching mode (K=2K=2) First Attempt: Incorrect (missed boundary case) Stage 3 Refinement: • Root cause traced to incomplete case enumeration • Uncertainty boosted, triggering re-analysis • Second attempt: correct answer (x∈−3,4x∈\-3,4\) I.3. Case 3: Adaptive Branching (HotpotQA) Problem: “Were the directors of ’Jaws’ and ’E.T.’ the same person?” Stage 1 Analysis: • Context coverage: 0.85 (good evidence alignment) • Multi-hop structure detected (two entity lookups + comparison) • Confidence ct=0.62c_t=0.62 Stage 2 Decision: Branching mode (K=2K=2) • Branch 1: Direct comparison from context • Branch 2: Explicit entity extraction then comparison Consensus: Both branches agree on “Yes” (Steven Spielberg directed both). High cohesion score confirms answer. I.4. Case 4: Code Generation with Test-Driven Refinement (MBPP) Problem: “Write a function to find the longest palindromic substring in a given string.” Stage 1 Analysis: • Semantic uncertainty ut=0.38u_t=0.38 (medium, algorithm choice ambiguity) • Two interpretation clusters detected: – Cluster 1: Expand-around-center approach – Cluster 2: Dynamic programming approach • Confidence ct=0.62c_t=0.62 Stage 2 Decision: Branching mode (K=2K=2) First Attempt (Branch 1): Expand-around-center implementation def longest_palindrome(s): if not s: return "" start, max_len = 0, 1 for i in range(len(s)): # Check odd-length palindromes l, r = i, i while l >= 0 and r < len(s) and s[l] == s[r]: if r - l + 1 > max_len: start, max_len = l, r - l + 1 l -= 1; r += 1 return s[start:start + max_len] Test Execution Result: FAIL • Test case: longest_palindrome("cbbd") expected "b" • Actual output: "c" (missed even-length palindromes) Stage 3 Refinement: • Root cause traced: missing even-length palindrome expansion • Diagnostic signal: test failure with specific counterexample • Targeted fix: add even-length expansion loop Refined Code: def longest_palindrome(s): if not s: return "" start, max_len = 0, 1 for i in range(len(s)): # Odd-length palindromes for l, r in [(i, i), (i, i+1)]: # Added even case while l >= 0 and r < len(s) and s[l] == s[r]: if r - l + 1 > max_len: start, max_len = l, r - l + 1 l -= 1; r += 1 return s[start:start + max_len] Result: All test cases pass after one refinement cycle. Key Insight: Unlike mathematical reasoning where verification is often semantic, code generation benefits from external execution feedback. The test failure provides a precise diagnostic signal (specific input-output mismatch), enabling targeted correction rather than full regeneration. Appendix J Limitations and Future Work We acknowledge several limitations of DenoiseFlow that suggest directions for future research: Model Dependence. Our main experiments use GPT-4o-mini as the backbone LLM, following established benchmarks in the field (Zhang et al., 2024; Zhang and others, 2025). While cross-model experiments (Table 8) confirm generalization to GPT-4o and DeepSeek-V2.5, broader validation on fully open-source models (e.g., Llama, Mistral) remains future work. Different models may exhibit different uncertainty characteristics, potentially requiring recalibration of thresholds. Calibration Cold Start. The online calibration mechanism requires several initial observations (≈ 20 problems) before the temperature estimate stabilizes. During this warm-up phase, uncertainty estimates may be less reliable. Future work could explore meta-learning approaches to initialize calibration from related tasks. Cross-Task Calibration. When switching between task types (e.g., from math to code), the calibrated temperature may not transfer well due to different uncertainty distributions. In our experiments, each dataset is evaluated independently with fresh calibration state. For deployment scenarios with mixed task streams, adaptive reset strategies (e.g., detecting distribution shift via uncertainty statistics) would be needed to maintain calibration quality. Verification Dependency. The effectiveness of Stage 3 refinement depends on the quality of the verification signal. For tasks without clear success criteria (e.g., open-ended generation), the refinement loop may be less effective. Extending to weak supervision or learned verifiers is an interesting direction. Computational Overhead. While adaptive branching reduces average cost compared to fixed exploration, the Monte Carlo sampling in Stage 1 introduces overhead for simple problems. A meta-controller that skips uncertainty estimation for obviously easy problems could further improve efficiency. Domain Scope. We evaluate on reasoning-intensive tasks (math, code, QA) where semantic uncertainty is prominent. The applicability to other domains (e.g., creative writing, multi-turn dialogue) where uncertainty manifests differently requires further investigation. Appendix K Detailed Method Comparison Table 15 compares DenoiseFlow with representative related methods along five capabilities required for reliable long-horizon workflow execution: (1) Uncertainty Sensing: whether the system explicitly estimates semantic-level uncertainty before acting; (2) Adaptive Branching: whether exploration effort adjusts to per-problem difficulty (online) rather than using a fixed budget or offline-determined structure; (3) Root Cause Tracing: whether failures are diagnosed via dependency-aware localization rather than blind restarts; (4) Online Calibration: whether uncertainty estimates are continuously recalibrated at runtime without ground-truth labels; (5) Targeted Correction: whether the system corrects only the identified source of error while preserving valid intermediate states. Existing methods address at most one or two of these dimensions in isolation. Branching methods (CoT-SC, ToT) apply fixed exploration; error-recovery methods (Reflexion) restart broadly; workflow optimization methods (AFlow, MermaidFlow) fix the structure offline; and JudgeFlow (Ma et al., 2026) introduces offline block-level blame attribution but does not perform runtime uncertainty sensing or adaptive execution. DenoiseFlow is the first to integrate all five within a unified closed-loop framework, enabling coordinated uncertainty-aware execution. Method Uncertainty Adaptive Root Cause Online Targeted Sensing Branching Tracing Calibration Correction CoT-SC (Wang et al., 2022) ✗ Fixed K ✗ ✗ ✗ ToT (Yao et al., 2024) ✗ Fixed K ✗ ✗ ✗ Reflexion (Shinn et al., 2024) ✗ ✗ ✗ ✗ Restart Self-Refine (Madaan et al., 2024) ✗ ✗ ✗ ✗ Local AFlow (Zhang et al., 2024) ✗ Offline ✗ ✗ ✗ MermaidFlow (Zheng and others, 2025) ✗ ✗ ✗ ✗ ✗ JudgeFlow (Ma et al., 2026) ✗ Offline Offline ✗ ✗ DenoiseFlow ✓ Online ✓ ✓ ✓ Table 15. Capability comparison with related methods. Each column represents a key requirement for reliable workflow execution (§2). DenoiseFlow is the only method that addresses all five within a unified closed-loop architecture. Appendix L Complexity Analysis We analyze the computational overhead of DenoiseFlow relative to the budget C. Let N be the sample size for semantic anchoring, L be the workflow length, and KmaxK_ be the maximum branching factor. Stage 1 (Sensing) Overhead. The Sensing stage incurs O(N)O(N) inference cost per step for Monte Carlo sampling, which is parallelizable via batch decoding. Embedding computation for clustering is O(N⋅d)O(N· d) where d is the embedding dimension. The semantic entropy computation is O(N2)O(N^2) for pairwise similarity, but since N is small (typically 5), this is negligible. Stage 2 (Regulating) Overhead. In the worst case (all tasks in branching regime), the complexity grows to O(L⋅Kmax)O(L· K_ ). However, thanks to our confidence-based routing (Eq. 9), the empirical strategy distribution is typically skewed toward Branch: across datasets, Direct accounts for 0.8–40.7% of problems (highest on MBPP where many problems are straightforward), Branch accounts for 59.3–99.2%, and 0–12.6% ultimately trigger Stage 3 refinement (Table 9). The effective average cost is significantly lower than the worst case. Stage 3 (Correcting) Overhead. Discrete gradient tracing operates on the dependency graph G with O(|V|+|E|)O(|V|+|E|) complexity, where |V||V| is the number of workflow steps and |E||E| is the edge count. This is negligible compared to LLM inference. Rollback and re-execution incur additional LLM calls proportional to the distance from root cause k∗k^* to the failure point. Online Calibration Overhead. Temperature updates occur every Δ observations (default Δ=20 =20), requiring only O(1)O(1) operations per update. This overhead is negligible. Summary. DenoiseFlow improves reliability with manageable marginal cost. The total cost remains within linear bounds of the optimal path length in most successful trajectories. Table 16 summarizes the per-stage complexity. Stage Time Complexity Dominant Cost Sensing O(N)O(N) per step LLM inference Regulating O(Kt)O(K_t) per step LLM inference Correcting O(|V|+|E|)O(|V|+|E|) Graph traversal Calibration O(1)O(1) per update Arithmetic Table 16. Per-stage computational complexity. Appendix M Theoretical Analysis We provide theoretical justification for key components of DenoiseFlow. M.1. Uncertainty Propagation Bound Proposition M.1 (Propagation Bound). Under the Noisy MDP formulation with dual-channel risk propagation (Eq. 5), the accumulated divergence proxy u~T u_T after T steps is bounded by: (19) u~T≤∑t=1Tϵt⋅∏k=tT−1(1+λ⋅wmax+β⋅w¯) u_T≤ _t=1^T _t· _k=t^T-1(1+λ· w_ +β· w) where ϵt _t is the local noise at step t, wmax=maxk,twktw_ = _k,tw_kt is the maximum coupling coefficient, w¯ w is the average coupling, and λ,βλ,β are the channel weights. Proof. We prove by induction on the number of steps T. Base case (T=1T=1): By definition, u~1=ϵ1 u_1= _1, and the bound holds trivially since the product over an empty range equals 1. Inductive step: Assume the bound holds for T−1T-1 steps. From the propagation recurrence (Eq. 5): (20) u~T=ϵT+λ∑k<TwkTu~k+β⋅w¯⋅u¯<T u_T= _T+λ _k<Tw_kT u_k+β· w· u_<T where u¯<T=1T−1∑k<Tu~k u_<T= 1T-1 _k<T u_k. Applying the inductive hypothesis to each u~k u_k: (21) u~T u_T ≤ϵT+λ⋅wmax∑k<Tu~k+β⋅w¯⋅u¯<T ≤ _T+λ· w_ _k<T u_k+β· w· u_<T (22) ≤ϵT+(λ⋅wmax+β⋅w¯)∑k=1T−1u~k ≤ _T+(λ· w_ +β· w) _k=1^T-1 u_k (23) ≤ϵT+(λ⋅wmax+β⋅w¯)∑k=1T−1(∑t=1kϵt∏j=tk−1α) ≤ _T+(λ· w_ +β· w) _k=1^T-1 ( _t=1^k _t _j=t^k-1α ) where α=1+λ⋅wmax+β⋅w¯α=1+λ· w_ +β· w. Rearranging the double sum and factoring: (24) u~T≤∑t=1Tϵt⋅∏k=tT−1α u_T≤ _t=1^T _t· _k=t^T-1α which completes the induction. ∎ Implication. This bound shows that errors at early steps (t small) have exponentially higher impact due to the product term. Our adaptive branching allocates more resources to high-uncertainty early steps, effectively reducing ϵt _t where it matters most. M.2. Empirical Observations on System Behavior Beyond the formal propagation bound, we observe two important empirical properties of DenoiseFlow: Remark 1 (Temperature Adaptation). The online calibration temperature T(n)T^(n) adapts to task difficulty: when low-uncertainty problems frequently fail, T increases to raise uncertainty estimates; when high-uncertainty problems frequently pass, T decreases. This self-correcting behavior enables domain adaptation without manual tuning, as evidenced by the ablation study (Table 2) showing that disabling online calibration reduces accuracy by 0.2–4.7% across datasets, with the largest impact on code generation (MBPP: −-4.65%). Remark 2 (Root-Cause Localization). The influence-based localization heuristic (Eq. 11) successfully identifies root causes when (i) the true root cause has high uncertainty relative to other nodes, and (i) it has strong influence on the failure. Empirically, we observe 33–44% recovery rates when Stage 3 is triggered (Table 10), validating the effectiveness of prioritizing upstream high-uncertainty nodes for correction.