惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

月光博客
月光博客
L
LangChain Blog
Jina AI
Jina AI
WordPress大学
WordPress大学
人人都是产品经理
人人都是产品经理
S
Secure Thoughts
T
The Exploit Database - CXSecurity.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - 聂微东
小众软件
小众软件
Apple Machine Learning Research
Apple Machine Learning Research
C
Cyber Attacks, Cyber Crime and Cyber Security
Project Zero
Project Zero
T
Threat Research - Cisco Blogs
量子位
G
GRAHAM CLULEY
腾讯CDC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
C
CERT Recently Published Vulnerability Notes
The Hacker News
The Hacker News
C
Cisco Blogs
Scott Helme
Scott Helme
Spread Privacy
Spread Privacy
宝玉的分享
宝玉的分享
V
V2EX
博客园 - 三生石上(FineUI控件)
T
Tor Project blog
P
Proofpoint News Feed
雷峰网
雷峰网
D
Darknet – Hacking Tools, Hacker News & Cyber Security
V
Vulnerabilities – Threatpost
PCI Perspectives
PCI Perspectives
博客园_首页
L
LINUX DO - 最新话题
IT之家
IT之家
有赞技术团队
有赞技术团队
博客园 - Franky
Hacker News: Ask HN
Hacker News: Ask HN
Last Week in AI
Last Week in AI
The Cloudflare Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
美团技术团队
博客园 - 【当耐特】
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Security Archives - TechRepublic
Security Archives - TechRepublic
L
LINUX DO - 热门话题
AWS News Blog
AWS News Blog
S
Security Affairs
T
Tailwind CSS Blog

Redis

