FlashHead: Efficient Drop-In Replacement for the Classification Head in Language Model Inference

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Tranheden, Wilhelm, Ahmed, Shahnawaz, Dubhashi, Devdatt, Matthiesen, Jonna, von Essen, Hannes
Natura: Preprint
Pubblicazione: 2026
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866914395684077568
author Tranheden, Wilhelm
Ahmed, Shahnawaz
Dubhashi, Devdatt
Matthiesen, Jonna
von Essen, Hannes
author_facet Tranheden, Wilhelm
Ahmed, Shahnawaz
Dubhashi, Devdatt
Matthiesen, Jonna
von Essen, Hannes
contents Language models are increasingly adopting smaller architectures optimized for consumer devices. In this setting, inference efficiency is the primary constraint. Meanwhile, vocabulary sizes continue to grow rapidly, making the classification head a critical bottleneck that accounts for up to 60\% of model parameters, and 50\% of inference compute. We introduce FlashHead, the first efficient drop-in replacement for the dense classification head that is training-free and hardware-friendly. FlashHead builds on principles from information retrieval, reframing that computation at the output head as a retrieval problem rather than a dense classification over the full vocabulary. FlashHead introduces four key innovations: (1) a balanced clustering scheme that structures vocabulary partitions into compact hardware-efficient tensors, (2) extending multiprobe retrieval to language model heads, enabling thousands of clusters to be scored in parallel, (3) a novel inference-time sampling mechanism that extends retrieval beyond top tokens, enabling probabilistic sampling across the full vocabulary, and (4) selective quantization, enabling effective low-bit computation in the head. Experiments on Llama-3.2, Gemma-3, and Qwen-3 show that FlashHead delivers model-level inference speedups of up to \textbf{1.75x} which maintaining output accuracy compared to the original head. By overcoming the classification head bottleneck, FlashHead establishes a new benchmark for efficient inference and removes a key barrier to developing smaller, capable models for consumer hardware.
format Preprint
id arxiv_https___arxiv_org_abs_2603_14591
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle FlashHead: Efficient Drop-In Replacement for the Classification Head in Language Model Inference
Tranheden, Wilhelm
Ahmed, Shahnawaz
Dubhashi, Devdatt
Matthiesen, Jonna
von Essen, Hannes
Machine Learning
Artificial Intelligence
Information Retrieval
Language models are increasingly adopting smaller architectures optimized for consumer devices. In this setting, inference efficiency is the primary constraint. Meanwhile, vocabulary sizes continue to grow rapidly, making the classification head a critical bottleneck that accounts for up to 60\% of model parameters, and 50\% of inference compute. We introduce FlashHead, the first efficient drop-in replacement for the dense classification head that is training-free and hardware-friendly. FlashHead builds on principles from information retrieval, reframing that computation at the output head as a retrieval problem rather than a dense classification over the full vocabulary. FlashHead introduces four key innovations: (1) a balanced clustering scheme that structures vocabulary partitions into compact hardware-efficient tensors, (2) extending multiprobe retrieval to language model heads, enabling thousands of clusters to be scored in parallel, (3) a novel inference-time sampling mechanism that extends retrieval beyond top tokens, enabling probabilistic sampling across the full vocabulary, and (4) selective quantization, enabling effective low-bit computation in the head. Experiments on Llama-3.2, Gemma-3, and Qwen-3 show that FlashHead delivers model-level inference speedups of up to \textbf{1.75x} which maintaining output accuracy compared to the original head. By overcoming the classification head bottleneck, FlashHead establishes a new benchmark for efficient inference and removes a key barrier to developing smaller, capable models for consumer hardware.
title FlashHead: Efficient Drop-In Replacement for the Classification Head in Language Model Inference
topic Machine Learning
Artificial Intelligence
Information Retrieval
url https://arxiv.org/abs/2603.14591