arXiv ScienceSearch

arXiv · 2505.20438

HAMburger: Accelerating LLM Inference via Token Smashing

Abstract

The growing demand for efficient Large Language Model (LLM) inference requires a holistic optimization on algorithms, systems, and hardware. However, very few works have fundamentally changed the generation pattern: each token needs one forward pass and one KV cache. This can be sub-optimal because we found that LLMs are extremely capable of self-identifying the exact dose of information that a single KV cache can store, and many tokens can be generated confidently without global context. Based on this insight, we introduce HAMburger, a Hierarchically Auto-regressive Model that redefines resource allocation in LLMs by moving beyond uniform computation and storage per token during inference. Stacking a compositional embedder and a micro-step decoder in between a base LLM, HAMburger smashes multiple tokens into a single KV and generates several tokens per step. Additionally, HAMburger functions as a speculative decoding framework where it can blindly trust self-drafted tokens. As a result, HAMburger shifts the growth of KV cache and forward FLOPs from linear to sub-linear with respect to output length, and adjusts its inference speed based on query perplexity and output structure. Extensive evaluations show that HAMburger reduces the KV cache computation by up to 2$\times$ and achieves up to 2$\times$ TPS, while maintaining quality in both short- and long-context tasks. Our method explores an extremely challenging inference regime that requires both computation- and memory-efficiency with a hardware-agnostic design.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Jingyu Liu, Ce Zhang. 2025-05-26. HAMburger: Accelerating LLM Inference via Token Smashing. https://arxiv.org/abs/2505.20438

Cite the original work for its findings. Save a collection to share your selection of sources.

KEEP EXPLORING

Related papers

"You are an expert annotator": Automatic Best-Worst-Scaling Annotations for Emotion Intensity Modeling

Labeling corpora constitutes a bottleneck to create models for new tasks or domains. Large language models mitigate the issue with automatic corpus labeling methods, particularly for categorical annotations. Some NLP tasks such as emotion intensity prediction, however, require text regression, but there is no work on automating annotations for continuous label assignments. Regression is considered more challenging than classification: The fact that humans perform worse when tasked to choose values from a rating scale lead to comparative annotation methods, including best-worst scaling. This raises the question if large language model-based annotation methods show similar patterns, namely that they perform worse on rating scale annotation tasks than on comparative annotation tasks. To study this, we automate emotion intensity predictions and compare direct rating scale predictions, pairwise comparisons and best-worst scaling. We find that the latter shows the highest reliability. A transformer regressor fine-tuned on these data performs nearly on par with a model trained on the original manual annotations.

cs.CL

A Systematic Review of NLP for Ghanaian Languages: Datasets, Models, and a Research Roadmap

Natural Language Processing (NLP) for Ghana's 73 living indigenous languages remains deeply fragmented, under-resourced, and heavily skewed toward a single language. We present the first systematic review of the Ghanaian NLP landscape, screening 17,000+ publications across four academic databases to critically synthesize 36 core studies spanning datasets, model architectures, and evaluation paradigms. Our analysis exposes a severe resource imbalance: Twi-centric NLP has grown modestly, driven largely by religious-text alignment and crowdsourcing, while the remaining 70+ languages remain almost entirely unaddressed, and dataset releases, model checkpoints, and evaluation practices remain inconsistent and rarely shared across the field. We translate these findings into a prioritized roadmap targeting Ghana's acute regional constraints, dialectal variation, non-standardized orthographies, and the absence of shared infrastructure, offering a replicable template for systematic review and research prioritization in other low-resource language settings.

cs.CL

Which Demographics do LLMs Default to During Annotation?

Demographics and cultural background of annotators influence the labels they assign in text annotation -- for instance, an elderly woman might find it offensive to read a message addressed to a "bro", but a male teenager might find it appropriate. It is therefore important to acknowledge label variations to not under-represent members of a society. Two research directions developed out of this observation in the context of using large language models (LLM) for data annotations, namely (1) studying biases and inherent knowledge of LLMs and (2) injecting diversity in the output by manipulating the prompt with demographic information. We combine these two strands of research and ask the question to which demographics an LLM resorts to when no demographics is given. To answer this question, we evaluate which attributes of human annotators LLMs inherently mimic. Furthermore, we compare non-demographic conditioned prompts and placebo-conditioned prompts (e.g., "you are an annotator who lives in house number 5") to demographics-conditioned prompts ("You are a 45 year old man and an expert on politeness annotation. How do you rate {instance}"). We study these questions for politeness and offensiveness annotations on the POPQUORN data set, a corpus created in a controlled manner to investigate human label variations based on demographics which has not been used for LLM-based analyses so far. We observe notable influences related to gender, race, and age in demographic prompting, which contrasts with previous studies that found no such effects.

cs.CL