In-context Ranking Preference Optimization

Junda Wu, Rohan Surana, Zhouhang Xie, Yiran Shen, Yu Xia, Tong Yu, Ryan A. Rossi, Prithviraj Ammanabrolu, Julian McAuley

TL;DR

This paper introduces IRPO, a novel framework that optimizes Large Language Models (LLMs) for ranking tasks using sparse, in-context user feedback. By jointly considering item relevance and positional importance, IRPO significantly improves LLM performance on various ranking tasks compared to existing methods, while also being more computationally efficient.

What Problem Does This Paper Address?

Modern applications like conversational agents and summarization systems often require LLMs to rank outputs effectively. While Direct Preference Optimization (DPO) has shown promise in aligning LLMs with user preferences, it typically relies on explicit pairwise comparisons. However, real-world user feedback often comes in the form of identifying a few relevant items within an ordered list (in-context feedback). This type of feedback is sparse and doesn't directly map to the pairwise comparisons DPO uses. Furthermore, existing methods struggle to capture both the relevance of items and their positions within the ranked list, which is crucial for tasks where the order of results matters significantly. This gap limits the ability of LLMs to effectively learn from natural, in-context user interactions for ranking.

Methods

The core contribution is the In-context Ranking Preference Optimization (IRPO) framework. IRPO extends DPO by:

  • Positional Preference Modeling: It uses a Plackett-Luce (PL) inspired model to capture preferences that consider both item relevance and their position in the ranked list. This allows it to interpret sparse listwise feedback.
  • Differentiable Objective: To overcome the challenge of optimizing discrete ranking metrics (like NDCG), IRPO introduces a differentiable objective. This is achieved by aggregating pairwise item preferences in a way that allows for effective gradient-based optimization.
  • Theoretical Insights: The authors provide theoretical analysis showing that IRPO's gradient naturally emphasizes items with significant discrepancies between the model's predictions and the desired ranking. This mechanism is linked to importance sampling, leading to an unbiased gradient estimator with reduced variance.

Datasets

The paper evaluates IRPO on several standard datasets across different tasks:

  • Conversational Recommendation: Inspired, Redial
  • Generative Retrieval: HotpotQA, MuSiQue
  • Question-Answering Re-ranking: ARC, CommonsenseQA

Key Insights and Ideas

  • The Power of Joint Modeling: The success of IRPO highlights that effectively ranking requires considering both what items are relevant and where they appear in the list. Simply optimizing for relevance alone is insufficient for many real-world ranking scenarios.
  • Bridging the Gap to Real-World Feedback: IRPO provides a practical way to leverage the more natural and common form of in-context, sparse feedback, moving beyond the limitations of requiring explicit pairwise comparisons.
  • Efficiency Through Smart Optimization: The theoretical connection to importance sampling is a key insight. It explains why IRPO is efficient and stable, as it intelligently focuses updates on the most informative parts of the data.
  • Beyond Pairwise: While DPO focuses on pairwise comparisons, IRPO's listwise approach, combined with positional awareness, offers a more holistic optimization strategy for ranking.

Key Results

  • Performance Improvement: IRPO consistently outperforms standard DPO and other baselines (SFT, SDPO, LiPO) across all evaluated tasks and LLM backbones (Llama3, Gemma2, Phi3) in terms of NDCG and Recall metrics. For example, on the ARC dataset, IRPO achieved significantly higher NDCG@5 scores compared to DPO.
  • Computational Efficiency: IRPO achieves approximately a 4x speedup in runtime per sample compared to other baselines due to its single-pass architecture.
  • Qualitative Improvements: Case studies demonstrate IRPO's ability to produce more coherent and contextually relevant rankings compared to baselines.

Limitations and Future Work

  • Limitations: The paper acknowledges that while IRPO is designed for sparse feedback, its performance might still benefit from richer feedback signals. The theoretical analysis relies on certain assumptions, such as bounded gradient differences, which are addressed in practice through techniques like gradient clipping.
  • Future Work: The authors suggest that IRPO's framework is generalizable to other ranking metrics beyond NDCG (e.g., P@K, MRR, MAP) and can be extended to online settings for continuous learning and adaptation in dynamic environments. The potential for broader integration into action-space exploration and reinforcement learning is also highlighted.

Summary updated

BibTeX
@inproceedings{wu2025context,
  author = {Junda Wu and Rohan Surana and Zhouhang Xie and Yiran Shen and Yu Xia and Tong Yu and Ryan A. Rossi and Prithviraj Ammanabrolu and Julian McAuley},
  title = {{In-context Ranking Preference Optimization}},
  booktitle = {COLM},
  year = {2025},
  url = {https://openreview.net/forum?id=L2NPhLAKEd},
}
Figure