Efficient Beam Search for Large Language Models Using Trie-Based Decoding

Brian J Chan, MaoXun Huang, Jui-Hung Cheng, Chao-Ting Chen, Hen-Hsen Huang
1/31/2025
cs.CL

No confident code implementation found for this paper.

Abstract

This work presents a novel trie (prefix-tree)-based parallel decoding method that addresses the memory inefficiency of batch-based beam search. By sharing a single KV cache across beams with common prefixes, our approach dramatically reduces memory usage and enables efficient decoding. We evaluated our method across three attention architectures, Multi-Head Attention (Phi-3.5-mini-instruct), Grouped Query Attention (Llama-3.1-8B-Instruct), and Sliding Window Attention (Mistral-Small-24B-Instruct-2501), using CNN/DailyMail for abstractive summarization and HumanEval for code generation. Our experiments demonstrate substantial memory savings (4--8$\times$) and up to 2.4$\times$ faster decoding, without compromising generation quality. These results highlight our method's suitability for memory-constrained environments and large-scale deployments.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{chan2025efficient,
  title  = {Efficient Beam Search for Large Language Models Using Trie-Based Decoding},
  author = {Brian J Chan and MaoXun Huang and Jui-Hung Cheng and Chao-Ting Chen and Hen-Hsen Huang},
  year   = {2025},
  eprint = {2502.00085},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2502.00085v2}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2502.00085.svg)](https://codeofpaper.com/paper/2502.00085)

Discussion