Source-linked AI summary
Dynamic Speculative Agent Planning
Yilin Guan, Qingfeng Lan, Sun Fei, Dujian Ding, Devang Acharya, Chi Wang, William Yang Wang, Wenyue Hua
TL;DR
LLM-based agents face latency that limits user experience and time-sensitive deployment, while existing acceleration methods have gaps in losslessness, preparation, and user control. DSP uses online reinforcement learning to adapt speculation steps and provide user control over latency-cost trade-offs. Across two standard agent benchmarks, it reports comparable efficiency to the fastest lossless methods with reduced total and unnecessary costs.
Problem
LLM-agent latency degrades user experience and limits time-sensitive deployment, while acceleration approaches can lack lossless guarantees, require pre-deployment preparation, or offer little user control.
Source: §1 · p. 1Method
DSP combines speculative planning with online reinforcement learning to adapt speculation steps and provides mechanisms for user control of the latency-cost balance.
Source: §1 · p. 2Results
Across two standard agent benchmarks, DSP reports comparable efficiency to the fastest lossless acceleration methods, reducing total cost by up to 30% and unnecessary cost by 60%.
Source: §1 · p. 2, §7 · p. 17Takeaways & Limitations
DSP’s user-controllable parameters calibrate latency-cost trade-offs while maintaining acceleration benefits and reducing redundant computational overhead.
Source: §7 · p. 17The concurrency estimate assumes target-agent calls are long-running enough that speculative calls overlap, making average k a proxy for sustained concurrency.
Source: §5 · p. 10
Abstract
from arXiv · showhide
Despite their remarkable success in complex tasks propelling widespread adoption, large language-model-based agents still face critical deployment challenges due to prohibitive latency and inference costs. While recent work has explored various methods to accelerate inference, existing approaches suffer from significant limitations: they either fail to preserve performance fidelity, require extensive offline training of router modules, or incur excessive operational costs. Moreover, they provide minimal user control over the tradeoff between acceleration and other performance metrics. To address these gaps, we introduce Dynamic Speculative Planning (DSP), an asynchronous online reinforcement learning framework that provides lossless acceleration with substantially reduced costs without requiring additional pre-deployment preparation. DSP explicitly optimizes a joint objective balancing end-to-end latency against dollar cost, allowing practitioners to adjust a single parameter that steers the system toward faster responses, cheaper operation, or any point along this continuum. Experiments on two standard agent benchmarks demonstrate that DSP achieves comparable efficiency to the fastest lossless acceleration method while reducing total cost by 30% and unnecessary cost up to 60%. Our code and data are available through https://github.com/guanyilin428/Dynamic-Speculative-Planning.
1 Introduction
LLM-based agents face substantial latency that limits user experience and time-sensitive deployment, while existing acceleration approaches leave gaps in losslessness, deployment preparation, and user control. DSP uses online adaptive speculation to balance latency and cost, and its evaluation reports comparable efficiency to the fastest lossless methods with reduced costs.
1 Introduction
- Latency degrades user experience and limits agent deployment in time-sensitive settings such as real-time decision support and interactive tutoring.The introduction describes latency as a reported challenge across deployed LLM-based agents.Source: §1 · p. 1
- Existing acceleration methods may lack lossless guarantees, require pre-deployment module training, or offer little user control over efficiency trade-offs.The cited examples include router training, prompt engineering, and learning to generate parallelizable steps.Source: §1 · pp. 1–2
- DSP is a lossless, user-controllable agent-planning acceleration framework that requires no pre-deployment preparation.It applies a speculative strategy to preserve agentic performance.Source: §1 · p. 2
- Fixed speculation steps can waste calls on complex tasks or under-accelerate simpler ones because the optimal step depends on context and is unknown in advance.The paper studies the latency-cost Pareto frontier to determine the optimal cost for a given latency-reduction target.Source: §1 · p. 2
- Online reinforcement learning updates a lightweight speculation-step predictor as tasks are processed, without external datasets, preprocessing, or a dedicated pre-deployment phase.The system learns organically while processing tasks.Source: §1 · p. 2
- Biased step prediction and an unbiased step with biased offset let practitioners calibrate operation from low-cost, low-speed to high-cost, high-speed.The controls address differing organizational priorities and changing pricing and inference speeds.Source: §1 · p. 2
- Up to 30% lower total cost and 60% less unnecessary cost accompany comparable efficiency to the fastest lossless acceleration methods across two standard agent benchmarks.The reported comparison also preserves comparable acceleration.Source: §1 · p. 2
2 Related Work
Prior work addresses agent latency through faster models, shorter prompts, and parallelized planning, but the approaches leave trade-offs in performance guarantees, preparation, computational cost, and user control. Speculative planning adapts speculative execution to agent plans, while fixed speculation steps remain a limitation.
2 Related Work
- Extended agent inference times have been reported as unsuitable for highly interactive applications, including gaming (Liu et al. 2023a).Other examples include 24-hour processing windows for o1-based engineering tasks and latency effects in virtual reality (Jaech et al. 2024).Source: §2 · p. 2
- System 1.x substitutes smaller models for straightforward subtasks, EcoAct omits irrelevant tool descriptions, and ISP parallelizes action generation and verification (Zhang et al. 2024b; Hua et al. 2024).These approaches target different sources of agent latency.Source: §2 · p. 2
- Prior approaches can compromise performance guarantees, require extensive pre-deployment preparation, or incur high computational costs without controls for latency trade-offs.The paper positions its speculative framework as addressing this combined gap.Source: §2 · p. 3
- Speculative planning adapts draft-and-verify execution to agents: an approximation agent proposes steps while a target agent verifies them asynchronously, committing aligned actions and correcting divergences.The verification mechanism keeps the final execution path aligned with the target agent’s policy.Source: §2 · p. 3
- ISP preserves planning performance with a plug-and-play approach, but its fixed speculation step can cause excessive costs or insufficient acceleration.DSP addresses this limitation with online reinforcement learning and user-controllable latency-cost settings.Source: §2 · p. 3
3 Why is Speculative Planning Expensive?
Fixed speculation steps create a cost-acceleration trade-off, while optimal speculation varies across trajectories, even within one task. Mismatches waste approximation- and target-agent tokens, motivating adaptive step selection and user-controlled efficiency settings.
Speculative Planning
- Speculative planning parallelizes candidate actions and target verification, committing aligned actions and continuing from the target’s correction after divergence.The parallel process reduces end-to-end latency compared with traditional autoregressive planning while keeping the execution path aligned with the target policy.Source: §3 · pp. 3–4
Implications for Dynamic Speculative Planning
- A small fixed k limits acceleration, while a large k increases speedup but wastes computation when mismatches invalidate speculative steps.The section identifies an inherent tension because no single k is optimal throughout a plan.Source: Figure 2 · p. 4, §3 · p. 5
Speculative Planning Cost Broken-Down
- Approximation-agent waste rises when k exceeds the number of correct sequential steps; in direct-generation A with CoT T, A’s waste is mainly prompt tokens.Long environment, task, and trajectory prompts outweigh moderate generation lengths in this configuration.Source: §3 · p. 4
- A mismatch wastes completed target steps and can cancel ongoing calls after they have consumed prompt tokens or generated partial outputs.Larger k launches more target steps ahead of validation, increasing potential waste when mismatches occur.Source: §3 · p. 4
- Figure 3 breaks token costs into approximation- and target-agent prompt and generation tokens across two OpenAGI configurations; higher fixed k yields substantially greater total token costs.The configurations are Direct A with ReAct T, and CoT A with Multi-Agent Debate T.Source: §3 · p. 4, Figure 3 · p. 5
Variation of Optimal k
- Across 312 OpenAGI tasks, average maximum optimal k was 3.53, average minimum was 1.60, mean variance was 1.46, and average range was 1.93.Optimal k is the number of speculative steps up to the first mismatch, achieving maximal speedup without invalid tokens.Source: §3 · p. 5
Implications for Dynamic Speculative Planning
- Configurable latency-cost settings accommodate deployments that prioritize rapid responses or cost-efficient moderate acceleration, such as batch processing.The preferred balance varies with pricing structures and organizational priorities.Source: §3 · p. 5
4 Dynamic Speculative Planning with User Controllability
DSP learns speculative-step predictions online from task trajectories and updates them asynchronously while planning continues. Its prediction bias provides user control over the latency–cost trade-off.
4 Dynamic Speculative Planning with User Controllability
- DSP collects trajectory-and-step training pairs during execution and asynchronously trains a lightweight predictor, using the latest checkpoint without blocking planning.The predictor is described as a DistilBERT-based regressor; online learning begins reducing expenses as new data arrive rather than waiting for an offline dataset.Source: §4 · pp. 5–6
4.1 Speculative-Step Control as Value Predictions
- The method models speculative-step prediction as online state-value learning, with speculative steps as actions and episodes ending at an approximation–target mismatch.The reward design makes the return correspond to the predicted speculative step, and the learned state-value function can predict that step without waiting for the slower target agent.Source: §4.1 · p. 6
4.2 Multi-Thread Online Learning
- Prediction and training run asynchronously alongside planning, hiding predictor latency and allowing updated weights to reach the inference model after training.A separate training predictor is updated while an inference predictor serves runtime requests.Source: §4.2 · pp. 6–7
4.3 Controlling the Cost-Latency Trade-Off
- Users can steer latency and cost by biasing predicted steps through expectile regression or an inference-time offset.Higher expectiles favor faster execution at higher cost, while lower expectiles favor lower cost at increased latency; positive offsets make speculation more aggressive and negative offsets more conservative.Source: §4.3 · p. 7
5 Main Experiment
The evaluation uses OpenAGI and TravelPlanner and compares dynamic speculative planning with fixed-step baselines across efficiency, resource use, and concurrency measures. The supplied passages describe the setup and metrics, but do not report comparative results.
5 Main Experiment
- The evaluation covers 312 multi-step OpenAGI tasks and 180 TravelPlanner tasks, comparing DSP with selected baselines.OpenAGI focuses on complex vision-and-language decision-making, while TravelPlanner targets travel-planning scenarios.Source: §5 · p. 7
- Fixed-step speculative planning uses k values of 2, 4, and 6, while DSP is tested with Direct-Generation, CoT, ReAct, and MAD configurations.The fixed-step settings are selected independently of environment characteristics and task requirements.Source: §5 · p. 8
5.1 Evaluation Metrics
- Evaluation metrics cover latency reduction, resource overhead, and concurrency, reporting relative changes versus sequential planning and absolute ratios versus fixed k = 2.The reported measures include latency, prompt tokens, generation tokens, monetary cost, peak concurrency, and average predicted step length.Source: §5.1 · p. 8
- Fixed k = 2 is the reference baseline, described as typically yielding 15%-25% latency reduction against sequential planning with low token overhead on OpenAGI.The passage identifies it as the minimal non-trivial setting for meaningful acceleration with minimal resource cost.Source: §5.1 · p. 8
1. Time Decrease (∆T)
The section measures speculative planning’s time savings against sequential planning and clarifies how to interpret the sign of the result.
1. Time Decrease (∆T)
- Time savings are calculated for each task by comparing completion time under speculative planning with completion time under sequential planning.The passage names the two completion times but does not provide the full formula in the supplied text.Source: §1 · p. 8
- Positive time-saving values indicate that speculative planning reduces completion time.Source: §1 · p. 8
- Token increase is measured beyond a baseline that includes sequential planning costs for both the target and approximation agents.The passage characterizes this excess as overhead from speculative failures, while noting that the baseline is required even with perfect speculative accuracy.Source: §2 · p. 8
2. Cost and Token Increase
The cost metrics distinguish prompt and generation token overhead and compare speculative planning against sequential planning, accounting for differing token prices.
2. Cost and Token Increase
- Prompt and generation costs are evaluated separately because their per-token prices can differ, with a combined total-cost increase also reported.Source: §2 · p. 8
- Prompt-token increase measures redundant prompt use under speculative planning relative to sequential execution of target and approximation prompts.Source: §2 · pp. 8–9
- Generation-token increase captures extra generation caused by incorrect speculation, relative to target and approximation generation under sequential execution.Source: §2 · p. 9
- Total cost increase compares speculative and sequential planning using prompt and generation token counts weighted by their respective API costs.The cost breakdown defines separate prompt and generation prices for approximation and target APIs.Source: §2 · p. 9
3. Absolute Time Ratio (T(×))
The absolute time ratio compares time in the current configuration with the baseline configuration, fixed at k = 2.
4. Absolute Cost and Token Ratio
The metric compares absolute token usage and cost in the current configuration with those in the baseline configuration, fixed at k = 2.
5. Concurrency Dynamics
DSP’s dynamic policies achieve cost-effective acceleration over fixed-k baselines while offering adjustable latency-cost operating points. The section also characterizes concurrency through peak API-call overlap and average speculative step, and compares two ways to bias speculation.
5. Concurrency Dynamics
- Average Max Concurrent API Calls (MC) measures each task’s peak overlapping requests, while Average Speculative Step (K) proxies sustained concurrency because long-running target computations tend to overlap speculative calls.K averages speculative steps across episodes; MC indicates peak parallelism and whether concurrency constraints are respected.Source: §5 · p. 10
5.2.1 Cost-Efficiency Dominance
- In OpenAGI setting 2, Dyn. (τ = 0.5) provides 8% better latency reduction while consuming 5% less cost than Fix (k = 2).Other reported comparisons include lower cost at comparable latency and faster execution at similar cost.Source: §5.2.1 · pp. 10–11, Table 2 · p. 11
5.2 Main Experiment Result
- DSP consistently outperforms fixed-k baselines in cost-effective acceleration across evaluated settings, benchmarks, and agent configurations.The experiments report strict computational-cost improvements for equal or lower latency relative to static speculation policies.Source: §5.2 · p. 10, Table 1 · p. 10, §5.2.1 · pp. 11–12
5.2.2 Actual Performance
- In OpenAGI setting 1, Dyn. (offset = 2) achieves time reduction comparable to Fix (k = 6), the fastest fixed configuration, while reducing redundant cost by 60.65%.In settings 2 and 3, Dyn. (offset = 2) matches or achieves comparable time savings to the fastest fixed configuration, reducing redundant cost by 53.13% and 50.95%, respectively.Source: §5.2.2 · p. 12
- On Travel Planner, Dyn. (τ = 0.99) achieves similar latency while reducing redundant cost by 28.26% versus Fix (k = 4) and 41.37% versus Fix (k = 2).In setting 1, Dyn. (τ = 0.8) is slightly faster than Fix (k = 2) while reducing redundant cost by 16.28%.Source: §5.2.2 · p. 12, Table 6 · p. 12
- The fastest dynamic configurations use 40% lower sustained system pressure (K) than Fix (k = 6) at comparable latency, and all dynamic variants keep MC below 6.Source: §5.2.2 · p. 13
5.3 Tunable trade-off control
- Tuning τ alone selects high-performance, balanced, or economy operation, spanning a latency-token-cost continuum without changing the algorithm.High-performance settings retain over 90% of the fastest setting’s time savings while saving 30% total cost; balanced settings achieve over 80% of latency reduction while averaging half the total cost of the fastest setting.Source: §5.3 · p. 13
5.4 Biased k Prediction v.s. k with Biased Offset
- Expectile-regression bias offers finer control at intermediate efficiency-cost points, while inference-time offsets are simpler to adjust and work at discrete operating points.Moderate τ settings (0.8, 0.9) produce acceleration profiles that integer offsets do not precisely match; offset = 2 reaches 97% acceleration of optimal fixed k = 6 while saving up to 28% cost.Source: §5.4 · p. 13
6 Performance Analysis
The performance analysis tracks online warmup and predictor learning, compares TD-based reinforcement learning with supervised and non-contextual alternatives, and examines DSP’s cost tradeoffs. Across these analyses, it reports learning stability and efficiency gains under different settings.
6.1 Online Warmup
- Warmup took around 3–5 tasks with GPT-4.1-mini and approximately 8–10 tasks with DeepSeek-series models.The paper attributes the difference to API response times and the resulting pace of collecting enough training data.Source: §6.1 · p. 14
6.2 Predictor Accuracy over Online Training
- Across settings, predictor mean accuracy reached 0.70–0.76 in tasks 200–300 as variance fell, with no evidence of later drift or instability.The reported trend is consistent with online updates improving generalization to unseen tasks.Source: §6.2 · p. 14, Figure 5 · p. 15, Table 8 · p. 15
6.3 Supervised vs. Reinforcement Learning for Speculative Step Prediction
- Dyn. (SFT) consistently underperformed Dyn. (τ=0.5) in latency reduction and accuracy, despite similar or lower token-cost savings.In most cases, SFT was slower than the fixed k=2 baseline; the authors attribute its conservative predictions to noisy rollout-derived labels and regression averaging.Source: §6.3 · p. 15, Table 9 · p. 16
6.4 Evaluation on Non-Contextual Dynamic Heuristics
- In Direct-ReAct with GPT, BO matched DSP (τ=0.5) in latency reduction but incurred 10% higher total cost; at τ=0.8, it matched token cost yet delivered significantly less acceleration.Source: §6.4 · p. 16
6.5 DSP Cost Broken-Down
- At τ=0.5, DSP reduced average redundant tokens from +10,748.3 to +672.2 (setting 1) and +20,424.0 to +8,508.7 (setting 2) versus fixed k=2.The paper describes this as around a 71% reduction in redundant token consumption.Source: §6.5 · p. 16, Table 11 · p. 17
- At τ=0.99, DSP reduced average total token consumption from +52,664.6 to +14,452.6 (setting 1) and +96,927.3 to +50,977.8 (setting 2) versus fixed k=6.The paper reports around a 50% reduction in redundant token consumption and says τ provides fine-grained efficiency-cost control.Source: §6.5 · p. 17, Table 11 · p. 17
7 Conclusion
The conclusion presents DSP as a lightweight online reinforcement-learning approach to fixed-step speculative execution that requires no pre-deployment preparation. Its evaluation reports reduced overhead and cost while retaining acceleration and user control over latency-cost tradeoffs.
7 Conclusion
- DSP reduced redundant computational overhead by up to 60% and overall cost by 30% while maintaining acceleration benefits.User-controllable parameters calibrate latency-cost tradeoffs.Source: §7 · p. 17