---
title: "Universal Assisted Generation: Faster Decoding with Any Assistant Model"
description: "Universal Assisted Generation (UAG) extends speculative decoding so the assistant model no longer needs the target's tokenizer."
url: "https://swe.quest/articles/universal-assisted-generation-faster-decoding-with-any-assistant-model-9472b2a3456cf247"
canonical: "https://huggingface.co/blog/universal_assisted_generation"
source: "Hugging Face"
published: "2024-10-29"
difficulty: "hard"
kind: "Research"
reading_minutes: 6
tags: ["inference","llms","performance"]
---

# Universal Assisted Generation: Faster Decoding with Any Assistant Model

A post on [Hugging Face](https://swe.quest/sources/hugging-face.md), published 2024-10-29, 6 min read, Research. Original: [https://huggingface.co/blog/universal\_assisted\_generation](https://huggingface.co/blog/universal_assisted_generation)

## Summary

Universal Assisted Generation (UAG) extends speculative decoding so the assistant model no longer needs the target's tokenizer. Draft tokens are translated in both directions through text, re-encoded with a window of preceding tokens, and aligned to the target sequence, and mismatched tokens are evicted from the assistant's KV cache. Benchmarks pair models such as gemma-2-9b, Mixtral-8x22B and Llama-3.1-70B with tiny cross-family assistants like vicuna-68m and Qwen2-0.5B and report 1.5x–1.9x speedups. UAG ships in Transformers 4.46 via the tokenizer/assistant\_tokenizer arguments to generate(), and with sampling it currently supports only multinomial sampling, not speculative sampling.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## 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)

## Prerequisites

- speculative decoding
- tokenizers
- KV cache ([easy posts on Caching](https://swe.quest/tags/caching.md?difficulty=easy))
- Hugging Face Transformers

## Keywords

Universal Assisted Generation, speculative decoding, Hugging Face Transformers, Intel Labs, gemma-2-9b, Mixtral-8x22B

## Related posts

- [Assisted Generation: a new direction toward low-latency text generation](https://swe.quest/articles/assisted-generation-a-new-direction-toward-low-latency-text-generation-46c4fea13508392f.md): Hugging Face · 2023-05-11 · Medium · 12 min read · Inference & serving, LLMs, Performance engineering, Python
  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.
- [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.
- [Speculative Decoding for 2x Faster Whisper Inference](https://swe.quest/articles/speculative-decoding-for-2x-faster-whisper-inference-c8681e4ac958e48b.md): Hugging Face · 2023-12-20 · Medium · 12 min read · Speech & audio, Inference & serving, Performance engineering, Python
  Speculative decoding speeds up Whisper transcription by about 2x while producing mathematically identical outputs.
- [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.
- [Achieve state-of-the-art inference latencies with speculative decoding](https://swe.quest/articles/achieve-state-of-the-art-inference-latencies-with-speculative-decoding-29855d3aec239f45.md): Modal · 2026-06-24 · Hard · 9 min read · Inference & serving, LLMs, Performance engineering, Model training
  Speculative decoding is the dominant lever for low-latency LLM serving because decode steps dominate latency and speculation yields multiplicative speedups roughly linear in acceptance length.

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)
