Salvato in:
Dettagli Bibliografici
Autori principali: Fifty, Christopher, Junkins, Ronald G., Duan, Dennis, Iyengar, Aniketh, Liu, Jerry W., Amid, Ehsan, Thrun, Sebastian, Ré, Christopher
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:https://arxiv.org/abs/2410.06424
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866917957511151616
author Fifty, Christopher
Junkins, Ronald G.
Duan, Dennis
Iyengar, Aniketh
Liu, Jerry W.
Amid, Ehsan
Thrun, Sebastian
Ré, Christopher
author_facet Fifty, Christopher
Junkins, Ronald G.
Duan, Dennis
Iyengar, Aniketh
Liu, Jerry W.
Amid, Ehsan
Thrun, Sebastian
Ré, Christopher
contents Vector Quantized Variational AutoEncoders (VQ-VAEs) are designed to compress a continuous input to a discrete latent space and reconstruct it with minimal distortion. They operate by maintaining a set of vectors -- often referred to as the codebook -- and quantizing each encoder output to the nearest vector in the codebook. However, as vector quantization is non-differentiable, the gradient to the encoder flows around the vector quantization layer rather than through it in a straight-through approximation. This approximation may be undesirable as all information from the vector quantization operation is lost. In this work, we propose a way to propagate gradients through the vector quantization layer of VQ-VAEs. We smoothly transform each encoder output into its corresponding codebook vector via a rotation and rescaling linear transformation that is treated as a constant during backpropagation. As a result, the relative magnitude and angle between encoder output and codebook vector becomes encoded into the gradient as it propagates through the vector quantization layer and back to the encoder. Across 11 different VQ-VAE training paradigms, we find this restructuring improves reconstruction metrics, codebook utilization, and quantization error. Our code is available at https://github.com/cfifty/rotation_trick.
format Preprint
id arxiv_https___arxiv_org_abs_2410_06424
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Restructuring Vector Quantization with the Rotation Trick
Fifty, Christopher
Junkins, Ronald G.
Duan, Dennis
Iyengar, Aniketh
Liu, Jerry W.
Amid, Ehsan
Thrun, Sebastian
Ré, Christopher
Machine Learning
Computer Vision and Pattern Recognition
Vector Quantized Variational AutoEncoders (VQ-VAEs) are designed to compress a continuous input to a discrete latent space and reconstruct it with minimal distortion. They operate by maintaining a set of vectors -- often referred to as the codebook -- and quantizing each encoder output to the nearest vector in the codebook. However, as vector quantization is non-differentiable, the gradient to the encoder flows around the vector quantization layer rather than through it in a straight-through approximation. This approximation may be undesirable as all information from the vector quantization operation is lost. In this work, we propose a way to propagate gradients through the vector quantization layer of VQ-VAEs. We smoothly transform each encoder output into its corresponding codebook vector via a rotation and rescaling linear transformation that is treated as a constant during backpropagation. As a result, the relative magnitude and angle between encoder output and codebook vector becomes encoded into the gradient as it propagates through the vector quantization layer and back to the encoder. Across 11 different VQ-VAE training paradigms, we find this restructuring improves reconstruction metrics, codebook utilization, and quantization error. Our code is available at https://github.com/cfifty/rotation_trick.
title Restructuring Vector Quantization with the Rotation Trick
topic Machine Learning
Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2410.06424