GPUTOK: GPU Accelerated Byte Level BPE Tokenization

arXiv cs.CL / 3/4/2026

Tools & Practical Usage

Key Points

  • GPUTOK is a GPU-based byte-level BPE tokenizer following GPT-2's merge rules, designed to accelerate tokenization for large language models with million-token context windows.
  • It offers two implementations: a basic BlockBPE kernel and an optimized version utilizing cuCollections static map, CUB reductions, and a pybind11 interface for Python.
  • On long WikiText103 inputs (up to 131k tokens), the optimized GPU tokenizer is about 1.7x faster than tiktoken and 7.6x faster than HuggingFace GPT-2 tokenizer, producing equivalent tokens.
  • Performance profiling indicates that most CUDA API time is spent on memory allocation, suggesting memory pooling as a key future optimization.
  • Evaluations on generation tasks show output similarity and overlap metrics close to CPU tokenizers, confirming GPUTOK maintains output quality while improving speed.

Computer Science > Computation and Language

arXiv:2603.02597 (cs)
[Submitted on 3 Mar 2026]

Title:GPUTOK: GPU Accelerated Byte Level BPE Tokenization

View a PDF of the paper titled GPUTOK: GPU Accelerated Byte Level BPE Tokenization, by Venu Gopal Kadamba and 1 other authors
View PDF HTML (experimental)
Abstract:As large language models move toward million-token context windows, CPU tokenizers become a major slowdown because they process text one step at a time while powerful GPUs sit unused. We built a GPU-based byte-level BPE tokenizer that follows GPT-2's merge rules. It includes a basic BlockBPE-style kernel and a faster, optimized version that uses cuCollections static map, CUB reductions, and a pybind11 interface for Python.
On WikiText103 sequences up to 131k tokens, the optimized GPU tokenizer produces the same tokens as a CPU version and, for the longest inputs, is about 1.7x faster than tiktoken and about 7.6x faster than the HuggingFace GPT-2 tokenizer. Nsight profiling shows that 70-80% of CUDA API time goes to memory allocation, so adding memory pooling should give the biggest speed boost next. Tests on generation tasks using WikiText103 prompts show that our GPU tokenizer's outputs stay within about one percentage point of tiktoken and HuggingFace GPT-2 on similarity and overlap metrics, meaning it keeps output quality while making long-context inference more practical.
Subjects: Computation and Language (cs.CL); Artificial Intelligence (cs.AI); Distributed, Parallel, and Cluster Computing (cs.DC); Machine Learning (cs.LG)
Cite as: arXiv:2603.02597 [cs.CL]
  (or arXiv:2603.02597v1 [cs.CL] for this version)
  https://doi.org/10.48550/arXiv.2603.02597
Focus to learn more
arXiv-issued DOI via DataCite

Submission history

From: Venu Gopal Kadamba [view email]
[v1] Tue, 3 Mar 2026 04:48:28 UTC (41 KB)
Full-text links:

Access Paper:

Current browse context:
cs.CL
< prev   |   next >
Change to browse by:

References & Citations

export BibTeX citation Loading...

BibTeX formatted citation

×
Data provided by:

Bookmark

BibSonomy logo Reddit logo
Bibliographic Tools

Bibliographic and Citation Tools

Bibliographic Explorer Toggle
Bibliographic Explorer (What is the Explorer?)
Connected Papers Toggle
Connected Papers (What is Connected Papers?)
Litmaps Toggle
Litmaps (What is Litmaps?)
scite.ai Toggle
scite Smart Citations (What are Smart Citations?)
Code, Data, Media

Code, Data and Media Associated with this Article

alphaXiv Toggle
alphaXiv (What is alphaXiv?)
Links to Code Toggle
CatalyzeX Code Finder for Papers (What is CatalyzeX?)
DagsHub Toggle
DagsHub (What is DagsHub?)
GotitPub Toggle
Gotit.pub (What is GotitPub?)
Huggingface Toggle
Hugging Face (What is Huggingface?)
Links to Code Toggle
Papers with Code (What is Papers with Code?)
ScienceCast Toggle
ScienceCast (What is ScienceCast?)
Demos

Demos

Replicate Toggle
Replicate (What is Replicate?)
Spaces Toggle
Hugging Face Spaces (What is Spaces?)
Spaces Toggle
TXYZ.AI (What is TXYZ.AI?)
Related Papers

Recommenders and Search Tools

Link to Influence Flower
Influence Flower (What are Influence Flowers?)
Core recommender toggle
CORE Recommender (What is CORE?)
About arXivLabs

arXivLabs: experimental projects with community collaborators

arXivLabs is a framework that allows collaborators to develop and share new arXiv features directly on our website.

Both individuals and organizations that work with arXivLabs have embraced and accepted our values of openness, community, excellence, and user data privacy. arXiv is committed to these values and only works with partners that adhere to them.

Have an idea for a project that will add value for arXiv's community? Learn more about arXivLabs.