Introduction
In modern computer vision and generative AI, image tokenization is a critical bottleneck. Standard models typically employ a fixed compression ratio, transforming every image—regardless of its inherent complexity—into a uniform number of tokens (e.g., 256). This "one-size-fits-all" approach leads to significant inefficiencies: complex images containing text or fine facial features suffer from over-compression and loss of detail, while simple images, such as a clear blue sky, waste computational resources through under-compression.
To address these limitations, we introduce CAT (Content-Adaptive Tokenizer). CAT dynamically adjusts the token budget based on the visual complexity of the content, predicted via a Large Language Model (LLM). This approach ensures high fidelity where it matters most while optimizing inference speed for simpler scenes.
Methodology
CAT's architecture consists of two primary innovations: an LLM-based complexity evaluator and a Nested Variational Autoencoder (VAE).
1. LLM-based Complexity Evaluation
Traditional pixel-level metrics like MSE or JPEG file size often fail to capture semantic complexity. For instance, a high-frequency texture like grass might have a large file size but low semantic importance compared to a small block of text. CAT utilizes Llama 3 to evaluate image descriptions and perception-focused queries (e.g., "Are there human faces?"). The LLM outputs a complexity score that maps to one of three compression ratios: 8x, 16x, or 32x.
2. Nested VAE Architecture
To support multiple compression ratios within a single framework, we designed a Nested VAE. Instead of training three separate models, this unified architecture uses different internal "routes" through the encoder and decoder. By employing skip connections and channel matching, the model shares a core middle block while outputting latent features of variable spatial dimensions (e.g., 64x64, 32x32, or 16x16).
Key Results and Insights
Our evaluation demonstrates that text is a superior proxy for visual complexity compared to raw pixel metrics. As shown in our quantitative analysis, LLM-based captions achieve a significantly higher Pearson correlation ($r=0.55$) with human-perceived optimal compression levels than traditional metrics like JPEG or MSE.
Performance Metrics
- Superior Reconstruction: CAT significantly outperforms fixed-ratio baselines on detail-sensitive datasets, reducing reconstruction FID (rFID) by 12% on CelebA (faces) and 39% on ChartQA (text/charts).
- Generative Efficiency: When integrated into a Diffusion Transformer (DiT) pipeline, CAT achieved an improved FID score of 4.56 on ImageNet while boosting inference throughput by 18.5%. This speedup is achieved because the model processes fewer tokens for the simpler images that constitute a large portion of natural datasets.
- Controllable Fidelity: The system allows for manual "token budgeting," enabling users to force high-fidelity 8x compression for critical subjects like portraits while using 32x for background landscapes.
Conclusion
CAT represents a shift toward semantically aware image processing. By leveraging the reasoning capabilities of LLMs to guide tokenization, we achieve a better balance between visual quality and computational efficiency. Future work will explore extending this content-adaptive approach to discrete tokenizers and the high-redundancy domain of video generation.
Summary updated