Real-Time Fraud Detection: Latency, Features & Scale Context window in AI: why every token is a budget decision Connecting to Redis Cloud with AWS PrivateLink vs. VPC peering | Redis Redis Data Integration in Redis Cloud is now GA in AWS | Redis Why AI Misses Business Context & How Teams Fix It AI Reasoning Explained: Why Context Matters Semantic Layer vs Context Layer: Key Differences Redis array data type: How it works and when to use it Context Graphs vs. Vector Search: When RAG Falls Short What’s new in two – May 2026 edition Redis 8.8 performance improvements: Faster string, hash, streams, SCAN & more Redis 8.8: New array data structure & open source features How Conflict-free Replicated Data Types power active-active database replication Context Orchestration: What It Is & How It Works Context Compaction for AI Agents: A Complete Guide Prompt Bloat: Causes, Costs & Fixes for LLM Apps Agentic Retrieval Techniques: A Complete Guide Single-shot reliable consumers with XREADGROUP CLAIM in Redis 8.4 | Redis Long-Horizon AI Agents: Memory & State Infrastructure What is a context engine? What Is a Context Layer? AI Agent Infrastructure Context Retrieval for AI Agents: What It Is & Why It Matters Context Poisoning: How Bad Data Breaks Agent Reasoning Context is all you need: Introducing Redis Iris | Redis Context Engineering for AI: What It Is & How to Build It Dynamic endpoints: Migrate databases without changing your endpoint | Redis AI Shopping Assistants: How They Work & What to Build Endless Aisle Retail: Infrastructure & Real-Time Data LLM Speed Benchmarks: Metrics & Infrastructure Guide Context Pruning: Cut LLM Tokens Without Losing Quality What’s new in two – April 2026 edition Agentic AI Architecture: 5 Patterns Explained AI Agent vs Chatbot: Key Differences Explained Advantages of Building a Vector Search Solution API Latency in LLM Apps: Causes & How to Fix It Security advisory: [CVE‑2026‑23479] [CVE‑2026‑25243] [CVE-2026-25588] [CVE‑2026‑25589] [CVE-2026-23631] | Redis Edge Computing Latency: Causes & How to Reduce It AI Agents vs Workflows: When to Use Each Streaming LLM Responses: Make Your AI App Feel Fast Active-Active vs Active-Passive Database Architecture Prefill vs Decode: LLM Inference Phases Explained Long-Term Memory Architectures for AI Agents Time to First Byte Test: Tools, Causes & Fixes P95 Latency: What It Is & Why It Matters Why Multi-Agent LLM Systems Fail & How to Fix Them AI Human in the Loop: Production Oversight Patterns Native OpenTelemetry metrics for Redis client libraries | Redis Client-side geographic failover for Redis Active-Active | Redis Use Redis with SQL | Redis Introducing Redis Feature Form Build Google ADK Agents with persistent, real-time memory on Redis | Redis Startup Spotlight: Neuron Systems API Throttling: Algorithms, Patterns & Mistakes Agentic AI Examples Across 6 Industries Best Chunking Strategies for RAG Pipelines Agentic AI Guardrails: Controls That Work Redis joins AWS at GDC to support the next generation of gaming | Redis Designing a semantic routing system: From static rules to dynamic intelligence with Redis and Java | Redis Real-Time Dispatch System: A Complete Guide P99 Latency: What It Means & How to Fix It Tokenization in LLMs: What AI App Devs Need to Know TTFT Meaning: What is Time to First Token? Atomic slot migration with Redis 8.4 Hybrid search benefits: Why your RAG system needs both keyword & vector search What’s new in two: March 2026 edition Vector embedding generators: How they work & how to use them Throughput-optimizing Redis for L2 KV Cache Reuse What is a data pipeline? Building AI agent pipelines that don't forget, fail, or fall apart Redis achieves Google Cloud Ready, Distributed Cloud status ahead of Google Cloud Next ‘26 | Redis Real-time network monitoring: what your data platform needs to keep up AI agent API: How agents connect to the real world What is multicloud infrastructure? A guide for 2026 What is a transaction monitoring system & how does it work? Why your AI agent fails in production & how tracing helps AI agent benchmarks: Where they fall short & why your infrastructure matters What is a JSON database (and when should you use one)? Introducing the Redis Partner Network: A new foundation for real-time innovation How real-time customer segmentation works in retail Payment orchestration & vault architecture in retail Agentic systems vs. GenAI: when generation isn't enough What is fuzzy matching? Semantic caching & routing: two powerful patterns for vector classification Redis alternatives: Why there are no exact substitutes Connect to Azure Managed Redis with Redis Insight 3.2.0 How to tame the thundering herd problem Redis to Manage Storage Replication | Redis How hierarchical navigable small world (HNSW) algorithms can improve search | Redis How leading financial institutions use Redis to drive growth | Redis What’s new in two: May 2025 | Redis Introducing Model Context Protocol (MCP) for Redis | Redis Redis vs. Elasticsearch: What’s faster for GenAI & vector search? | Redis Build fast, production-worthy AI apps with Spring AI and Redis | Redis Azure Managed Redis is GA today | Redis Redis then & now: Adapting with developers through every era | Redis Supercharge Your AI with OpenShift AI and Redis: Unleash speed and scalability | Redis What’s new in two: April 2025 | Redis Redis 8 is now GA, loaded with new features and more than 30 performance improvements | Redis What is a data strategy? 6 key components explained Data replication explained: types, examples & use cases
Speculative decoding: how it works & when to use it
Redis · 2026-04-23 · via Redis

You're running LLM inference in production. Semantic caching handles the easy wins: repeated queries with the same intent come back from cache without touching the model. But everything else still hits the model at full cost, and that adds up fast at scale.

Speculative decoding is one way to speed up those requests without touching the model or its outputs. This guide covers how it works, the variants gaining traction in 2026, when it helps, when it doesn't, and where it fits in a layered inference stack alongside semantic caching.

What is speculative decoding

Speculative decoding makes LLM responses faster without changing what the model outputs. Instead of generating one token at a time, a small draft model runs ahead and proposes several tokens. The large model checks those proposals in a single pass. When they're accepted, you get multiple tokens for roughly the cost of one. The output stays identical to running the large model alone, so there's no quality tradeoff.

How much faster depends on how often the large model agrees with the draft. When the two align closely, the gains are meaningful. When they diverge, the overhead of running the draft model eats into the benefit. Early experiments on large models measured 2–2.5× speedups in distributed setups, but results vary widely depending on model pairing and workload.

The memory-bandwidth problem with autoregressive decoding

LLMs generate text slowly not because the math is hard, but because of how much data has to move. Every token your model generates requires loading the entire set of model weights from memory (tens of gigabytes for a large model), doing a small amount of arithmetic on them, and then producing a single token. Then repeating the whole thing for the next token.

