Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Hugging Face 12 min read How-to mediumAdept

Speculative Decoding for 2x Faster Whisper Inference

Speculative decoding speeds up Whisper transcription by about 2x while producing mathematically identical outputs. A fast assistant model drafts candidate tokens and the main model verifies them in a single forward pass. With Distil-Whisper (full encoder, 2 decoder layers) as assistant to Whisper large-v2, a 73-sample LibriSpeech benchmark dropped from 73s to 33s at the same 3.5% WER, with only about 8% extra VRAM from sharing the encoder. For multilingual use, a multilingual checkpoint such as Whisper tiny can serve as assistant, since the only hard constraint is an identical tokenizer. Note that large-v3's expanded vocabulary makes it incompatible with older checkpoints.

Assumes: transformer autoregressive decodingHugging Face TransformersPyTorch basics

Related posts

  • Powerful ASR + diarization + speculative decoding with Hugging Face Inference Endpoints

    Hugging Face mediumAdept

    A custom inference handler on Hugging Face Inference Endpoints serves Whisper ASR, Pyannote speaker diarization and speculative decoding behind a single API endpoint. The handler is split into model settings, inference config and diarization utilities, with models chosen via Pydantic environment variables. Creating the endpoint through the API is needed to pass the HF token that diarization requires. A k6 benchmark on an A10 GPU shows distil-large-v3 as assistant model cutting latency on 8s audio from ~784ms to ~327ms but slowing 60s audio (3.48s to 4.15s). Speculative decoding requires batch size 1, so batching wins for long, chunked inputs.

  • Blazingly fast whisper transcriptions with Inference Endpoints

    Hugging Face easyNovice

    Hugging Face Inference Endpoints now offers a Whisper deployment built on vLLM that delivers up to roughly 8x higher real-time factor (RTFx) than the Transformers implementation, with comparable word error rate. It targets NVIDIA Ada Lovelace GPUs (L4, L40s) and gets its speedup from torch.compile JIT kernels, CUDA graphs that batch GPU kernel launches, and a float8 KV cache that halves cache memory versus bfloat16. Whisper Large V3, V3-Turbo and Distil-Whisper V3.5 were benchmarked for WER on 8 Open ASR Leaderboard datasets and for RTFx on 45+ minute rev16 audio using a single L4. Deployment is one click, and the endpoint is called through an OpenAI-style /audio/transcriptions HTTP API; a FastRTC demo shows real-time transcription.

  • Fine-Tune Whisper For Multilingual ASR with 🤗 Transformers

    Hugging Face mediumAdept

    Whisper, OpenAI's encoder-decoder ASR model pre-trained on 680,000 hours of labelled audio, can be fine-tuned for a low-resource language with Hugging Face Transformers using only about 8 hours of data. The walkthrough fine-tunes the multilingual small checkpoint (244M params) on Hindi from Common Voice 11. It covers loading and trimming the dataset, then preparing data with WhisperFeatureExtractor, which resamples to 16kHz, pads or truncates to 30s and converts audio to log-Mel spectrograms, plus WhisperTokenizer. It then moves through training and WER evaluation and ends with a Gradio demo. Along the way it explains why supervised pre-training needs less fine-tuning than Wav2Vec 2.0 and why Whisper needs no attention mask.

  • Achieve state-of-the-art inference latencies with speculative decoding

    Modal hardMaster

    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. Working with Decagon's voice agents, Modal combined regional serving, SGLang host-overhead fixes, and open-source kernels with DFlash draft models that reuse target-model KV projections and draft tokens in parallel. Fine-tuning ("mid-training") the speculator on synthetic data generated by the target model from public prompts in the task's output grammar avoids exposing user data. The custom speculator cut about 100ms from a ~290ms p50 baseline, roughly 40% of server-side decode latency, and beat proprietary providers by over 60ms. Out-of-distribution evaluation was used to guard against overfitting.

  • Fine-Tune Wav2Vec2 for English ASR in Hugging Face with 🤗 Transformers

    Hugging Face mediumAdept

    Wav2Vec2, pretrained with a contrastive masked objective on 50k+ hours of unlabeled speech, can be fine-tuned with CTC on small labeled datasets for end-to-end English ASR without a language model. The walkthrough fine-tunes the base checkpoint on the 5-hour Timit corpus using 🤗 Transformers and Datasets. It covers building a character-level CTC vocabulary (lowercasing, stripping punctuation, keeping apostrophes, mapping space to a word delimiter, and adding UNK and PAD/blank tokens), and configuring the feature extractor with a matching 16kHz sampling rate and normalization. It also explains why the base checkpoint works better without an attention mask, and evaluates with WER via jiwer while pushing checkpoints to the Hub.

The quest for software engineering knowledge.

Look:
Layout: