Learning-to-Rank Meets Language: Boosting Language-Driven Ordering Alignment for Ordinal Classification

Rui Wang, Peipei Li, Huaibo Huang, Chunshui Cao, Ran He, Zhaofeng He · DOI

Abstract

Ordinal classification tasks, such as age estimation or image quality assessment, require models to understand the inherent sequence of labels. While vision-language models like CLIP excel at semantic alignment, they often struggle with ordering alignment. We present L2RCLIP, a framework that integrates "Learning-to-Rank" principles into CLIP. By utilizing a novel RankFormer module and a cross-modal pairwise loss, L2RCLIP ensures that internal representations respect natural label sequences. Our approach achieves state-of-the-art performance across multiple benchmarks and demonstrates significant robustness in few-shot scenarios.

Introduction

In standard classification, labels are treated as independent categories (e.g., "cat" vs. "dog"). However, in ordinal classification, labels follow a natural, sequential order (e.g., "10 years old" < "20 years old" < "30 years old"). Treating these as independent classes is suboptimal; a model predicting 11 for a 10-year-old should be penalized less than one predicting 80.

While recent vision-language models like CLIP have shown great promise, they struggle with ordinality. They are excellent at semantic alignment (matching an image of a child to the text "a child"), but they often fail at ordering alignment (ensuring the embedding for "10 years old" is closer to "11" than to "60"). Previous attempts to fix this often overfit training data or sacrifice semantic accuracy to force a linear order.

Comparison of L2RCLIP with previous methods CoOp and OrdinalCLIP. L2RCLIP maintains both semantic and ordering alignment.

Methodology

L2RCLIP introduces two primary innovations to the CLIP architecture to address the gap between semantic and ordinal alignment:

1. RankFormer

RankFormer is a prompt-tuning technique that replaces static text prompts with a token-level attention mechanism using residual-style blending. It "boosts" the inherent ordinal relationships already present in human language—such as the fact that the word "sixty" naturally implies a greater value than "ten"—within the word embedding space.

2. Cross-modal Ordinal Pairwise Loss ($L_{cop}$)

The authors restructured the standard cross-entropy loss for a cross-modal space. This new loss function employs "attraction" to pull image features toward their correct text labels and a weighted "repulsion" to push them away from incorrect labels based on their distance in the label space. This ensures that the geometric distance in the embedding space reflects the difference in ranks.

Overview of the L2RCLIP framework, showing the feature space dynamics including attraction and repulsion mechanisms.

Experimental Results

The model was evaluated across three distinct ordinal tasks using five datasets: Facial Age Estimation (MORPH II, CLAP2015, Adience), Aesthetic Assessment (CrowdBeauty), and Historical Image Dating (HCI).

L2RCLIP consistently outperformed both conventional ordinal regression algorithms and recent language-driven models:

  • Age Estimation: On the MORPH II dataset, it achieved a Mean Absolute Error (MAE) of 2.13, significantly outperforming the previous best language-based model, OrdinalCLIP.
  • Aesthetics & Dating: It set new state-of-the-art benchmarks on CrowdBeauty and HCI, improving accuracy by roughly 3-10% over vanilla CLIP and CoOp.
  • Few-Shot Learning: In a 1-shot setting, L2RCLIP reduced the MAE on MORPH II from 5.09 (CoOp) to 4.54, demonstrating its ability to generalize from minimal data by leveraging language priors.

Discussion and Key Insights

A core finding of this work is that human language contains rich ordinal priors. Rather than teaching a model ordinality from scratch, L2RCLIP leverages existing linguistic knowledge. Furthermore, while previous methods like OrdinalCLIP achieved ordering by interpolating features—which often "smudged" semantic clarity—L2RCLIP demonstrates that a feature space can be both perfectly ordered and semantically distinct.

Because L2RCLIP relies on language priors rather than just memorizing training sets, it performs exceptionally well under distribution shifts or when training data is imbalanced.

Conclusion

L2RCLIP successfully bridges the gap between semantic and ordering alignment in vision-language models. While the model shows impressive technical gains, the authors note that pre-trained models may harbor demographic biases. Future work will explore applying these language-driven ranking priors to more complex tasks, such as video-based ordinal classification and multi-modal recommendation systems.

Summary updated

BibTeX
@inproceedings{wang2023learning,
  author = {Rui Wang and Peipei Li and Huaibo Huang and Chunshui Cao and Ran He and Zhaofeng He},
  title = {{Learning-to-Rank Meets Language: Boosting Language-Driven Ordering Alignment for Ordinal Classification}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2023},
  url = {https://openreview.net/forum?id=XXagS1RQH0},
}
Figure