arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2410.04350cs.CL
收藏

TIS-DPO:基于估计权重的直接偏好优化的token级重要性采样

TIS-DPO: Token-level Importance Sampling for Direct Preference Optimization With Estimated Weights

Tsinghua University(清华大学);Apple(苹果公司);University of Illinois at Chicago(伊利诺伊大学芝加哥分校)

Aiwei Liu, Haoping Bai, Zhiyun Lu, Yanchao Sun, Xiang Kong, Simon Wang, Jiulong Shan, Albin Madappally Jose, Xiaojiang Liu, Lijie Wen, Philip S. Yu, Meng Cao

AI总结:

针对DPO将整个响应视为单个臂、忽略token重要性差异的问题,提出TIS-DPO,通过token级重要性采样并基于对比LLMs估计权重优化目标,在对齐及摘要任务上显著优于基线,还可识别关键token位置。

摘要:

直接偏好优化(DPO)因其简洁性和有效性,已被广泛用于大语言模型(LLMs)的偏好对齐。然而,DPO被推导为一个 bandit 问题,将整个响应视为单个臂,忽略了token之间的重要性差异,这可能影响优化效率并难以获得最优结果。在本工作中,我们提出,当token重要性无差异时,DPO的最优数据应满足获胜和失败响应中每个token的期望奖励相等。但由于最优数据集在实践中不可得,我们提出使用原始数据集进行重要性采样以实现无偏优化。据此,我们提出一种token级重要性采样的DPO目标函数TIS-DPO,它基于token的奖励为每个token分配重要性权重。受先前工作启发,我们利用一对对比LLMs的预测概率差异来估计token重要性权重。我们探索了三种构建对比LLMs的方法:(1)用对比提示引导原始LLM;(2)使用获胜和失败响应分别训练两个独立的LLMs;(3)用获胜和失败响应进行正向和反向DPO训练。实验表明,TIS-DPO在无害性和有用性对齐任务以及摘要任务上显著优于多种基线方法。我们还对估计的权重进行了可视化,证明其能够识别关键token位置。

英文摘要:

Direct Preference Optimization (DPO) has been widely adopted for preference alignment of Large Language Models (LLMs) due to its simplicity and effectiveness. However, DPO is derived as a bandit problem in which the whole response is treated as a single arm, ignoring the importance differences between tokens, which may affect optimization efficiency and make it difficult to achieve optimal results. In this work, we propose that the optimal data for DPO has equal expected rewards for each token in winning and losing responses, as there is no difference in token importance. However, since the optimal dataset is unavailable in practice, we propose using the original dataset for importance sampling to achieve unbiased optimization. Accordingly, we propose a token-level importance sampling DPO objective named TIS-DPO that assigns importance weights to each token based on its reward. Inspired by previous works, we estimate the token importance weights using the difference in prediction probabilities from a pair of contrastive LLMs. We explore three methods to construct these contrastive LLMs: (1) guiding the original LLM with contrastive prompts, (2) training two separate LLMs using winning and losing responses, and (3) performing forward and reverse DPO training with winning and losing responses. Experiments show that TIS-DPO significantly outperforms various baseline methods on harmlessness and helpfulness alignment and summarization tasks. We also visualize the estimated weights, demonstrating their ability to identify key token positions.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