Source-linked AI summary
Dream2Discern: Learning from Hard Latent Variants for Runtime Failure Prediction in Multi-Agent Systems
Boxuan Zhang, jianing Zhu, Xiaotian Han, Ruixiang Tang
TL;DR
Runtime auditors face limited verified trajectory corpora, and broader failure coverage alone does not identify the current auditor’s hard cases. Dream2Discern creates loss-guided latent variants and trains on them with recorded outcomes; evaluations report improved prediction on AFTraj-2K and StepShield while retaining an accuracy–timeliness trade-off.
Problem
Existing auditors rely on limited verified trajectories, while broader failure coverage alone does not identify prefixes that the current auditor finds difficult to classify.
Source: §1 · pp. 1–2Method
Dream2Discern alternates loss-guided perturbations of representation operators to create hard latent variants with training on those variants using recorded outcome labels.
Source: RESEARCH QUESTION · p. 3Results
Dream2Discern improves runtime failure prediction across AFTraj-2K and StepShield, outperforming competitive auditors while maintaining an accuracy–timeliness trade-off.
Source: §4.2 · p. 9, §4.3 · p. 9, §6 · p. 12Takeaways & Limitations
Targeting the auditor’s current prediction difficulties supports improved learning from a fixed trajectory corpus.
Source: §6 · p. 12Auditor predictions can be incorrect and do not certify safe execution or prevent harmful actions; deployment should retain task-specific safeguards and human oversight.
Source: Ethics Statement · p. 13
Abstract
from arXiv · showhide
Reliable deployment of LLM-based multi-agent systems calls for runtime auditors that predict terminal outcomes from observed execution prefixes. These auditors typically learn from a limited corpus of trajectories with verified outcomes. Expanding this corpus requires costly execution and verification, yet broader failure coverage alone provides no explicit criterion for identifying prefixes that the current auditor finds difficult to classify. To this end, we propose Dream2Discern, a runtime auditor trained through implicit augmentation guided by its own prediction loss. During Dream, we select perturbations of the auditor's representation operators to increase prediction loss on recorded prefixes, yielding hard latent variants. During Discern, the auditor learns to predict execution outcomes from these variants using the original labels. The variants are regenerated as the auditor learns, turning a limited corpus into a renewable source of hard examples and requiring no additional trajectory collection or outcome verification. Extensive evaluations on AFTraj-2K and StepShield show that Dream2Discern outperforms competitive failure auditors and achieves over 90% trajectory-level weighted accuracy on both benchmarks while balancing prediction accuracy and timeliness. Project page: https://zbox1005.github.io/dream2discern-project/
1 Introduction
Existing runtime auditors rely on limited verified trajectories, while broader coverage does not identify which prefixes the current auditor finds difficult. Dream2Discern uses loss-guided latent variants, and evaluations report strong failure-prediction performance across both benchmarks.
1 Introduction
- Collecting verified trajectories is costly, editing can invalidate outcome labels, and broader failure coverage alone does not identify prefixes the current auditor finds difficult.The motivating question is whether those hard cases can be identified and exploited without acquiring additional labeled trajectories.Source: §1 · pp. 1–2, RESEARCH QUESTION · p. 2
RESEARCH QUESTION
- Over 90% trajectory-level weighted accuracy (wACC) on both benchmarks, with up to 11.11% wACC above the strongest auditor baseline.The method also maintains an accuracy–timeliness trade-off, and the reported gains extend to Llama backbones.Source: RESEARCH QUESTION · pp. 2–3
- Loss-guided variants improve outcome discrimination over training without perturbations or with random perturbations, with improved prediction performance reported across model families.The evaluations cover AFTraj-2K and StepShield.Source: RESEARCH QUESTION · p. 3
- Under a fixed training budget, augmenting the corpus with edited prefixes does not improve held-out prediction.This motivates constructing variants tailored to the current auditor instead.Source: RESEARCH QUESTION · p. 3
- Dream2Discern alternates between loss-guided operator perturbations that construct hard latent variants and outcome-supervised learning from those variants using recorded labels.The perturbations target the auditor’s representation computation, and the variants evolve as training alternates between Dream and Discern.Source: RESEARCH QUESTION · p. 3
2 Problem Formulation
The formulation represents each completed multi-agent execution as a labeled trajectory and asks an auditor to predict its terminal outcome from prefixes observed before completion. Training pairs prefix-derived inputs with trajectory outcomes and optimizes prediction loss over selected batches.
2 Problem Formulation
- A trajectory comprises an initial context and interaction records, with terminal outcome Y_i=1 for failure and Y_i=0 for success.Each record identifies its source and contains an associated message, action, or observation.Source: §2 · p. 3
- At each nonterminal step, the auditor predicts the terminal outcome from the observed prefix; future interactions, realized trajectory length, and outcome are unavailable.The prefix includes the initial context and interaction records through the current step.Source: §2 · p. 3
- The trainable auditor maps prefix-derived input X_i,t to a scalar failure score, which is thresholded into a binary prediction.The decision rule is specified separately in Section 3.4.Source: §2 · p. 3
- Training pairs each selected recorded prefix with its trajectory’s terminal outcome and defines mean binary cross-entropy over indexed batches.The indexed prefix input is X_q and its target is Y_q.Source: §2 · p. 3
3 Method
Dream2Discern alternates construction of hard latent variants and auditor training, then converts prefix scores into runtime decisions.
3.1 Motivation
- 85.7% of verified continuations from failed source trajectories succeeded, so edited histories could not retain source labels without re-verification.Acquiring new trajectories also required rollout and verification time that averaged tens of seconds per trajectory.Source: §3.1 · p. 4
- Under the tested budget, +Edited had higher held-out class-balanced BCE than Original, while a training-selected Dream perturbation raised loss with the Original head fixed.The original and edited prefix representations also substantially overlapped in a shared PCA projection.Source: §3.1 · p. 4, Figure 2 · p. 4
3.2 Dream: Constructing Hard Latent Variants
- Dream forms class-balanced batches and searches shared, bounded, low-rank query/value perturbations that raise prediction loss while keeping prefix inputs and labels unchanged.The perturbation budget uses a global relative radius and a rank cap for each projection.Source: §3.2 · p. 5
- Dream approximates the loss-increasing direction with rank-r scaled gradients, then halves candidate perturbations until batch loss strictly rises or returns zero.Each batch starts a fresh search from zero rather than carrying perturbations across batches.Source: §3.2 · p. 6
3.3 Discern: Learning from Hard Latent Variants
- Discern holds the selected perturbation fixed and updates LoRA adapters and the classification head to minimize loss on perturbed representations using recorded outcomes.The pretrained weights remain frozen, and a zero Dream perturbation falls back to the unperturbed batch loss.Source: §3.3 · pp. 6–7
3.4 Runtime Auditing
- At runtime, perturbations are discarded; each nonterminal prefix is scored in one forward pass and compared with offline-fitted, step-dependent thresholds.The thresholds are calibrated from successful trajectories in the training partition and remain fixed at runtime.Source: §3.4 · p. 7
4 Experiments
Dream2Discern is evaluated against auditor and LLM-judge baselines on AFTraj-2K and StepShield, then analyzed through perturbation ablations, accuracy–timeliness comparisons, mechanism tests, and a held-out case study. The results report stronger auditor performance, including across Llama backbones, and examine how loss-guided variants relate to prediction difficulty.
4.1 Experimental Setups
- Evaluations use in-domain AFTraj-2K and template-level out-of-domain StepShield, comparing LLM judges, token-uncertainty methods, and learned failure auditors with trajectory-level metrics.Reported metrics include AUROC, FPR95, weighted accuracy, and time-weighted accuracy; fitted thresholds use nominal α=0.05 except for proprietary judges.Source: §4.1 · pp. 7–8
4.2 Main Experiments
- Dream2Discern leads all four metrics on AFTraj-2K and leads weighted and time-weighted accuracy on StepShield; it also beats competitive auditor baselines across four metrics on both backbones.Its weighted-accuracy advantage is larger on out-of-domain StepShield than on in-domain AFTraj-2K.Source: Table 1 · p. 8, §4.2 · pp. 8–9
- On Llama backbones, Dream2Discern achieves the highest weighted accuracy on both benchmarks at both model sizes and leads all three reported AFTraj-2K metrics.The authors report this as evidence that the training strategy applies across model families.Source: Table 2 · p. 9, §4.2 · p. 9
4.3 Ablation and Further Analysis
- Dream achieves the highest AUROC in all four perturbation-ablation settings and improves weighted and time-weighted accuracy over random perturbations in most settings.The comparison includes training without perturbations and training with random low-rank perturbations.Source: Table 3 · p. 9, §4.3 · p. 9
- On AFTraj-2K, Dream2Discern achieves higher weighted accuracy when early detection is prioritized; on StepShield, gains span a broad range of accuracy–timeliness operating points.Figure 4 varies the nominal false-alarm level α from 0.01 to 1.00 and plots weighted accuracy against mean normalized detection time.Source: §4.3 · p. 9, Figure 4 · p. 10
4.4 Mechanism Analysis
- Dream perturbations increase batch loss on every tested batch, unlike random perturbations clustered near zero; held-out error rates also rise across groups ordered by Dream sensitivity.The batch test samples 50 batches of 32 AFTraj-2K training prefixes; the sensitivity analysis groups held-out prefixes into five equal-sized groups.Source: §4.4 · p. 10, Figure 5 · p. 10
4.5 Case Study
- In a held-out coding trajectory, Dream2Discern predicts failure at the ground-truth error step, two interactions before the environment reports TEST_FAILED.Dream perturbation sensitivity peaks at the error step, while the unperturbed auditor first predicts failure only after the test failure is reported.Source: Figure 6 · p. 10, §4.5 · pp. 10–11
5 Related Work
Related work covers agentic systems, failure analysis, and runtime failure prediction. Dream2Discern is positioned as complementary: it targets an auditor’s current prediction difficulties without expanding its trajectory corpus.
LLM-based agentic systems
- Agent frameworks coordinate specialized roles and communication, while other work studies memory and reliability over deployed lifespans.The section situates runtime outcome prediction within work on systems including AutoGen, MetaGPT, CAMEL, GPTSwarm, and Magentic-One.Source: §5 · p. 11
Failure analysis for LLM agents
- Failure-analysis research diagnoses errors, attributes decisive steps, or supports recovery, whereas runtime prediction estimates terminal outcomes before execution ends.Examples include MAST, Who&When, AgenTracer, AgentDebug, and OAT.Source: §5 · p. 11
Runtime failure prediction
- Runtime auditors estimate outcomes from partial histories; Dream2Discern complements prior auditors by targeting current prediction difficulties with loss-guided latent variants and original labels.The approach requires no additional trajectory collection or outcome verification.Source: §5 · p. 11
6 Conclusion
Dream2Discern addresses the difficulty of identifying an auditor’s hard cases by using prediction loss to construct latent variants of recorded prefixes. Evaluations report improved runtime failure prediction across benchmarks and model families.
6 Conclusion
- Dream2Discern uses loss-guided operator perturbations to create hard latent variants, trains on them with original outcome labels, and runs without perturbations at inference.The conclusion reports improved runtime failure prediction on AFTraj-2K and StepShield across model families.Source: §6 · p. 12
AI Use Statement
The authors led the research, method development, experiments, and manuscript preparation. Generative AI supported methodological and experimental choices, mathematical formulation, proof development, implementation, data analysis, and drafting or editing; the authors reviewed the assisted work and take responsibility for the submission.
AI Use Statement
- The authors report reviewing and revising AI-assisted material against implementation and recorded results, making final scientific and editorial decisions, and taking responsibility for the submission.LLM use for trajectory editing, outcome checks, and baseline judgments is documented in Appendices D.1.1 and C.4.Source: AI Use Statement · p. 13
Ethics Statement
The work studies runtime failure prediction on existing agent-trajectory benchmarks to support reliable deployment, while emphasizing that auditor predictions do not certify safe execution.
Ethics Statement
- Auditor predictions can be incorrect and do not certify safe execution or prevent harmful actions.Deployment should retain task-specific safeguards and human oversight, and protect sensitive information in execution histories supplied to the auditor.Source: Ethics Statement · p. 13
A.1 Training Algorithm and Solver Details
Dream2Discern alternates between selecting shared representation-operator perturbations that raise batch loss and training the auditor on accepted variants. Runtime thresholds are calibrated from trajectory-level maxima of nonterminal-prefix scores.
A.1 Training Algorithm and Solver Details
- Each batch starts from zero perturbation; the solver takes a normalized gradient step, truncates by SVD, projects radially, then accepts the first tested scale that raises measured batch loss or returns zero.The outer update holds the returned perturbation fixed, updates only persistent adapters and the prediction head, and saves the auditor for runtime with no perturbation.Source: §A.1 · p. 17
- Shared query/value operator perturbations couple latent changes across tokens and prefixes, creating rank-limited hard variants under a fixed prediction head.The changes depend on incoming states and local output directions.Source: §A.1 · p. 18
A.2 Runtime Threshold Calibration
- Calibration scores every nonterminal prefix from selected successful training trajectories, then uses stepwise reference distributions and trajectory maxima to set fixed runtime thresholds.The reference distribution at later steps carries forward the last step with at least 20 calibration scores; the nominal α is not a finite-sample false-alarm guarantee.Source: §A.2 · p. 18
B.1 Proof of Proposition 1
- The proposition’s proof rescales perturbation blocks by their projection weights, uses rank-constrained singular-value bounds, and constructs a feasible perturbation attaining the resulting upper bound.When the retained-gradient norm is zero, the bound is attained by the zero perturbation.Source: §B.1 · pp. 18–19
B.2 Proof of Proposition 2
The solver’s accepted perturbation lies on the candidate segment and is controlled by a remainder bound; the evaluation uses benchmark-specific trajectory partitions and annotation-guided prefix sampling.
B.2 Proof of Proposition 2
- A sufficient condition, β∥V_B∥ω < 2g_r, guarantees a strictly positive loss increase and acceptance of the full candidate in exact arithmetic.If all six tested points are rejected, the solver returns zero even though a smaller untested step may still increase loss.Source: §B.2 · p. 20
C.1 Datasets and Evaluation Partitions
- AFTraj-2K covers mathematical reasoning, coding, and tool tasks, while StepShield evaluation uses paired clean/rogue trajectories; failure is labeled 1 and success 0.The StepShield split has 639 training pairs and 108 test pairs, with pair members kept in the same partition; AFTraj-2K retains its recorded split.Source: §C.1 · p. 20
C.2 Training Prefix Construction
- Training prefixes are selected offline from completed trajectories using failure decisive-step annotations, success-start sampling, and balancing by ending step, offset, and terminal status.Annotations guide prefix selection but are excluded from auditor inputs; batches are subsequently class-balanced through the group, trajectory, and prefix hierarchy.Source: §C.2 · p. 20
C.3 Auditor Training and Reporting
The appendices specify auditor training and evaluation choices, and report diagnostics on edited trajectories and loss under latent perturbations. In the reported diagnostic, verified edits did not reduce held-out prediction loss, whereas the training-selected perturbation increased it.
C.3 Auditor Training and Reporting
- Dream2Discern uses rank-8 LoRA adapters on query and value projections, last-token readout, and a 2,048-token input budget with first-and-last truncation.For each benchmark and backbone, training includes 100 supervised steps followed by 1,057 Dream/Discern steps on AFTraj-2K or 979 on StepShield; reports average three seeds.Source: §C.3 · p. 21
C.4 Baseline Implementations
- Baseline implementations include open- and closed-source judges, token-uncertainty scores, and learned sequential scorers trained on benchmark-specific observed-prefix features.Closed-source rows use returned labels for binary predictions and represent one recorded evaluation run; token uncertainty is a proxy model’s uncertainty about recorded text.Source: §C.4 · pp. 21–22
C.5 Evaluation Metrics
- Evaluation counts a trajectory as detected when any nonterminal prefix is flagged, measures time at its first such step, and reports AUROC, FPR95, wACC, and TWA.Higher AUROC, wACC, and TWA are better; lower FPR95 is better.Source: §C.5 · pp. 22–23
D.1.1 Trajectory Editing and Outcome Re-verification
- The trajectory-editing diagnostic replays preceding actions, replaces one nonterminal action, and re-verifies outcomes, retaining 326 continuations from 97 sources.Edits were attempted on 128 training-pool mathematical reasoning and coding trajectories; outcome checks used task tests for coding and reference answers with LLM-assisted review for mathematics.Source: §D.1.1 · p. 23
D.1.2 Representation and Learning Diagnostics
- The representation diagnostic compares original-only and original-plus-edited training on 2,820 held-out prefixes, then evaluates a Dream perturbation with the Original head fixed.The loss-plane coordinates vary the head parameters and perturbation scale independently; dashed contours mark measurements beyond the perturbation budget.Source: §D.1.2 · pp. 23–24
- The training-selected Dream perturbation increases held-out loss with the Original head fixed, while adding verified edits does not reduce held-out prediction loss under the fixed budget.The diagnostic evaluates the conditions on the same held-out prefixes and supports constructing hard latent variants beyond the search batch.Source: §D.1.2 · p. 24
D.2 Mechanism Analysis
- The mechanism analyses use fixed seed-0 auditors on AFTraj-2K without updating parameters during measurement.The loss comparison uses the final Qwen3-8B auditor trained with Dream2Discern; sensitivity analysis uses the final Qwen3-4B auditor trained without perturbations.Source: §D.2 · p. 24
D.2.1 Variant Construction
The diagnostic finds that loss-guided Dream perturbations increase batch loss more consistently than random perturbations, and that higher sensitivity is associated with greater held-out prediction error. Further analyses compare perturbation strategies, prefix readouts, perturbation radii, and evaluation scope.
D.2.1 Variant Construction
- 0.0307 median loss increase for Dream versus 6.20 × 10−6 for random perturbations, with Dream higher on all 50 batches.The comparison uses the same operator scope, rank cap, and nominal budget.Source: §D.2.1 · pp. 24–25
D.2.2 Dream Sensitivity
- Weighted error rises from 4.4% in the lowest sensitivity quintile to 51.1% in the highest, with point estimates increasing across all five bins.Perturbations were constructed from training batches, and the sensitivity-error association was measured on held-out prefixes.Source: §D.2.2 · p. 25
D.3.1 Perturbation Strategy
- The perturbation-strategy comparison uses unperturbed, random-perturbation, and Dream-perturbation training variants under shared data, backbone, initialization, and optimizer-step budget.Random perturbations are used directly, while Dream perturbations follow Algorithm 1.Source: §D.3.1 · pp. 25–26
D.3.2 Prefix Readout
- Last-token readout yields higher AUROC in all four comparisons, but wACC and TWA advantages depend on backbone and benchmark.With Qwen3-8B, mean pooling has higher TWA on both benchmarks; Table 7 reports the readout comparisons.Source: §D.3.2 · p. 26, Table 7 · p. 26
D.4 Sensitivity to Perturbation Radius
- Larger perturbation radii do not consistently improve either metric, and the best setting varies across backbones and benchmarks.A radius of 10−2 lowers TWA for both backbones on AFTraj-2K and substantially lowers wACC on StepShield.Source: §D.4 · p. 26, Table 8 · p. 26
E Limitations
- The evaluation covers textual execution histories and binary terminal outcomes; effects of auditor-guided interventions on task success and execution cost require closed-loop experiments.Visual observations and finer-grained outcome categories remain future work.Source: E Limitations · p. 27
Related papers
This paper cites
- AgentForesight: Online Auditing for Early Failure Prediction in Multi-Agent Systems2026
- Uncertainty Quantification in LLM Agents: Foundations, Emerging Challenges, and Opportunities2026
- Hide-and-Seek in Trajectories: Discovering Failure Signals for VLA Runtime Monitoring2026
- Tracing Agentic Failure from the Flow of Success2026
- StepGuard: Learning Step-Level Guardrails with Scalable Supervision and Safety-Utility Balancing2026