Papers
Topics
Authors
Recent
Search
2000 character limit reached

Perceptual Group Tokenizer (PGT)

Updated 22 December 2025
  • Perceptual Group Tokenizer (PGT) is a vocabulary-free embedding approach that leverages character trigram patterns to produce sparse, high-dimensional representations.
  • It employs hash-based sparse activations to directly embed words, dramatically reducing embedding layer sizes while matching or outperforming traditional tokenizers like BPE.
  • Empirical findings indicate over 85% parameter reduction, enhanced cross-lingual robustness, and lower GPU memory footprints, leading to more stable training curves.

Sparse Trigram Activations (T-FREE) are a tokenizer-free representation for LLMs that replaces subword vocabularies with high-dimensional, extremely sparse codes defined over character trigrams. T-FREE directly embeds words via sparsely activated vectors without referring to a predefined vocabulary or corpus. By exploiting character-level morphological similarities, T-FREE achieves strong compression of embedding layers, with empirical results demonstrating competitive performance relative to traditional Unigram and BPE tokenization while reducing embedding-layer parameter count by over 85%. Further advantages include improved cross-lingual transfer and uniformly distributed gradients during training, resulting in stable loss curves and lower GPU memory footprints (Deiseroth et al., 2024).

1. Motivation and Problem Context

Developments in tokenization for LLMs have stagnated, with existing methods like Byte Pair Encoding (BPE) and Unigram encountering several limitations. These include computational overhead, inefficient vocabulary utilization, corpus bias that reduces efficacy for underrepresented languages, and unnecessarily large embedding and prediction head layers. By construction, fixed vocabularies are less adaptive to morphological variation and multi-lingual settings. T-FREE addresses these issues by removing vocabulary dependence entirely, embedding words as sparse codes derived from sequences of character trigrams (Deiseroth et al., 2024).

2. Mathematical Formulation and Encoding Pipeline

Let ww denote a word or symbol, including leading and trailing whitespace markers for boundary representation. A sliding window extracts an ordered sequence of n=∣w∣+1n=|w|+1 overlapping character trigrams [t1,t2,...,tn][t_1, t_2, ..., t_n]. For each trigram tℓt_\ell, mm independent hashes are computed and reduced modulo a fixed vocabulary size vv (e.g., v=8 000v=8\,000):

(hℓ,1,...,hℓ,m)=(hash(tℓ∥1),...,hash(tℓ∥m))\bigl(h_{\ell,1}, ..., h_{\ell,m}\bigr) = \bigl(\mathrm{hash}(t_\ell \Vert 1), ..., \mathrm{hash}(t_\ell \Vert m)\bigr)

I(w)={hℓ,i mod v:ℓ=1,...,n,i=1,...,m}\mathcal I(w) = \{ h_{\ell,i} \bmod v : \ell=1,...,n, i=1,...,m \}

The sparse binary activation vector z(w)∈{0,1}vz(w) \in \{0,1\}^v is defined element-wise as n=∣w∣+1n=|w|+10 if n=∣w∣+1n=|w|+11, otherwise n=∣w∣+1n=|w|+12. The resulting sparsity constraint is n=∣w∣+1n=|w|+13. No n=∣w∣+1n=|w|+14 or n=∣w∣+1n=|w|+15 normalization is performed during encoding. Let n=∣w∣+1n=|w|+16 be the shared embedding matrix (n=∣w∣+1n=|w|+17, e.g., n=∣w∣+1n=|w|+18). The final word embedding is given by summing the active columns:

n=∣w∣+1n=|w|+19

Empirical configuration uses [t1,t2,...,tn][t_1, t_2, ..., t_n]0, [t1,t2,...,tn][t_1, t_2, ..., t_n]1, and typical [t1,t2,...,tn][t_1, t_2, ..., t_n]2 values (not specified), yielding a compact representation.

Encoding proceeds as follows:

  1. Raw text is split on non-alphanumeric boundaries, treating each word or symbol as a token.
  2. Tokens are padded at both ends with a whitespace marker, then decomposed into overlapping trigrams.
  3. For each trigram and for each of [t1,t2,...,tn][t_1, t_2, ..., t_n]3 hash slots, a hash value is computed, reduced modulo [t1,t2,...,tn][t_1, t_2, ..., t_n]4, and the corresponding index in a length-[t1,t2,...,tn][t_1, t_2, ..., t_n]5 binary vector is set to 1.
  4. The [t1,t2,...,tn][t_1, t_2, ..., t_n]6 columns in [t1,t2,...,tn][t_1, t_2, ..., t_n]7 corresponding to nonzero entries in [t1,t2,...,tn][t_1, t_2, ..., t_n]8 are summed to yield [t1,t2,...,tn][t_1, t_2, ..., t_n]9.

3. Integration with LLMs

T-FREE modifies only the input embedding layer and the language modeling (LM) head in a Transformer architecture. All self-attention and MLP blocks remain identical. The embedding and head layers' shapes transition from tâ„“t_\ell0 (where vocabularies for BPE/Unigram are typically tâ„“t_\ell1 or more) to tâ„“t_\ell2, with tâ„“t_\ell3 much smaller for T-FREE.

During pre-training, the next-word prediction head outputs a logit vector tâ„“t_\ell4. Rather than a single-label softmax, multi-label binary cross-entropy (MLBCE) is used:

tâ„“t_\ell5

No explicit regularizer on the tâ„“t_\ell6 norm is necessary due to fixed hash bucketed sparsity.

Decoding involves a pre-compiled dictionary matrix tâ„“t_\ell7, where each row is the sparse pattern tâ„“t_\ell8 for the tâ„“t_\ell9 most frequent words. Given predicted logits, the dictionary is multiplied by mm0, and the softmax is computed over the resulting scores to select the output. This is efficiently implemented using sparse-dense kernels because mm1.

4. Parameter and Memory Efficiency

The parameter count in both embedding and LM head layers is drastically reduced. With mm2 and mm3 for T-FREE—versus mm4 for BPE—memory requirements are reduced to mm5, i.e., mm6 fewer parameters:

mm7

This translates to savings of roughly mm8 million parameters per layer. Peak GPU memory footprint is correspondingly reduced (e.g., mm9 GB vs vv0 GB for a vv1B-parameter model), with more stable training curves and fewer spikes in loss due to fixed hashing and uniform gradient updates.

5. Empirical Performance and Cross-Lingual Robustness

On 18 zero- and few-shot downstream benchmarks, vv2B-parameter models with T-FREE (vv3k) match or surpass dense vv4k-token Unigram baselines, despite having vv5 fewer parameters overall. Fertility—average tokens per word—declines from vv6 in English with T-FREE, indicating more efficient segmentation. Robustness is observed across German, Russian, Vietnamese, and Arabic, where classical tokenizers experience degraded performance. In continual pre-training for English-to-German transfer with a vv7B-parameter model, T-FREE narrows the German performance gap by vv8 after 20k steps, in contrast to minimal improvement with the standard tokenizer (Deiseroth et al., 2024).

6. Limitations and Future Directions

T-FREE's reliance on pooled sparse sums makes encoding very long words susceptible to underweighting, potentially diminishing representation quality. Decoding necessitates a pre-compiled dictionary for the vv9 most frequent words, which may limit arbitrarily open-vocabulary generation. Proposed future research directions include learning hash functions, introducing byte-fallback for rare Unicode blocks, and extending T-FREE to domains such as programming languages or morphologically rich scripts. These areas may address current challenges and extend the applicability of sparse trigram activations beyond natural language (Deiseroth et al., 2024).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Perceptual Group Tokenizer (PGT).