EMO icon indicating copy to clipboard operation
EMO copied to clipboard

[ICLR 2024]EMO: Earth Mover Distance Optimization for Auto-Regressive Language Modeling(https://arxiv.org/abs/2310.04691)

Results 4 EMO issues
Sort by recently updated
recently updated
newest added

Hello! ## Pull Request overview * Fix typo in README ## Details This PR should speak for itself :) Unrelated: I also wanted to check out the source for the...

您好,请教一下。 我再qwen 上使用这个loss,进行的是下游任务的微调,原本的loss 是 mle。 使用的是: EMO/language_modeling/gpt2.py 中的emo 。 他在训练的过程中会出现这样的现象: ![image](https://github.com/DRSY/EMO/assets/56286786/9cd640fa-72cd-4172-a180-db8c94c60241) 以及: ![image](https://github.com/DRSY/EMO/assets/56286786/98d74c83-58c8-4273-adb8-cb4ba7b65334) 请问这个情况大概是为什么?

gt_q = (q_grad * one_hot).detach() q_final = q_grad - gt_q 理论上改完之后loss的值应该不变,但现在使用公式$1 − ( EQ_{\theta})^TEP$算出来修改之前和之后的结果不同,又验证了公式$Q_{\theta}^TCP$,修改前后相同,应该是$Q_{\theta}$本身发生了变化导致$Q_{\theta}^TP$的值不等于1了,所以 emo_loss = (1 - torch.sum(p_contextual_repr * q_contextual_repr, dim=-1))是不是需要再减去一项 torch.sum(gt_q * stable_onehot, dim=-1)? 另外,在ground-truth token处因为$1-E^TE$对角线一直为0,梯度本身也会乘以这个值,相当于ground-truth token处的梯度为0,也不需要更新梯度,这两行代码是否还有存在的必要?

在我自己的代码中引入 emo, 使用的 bf16 训练, 训练过程中 loss 会变负, 可能是什么原因呢 loss: -2.334918e-02, loss_cur_dp: -2.334918e-02