GQ-VAE: A gated quantized VAE for learning variable length tokens

Theo Datta, Kayla Huang, Sham Kakade, David Brandfonbrener
12/26/2025
cs.LG

Official code: Theo-Datta-115/gq-vae (3 stars, last commit 2025-10-03).

Abstract

While most frontier models still use deterministic frequency-based tokenization algorithms such as byte-pair encoding (BPE), there has been significant recent work to design learned neural tokenizers. However, these schemes generally add to underlying language model complexity and force large changes to architecture, making them hard to implement at large scales. To overcome these challenges, we propose the gated quantized variational autoencoder (GQ-VAE), a novel architecture that can be independently pre-trained to serve as a drop-in replacement for existing tokenizers. The key innovation of the architecture is to learn to encode variable-length discrete tokens. GQ-VAE improves compression and language modeling performance over a standard VQ-VAE tokenizer, and approaches the compression rate and language modeling performance of BPE. Interestingly, if we use BPE with a smaller vocabulary, such that the compression is equivalent between GQ-VAE and BPE, we find that GQ-VAE improves downstream language model learning. We conclude with a discussion of several exciting avenues for future work. Code can be found at https://github.com/Theo-Datta-115/gq-vae.

View on arXivView PDF

Code Implementations(1)

30Shell, PythonSep 16, 20251 years ago

Cite this paper

@article{datta2025gqvae,
  title  = {GQ-VAE: A gated quantized VAE for learning variable length tokens},
  author = {Theo Datta and Kayla Huang and Sham Kakade and David Brandfonbrener},
  year   = {2025},
  eprint = {2512.21913},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2512.21913v1}
}

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/2512.21913.svg)](https://codeofpaper.com/paper/2512.21913)

Discussion