LLBPE: Linked-List Based GPU-Parallel BPE Tokenizer
Aditya Kovilur, Varun Chandra Shekar, Ariful Azad
Abstract
Every LLM inference begins with tokenization, which converts raw input bytes into the discrete token sequence the model consumes. For text, this step is often implemented using Byte Pair Encoding (BPE), an algorithm originally introduced for data compression. BPE has traditionally run on the CPU with extensive optimization, but recent work has moved it to the GPU for higher throughput. We show that these GPU implementations are bottlenecked not by computation but by data movement. We develop LLBPE that represents the token sequence as an array-based linked list so that each merge reduces to a constant- time pointer update. Furthermore, LLBPE fuses rank lookup, minimum selection, and merging into a single kernel to eliminate redundant hash map queries. LLBPE achieves up to 5.2x higher throughput than the best existing GPU implementation and 24.6x over optimized CPU implementations, at the cost of minor discrepancies in tokenized output.
Create a lesson
Related papers
Tandem Queues with Hybrid Abandonment in Heavy Traffic
Cameron Curtis, Izzy Grosof, Seyed Iravani
Reproducible LLM Inference Benchmarking: A Sequential Isolation Protocol for Regression Testing
Arnold Olympio, Juan Manuel Servera Bondroit, Wael Abdelmalek et al.
CXDVirt: Low Latency Kernel Module Based CXL-SSD Emulation
Hyunsun Chung, Seongho Bong, Hong-Yeon Kim et al.
Energy-performance tradeoffs in server farms with batch services and setup times
Thu Le-Anh, Tuan Phung-Duc
PonyTail: Profiling and Improving Service Tail Latency
Roee Wodislawski, Adam Morrison
Execution-Path Qualification and Realized Costs in Speculative Decoding on Consumer Systems
Chengzhan Li