Open CS123n opened 2 years ago
Hi, this is not a bug. We need to backdrop gradient signal from these two losses to the embedding function in order to jointly train.
@XiangLi1999 Hi, I'm curious about the loss funtion too. I can not understand why we need to compute decoder_nll
using x_start
in decoder_nll = self.token_discrete_loss(x_start, get_logits, input_ids)
. I think x_start
is the word embedding added with extra noise, and this decode loss is trying to recover the noise, and this has no relation with diffusion model. Besides, this is not consistent with the formulation in loss function, in the \log p_theta (w|x_0) part. Why can't we replace x_start
to the predicted model_out_x_start
? Is this more reasonable? (But the experiment results is not good)
@XiangLi1999 Hi, I'm curious about the loss funtion too. I can not understand why we need to compute
decoder_nll
usingx_start
indecoder_nll = self.token_discrete_loss(x_start, get_logits, input_ids)
. I thinkx_start
is the word embedding added with extra noise, and this decode loss is trying to recover the noise, and this has no relation with diffusion model. Besides, this is not consistent with the formulation in loss function, in the \log p_theta (w|x_0) part. Why can't we replacex_start
to the predictedmodel_out_x_start
? Is this more reasonable? (But the experiment results is not good)
Hi @summmeer ,
I also share the same feelings about this problem. It seems that decoder_nll
has less correlation with the training of diffusion models. And I wonder how is it performing during your experiments? As I was training the model, I found that NLL loss equals to zero for a long training period (about 8k iterations). At about 10k
training steps, the NLL loss occurs with increasing values. Have you ever encountered the similar situation? How is the NLL loss during your experiments?
Thanks for your reply in advance. It would help me a lot.
Best,
https://github.com/XiangLi1999/Diffusion-LM/blob/352b28c623c83083ab31d0d0b2a611f01c0fcb6c/improved-diffusion/improved_diffusion/gaussian_diffusion.py#L1549-L1557
Hi, I see there are three main losses. MSE, decoder_nll and kl_T. I think decoder_nll is designed for the decoder and MSE is designed for the diffusion model. However, I see x_start is not detached from these two losses, so these two losses also influence the embedding part. Is this a bug or a particular design?