Test-Time Preference Optimization: On-the-Fly Alignment via Iterative Textual Feedback

Yafu Li, Xuyang Hu, Xiaoye Qu, Linjie Li, Yu Cheng
2/14/2026

No official code found. Best implementation: yafuly/TPO (186 stars, last commit 2025-05-08).

Abstract

Large language models (LLMs) demonstrate impressive performance but lack the flexibility to adapt to human preferences quickly without retraining. In this work, we introduce Test-time Preference Optimization (TPO), a framework that aligns LLM outputs with human preferences during inference, removing the need to update model parameters. Rather than relying on purely numerical rewards, TPO translates reward signals into textual critiques and uses them as textual rewards to iteratively refine its response. Evaluations on benchmarks covering instruction following, preference alignment, safety, and mathematics reveal that TPO progressively improves alignment with human preferences. Notably, after only a few TPO steps, the initially unaligned Llama-3.1-70B-SFT model can surpass the aligned counterpart, Llama-3.1-70B-Instruct. Furthermore, TPO scales efficiently with both the search width and depth during inference. Through case studies, we illustrate how TPO exploits the innate capacity of LLM to interpret and act upon reward signals. Our findings establish TPO as a practical, lightweight alternative for test-time preference optimization, achieving alignment on the fly. Our code is publicly available at https://github.com/yafuly/TPO.

View on arXivView PDF

Code Implementations(1)

yafuly/TPOCommunity100%

Test-time preferenece optimization (ICML 2025).

18612Python, Jupyter NotebookJan 14, 20251 years ago

Similar Papers

Cite this paper

@article{li2026testtime,
  title  = {Test-Time Preference Optimization: On-the-Fly Alignment via Iterative Textual Feedback},
  author = {Yafu Li and Xuyang Hu and Xiaoye Qu and Linjie Li and Yu Cheng},
  year   = {2026},
  eprint = {2501.12895},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2501.12895},
  journal = {ICML 2025 2025}
}

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/2501.12895.svg)](https://codeofpaper.com/paper/2501.12895)

Discussion