SPD: Single Pass Decoding for Generative Reranking

TL;DR

SPD uses the Hungarian algorithm for single-pass decoding, achieving a 64x speed-up.

cs.LG 🔴 Advanced 2026-09-02 4 views
Emil Laftchiev Prachi Agrawal Moe Kayali Bixing Yan Qi Xu Zijie Lei Chen Qiu Zhi Hua Ke Li Luke Simon
generative ranking Hungarian algorithm LoRA fine-tuning large language models combinatorial optimization

Key Findings

Methodology

SPD decodes rankings in a single forward pass. It uses a lightweight self-attention head to read an N×K item-position score matrix from the LLM's prefill hidden states, then decodes the ordinals as the optimal bipartite assignment via the Hungarian algorithm. Combined with LoRA-based fine-tuning and autoregressive LLM ranking distillation, SPD achieves 28 ms end-to-end inference speed.

Key Results

  • On the internal dataset, SPD achieved a 64x speed-up while maintaining ranking quality comparable to the teacher model. Specifically, SPD reached 0.1652 on Recall@1, compared to the teacher's 0.1634.
  • On the Amazon Beauty dataset, SPD achieved a 44.9x speed-up, with an AUC of 0.6168, close to the 32B Qwen model's 0.6292.
  • Ablation studies on different scoring head configurations confirmed the superior performance of the self-attention head.

Significance

SPD combines generative ranking with combinatorial optimization, significantly enhancing real-time ranking efficiency. By simplifying ranking decoding to an optimal assignment problem, SPD paves the way for other O(1) decode mechanisms, with broad application potential in recommendation systems, advertising, and search.

Technical Contribution

SPD introduces a new decoding strategy, casting ranking decoding as an optimal assignment problem on hidden states. Compared to existing autoregressive decoding methods, SPD achieves significant inference speed-up and guarantees output validity. LoRA fine-tuning enhances model adaptability.

Novelty

SPD is the first to apply the Hungarian algorithm to the decoding process of generative ranking, directly decoding rankings from hidden states rather than output logits. Compared to methods like FIRST, SPD achieves fundamental innovation in decoding strategy.

Limitations

  • SPD may be limited by the complexity of the Hungarian algorithm when handling large-scale datasets, although it performs well on smaller datasets.
  • The model's performance depends on the quality of prefill hidden states, which may be affected in certain scenarios.
  • Further optimization may be needed to handle specific ranking requirements in some applications.

Future Work

Future research could explore SPD's performance across different datasets and application scenarios, optimize the efficiency of the Hungarian algorithm, and integrate other combinatorial optimization techniques to further enhance ranking quality and speed.

AI Executive Summary

Large language models excel in generative ranking, but their decoding process typically requires sequential generation of ranking items, leading to inefficiencies. SPD decodes all ranking items in a single forward pass, significantly enhancing ranking efficiency. The method utilizes a lightweight self-attention head to read score matrices from hidden states and decodes them using the Hungarian algorithm. Experiments demonstrate SPD's significant speed-up across multiple datasets while maintaining ranking quality comparable to teacher models. SPD's innovation lies in treating ranking decoding as a combinatorial optimization problem, offering a new solution for real-time ranking. While SPD may face limitations in certain scenarios, its potential is vast, and future research can further optimize its performance.

Deep Analysis

Background

Generative ranking is crucial for recommendation systems, advertising, and search. Traditional autoregressive decoding methods require sequential generation of ranking items, leading to inefficiencies. Recently, large language models have excelled in generative ranking, but their decoding process remains a bottleneck. SPD offers a new solution by simplifying ranking decoding to a combinatorial optimization problem.

Core Problem

Generative ranking requires ordering N candidate items, with traditional autoregressive decoding methods needing sequential generation, leading to inefficiencies. Enhancing decoding efficiency while maintaining ranking quality is a crucial and challenging problem.

Innovation

SPD decodes all ranking items in a single forward pass, significantly enhancing ranking efficiency. Its core innovation lies in using the Hungarian algorithm for decoding ranking items, treating ranking decoding as an optimal assignment problem. Compared to existing methods, SPD achieves fundamental innovation in decoding strategy.

Methodology

  • �� Use a lightweight self-attention head to read an N×K item-position score matrix from the LLM's prefill hidden states.
  • �� Decode the ordinals as the optimal bipartite assignment via the Hungarian algorithm, yielding a valid permutation.
  • �� Combine LoRA-based fine-tuning and autoregressive LLM ranking distillation to achieve 28 ms end-to-end inference speed.

