Make Large Language Model a Better Ranker

Wenshuo Chao, Zhi Zheng, Hengshu Zhu, Hao Liu

Introduction

Large Language Models (LLMs) have demonstrated remarkable capabilities across various domains, yet their application in recommendation systems (RS) remains challenging. Traditional ranking methods often struggle with computational efficiency or fail to align with specific ranking objectives. This paper introduces ALRO (Aligned List-wise Ranking Objectives), a framework designed to transform LLMs into high-performance, efficient recommendation rankers by addressing two critical issues: objective misalignment and position bias.

The Ranking Paradigm Shift

Most existing LLM-based recommendation approaches rely on point-wise or pair-wise ranking. Point-wise methods evaluate items individually, while pair-wise methods compare them in pairs. Both are computationally expensive, requiring $N$ or $O(N \log N)$ model calls respectively to rank a list of $N$ items.

Comparison of Point-wise, Pair-wise, and List-wise ranking paradigms.

In contrast, list-wise ranking processes the entire candidate list in a single pass. While significantly faster, it faces two major hurdles:

  1. Objective Misalignment: LLMs are typically optimized for next-token prediction using cross-entropy loss, which does not directly optimize for ranking metrics like Normalized Discounted Cumulative Gain (NDCG).
  2. Position Bias: LLMs exhibit a sensitivity to the order of input items, where the same set of items can yield different rankings simply by shuffling their positions in the prompt.

The Challenge of Position Bias

The phenomenon of position bias is a significant obstacle for reliable list-wise ranking. Empirical evidence shows that the predicted rank of an item can vary drastically based on its position in the input sequence, even when the underlying relevance (labels) remains constant. This inconsistency undermines the reliability of LLMs in production environments.

Empirical evidence of position bias in LLM-based ranking.

The ALRO Framework

To overcome these challenges, the ALRO framework fine-tunes LLMs using Low-Rank Adaptation (LoRA) combined with two innovative loss functions:

Soft Lambda Loss (SLL)

Ranking metrics are generally non-differentiable because they involve discrete sorting operations. ALRO introduces a Soft Lambda Loss, which utilizes a soft-argmax approach to create a differentiable ranking score. By scaling the softmax distribution with a hyperparameter $\gamma$, the model can be optimized directly for order relations and user rating magnitudes, bridging the gap between language modeling and Information Retrieval (IR) theory.

Permutation-Sensitive Loss (PSL)

To mitigate position bias without the inference-time overhead of shuffling (bootstrapping), ALRO employs Permutation-Sensitive Loss during training. The model is fed both an original list and a permuted version. A Kullback–Leibler (KL) divergence loss is then applied to force the model’s output probability distributions to remain consistent regardless of input order. This approach ensures robustness at zero additional cost during inference.

Experimental Evaluation

The framework was evaluated on four benchmark datasets: MovieLens-1M, Amazon "CDs & Vinyl", Amazon "Books", and Amazon "Toys and Games". The researchers sampled the most recent 25 user-interacted items as candidates for the ranking task. Results demonstrate that ALRO consistently outperforms traditional embedding-based models (e.g., SASRec, DIN) and state-of-the-art LLM-based baselines (e.g., TallRec, LlamaRec).

Key Results

  • Efficiency: ALRO achieves a 5-fold reduction in inference time compared to bootstrapping methods (0.25s vs 1.37s per sample) while maintaining or improving accuracy.
  • Scalability: The benefits of ALRO are more pronounced in larger models (e.g., Llama3-8B), suggesting that it effectively leverages the innate reasoning capabilities of advanced LLMs.
  • Necessity of Fine-tuning: Zero-shot and few-shot LLMs performed poorly compared to traditional methods, confirming that specialized fine-tuning is essential for complex ranking tasks.

Conclusion and Future Work

ALRO provides a robust and efficient solution for list-wise ranking in recommendation systems. While highly effective, future research is needed to address the potential loss of natural language explainability and to scale the framework beyond current context window limitations, perhaps through multi-stage "retrieve-and-rank" architectures.

Summary updated

BibTeX
@inproceedings{chao2024make,
  author = {Wenshuo Chao and Zhi Zheng and Hengshu Zhu and Hao Liu},
  title = {{Make Large Language Model a Better Ranker}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2024},
  doi = {10.18653/v1/2024.findings-emnlp.51},
}
Figure