---
title: 'FastSoftRank: Efficient Large-Scale Ranking via ALS'
url: https://www.emergentmind.com/topics/fastsoftrank
type: topic
---

# FastSoftRank: Efficient Large-Scale Ranking via ALS

FastSoftRank is a framework for large-scale ranking tasks, providing NDCG-consistent softmax approximation losses coupled with an accelerated alternating least squares (ALS) optimization scheme. The approach centers on quadratic surrogates derived via Taylor expansion of the standard softmax loss, enabling dramatic improvements in computational efficiency without sacrificing ranking quality on core metrics such as NDCG and MRR. FastSoftRank comprises the Ranking-Generalizable squared (RG²) loss and Ranking-Generalizable interactive (RGˣ) loss, both of which are directly aligned with ranking metrics and permit closed-form ALS updates with global linear convergence rates [2506.09454].

## 1. Motivation: Computational Bottlenecks in Softmax for Ranking

Softmax (cross-entropy) loss is Bayes-consistent with Discounted Cumulative Gain (DCG) and its normalized form (NDCG), indirectly maximizing a lower bound on NDCG, and is thus standard in many modern ranking architectures. However, the quadratic computational cost of full softmax becomes prohibitive as object corpora scale. Even sampled softmax surrogates—which randomly sample a subset of negatives—retain significant overhead due to exponential and normalization terms and exhibit slow convergence under standard stochastic gradient descent (SGD). This motivates the search for smooth, quadratic surrogates that retain NDCG-consistency, but permit efficient optimization, preferably with global linear convergence.

## 2. Quadratic Surrogates via Taylor Expansion: RG² and RGˣ Losses

The per-context softmax loss for a positive pair \((x, y)\) is
\[
\ell_{\rm SM}(o^{(x)}) = -\log \left( \frac{e^{o^{(x)}_y}}{\sum_{j=1}^N e^{o^{(x)}_j}} \right).
\]
A second-order Taylor expansion about the zero vector yields
\[
\ell(o) \approx \log N - o_y + \frac{1}{2N} \| o + \mathbf{1}_N \|^2 - \frac{1}{2N^2} (\mathbf{1}_N^T o)^2.
\]
This produces two main surrogates by omitting or retaining the “interaction” term:

- **Ranking-Generalizable squared loss (RG²):**
  \[
  \mathcal{L}_{\rm RG^2}(o;y) = -o_y + \frac{1}{2N} \sum_{j=1}^N (o_j + 1)^2
  \]
- **Ranking-Generalizable interactive loss (RGˣ):**
  \[
  \mathcal{L}_{\rm RG^\times}(o;y) = -o_y + \frac{1}{2N} \| o + \mathbf{1}_N \|^2 - \frac{1}{2N^2} (\mathbf{1}_N^T o)^2
  \]

Gradients with respect to $o$ are, respectively,
\[
\nabla_o\,{\cal L}_{\rm RG^2}(o;y) = -e_y + \frac{1}{N}(o + \mathbf{1}_N)
\]
\[
\nabla_o\,{\cal L}_{\rm RG^\times}(o;y) = -e_y + \frac{1}{N}(o + \mathbf{1}_N) - \frac{1}{N^2}(\mathbf{1}_N^T o)\mathbf{1}_N
\]

## 3. Relationship to Weighted Squared Losses and Loss Paradigms

RG² can be interpreted as a weighted squared error over all \((x, y)\) pairs:
\[
\sum_{x,y} w_{x,y}\left(o^{(x)}_y + 1 - r_{x,y}\frac{N}{|\mathcal{I}_x|}\right)^2,
\]
where $r_{x,y} \in \{0,1\}$ (click labels), $|\mathcal{I}_x|$ is the number of observed positives per context, and weights $w_{x,y}$ depend on sample derivation:
\[
w_{x,y} =
\begin{cases}
|\mathcal{I}_x|, & (x, y) \in D \\
|\mathcal{I}_x|(n+1)/N, & (x, y)\notin D
\end{cases}
\]
This directly recovers the “weighted squared loss” (WSL) employed in ALS-based recommenders and unifies sampling-based with non-sampling surrogates, offering a direct ranking-consistency interpretation. RGˣ refines RG² by penalizing the sum of scores globally, thereby more closely tracking the original softmax function.

