Skip to main content
QUICK REVIEW

[论文解读] Finite Scalar Quantization: VQ-VAE Made Simple

Fabian Mentzer, David Minnen|arXiv (Cornell University)|Sep 27, 2023
Advanced Image and Video Retrieval TechniquesComputer Science被引用 12
一句话总结

本文用有限标量量化(FSQ)替代 VQ-VAE 中的向量量化,FSQ 是一种简单、有限界、低维的标量量化,在图像生成和密集视觉任务中仍能获得具有竞争力的结果,同时避免了与码本相关的缺点。

ABSTRACT

We propose to replace vector quantization (VQ) in the latent representation of VQ-VAEs with a simple scheme termed finite scalar quantization (FSQ), where we project the VAE representation down to a few dimensions (typically less than 10). Each dimension is quantized to a small set of fixed values, leading to an (implicit) codebook given by the product of these sets. By appropriately choosing the number of dimensions and values each dimension can take, we obtain the same codebook size as in VQ. On top of such discrete representations, we can train the same models that have been trained on VQ-VAE representations. For example, autoregressive and masked transformer models for image generation, multimodal generation, and dense prediction computer vision tasks. Concretely, we employ FSQ with MaskGIT for image generation, and with UViM for depth estimation, colorization, and panoptic segmentation. Despite the much simpler design of FSQ, we obtain competitive performance in all these tasks. We emphasize that FSQ does not suffer from codebook collapse and does not need the complex machinery employed in VQ (commitment losses, codebook reseeding, code splitting, entropy penalties, etc.) to learn expressive discrete representations.

研究动机与目标

  • 通过用有界标量量化替代 VQ,激发更简单的离散表示。
  • 证明 FSQ 可以作为多种架构(MaskGIT、UViM)和任务中的直接替代。
  • 分析 FSQ 与 VQ 在码本利用、扩展行为和表示复杂度上的差异。
  • 表明 FSQ 避免了 VQ 基方法中常见的码本塌陷和辅助损失。

提出的方法

  • 引入有限标量量化(FSQ),使一个 d 维编码器输出在每个通道上有界并四舍五入到 L_i 个等级,产生大小为 ∏ L_i 的隐式码本。
  • 使用直通估计器(STE)通过四舍五入操作传播梯度。
  • 提供选择 FSQ 超参数(d 和 L_i)以近似目标码本大小的启发式方法,实际建议 L_i ≥ 5。
  • 将 FSQ 视为支持离散表示的神经网络中 VQ 的直接替代,适当调整输入/输出层。
  • 对比 VQ 与 FSQ 在 MaskGIT(图像生成)和 UViM(深度、上色、全景分割)在不同码本大小下的表现。

实验结果

研究问题

  • RQ1FSQ 能否在基于 VQ-VAE 的架构中作为 VQ 的直接替代且无需辅助损失?
  • RQ2随着码本大小增大,FSQ 与 VQ 在码本利用、重建质量和采样性能方面的比较?
  • RQ3更大尺寸的 FSQ 码本是否提升性能,是否存在因建模复杂度带来的收益递减点?
  • RQ4在有限的架构改动下,FSQ 是否对多样化的视觉任务与架构(MaskGIT、UViM)具有鲁棒性?
  • RQ5在表示复杂度与类似压缩器的度量(如压缩成本)之间,FSQ 与 VQ 的权衡为何?

主要发现

  • FSQ 可以替代基于 VQ-VAE 的模型中的 VQ,性能降幅仅为(报告指标中的)0.5–3%。
  • FSQ 在大码本下实现接近100%的码字利用率,而 VQ 很难利用大量码字(下降至不到 50%)。
  • FSQ 在多次运行中展现出在图像生成(MaskGIT)和密集视觉任务(UViM)上的有竞争力的重建与采样质量。
  • FSQ 不需要像承诺损失或熵惩罚等辅助损失,且避免码本塌陷。
  • FSQ 的码本维度通常远小于 VQ(d<10 vs d≥512),这有助于减少参数和简化优化。
  • 增大 FSQ 码本大小会提升 FSQ 的重建 FID,而采样 FID 在大约 2^12 码后趋于饱和,原因是更高的压缩成本。
  • 在各任务中,即使减少或移除辅助信息/上下文(例如在 UViM 中无上下文的 FSQ vs VQ),FSQ 仍然具备与 VQ 相竞争的性能。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。