AdaTree: Serving-Aware Adaptive Tree Speculative Decoding

AdaTree (arXiv:2611.38572) is a serving-aware plug-in for speculative decoding that dynamically selects optimal token tree size and depth per iteration. By combining temperature-scaled (T=1.2) draft logit acceptance estimation with XGBoost execution-time predictors, AdaTree beats static EAGLE-3 and chain decoding by up to 1.3x (1.26x average) under live serving loads.
AdaTree: Serving-Aware Adaptive Tree Speculative Decoding: AdaTree (arXiv:2611.38572) is a serving-aware plug-in for speculative decoding that dynamically selects optimal token tree size and depth per iteration. By combining temperature-scaled (T=1.2) draft logit acceptance estimation with XGBoost execution-time predictors, AdaTree beats static EAGLE-3 and chain decoding by up to 1.3x (1.26x average) under live serving loads. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.
- Live Load Adaptation: Shrinks verification trees (e.g. size 32 vs static EAGLE-3 size 60) as batch size grows, cutting verification time by 1.3x.
- Calibrated Acceptance Estimator: Applies T=1.2 temperature scaling to draft logits to prevent overconfident deep tree expansion.
- XGBoost Non-Linear Cost Model: Predicts draft (`M_D`) and target (`M_T`) kernel latencies accurately across fluctuating batch sizes.
- Lossless Output Distribution: Preserves exact target-model token verification while delivering 1.26x mean speedup across Spec-Bench, HumanEval, and ShareGPT.
import { createAgent } from '@smoke-monkey/harness';// Connect Smoke Monkey coding loop to a low-latency speculative-decoding serverconst fastCodingAgent = createAgent({agentId: 'adatree-speculative-coder',provider: 'openai-compatible',model: 'meta-llama/Llama-3.1-8B-Instruct',baseUrl: 'http://127.0.0.1:8000/v1',workspacePath: process.cwd(),permissions: {read_file: 'allow',write_file: 'allow',run_command: 'ask',},});async function streamLowLatencyRefactor() {const result = await fastCodingAgent.run('Generate TypeScript Zod validation schemas for all API payloads in src/routes/ and run typecheck.');console.log('Low-latency speculative run:', result.summary);}streamLowLatencyRefactor().catch(console.error);
Watch: Related Video Guides
Faster LLMs: Accelerate Inference with Speculative Decoding
How LLMs Get Faster Without Changing Their Outputs | Speculative Decoding
What Is AdaTree? Solving Static Speculative Tree Bottlenecks
AdaTree is a lightweight scheduling component for tree-based speculative decoding that selects optimal tree size (k_s) and tree depth (d) on every batched decoding step. Unlike static EAGLE-3 (k_s=60, d=8), AdaTree prevents target verification from turning compute-bound under concurrency, accelerating Spec-Bench and HumanEval by 1.26x on average.
Static speculative trees break down in production serving for two reasons: high request rates enlarge batch sizes and turn oversized 60-token verification trees into compute bottlenecks, while unpredictable prompts waste extra draft iterations when acceptance probability drops early. AdaTree models per-iteration throughput R explicitly and halts expansion the moment marginal draft/verify latency outweighs expected accepted tokens.
| Decoding Strategy (RTX Pro 6000 Blackwell) | Tree Config (k_s, d) | Avg Acceptance Length | Verification Speed vs Static | Peak End-to-End Speedup |
|---|---|---|---|---|
| Autoregressive (AD) | 1, 1 | 1.0 | Baseline | 1.00x |
| Static Chain (`SpS`) | Chain 8 | 4.4 (GSM8K @ 2 req/s) | Faster verify, lower accept | Baseline chain |
| Static Tree (`EAGLE-3`) | 60, 8 | High accept, compute-bound | 1.00x (baseline tree) | Slower at high batch |
| AdaTree (Dynamic) | Adaptive (e.g. `32`) | `5.4` (GSM8K @ 2 req/s) | `1.3x` faster verify | `1.2x` (GSM8K 3 req/s), `1.3x` (CNN) |
Temperature-1.2 Logit Calibration & XGBoost Latency Modeling
Small draft models are systematically overconfident about multi-step token continuations, inflating raw probability products p_v and triggering wasteful draft forward passes. AdaTree applies temperature scaling (T = 1.2) to draft logits before computing expected acceptance length tau_hat, keeping predicted acceptance aligned with actual target verification.
Because GPU kernel execution time scales non-linearly across batch size b, tree size k_s, and context length, analytical FLOP formulas mispredict verify cost. AdaTree trains lightweight XGBoost decision-tree regressors offline on target GPU profiles and queries them dynamically inside a Triton batched tree-attention runtime.
Calibrate Draft Logits Before Tree Pruning
Without temperature calibration (`T=1.2`), uncalibrated EAGLE-3 draft heads overestimate deep path acceptance, pushing tree expansion into diminishing returns on creative or high-entropy prompts.
Reproducible Throughput Optimization & Spec-Bench Profiling
Replicate AdaTree's per-iteration throughput objective R(k_s, d, b) and test dynamic tree termination before deploying speculative decoding in your serving stack.
import math
# AdaTree per-iteration throughput objective: R = sum(tau) / (d * T_draft + T_verify)
def calibrated_probs(logits: list[float], temp: float = 1.2) -> list[float]:
scaled = [z / temp for z in logits]
m = max(scaled)
exps = [math.exp(z - m) for z in scaled]
s = sum(exps)
return [e / s for e in exps]
def select_optimal_depth(expected_taus_by_depth: dict[int, float],
draft_ms: float, verify_ms_by_size: dict[int, float],
width_per_step: int = 10) -> tuple[int, float]:
best_d, best_r = 1, 0.0
for d, tau_sum in expected_taus_by_depth.items():
k_s = min(60, d * width_per_step)
t_total = d * draft_ms + verify_ms_by_size.get(k_s, 12.0)
r = tau_sum / t_total
if r > best_r:
best_d, best_r = d, r
return best_d, best_r
print("Optimal (depth, tok/ms):", select_optimal_depth({2: 2.9, 4: 4.8, 6: 5.4, 8: 5.6}, 0.8, {20: 4.1, 40: 6.0, 60: 9.8}))Why Sub-Second Token Throughput Matters in Smoke Monkey Agents
Multi-turn coding loops inside Smoke Monkey Harness execute dozens of short tool-call and AST-edit turns per task. Under concurrent team usage, static speculative decoding degrades precisely when multiple developers run agents simultaneously. Adaptive tree sizing keeps time-per-output-token flat as concurrency climbs, shrinking end-to-end wall-clock agent runs without altering a single sampled token.
Frequently Asked Questions
Q:Why does static tree speculative decoding slow down at higher request rates?
As request rates rise, continuous batching increases active batch size, making target-model verification of large static trees (such as 60 tokens in EAGLE-3) compute-bound and slower than smaller adaptive trees.
Q:Does AdaTree change the output distribution of the target LLM?
No. Like standard speculative decoding, AdaTree verifies proposed token trees in parallel against the target model's exact distribution, guaranteeing mathematically lossless outputs.
Q:Why does AdaTree use XGBoost instead of a linear latency formula?
GPU kernel execution time exhibits non-linear step functions across batch size, tree size, and memory-to-compute transitions that decision trees capture accurately with microsecond inference overhead.
Q:What benchmarks and hardware did AdaTree evaluate on?
AdaTree was evaluated on Llama-3.1-8B-Instruct + EAGLE-3 across Spec-Bench (MT-Bench, WMT, CNN, NQA, GSM8K, DPR), HumanEval, and ShareGPT on NVIDIA RTX Pro 6000 Blackwell and RTX 3090 GPUs, averaging 1.26x speedup.
Related Alternatives & Comparisons
Related Architecture Guides
View all guidesBest Open Source Coding Agents in 2026: Free, Local & Fully Hackable Harnesses
MCP Server Security Best Practices: Hardening Model Context Protocol Agents in 2026
Open Source Coding Agent Harness: Build a Forkable, Local AI Engineering Runtime
Build with Smoke Monkey Harness
Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.