Experiments

Experiments were conducted on internal and Amazon Beauty datasets, evaluating SPD's performance and latency. Metrics include AUC, Recall@{1, 10}, and NDCG@1. Ablation studies validated the performance of different scoring head configurations.

Results

SPD achieved a 64x speed-up on the internal dataset while maintaining ranking quality comparable to the teacher model. On the Amazon Beauty dataset, SPD achieved a 44.9x speed-up, with an AUC of 0.6168, close to the 32B Qwen model's 0.6292. Ablation studies confirmed the superior performance of the self-attention head.

Applications

SPD can be used in real-time ranking tasks in recommendation systems, advertising, and search. Its efficient decoding strategy allows it to provide high-quality ranking results under strict latency constraints.

Limitations & Outlook

SPD may be limited by the complexity of the Hungarian algorithm when handling large-scale datasets. The model's performance depends on the quality of prefill hidden states, which may be affected in certain scenarios. Future research can further optimize its performance.

Plain Language Accessible to non-experts

Imagine you're shopping in a large supermarket, and SPD is like a super-efficient cashier. Traditional cashiers scan each item one by one, but SPD just takes a glance at your cart and quickly decides the best placement for each item. It uses a special algorithm to ensure every item finds its spot quickly without needing individual processing. This method not only saves time but also ensures every item is correctly arranged, just like products neatly organized on supermarket shelves.

ELI14 Explained like you're 14

Hey, buddies! Imagine you're playing a super cool game where you need to quickly arrange a bunch of items. Traditional methods are like slowly placing items one by one, while SPD is like a super-fast robot that takes a quick look and arranges all items at once. It uses a super-smart method called the Hungarian algorithm to make sure every item finds its best spot. This way, you can quickly finish the task and continue enjoying the game! Isn't that cool?

Glossary

Hungarian Algorithm

An algorithm used to solve optimal assignment problems, capable of finding the best match in polynomial time.

Used in SPD for decoding ranking items.

LoRA Fine-tuning

A low-rank adaptation technique used to fine-tune linear projections in models, enhancing adaptability.

Enhances SPD's model performance.

Generative Ranking

A technique for generating complete rankings of candidate items, often used in recommendation systems.

SPD achieves efficient generative ranking through combinatorial optimization.

Self-Attention Head

A lightweight attention mechanism used to compare relationships between candidate items.

Used to generate score matrices.

Combinatorial Optimization

An optimization technique involving the arrangement of discrete objects.

SPD treats ranking decoding as a combinatorial optimization problem.

Open Questions Unanswered questions from this research

  • 1 How can SPD's performance be further optimized for large-scale datasets? Current methods may be limited in handling large-scale data.
  • 2 How can other combinatorial optimization techniques be integrated to enhance SPD's ranking quality and speed?
  • 3 How can SPD's performance be validated across different application scenarios?

Applications

Immediate Applications

Real-time Recommendation Systems

SPD can be used in real-time recommendation systems, providing efficient ranking results under strict latency constraints.

Advertising Ranking

In advertising ranking, SPD can quickly generate high-quality ad arrangements, enhancing user experience.

Long-term Vision

Search Engine Optimization

SPD can be used to optimize search engine ranking algorithms, providing faster and more accurate search results.

Abstract

Large language models (LLMs) achieve state-of-the-art generative ranking quality, but the ranking they produce must be decoded, and autoregressive decoding spends one sequential forward pass per emitted token. We observe that the only tokens a ranker must emit are the $N$ ordinal values naming the items in ranked order, and that this narrow, permutation-structured output format admits decoding strategies which are much more efficient than left-to-right generation. We introduce SPD (Single Forward Pass), a format-specialized decoding strategy that decodes all $N$ ordinals in $O(1)$ forward passes. SPD reads an $N \times K$ item-position score matrix off the LLM's prefill hidden states with a lightweight self-attention head, then decodes the ordinals as the optimal bipartite assignment of that matrix via the Hungarian algorithm, yielding a valid permutation by construction rather than by repair. Through a systematic study of training signals and backbone adaptation, we show that LoRA-based fine-tuning combined with auto-regressive LLM ranking distillation reaches 28 ms end-to-end inference, a speed-up of 64x while maintaining ranking quality on par with the teacher. We provide a complete ablation decomposing the contributions of architecture, training signal, and backbone adaptation. Our framework connects generative ranking to combinatorial optimization, opening a path toward other $O(1)$-decode mechanisms for real-time ranking.

cs.LG cs.AI cs.IR