BLOGLLM Logo
Go Pro
Guest
Not signed in
All BlogsCoursesPracticeInterview prepSeriesTagsBookmarksPricing
Log in
All BlogsCoursesPracticeTagsBookmarksPricing
BlogsCourses
Practice
My PrepProblemsStudy PlansResearch PapersRoadmapInterviewContestsLeaderboardGames
Articles
Practice / Research papers
Transformers and LLMs · 2022

Fast Inference from Transformers via Speculative Decoding

Yaniv Leviathan, Matan Kalman, Yossi Matias

ICML 2023 · arXiv 2211.17192 · Read the paper ↗

A small model drafts tokens and the big model checks them in one pass, with the same output distribution.

3 steps · 0 solved

Start: Expected speedup →
  1. 1Expected speedupPick the draft length from the acceptance rate.Pick the best draft length for speculative decodingEasy
  2. 2Verify a draftAccept the longest matching prefix.Verify a draft model's guesses in speculative decodingMediumPro
  3. 3Speculative samplingAccept or reject with the probability ratio and resample.Accept or reject draft tokens in speculative samplingHardPro

More transformers and llms papers

  • Attention Is All You Need 2017
  • LoRA: Low-Rank Adaptation of Large Language Models 2021
  • FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 2022
  • RoFormer: Enhanced Transformer with Rotary Position Embedding 2021
  • Direct Preference Optimization: Your Language Model is Secretly a Reward Model 2023
  • Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity 2021
  • LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale 2022
Goal
Draft, verify, accept
0 / 3 solved
Start: Expected speedup →
How it works

Solve the steps in order. Each one is a small function with tests that run in your browser. Later steps reuse ideas from earlier ones.

© BlogLLM, Bengaluru, IndiaAboutTermsPrivacyRefundsDMCAContactRSS