## 4. Optimization via Alternating Least Squares (ALS)

In FastSoftRank, the score matrix is factored as $O = P Q^T$, with $P \in \mathbb{R}^{M \times K}$, $Q \in \mathbb{R}^{N \times K}$. For RG², the objective becomes
\[
\mathcal{L}_{\rm RG^2}(P, Q) = \sum_{x,y} W_{x, y} (S_{x, y} - P_{x \cdot} Q_{y \cdot}^T)^2 + \lambda(\|P\|_F^2 + \|Q\|_F^2)
\]
where
\[
S_{x, y} = r_{x, y}\frac{N}{|\mathcal{I}_x|} - 1, \qquad W_{x, y} = |\mathcal{I}_x| \quad \text{or} \quad |\mathcal{I}_x|(n+1)/N
\]
ALS updates each $P_{x \cdot}$ and $Q_{y \cdot}$ by solving the $K \times K$ normal equations:
\[
P_{x\cdot} = \left(Q^T \widetilde{W}_x Q + \lambda \cdot (\sum_y W_{x,y}) I_K \right)^{-1} \left( S_{x\cdot} \widetilde{W}_x Q \right)
\]
with $\widetilde{W}_x = \mathrm{diag}(W_{x,1}, \ldots, W_{x,N})$. The dominant per-iteration cost is $O(|D|K^2 + (M+N)K^3)$.

ALS achieves global linear convergence rates ($\mathcal{L}(P_T, Q_T) - \mathcal{L}^* = O(\rho^T)$ for $0<\rho<1$), outperforming the sublinear $O(1/\sqrt{T})$ convergence of SGD applied to the original or sampled softmax losses. Newton-CG achieves locally superlinear rates but incurs high computational cost due to Hessian-vector products.

## 5. Empirical Performance: Ranking Quality, Convergence, and Scalability

Benchmarks include MovieLens-10M, Amazon-Electronics, Steam (recommendation), and Simple-Wiki (link prediction), measured on NDCG@10 and MRR@10 (MAP@10 for Wiki). RG² and RGˣ consistently yield higher or matching ranking metrics compared to sampling-based baselines (e.g., BPR, BCE, Sampled-Softmax, Sparsemax, UIB, SML) and equal or slightly exceed the original full softmax. Observed NDCG@10 increases over softmax are 2–5%, with improvements over weighted-ALS (WRMF) of 4–10%.

In terms of optimization speed, ALS on the RG² or RGˣ objective reaches comparable NDCG plateaus in 10–15 epochs (each comprising one $P$- and one $Q$-sweep), at 5–10× less wall-clock time than softmax SGD, which requires 50–100 epochs per plateau. For $K=64$ and $|D|\sim 10^7$, a single ALS sweep requires seconds on a modern GPU, while softmax SGD requires several minutes.

## 6. Theoretical Significance and Practical Applicability

FastSoftRank provides a principled means of deriving NDCG-consistent quadratic losses, bridging the gap between sampling-based and non-sampling objectives in similarity learning. Its quadratic structure admits closed-form ALS updates with strong convergence guarantees, offering practical efficiency and theoretical clarity. The approach is algorithmically aligned with direct optimization of ranking metrics and is suitable for a broad class of large-scale ranking, recommendation, and link prediction tasks where both computational cost and metric fidelity are of paramount concern [2506.09454]. 

A plausible implication is that FastSoftRank positions quadratic ALS-based rankers as competitive with, and often superior to, deep cross-entropy-based matrix factorization frameworks in large-scale settings where time-to-convergence is critical and NDCG-centric evaluation governs model selection.

Source: https://www.emergentmind.com/topics/fastsoftrank