arXiv · 2609.22125
Type-Driven Tokenization for Brahmic Scripts
Abstract
Standard tokenizers used in large language models produce malformed text when applied to Brahmic scripts. They are a family of abugidas, writing systems whose consonants carry an inherent vowel that dependent marks can modify. They include Devanagari, Telugu, Tamil, Kannada, and others. The underlying issue is that these tokenizers violate orthographic constraints that do not arise in alphabetic scripts like English. We observe that while English orthography forms a \emph{semigroup} (any two valid tokens can be freely concatenated), Brahmic orthography forms a \emph{partial semigroup}: not every concatenation yields a valid string. We formalise this distinction in Agda, model valid Brahmic tokens as chains in a transition system, and derive a provably correct \texttt{fixToken} function that extends any candidate token to respect orthographic boundaries. We then show how this formal derivation translates into a practical patch for SentencePiece as well as a standalone Rust-based pre-tokenizer library, eliminating the observed errors across Indic scripts.
Explore related subjects
Keep this discovery
Explore connections, maps & timelines
Sai Hemanth Kapila, Rakshika Bagavathy. 2026-08-21. Type-Driven Tokenization for Brahmic Scripts. https://arxiv.org/abs/2609.22125
Cite the original work for its findings. Save a collection to share your selection of sources.