# Oral 31897

- Kind: Oral
- Talk page and recording: https://iclr.cc/virtual/2025/oral/31897

> Transcript of the talk's recording (session_asr), made by speech recognition or taken from the host's captions. It may contain errors. The words are the speakers'; listen to the recording on the talk's page before quoting it.

Today I'm going to talk about our work on universally quantized diffusion models. What we want to do is we want to do progressive compression and usually at this point in a talk I would show you an example of progressive compression. It is not loading right now but maybe you can imagine it.
So this is an image we want to send and then what we can do for example with JPEG 2000 is we can get some intermediate reconstructions. So at first it might look something like this very pixelated, very grainy, very unpleasant to look at and then as more and more bits are received the quality improves until we have loaded the image in and then it will look like this before.
with default quality. So this is kind of something that is already possible with traditional compression codecs for images, for example JPEG 2000.
Um, neural, set of your neural compression techniques on the other hand are very effective at compressing data, better than traditional codecs like JPEC, but they oftentimes lack desirable properties, for example, progressive modes like we have in those examples. On the other hand, of course, we have seen before in the low for the traditional codecs, we also have disadvantages, for example.
The low bit rate photo we've just seen right now, it looks very unpleasant to look at and maybe that's something where neural methods can help with by filling in the textures and details with a generative model. So what we want to do in this work basically is we want to kind of bridge the gap and create a state-of-the-art neural compression method that also allows for progressive compression and fixes both of them, the best of both worlds basically.
Neural compression follows this basic principle that we don't need to compress what we can predict, and a better generative model should also be a better compressor. And for us, diffusion models are a natural choice. They give us state-of-the-art unconditional samples that are generated progressively, which allows us to, at any point, as maybe we have seen in the talk before, to denoise our noisy latent and...
obtain samples that are increasing in quality the more sampling steps we have. The big question now is how can we turn this into a compression algorithm that works and that's practical.
And before we can take a closer look at solving this problem, we'll dive into the math and a little bit in the background to understand the tools that we need. Let's first talk a bit about relative entropy coding, which is a set of algorithms that solve this task where we want to transmit a sample from a distribution queue under a shared prior P that is both available to the encoder and the decoder in queue all of queue given P bits.
So imagine that, for example, P and Q here are the same distribution, then the decoder wouldn't need to have any bits received. It could just sample from P and that would already be a good sample of Q. In the case where they are different, we can do something similar. We can just sample a bunch of samples of this distribution Q that both of them have available and that they can sample from.
And then select one similar to rejection sampling where we select a sample with probability that is proportional to the ratio of p and q. And then we only need to select this k and transmit the k which is a discrete number which is possible.
The problem that we have is that in general, even for state-of-the-art methods in relative entropy coding that allow for transmitting samples, we need a large number of samples here in the order of two to the power of the information that we want to transmit, which is very impractical, especially for the big Gaussians we would need to transmit for diffusion models. And unfortunately, there's no workaround to that just yet.
Okay, so how does this connect to compression? Maybe let's take a look at something that's more familiar to people that have or that know compression and we want to compress. Unfortunately, there's something missing, but we want to compress in
using a variational autoencoder. So what we want to do here is we start on the left, we start with an X, an image for example, or any kind of data, and we encode it with a probabilistic encoder here Q Z given X.
Once we have this latent representation, we can discretize and entropy code it or in our case as an alternative we can use retro entropy coding. This means we can directly transmit this sample of this latent without having to quantize anything at all without having to do any discretization errors. And then once we have done this which will cost us KL of QZ given X.
Given P of Z bits, where PZ would be the prior, we will be able to get a lossless reconstruction with our probabilistic decoder. The total cost of compressing will be just the sum of two terms. The first term would be the cost of transmitting our sample Z with relative entropy coding, which is the second term here.
And then the first term would be the cost of losslessly compressing our X given that information. And we see a really nice connection because it is already the novel that we train our variation auto-coder on. So that is kind of a very important connection we train directly on the end-to-end compression cost of our algorithm using relative entropy coding. For diffusion models we want to do something similar. We also want to train on something that is a compression cost of a practical algorithm.
What we have for diffusion models is that it's a kind of model that adds noise to images from the right to the left here, and then iteratively in the reverse process P tries to remove this noise. And we can train a discrete version of this on an elbow that looks like me like this and also contains a bunch of terms that I cut out. We can view discrete diffusion models as sort of a hierarchical VAE, which will allow us to...
have the same connection between maximum likelihood estimation and compression.
Specifically we'll call the framework of Ho et al and Tice et al which will allow us to guide our diffusion model towards the image we want to actually encode. Instead of sampling from P like we would do with unconditional sampling we sample from the Q distribution which is conditioned on a true image X. This means instead of guessing what the noise is and removing some of it we remove some of the true noise and intuitively if our noise estimation is good because our diffusion model learns
Our reverse process very well. This will be cheap because we can use reductive entropy coding and only use KL of Q given P bits, which is small for a good approximation P. If we take a look at how this might look like in terms of the algorithm that we want to do at the end, we will first draw a sample of a very noisy version of our image, which has this cost of reductive entropy coding, or we can just sample pure noise in a diffusion model.
Then we will iteratively start with this noise, remove at every step some of the true noise and go closer towards our desired image by using relative entropy coding that transmits a sample of this Q distribution given the reverse process parameters that we have computed like the mean and the variance which will also ensure this KL divergence cost at each step and then finally as in the VE we can do a lossless reconstruction with this cost.
And now we see the same thing we have seen with the VAE example is that the fusion model we use, the compression cost of sending an image via this method is exactly L of X, which is also the number we have trained our diffusion model on. That's amazing.
And crucially, what is important for our model specifically is that at every point we can get an intermediate reconstruction by using either the denoising network or we can do ancestral sampling or flow-based reconstruction that uses the ODE or the SDE involved. And these reconstructions have more and more bits required because we need more and more steps of our relative entropy coding but also increase the...
quality. So this is exactly the progressive mode we want to have. So what is the big challenge here? The big challenge is that relative entry decoding has exponential runtime as I mentioned earlier especially for the Gauchens involved here.
Before I go to how we solve this problem, I want to quickly highlight that there's also some concurrent work that's amazing from other people here from the festival that is also presented at this conference. So if you want to, feel free to check them out on this Friday's poster session to see an alternative solution. Our solution is to use uniform distributions. Uniform distributions are simpler.
in the way that we are able to, if we restrict our problem to solve this problem efficiently, in the case where we have a distribution y that we add a uniform distribution to, and this being the noise channel that we want to sample from here, Q, we can make use of this equivalence that adding noise is equivalent to essentially doing this operation which involves adding removing noise and rounding.
But crucially, this intermediate step came, we have a discrete quantity that we can compress very effectively with entropy coding. And the cost that is involved is just the scale deviations between Q and P, which is something that we have seen before as well, which is the cost that we are expecting anyway.
So to sum it up, with uniform distributions we can do relative entropy coding in linear time. We want to now use universal quantization to avoid our exponential runtime and want to combine it with our framework of using diffusion models for compression. What we have to do specifically is to change our forward and backward process so they're compatible.
This is quite straightforward. We base our model on a VDM diffusion model and only change the Gaussians involved here to a uniform distribution of the same meaning variance. And in the backward process as well, we change our distribution to something that is convolvable with a uniform distribution, which makes universal quantization possible. If we now look at how our
The model works as a compressor. It will look exactly like in the Gaussian case, but now instead of just doing relative entropy coding, for example, via the sampling I showed, we can just plug in our universal quantization and achieve compression with a diffusion model or progressive coding that is
as we want really nice. Okay, let's take a look very quickly at some results. First, some toy data. We see that here on the x-axis is the number of diffusion steps we use on the y-axis the bit rate. For VDM, so a Gaussian diffusion model, the more diffusion steps we do, the lower our bit rate gets. Unfortunately, this is not the case for our model where we incur a little bit of a penalty for using uniform distributions that are less flexible than the Gaussians.
But on the other hand, what we can see here is that for sequence five, which is kind of a sweet spot, we see that the UQAM's performance using uniform distributions achieves a similar bit rate as using Gaussians. This is okay in our sense because if you want to use diffusion model for compression, you would prefer to have a low number of samples anyway because the more neural functional evaluations we have, the longer it will take.
So let's take a look at how that looks on images. Here we also see that we are able to match closely the performance of a Gaussian diffusion model. We have a sizable gap to the potential of a diffusion model with infinite steps. So here are a thousand steps. But again, those are not very practical because A, they use relative entropy coding, which is infeasible because it's not tractable and also a thousand steps.
too long for compression because we don't want to take minutes maybe we want to just take a few seconds to compress this is maybe the most important comparison all of those I rate distortion comparisons and higher is better we compare against traditional codecs that can do those kinds of thing and here are progressive baselines as well we see that we perform a little bit better here compared to both neural baselines that do progressive compression and traditional compressive progression
Um yeah I'm gonna skip the slide and then I'll conclude. Uh today we presented an end-to-end trainable neural compression framework that allowed for progressive coding as can be seen here with just one model and our framework avoids the exponential runtime of previous work and shows competitive uh performance across a wide range of bit rates. Um yeah thanks for listening. If uh you're curious about the details please read our paper or visit our project page or come by our poster which is later this afternoon as well.
Okay, thank you for the great talk. We have time to take a couple of questions. Do you have any questions? Please raise your hand. There. Can you do this with just one model or do you need two? Can you do this with just one model or do you need two? One for generation and one for compression.
So this will just require one model. If we compare it with other baselines, for example, here in green you see a baseline that uses a diffusion model that's conditional and they will have to use one model for every trade-off even so one for low bit rates, one for high bit rates and we'll use the same model that has been trained for unconditional generation. We can just use it to compress just one model. And is this some kind of continuous...
Like what how many levels of compression can you show is it some some kind of continuous thing how many levels of compressions can you show So there are as many levels of compression. For example here what we did we did five levels. We start off with something that has no information about the image and then we have five levels in between. But the number of levels is flexible in the sense that we can control it with the number of sampling steps we'll do in the diffusion model.
In our case we are limited a little bit in that we have to use a low number of of those steps so maybe less than 10 would be good for our method but we hope that maybe in the future this is a limitation we can circumvent but also maybe we don't need more than 10 between steps.
And so you confirm that you do this as you generate. It's not that it's another step in parallel or that you have to do after. Yeah, so the encoder sends at each step basically some bits and then the decoder receives those bits and in every packet of bits that's received we can improve the quality a little bit until all bits are received and then we have a lossless representation or transmission of our image. And sorry, one last one. And what is the kind of timing we're looking at?
Looking up because the demo didn't look. You mean the time to send?
order time to compress it. It really depends on the model we use. With our architecture the time cost of relative entropy coding is gone because universal quantization is O of 1 basically it's instant so it only is the time you need for one neural functional evaluation of the diffusion model times the number of samples you want to take. So if you have a bigger model it might take a few seconds if you have a small one it
wanted my beep faster or or slower depending on the size of the model really. Thanks. Yep. Okay, uh because the lack of time I guess we need to move on to the next page. So let's thank this speaker again.
