Token-level Direct Preference Optimization

Yongcheng Zeng, Guoqing Liu, Weiyu Ma, Ning Yang, Haifeng Zhang +1 more
2/12/2026

No official code found. Best implementation: Vance0124/Token-level-Direct-Preference-Optimization (156 stars, Apache-2.0, last commit 2025-02-14).

Abstract

Fine-tuning pre-trained Large Language Models (LLMs) is essential to align them with human values and intentions. This process often utilizes methods like pairwise comparisons and KL divergence against a reference LLM, focusing on the evaluation of full answers generated by the models. However, the generation of these responses occurs in a token level, following a sequential, auto-regressive fashion. In this paper, we introduce Token-level Direct Preference Optimization (TDPO), a novel approach to align LLMs with human preferences by optimizing policy at the token level. Unlike previous methods, which face challenges in divergence efficiency, TDPO incorporates forward KL divergence constraints for each token, improving alignment and diversity. Utilizing the Bradley-Terry model for a token-based reward system, TDPO enhances the regulation of KL divergence, while preserving simplicity without the need for explicit reward modeling. Experimental results across various text tasks demonstrate TDPO's superior performance in balancing alignment with generation diversity. Notably, fine-tuning with TDPO strikes a better balance than DPO in the controlled sentiment generation and single-turn dialogue datasets, and significantly improves the quality of generated responses compared to both DPO and PPO-based RLHF methods. Our code is open-sourced at https://github.com/Vance0124/Token-level-Direct-Preference-Optimization.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

Reference implementation for Token-level Direct Preference Optimization(TDPO)

15615PythonApr 16, 20241 years agoApache-2.0

Similar Papers

Cite this paper

@article{zeng2026tokenlevel,
  title  = {Token-level Direct Preference Optimization},
  author = {Yongcheng Zeng and Guoqing Liu and Weiyu Ma and Ning Yang and Haifeng Zhang and Jun Wang},
  year   = {2026},
  eprint = {2404.11999},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2404.11999},
  journal = {ICML 2024 2024}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2404.11999.svg)](https://codeofpaper.com/paper/2404.11999)

Discussion