The GPU's arithmetic units finish their work fast. The bottleneck is the memory transfer: fetching all those weights takes far longer than the actual computation. So the GPU sits partially idle between tokens, waiting on memory reads rather than doing useful work.

That idle compute is the gap speculative decoding exploits. It's also why semantic caching complements it: for repeated or semantically similar queries, no token generation runs at all. The answer is returned from cache. Speculative decoding speeds up the requests that do make it to the model.

Caching

Make your AI apps faster and cheaper

Cut costs by up to 90% and lower latency with semantic caching powered by Redis.

How the draft-verify loop works

The core idea: run a cheap model ahead of the expensive one, then check its work in bulk. Here's how that plays out in practice.

A small draft model generates several candidate tokens from the current context. This is fast and inexpensive compared to running the large model. The large model then checks all those candidates in a single pass. As covered above, that check costs roughly the same as generating one token the normal way.

Each candidate either passes or fails the check. The first failure stops the loop, and the large model corrects from that point. If all candidates pass, the large model adds one more token on top. The result: between one and several tokens produced per large-model pass, depending on how well the draft and target models agree.

The output is provably identical to what the large model would have generated on its own. Speculative decoding is a latency optimization, not an approximation.

Variants gaining traction in 2026

The base algorithm has spawned a range of variants, each solving a different limitation: draft model overhead, memory footprint, workload structure, or hardware constraints. Here are the ones showing up in recent research and production frameworks.

EAGLE-3: higher acceptance rates

EAGLE-3 is a speculative decoding method that improves how well the draft model predicts what the large model will output. Better predictions mean more draft tokens get accepted, and more accepted tokens means more output per large-model pass. The EAGLE family achieves this by attaching a lightweight head directly to the target model rather than training a separate model from scratch. EAGLE-3 advances on earlier versions by predicting tokens directly (rather than intermediate model features) and drawing on representations from multiple layers of the target model rather than just the top one. Across tested configurations, EAGLE-3 reported 3.0–6.5× speedups over standard generation, with a 20–40% improvement over EAGLE-2. A newer extension, P-EAGLE, pushes further by generating all draft tokens in a single pass, reporting 1.10–1.36× additional gains over EAGLE-3 in large-scale model benchmarks.

SuffixDecoding: training-free for agentic workloads

SuffixDecoding is useful when your workload produces repetitive, structured outputs — multi-step SQL generation, tool-calling loops, or code pipelines where the same patterns appear across requests. Instead of training a draft model, it builds draft candidates by matching the current generation against a history of past outputs. It maintains two pools of that history: one for the current request, and a shared pool across all prior requests. The shared pool drives most of the speedup, because cross-request repetition is where the gains are. No model training required means it can be layered onto an existing inference stack. SuffixDecoding reported a mean 5.3× speedup on AgenticSQL benchmarks.

Redis Iris

Give your AI apps real-time context

Run them on Redis for AI, built for fast retrieval and low-latency responses.

LayerSkip: smaller memory footprint

LayerSkip reduces memory overhead by using the target model itself as the draft. Instead of loading a separate model, it exits the target model's layers early to produce draft tokens, then runs the remaining layers to verify. The tradeoff: this only works with models specifically trained for it. You can't apply LayerSkip to an off-the-shelf model. It requires a model built or fine-tuned with the LayerSkip training recipe. For teams who can commit to that, benchmarks reported up to 2.16× with pretraining-based configurations on H100 GPUs.

Saguaro: overlapping draft & verify

Saguaro speeds things up by running drafting and verification at the same time rather than in sequence. While the large model is verifying one set of candidates, the draft model is already generating the next. The result: benchmarks reported an average 30% improvement over optimized speculative decoding baselines, and up to 5× over standard autoregressive decoding. The tradeoff is hardware: achieving that overlap means running the draft model on separate GPUs from the target model, which adds to infrastructure cost.

Reasoning-specific methods

Standard speculative decoding generates draft tokens one at a time, which hits a ceiling for reasoning models that produce thousands of chain-of-thought tokens. Methods like SpecReason and Lookahead Reasoning address this by drafting entire reasoning steps rather than individual tokens, then verifying them for semantic correctness rather than exact token match. One benchmark reported up to 2.1× when combined with n-gram speculative decoding on open-source reasoning models.

