TL;DR
WithinVAE is a compact visual autoencoder that learns semantic structure entirely from its own internal representations via self-distillation, eliminating the need for external pretrained encoders like CLIP or DINO. It achieves superior reconstruction quality and semantic organization at half the latent capacity of previous state-of-the-art methods, while enabling variable-rate "prefix decoding" from a single model.
What Problem Does This Paper Address?
Visual autoencoders face a difficult "trilemma": they must simultaneously be high-fidelity (reconstruct pixels accurately), compact (low dimensionality for efficient downstream tasks), and semantically structured (latents should represent meaningful concepts).
Most current "semantic tokenizers" solve the semantic part by "borrowing" representations from pretrained models like DINO or CLIP. However, these models are optimized for recognition and often discard the fine-grained appearance details—like texture and exact edges—required for perfect image reconstruction. This creates a coupling between the autoencoder and an external model that might not share the same goals. WithinVAE addresses the question: Can a compact autoencoder organize its own semantic structure without borrowing a recognition representation?
Methods
The authors introduce WithinVAE, which integrates three key mechanisms:
- Self-Distilled Semantics: Instead of an external teacher, WithinVAE uses an Exponential Moving Average (EMA) copy of itself. It employs two complementary distillation losses:
- Global DINO-style loss: Matches mean-pooled compact tokens between student and teacher across different augmented views of the same image.
- Local iBOT-style loss: Performs masked patch prediction to ensure the shared encoder retains spatially grounded details.
- Sequential Bottleneck & Position-Dependent Masking: The model maps images to a 1D sequence of tokens. During training, tokens later in the sequence have a higher probability of being masked. This "ordered corruption" forces the model to pack the most critical information into the early tokens (the "prefix").
- Variational Bottleneck: It uses a token-wise VAE to maintain a continuous, modelable latent space suitable for downstream generative tasks like diffusion.
Datasets
- ImageNet-1K: The primary dataset used for training and evaluation at $256 \times 256$ resolution.
- The model is evaluated on standard reconstruction metrics (PSNR, rFID, LPIPS, SSIM) and semantic probes (frozen linear probing and nearest-neighbor accuracy).
Key Insights and Ideas
- Semantics can be "homegrown": The paper demonstrates that internal pressures—view consistency and masked prediction—are sufficient to organize semantics. You don't need a billion-parameter external model to teach an autoencoder what an object is.
- Synergy over Trade-off: Surprisingly, adding semantic self-distillation actually improves reconstruction fidelity. The local iBOT-style loss is crucial here, as it prevents the encoder from becoming too invariant (losing detail) while chasing global semantic consistency.
- Ordered Reliability: The position-dependent masking creates a natural hierarchy. A single model can perform "prefix decoding," where using just the first 128 tokens (25% of the sequence) yields a reconstruction that is already better than previous full-sequence baselines.
Key Results
- State-of-the-Art Reconstruction: On ImageNet-1K, WithinVAE improves all four reported reconstruction metrics over the RPiAE baseline. It achieves a +1.36 dB PSNR gain while using only half the latent scalar capacity (8,192 vs 16,384 scalars).
- Superior Semantic Quality: In frozen linear probing, WithinVAE's latents outperform RPiAE by 6.5 points and its own reconstruction-only baseline by 5.1 points, proving that the semantic gains come from the self-distillation objective itself.
- Clean Attention: Qualitative attention maps show that WithinVAE naturally focuses on foreground objects without any explicit supervision, whereas baselines that borrow semantics often produce diffuse or fragmented attention in their actual bottlenecks.
Limitations and Future Work
- Generation Performance: While WithinVAE excels at reconstruction and semantics, its downstream generation quality (when paired with a Diffusion Transformer) currently trails behind some baselines (gFID of 9.12 vs 2.25 for RPiAE). The authors attribute this to a "compatibility" issue between the latent distribution geometry and the generator, rather than a failure of the representation.
- Quantization: The current model uses continuous scalars. Future work could involve discrete quantization to create a true variable-rate bitstream codec.
- Dense Task Evaluation: While global semantics are strong, testing on dense tasks like semantic segmentation would further confirm the quality of the local patch-level representations.
Summary updated