---
title: "Assisted Generation: a new direction toward low-latency text generation"
description: "Assisted generation cuts autoregressive LLM latency by letting a much smaller assistant model with the same tokenizer greedily draft candidate tokens, then verifying them all in a single forward pass of the large model."
url: "https://swe.quest/articles/assisted-generation-a-new-direction-toward-low-latency-text-generation-46c4fea13508392f"
canonical: "https://huggingface.co/blog/assisted-generation"
source: "Hugging Face"
published: "2023-05-11"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 12
tags: ["inference","llms","performance","python"]
---

# Assisted Generation: a new direction toward low-latency text generation

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2023-05-11, 12 min read, Deep dive. Original: [https://huggingface.co/blog/assisted-generation](https://huggingface.co/blog/assisted-generation)

## Summary

Assisted generation cuts autoregressive LLM latency by letting a much smaller assistant model with the same tokenizer greedily draft candidate tokens, then verifying them all in a single forward pass of the large model. The large model keeps matching tokens plus the first divergent one. The draft length adapts: it grows by 2 when every candidate matches and shrinks by 1 otherwise. The approach exploits the fact that forward passes are memory-bandwidth bound. In 🤗 Transformers it is exposed through an \`assistant\_model\` argument to \`generate\` (batch size 1 only) and yields up to 2x speedups, 3x with INT8, and up to 10x when the model relies on memory offloading. It works best on input-grounded tasks like ASR and summarization, and with sampling only at low temperatures.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Python](https://swe.quest/tags/python.md) (Languages)

## Prerequisites

- autoregressive decoding
- transformer forward pass
- KV caching basics ([easy posts on Caching](https://swe.quest/tags/caching.md?difficulty=easy))
- Hugging Face Transformers

## Keywords

assisted generation, speculative decoding, Hugging Face Transformers, Pythia, greedy decoding, INT8 quantization, Tensor Parallelism

## Related posts

- [Faster Assisted Generation with Dynamic Speculation](https://swe.quest/articles/faster-assisted-generation-with-dynamic-speculation-d8a65fbd607c86ac.md): Hugging Face · 2024-10-08 · Medium · 7 min read · Inference & serving, LLMs, Performance engineering
  Dynamic speculative decoding stops the draft model's token generation as soon as its softmax confidence falls below a threshold (assistant\_confidence\_threshold), rather than always drafting a fixed or heuristically adjusted number of tokens before verification by the target model.
- [Universal Assisted Generation: Faster Decoding with Any Assistant Model](https://swe.quest/articles/universal-assisted-generation-faster-decoding-with-any-assistant-model-9472b2a3456cf247.md): Hugging Face · 2024-10-29 · Hard · 6 min read · Inference & serving, LLMs, Performance engineering
  Universal Assisted Generation (UAG) extends speculative decoding so the assistant model no longer needs the target's tokenizer.
- [Make your llama generation time fly with AWS Inferentia2](https://swe.quest/articles/make-your-llama-generation-time-fly-with-aws-inferentia2-bc8b5e1981a590c0.md): Hugging Face · 2023-11-07 · Medium · 7 min read · Inference & serving, LLMs, Hardware, Cloud platforms, Performance engineering
  optimum-neuron can now compile and export Llama 2 models for text generation on AWS Inferentia2, using static input shapes (batch size, 2048 sequence length that also bounds the KV cache) and a configurable core count and fp16 precision.
- [Faster Text Generation with Self-Speculative Decoding](https://swe.quest/articles/faster-text-generation-with-self-speculative-decoding-0171e077befc3347.md): Hugging Face · 2024-11-20 · Hard · 13 min read · Inference & serving, LLMs, Performance engineering
  Self-speculative decoding from the LayerSkip paper drafts tokens by exiting early from a model's own intermediate layers and verifies them with the remaining layers.
- [Accelerating Qwen3-8B Agent on Intel® Core™ Ultra with Depth-Pruned Draft Models](https://swe.quest/articles/accelerating-qwen3-8b-agent-on-intel-coretm-ultra-with-depth-pruned-draft-models-ea1317a126102827.md): Hugging Face · 2025-09-29 · Medium · 6 min read · Inference & serving, LLMs, AI agents, Performance engineering
  Speculative decoding with a Qwen3-0.6B draft model speeds up 4-bit Qwen3-8B on an Intel Lunar Lake integrated GPU by about 1.3× using OpenVINO.GenAI.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