When speculative decoding helps & when it doesn't

Each of those variants targets a different constraint, but knowing which one fits your architecture is only half the equation. Batch size, workload shape, and hardware profile all determine whether speculative decoding helps or hurts. Understanding those variables is the difference between a meaningful latency reduction and wasted engineering effort.

Batch size is the biggest variable

At low batch sizes, speculative decoding delivers real speedups. At high batch sizes with short-to-medium context lengths, it can slow things down. Verification overhead outpaces the gains. Long-context serving is a meaningful exception: when batch size is large and sequences are long, the KV cache itself becomes the memory bottleneck, which can restore the conditions where speculative decoding helps. This is the most important production consideration that benchmark headlines tend to obscure.

In one benchmark on Qwen3-8B, speedup degraded from 1.93× to 0.99× as batch size grew from 2 to 48.

Adaptive speculation addresses this by dynamically choosing the draft length γ based on current batch size. Adaptive approaches measured an average 1.94× across all batch sizes in one study, where fixed-length speculation performed worse and gains diminished at batch size 32+.

High-gain workloads

Agentic, reasoning, and code generation workloads tend to show the largest gains. The common thread is repetitive, structured, multi-step output patterns: exactly the kind of sequences where a draft model can predict what comes next with high acceptance rates.

Where gains diminish

High-concurrency batch serving, highly stochastic sampling (high temperature, top-k with wide distributions), and scenarios without a well-matched draft model all reduce the benefits. Those conditions lower acceptance rates or make verification overhead harder to amortize across tokens.

Hardware matters too

The memory-bandwidth gap that speculative decoding exploits varies by GPU. In one comparison using Mamba 2.8B with a 130M draft model, an RTX 3090 measured 1.5× speedup while an H100 showed no speedup under the same configuration. Higher-bandwidth GPUs leave less idle compute for speculative decoding to reclaim.

The practical takeaway: benchmark with your actual model, batch shape, hardware, and sampling settings before committing to speculative decoding in production.

Where speculative decoding fits in the optimization stack

Once you've validated that speculative decoding fits your workload, the next question is where it sits in your serving stack. Production inference systems combine multiple optimizations, and the interactions between layers typically matter more than any single technique.

Here's how the layers typically stack up:

  • Semantic caching eliminates inference calls entirely for repeated or semantically similar queries by returning a previously cached response. When a cache hit occurs, the request never reaches the model.
  • Prefix and key-value (KV) cache reuse reduces redundant prefill computation across requests that share context like system prompts or few-shot examples.
  • Speculative decoding reduces per-token latency for individual requests that proceed to full inference.
  • Continuous batching maximizes GPU utilization across concurrent requests.
  • Prefill-decode disaggregation optimizes hardware allocation by routing the compute-heavy prefill and memory-heavy decode phases to separate hardware pools.

These layers aren't all additive. Speculative decoding and continuous batching can be in tension: as covered earlier, speculative decoding's speedup typically decreases as batch size grows, though the effect depends on workload and system conditions. Speculative decoding can also conflict with prefill-decode disaggregation in some serving architectures, since the decode phase is where speculative decoding operates.

Semantic caching and speculative decoding, by contrast, are naturally complementary. A cache hit makes speculative decoding irrelevant for that request. A cache miss routes to the inference stack where speculative decoding reduces latency for the full generation. The two techniques cover different parts of the request distribution without interfering with each other.

Redis handles both the vector search and semantic caching layers for AI workloads. Redis LangCache, currently in public preview, is a fully managed semantic caching service that handles embedding generation, similarity matching, and cached response retrieval through a Representational State Transfer (REST) API. No separate vector database or custom pipeline required.

Speculative decoding is a latency tool, not a silver bullet

Used with the right workload, speculative decoding meaningfully reduces per-request latency without changing model outputs. The benchmarks are real — the key is matching the technique to your batch size, context length, and draft model before committing.

The larger gains come from combining it with other techniques. Semantic caching eliminates inference calls for repeated queries. Speculative decoding speeds up what's left. Redis supports both as a single data layer for semantic caching and vector search, rather than separate infrastructure for each.

Try Redis free to see how semantic caching works with your inference pipeline, or talk to the team about optimizing your AI infrastructure.