BiGR: Harnessing Binary Latent Codes for Image Generation and Improved Visual Representation Capabilities

Shaozhe Hao, Xuantong Liu, Xianbiao Qi, Shihao Zhao, Bojia Zi, Rong Xiao, Kai Han, Kwan-Yee K. Wong

Introduction

BiGR (Binary latent codes for Generative and Representation) is a unified framework designed to bridge the persistent gap between image generation and visual understanding. By utilizing compact binary strings, BiGR combines a bidirectional transformer with a novel "entropy-ordered" sampling method. The result is a model capable of producing high-quality images while simultaneously serving as a powerful feature extractor for downstream classification tasks.

Overview of BiGR's capabilities, showcasing high-quality generation, zero-shot interpolation, and significant improvements in both FID and Linear Probe metrics compared to baselines.

The Problem: The Divide Between Creation and Comprehension

In the current AI landscape, there is a noticeable divide between models that create and models that understand. Generative models (like Diffusion or Autoregressive transformers) excel at producing visually stunning images but often fail to learn meaningful internal representations useful for perception tasks like object recognition. Conversely, discriminative models (like CLIP or MAE) are highly adept at understanding images but lack the architecture to generate them.

Researchers identified a specific weakness in conditional generative models: heavy reliance on class labels to guide the generation process often weakens the relationship between the learned image features and the actual visual categories. BiGR addresses this by creating a single, efficient model that treats generation and discrimination as two sides of the same coin.

The BiGR Architecture

BiGR introduces several architectural innovations to achieve this unification:

  • Binary Tokenizer: Instead of using a standard vocabulary of discrete visual tokens (like VQ-VAE), BiGR compresses images into sequences of binary latent codes. This compact format is highly efficient and forces the model to learn more "separable" discriminative features.
  • Bidirectional Backbone: While many image transformers (like LlamaGen) are autoregressive—predicting pixels sequentially from left to right—BiGR uses a bidirectional transformer based on the Llama architecture. This allows every part of the image to "see" the entire context during the modeling process.
  • Binary Transcoder: To predict the binary codes, the model employs a Bernoulli diffusion process. This transcoder predicts the probability of each bit being a 0 or a 1, elegantly handling discrete binary data within a continuous framework.
  • Entropy-Ordered Sampling: During inference, BiGR calculates the entropy (uncertainty) of its predictions and fills in the most "certain" tokens first. This iterative, coarse-to-fine process allows the model to build a global scaffold of the image before committing to fine-grained details.

Key Capabilities and Results

BiGR was primarily trained and evaluated on ImageNet-1K for class-conditional generation and linear-probe evaluation, with text-to-image capabilities trained on a 20M subset of LAION-400M and JourneyDB.

Performance Leap

Depending on the model scale, BiGR demonstrates massive improvements over previous baselines in both generation and representation:

  • Generation Quality: The flagship BiGR-XXL achieved an impressive FID-50k score of 2.36 on ImageNet 256x256, significantly outperforming its autoregressive counterpart, LlamaGen (3.09), and rivaling top-tier diffusion models.
  • Representation Strength: In "linear probing" (training a simple classifier on top of the model's frozen features), BiGR-XXL achieved 69.8% accuracy. This is a massive leap over LlamaGen (40.5%) and outperforms other generative-discriminative hybrids like MAR (60.0%).
  • Efficiency: Thanks to entropy-ordered sampling, BiGR can generate high-quality images in just 20–25 iterations, making it substantially faster than many traditional diffusion-based approaches.

Zero-Shot Versatility

Because BiGR is built on a masked modeling framework, it is inherently flexible. Without any fine-tuning or structural modifications, it can perform inpainting, outpainting, image editing, and interpolation simply by locking known pixels and letting the model predict the masked ones.

Limitations and Future Work

While BiGR represents a significant step forward, it does face a few hurdles:

  • Hyperparameter Sensitivity: The sampling process involves variables (like the Classifier-Free Guidance scale and Gumbel temperature) that require careful tuning to balance image quality and diversity.
  • Fixed Sequence Length: The architecture is currently tied to a specific sequence length determined during training, meaning generating higher-resolution images requires retraining the model.
  • Complex Details: Like many contemporary models, BiGR can still struggle to perfectly render highly complex scenes with intricate details, such as human hands or dense crowds.

Future work will likely focus on scaling training data and exploring more flexible architectures capable of handling variable resolutions natively, further cementing BiGR's role as a unified vision foundation model.

Summary updated

BibTeX
@inproceedings{hao2025bigr,
  author = {Shaozhe Hao and Xuantong LIU and Xianbiao Qi and Shihao Zhao and Bojia Zi and Rong Xiao and Kai Han and Kwan-Yee K. Wong},
  title = {{BiGR: Harnessing Binary Latent Codes for Image Generation and Improved Visual Representation Capabilities}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=1Z6PSw7OL8},
}
Figure