Dev.to AI πŸ€– Ai πŸ‘ 2 πŸ“– 2 min read

ResDecode: Accelerating LLM Inference via Residual Decoding Heads

Executive Briefing: The Autoregressive Latency Bottleneck Autoregressive decoding imposes a serial memory-bandwidth and latency tax on large language models, restricting deployment in latency-sensitive Cyber-Physical-S

Executive Briefing: The Autoregressive Latency Bottleneck

Autoregressive decoding imposes a serial memory-bandwidth and latency tax on large language models, restricting deployment in latency-sensitive Cyber-Physical-Social Intelligence (CPSI) environments. Speculative decoding mitigates this bottleneck by predicting multiple subsequent tokens in parallel with a lightweight draft mechanism and verifying them in a single target-model pass.

However, existing multi-head speculative architectures suffer compounding prediction degradation as draft token offsets grow, because downstream draft heads lack sufficient contextual alignment with the target model. Published in Big Data Mining and Analytics (2025, Vol. 8, Issue 3, pp. 100–112; DOI: 10.26599/bdma.2024.9020074), ResDecode pairs a compact full-context encoderβ€”distilled via mean-squared error against the target model's final transformer layerβ€”with dedicated residual decoding heads to compensate for long-range dependencies.

Across five backbone architectures (Vicuna-7B, Vicuna-13B, Vicuna-33B, LLaMA-2-chat-7B, and LLaMA-2-chat-13B), ResDecode reaches up to 3.35Γ— speedup on MT-bench under typical decoding (4.19 tokens max average acceptance length), 3.31Γ— (4.39 AAL) / 3.25Γ— (4.17 AAL) on GSM8K, and peak typical decoding speedups of 3.57Γ— on coding and 3.45Γ— on extraction tasks in Spec-Bench.

Architectural Design & Draft Head Ablation

  1. Knowledge-Distilled Full Context Encoder: Extracts representations from the target model's hidden states and undergoes mean-squared error (MSE) distillation against the target architecture's final transformer layer, while candidate draft tokens are supervised via cross-entropy loss across K heads.
  2. Residual Decoding Heads: Additive projection pathways compensate for long-range token dependency loss across draft positions. Draft head prediction accuracy saturates at 0.85 when the intermediate layer dimension matches the model hidden size, outperforming standard MLP (0.65) and linear layer (0.61) baselines.
  3. Medusa Head-by-Head Gain & Draft Horizon: Compared to Medusa, ResDecode improves top-1 accuracy by +63% at head 0, +107% at head 1, +241% at head 2, and +233% at head 3. Acceleration saturates when maximum speculative draft length reaches 6 tokens.

Quantitative Benchmarks

Trained on 70,000 ShareGPT multi-turn dialogues and evaluated on an NVIDIA A800 GPU setup:

Table 1: Speedup & Average Acceptance Length (AAL) Across Backbones

Decoding Strategy Model MT-bench Speedup MT-bench AAL Vicuna-bench Speedup Vicuna-bench AAL GSM8K Speedup GSM8K AAL
Greedy decoding V-7B 2.92Γ— 3.95 2.83Γ— 3.82 3.11Γ— 4.18
Greedy decoding V-13B 3.11Γ— 4.01 2.96Γ— 3.91 3.19Γ— 4.20
Greedy decoding V-33B 3.21Γ— 4.01 3.03Γ— 4.00 3.25Γ— 4.17
Greedy decoding L2-7B 2.89Γ— 3.88 2.75Γ— 3.88 3.03Γ— 3.91
Greedy decoding L2-13B 3.09Γ— 3.97 2.89Γ— 3.91 3.05Γ— 3.93
Typical decoding V-7B 3.04Γ— 4.13 2.97Γ— 4.03 3.25Γ— 4.42
Typical decoding V-33B 3.35Γ— 4.16 3.08Γ— 4.10 3.31Γ— 4.39
  • Additional verified benchmarks: 3.27Γ— on Vicuna-13B (MT-bench typical decoding); 3.12Γ— five-backbone average on GSM8K (greedy); Spec-Bench on Vicuna-33B: 2.93Γ— (multi-turn conversation) and 3.23Γ— (mathematical reasoning), with peak typical decoding speedups of 3.57Γ— (coding) and 3.45Γ— (extraction).

Practical Takeaways & Known Constraints

  • Hidden-size matching rule: Sizing the intermediate expansion layer to match the target hidden dimension hits the 0.85 accuracy ceiling without requiring a full auxiliary draft LLM.
  • Uncommon lexical tokens & saturation: Rare verbs and programmatic keywords remain harder for residual heads to predict, and speculative acceleration hits diminishing returns beyond a draft length of 6 tokens.

Reference

  • Journal Source: Big Data Mining and Analytics (2025, Vol. 8, Issue 3, pp. 100–112), DOI 10.26599/bdma.2024.9020074
  • Structured English Dossier & Benchmark Tables: ResDecode on SinoAILab
πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.