Graph Regularized Encoder Training for Extreme Classification

## Abstract

Abstract. Deep extreme classification (XC) aims to train an encoder architecture and an accompanying classifier architecture to tag a data point with the most relevant subset of labels from a very large universe of labels. XC applications in ranking, recommendation and tagging routinely encounter tail labels for which the amount of training data is exceedingly small. Graph convolutional networks (GCN) present a convenient but computationally expensive way to leverage task metadata and enhance model accuracies in these settings. This paper formally establishes that in several use cases, the steep computational cost of GCNs is entirely avoidable by replacing GCNs with non-GCN architectures. The paper notices that in these settings, it is much more effective to use graph data to regularize encoder training than to implement a GCN. Based on these insights, an alternative paradigm RAMEN is presented to utilize graph metadata in XC settings that offers significant performance boosts with zero increase in inference computational costs. RAMEN scales to datasets with up to 1M labels and offers prediction accuracy up to 15% higher on benchmark datasets than state of the art methods, including those that use graph metadata to train GCNs. RAMEN also offers 10% higher accuracy over the best baseline on a proprietary recommendation dataset sourced from click logs of a popular search engine. Code for RAMEN will be released publicly.

## 1. Introduction

Overview: Extreme classification (XC) refers to a supervised machine learning paradigm where multi-label learning must be performed on extremely large label spaces. Thus, a data point must be annotated with a subset of labels most relevant to it. The ability of XC to handle enormous label sets with millions of labels makes it an attractive choice for applications such as product recommendation (Medini et al., ; Dahiya et al., ; Mittal et al., ; Kharbanda et al., ), document tagging (Babbar and Schölkopf, ; You et al., ; Chang et al., ), search & advertisement (Prabhu et al., ; Dahiya et al., ; Jain et al., ), and query recommendation (Jain et al., ; Chang et al., ). Whereas both data points and queries are endowed with textual descriptions in these applications, often relational metadata over data points and/or objects can also be acquired in the form of relational graphs, correlation graphs, etc. Such metadata is of key interest to this work.

Challenges in XC: The key appeal of XC comes from the prospect of accurately tagging rare/tail labels relevant to a data point. Recommendations for rare but relevant objects can meaningfully improve user experience and the ability to associate rare tags with objects such as web documents can offer fine-grained object descriptions. However, a majority of labels in XC applications with millions of labels are tail or rare (Jain et al., ; Dean, ). A label is called tail if very few training data points are tagged with that label. XC applications can exhibit extreme label skew and more than 75% of the labels could appear in fewer than 10 training points. The tail problem is aggravated due to *missing labels* since it is infeasible to manually annotate a data point with all its relevant labels from a set of millions of labels and tail labels are at higher risk of going missing (Jain et al., ). Furthermore, most XC applications demand real-time inference i.e., the set of labels relevant to a test data point must be identified within milliseconds. XC training is made challenging by the sheer size of training sets that often contain millions of data points. Combined with the large label set with millions of labels makes it infeasible to train on all data point-label pairs, necessitating some form of *negative sampling* (Mikolov et al., ; Guo et al., ; Rawat et al., ; Reddi et al., ; Xiong et al., ).

Meta-data in XC: Auxiliary metadata can augment the meagre supervision available for tail labels and can be available in the form of textual descriptions of labels (Mittal et al., ; Dahiya et al., , ), multi-modal descriptions such as images (Mittal et al., ), or graphs (Mittal et al., ; Saini et al., ). Metadata graphs have also been used to enhance item representations e.g., GraphFormer (Yang et al., ), PINA (Chien et al., ) uses textual descriptions of an item as well as graph metadata to learn item embeddings by using graph convolutional networks (GCN). Most XC research focuses on textual metadata alone but this paper will focus on textual and graph metadata. Graph data can be inferred in several applications, e.g. hyperlink graphs in document tagging and recommendation, co-bidded keywords in sponsored search and queries co-occurring in the same search session in ad placement. These graphs can also be leveraged to handle missing labels. For instance, consider the LF-WikiSeeAlsoTitles-320K where the task is to predict related Wikipedia documents and a hyperlink graph is available which connects two Wikipedia articles with an edge if one of them contains a hyperlink to the other. A snapshot of the dataset in Figure 1 shows how a missing label “Crown group” can be recovered for the Wikipedia article “Cladistics” by traversing the hyperlink graph. However, such graphs can also be misleading since such traversal also leads to irrelevant labels such as “Vestigial organs”. Extracting meaningful information from such noisy graphs is a challenge.

Figure: Figure 1. A snapshot from the LF-WikiSeeAlsoTitles-320K dataset for the article on “Cladistics”, a method of biological classification that groups organisms based on common ancestry, related article “Common descent” is tagged but the ground truth is incomplete and has missing labels such as “Crown group” which is refers to hierarchy of organisms. Traversal on hyperlink edges can help discover missing labels but must be used with caution since they can also lead to irrelevant labels such as “Vestigial organs”.
Refer to caption: x1.png

Although the use of textual and graph metadata can offer enhanced model accuracy in XC and recommendation settings (Yang et al., ; Mittal et al., ; Saini et al., ; Chien et al., ), the use of GCN architectures makes both training and inference more expensive. It also requires the (bulky) graph to be preserved at inference time to embed a test data point which increases inference time and makes deployment challenging. These may be reasons behind the relatively limited adoption of graph metadata in XC literature and the focus on non-convolutional, text-only encoders such as DistilBERT, RoBERTA, etc.

Our Contributions: This paper develops RAMEN (gRaph regulArized encoder training for extreME classificatioN), a method to effectively utilize graph metadata at XC scales with minimal overheads in training cost and no overhead in model size or inference time. RAMEN can be incorporated into existing XC systems in a modular manner with few alterations. The key insights leading to RAMEN include a formal proof that in several use cases, GCN layers can be approximated by (much cheaper) non-GCN architectures and that it is more effective to use graph data to regularize encoder training than to implement a GCN. RAMEN can handle multiple graphs – graphs over data points, graphs over labels, or both – and offers increased prediction accuracy, even when presented with noisy graphs. RAMEN scales to datasets with up to 1M labels and can offer prediction accuracies that are up to 15% higher than state of the art methods including those that use graph metadata to train GCN. Code for RAMEN will be released publicly.

## 2. Related work

Extreme classification (XC) is a key paradigm in several areas such as ranking and recommendation. The literature on XC methods is vast (Dahiya et al., ; Guo et al., ; Wydmuch et al., ; Zhang et al., ; Guo et al., ; Medini et al., ; Mittal et al., , ; Saini et al., ; Liu et al., ; You et al., ; Jiang et al., ; Chalkidis et al., ; Ye et al., ; Zhang et al., ; Mineiro and Karampatziakis, ; Babbar and Schölkopf, ; Jasinska et al., ; Khandagale et al., ; Jain et al., ; Prabhu et al., ; Tagami, ; Yen et al., ; Wei et al., ; Siblini et al., ; Barezi et al., ; Jain et al., ; Gupta et al., , ). Early XC methods used fixed (bag-of-words)  (Mineiro and Karampatziakis, ; Babbar and Schölkopf, ; Jasinska et al., ; Khandagale et al., ; Jain et al., ; Prabhu et al., ; Tagami, ; Yen et al., ; Wei et al., ; Siblini et al., ; Barezi et al., ) or pre-trained (Jain et al., ) features and focused on learning only a classifier architecture. Recent advances have demonstrated significant gains by using task-specific features obtained from a variety of deep encoders such as bag-of-embeddings (Dahiya et al., , ), CNNs (Liu et al., ), LSTMs (You et al., ), and transformers (Jiang et al., ; Chalkidis et al., ; Ye et al., ; Zhang et al., ). Training is scaled to millions of labels and training points (Dahiya et al., ) by performing encoder pre-training followed by classifier training. A data point is trained only on its relevant labels (that are usually few in number) and a select few irrelevant labels deemed most informative using *negative mining*  (Mikolov et al., ; Dahiya et al., ; Guo et al., ; Faghri et al., ; Chen et al., ; He et al., ; Karpukhin et al., ; Lee et al., ; Luan et al., ; Hofstätter et al., ; Dahiya et al., ; Xiong et al., ; Qu et al., ; Dahiya et al., ).

Label Metadata in XC: Most XC methods use textual representation as label metadata since they allow scalable training and inference and allow leveraging good-quality pre-trained deep encoders such as RoBERTa (Liu et al., ), DistilBERT base (Sanh et al., ), etc. Examples include encoder-only models such as TwinBERT (Lu et al., ) and ANCE (Xiong et al., ) and encoder+classifier architectures such as DECAF (Mittal et al., ), SiameseXML (Dahiya et al., ), X-Transformer (Chang et al., ), XR-Transformer (Chang et al., ), LightXML (Jiang et al., ), ELIAS (Zhang et al., ) and others (Ye et al., ; Liu et al., ; You et al., ; Chalkidis et al., ). There is far less literature on the use of other forms of label metadata. For instance, ECLARE (Mittal et al., ) and GalaxC (Saini et al., ) use graph convolutional networks whereas MUFIN (Mittal et al., ) explores multi-modal label metadata in the form of textual and visual descriptors for labels.

Graph Neural Networks in Related Areas: A sizeable body of work exists on using graph neural networks such as graph convolutional networks (GCN) for recommendation (Hamilton et al., ; Chen et al., ; Zou et al., ; Huang et al., ; Chiang et al., ; Zeng et al., ; Yang et al., ; Zhu et al., ; He et al., ; Yang et al., ). Certain methods e.g., FastGCN (Chen et al., ), KGCL (Yang et al., ), LightGCN (He et al., ) learn item embeddings as (functions of) free vectors. This makes it difficult for these methods to ingest novel items and their use is restricted to warm-start scenarios. Other GCN-based methods such as PINA (Chien et al., ), GraphSAGE (Hamilton et al., ) and GraphFormers (Yang et al., ) learn node representations as functions of node metadata e.g. textual descriptions. This allows the methods to work in zero-shot settings but they still incur the high storage and computational cost of GCNs. Moreover, diminishing returns are observed with increasing number of layers of the GCN (Chiang et al., ; Mittal et al., ) with at least one model, namely LightGCN (He et al., ) foregoing all non-linearities in its network, effectively opting for a single-layer GCN.

We now develop the RAMEN method that offers a far more scalable alternative to GCNs and other popular graph-based architectures in XC settings, significantly reducing the overheads of graph-based learning, yet offering sustained and significant performance boosts in prediction accuracies.

## 3. RAMEN: g R aph regul A rized encoder training for extre ME classificatio N

Figure: Figure 2. The model architecture adopted by RAMEN. A shared encoder is used to embed both data points and labels (a). A cross-attention architecture (b) is used to obtain a label-adapted representation of the data point, which is then scored by a classifier vector. This score is combined with the base label-datapoint similarity score to yield the final score.
Refer to caption: x2.png

Notation: Let $L$ be the total number of labels in the application. Note that the label set remains same across training and testing. Let ${{\mathbf{x}}}_{i},{{\mathbf{z}}}_{l}$ be the textual descriptions of the data point $i$ and label $l$ respectively. For each data point $i\in[N]$, its ground truth label vector is ${{\mathbf{y}}}_{i}\in\{-1,+1\}^{L}$, where $y_{il}=+1$ if label $l$ is relevant to the data point $i$ and otherwise $y_{il}=-1$. The training set is comprised of $N$ labeled data points and $L$ labels as ${\mathcal{D}}:=\{\{{{\mathbf{x}}}_{i},{{\mathbf{y}}}_{i}\}_{i=1}^{N},\{{{{
\mathbf{z}}}_{l}}\}_{l=1}^{L}\}$. Let ${\mathcal{X}}\overset{\mathrm{def}}{=}\{{{\mathbf{x}}}_{i}\}_{i=1}^{N}$ denote the set of training data points and ${\mathcal{Z}}\overset{\mathrm{def}}{=}\{{{\mathbf{z}}}_{l}\}_{l=1}^{L}$ denote the set of labels. The meta-data graph over the auxiliary sets ${\mathcal{A}}$ (hyper-links, co-bidded queries) is denoted by ${\mathcal{G}}_{XA}$ and ${\mathcal{G}}_{ZA}$ for document and label respectively.

Metadata Graphs: RAMEN obtains metadata graphs over *Anchor Sets*. Let ${\mathcal{A}}=\left\{{{{\mathbf{a}}}_{1},{{\mathbf{a}}}_{2},\ldots,{{\mathbf{a
}}}_{M}}\right\}$ denote an anchor set of $M$ elements. We abuse notation to let ${{\mathbf{a}}}_{m}$ denote the textual representation of anchor item $m\in[M]$ as well. Two distinct types of metadata graphs are possible over an anchor set:

- (1)
Datapoint-anchor set: This is denoted as ${\mathcal{G}}_{XA}=(V_{XA},E_{XA})$ with $V_{XA}\overset{\mathrm{def}}{=}{\mathcal{X}}\cup{\mathcal{A}}$ i.e., the union of training data points and anchor points. The matrix $E_{XA}=\left\{{e_{im}}\right\}\in\left\{{0,1}\right\}^{N\times M}$ encodes whether data point ${{\mathbf{x}}}_{i}$ has an edge to to anchor item ${{\mathbf{a}}}_{m}$ or not.
- (2)
Label-anchor set: This is denoted as ${\mathcal{G}}_{ZA}=(V_{ZA},E_{ZA})$ with $V_{ZA}\overset{\mathrm{def}}{=}{\mathcal{Z}}\cup{\mathcal{A}}$ i.e. the union of labels and anchor points. The matrix $E_{ZA}=\left\{{e_{lm}}\right\}\in\left\{{0,1}\right\}^{L\times M}$ encodes whether label ${{\mathbf{z}}}_{l}$ has an edge to anchor item ${{\mathbf{a}}}_{m}$ or not.

We refer the reader to Section 4 for details of how the metadata graphs are constructed using random walks. RAMEN can work with multiple anchor sets as well. For instance, given two anchor sets ${\mathcal{A}}^{1}=\left\{{{{\mathbf{a}}}^{1}_{1},{{\mathbf{a}}}^{1}_{2},\ldots
,{{\mathbf{a}}}^{1}_{M_{1}}}\right\}$ and ${\mathcal{A}}^{2}=\left\{{{{\mathbf{a}}}^{2}_{1},{{\mathbf{a}}}^{2}_{2},\ldots
,{{\mathbf{a}}}^{2}_{M_{2}}}\right\}$, a total of 4 meta data graphs are possible as described above.

Intuition behind RAMEN: A popular way to incorporate graph information into XC and recommendation tasks is to take *initial* embeddings of a data point from some encoder and use a graph convolution step to obtain *augmented* embeddings for the data point. For example, let $X\in{\mathbb{R}}^{N\times D}=[{{\mathbf{x}}}_{1},\ldots,{{\mathbf{x}}}_{N}]^{\top}$ be the initial embeddings of the $N$ data points over which a graph with adjacency matrix $A\in[0,1]^{N\times N}$ is present. A typical layer in a GCN performs an operation of the form $\phi(AXW)\in{\mathbb{R}}^{N\times D}$ where $W\in{\mathbb{R}}^{D\times D}$ is a transformation matrix and $\phi:{\mathbb{R}}\rightarrow{\mathbb{R}}$ is some activation function applied coordinate-wise. Not only is this step expensive (Zeng et al., ; Hamilton et al., ), but also offers diminishing returns with increasing number of layers (Chiang et al., ; Mittal et al., ). Theorem 1 indicates that in cases where the adjacency matrix can be well-predicted using a non-GCN network (say feedforward or transformer) over the initial features, the convolutional layer can be well approximated by a non-GCN network as well. Note that edge prediction is often possible with high accuracy since the metadata graph available is closely linked to the prediction task at hand and Table 9 confirms this for the tasks considered in this paper. RAMEN uses this result to infer that it may be less useful to perform graph convolutions on top of a reasonably powerful encoder such as a transformer. Instead, utilizing the graph for regularization is cheaper yet effective. Theorem 1 is specified and proved in Appendix C in supplementary material. Extensions of Theorem 1 to networks with multiple GCN layers are also discussed.

###### Theorem 1 (Informal).

Let there exist a non-GCN (e.g. feedforward, transformer etc) network ${\mathcal{F}}:{\mathcal{X}}\rightarrow S^{P-1}$ where $S^{P-1}$ is the the unit sphere in say, $P$ dimensions, that effectively predicts edges in the metadata graph, say for any $i,j\in[N],a_{ij}\approx(1+{\mathcal{F}}({{\mathbf{x}}}_{i})^{\top}{\mathcal{F}
}({{\mathbf{x}}}_{j}))/2$ where $A=[a_{ij}]$ is the adjacency matrix of the graph, then there exists another non-GCN network ${\mathcal{H}}$ such that $\phi(AXW)\approx[{\mathcal{H}}({{\mathbf{x}}}_{1}),\ldots,{\mathcal{H}}({{
\mathbf{x}}}_{N})]^{\top}$.

Model Architecture: RAMEN’s architecture consists of three main components, encoder block (${\mathcal{E}}_{\boldsymbol{\theta}}$), cross-attention block (${\mathcal{A}}_{c}$) and extreme classifiers (${{\mathbf{w}}}$). The ${\mathcal{E}}_{\boldsymbol{\theta}}:{\mathcal{X}}\rightarrow{\mathcal{S}}^{D-1}$ with trainable parameters $\boldsymbol{\theta}$ is used to embed data points and labels using their textual descriptions. ${\mathcal{S}}^{D-1}$ denotes the $D$-dimensional unit sphere, *i.e.,* the encoder provides unit norm embeddings. We will often use ${\mathcal{E}}(\cdot)$ to denote the encoder. RAMEN uses a DistilBERT base (Sanh et al., ) encoder as ${\mathcal{E}}$. RAMEN trains a cross-attention block ${\mathcal{A}}_{c}$ to learn *label-adapted* representations for data points. Specifically, given the embeddings of a data point ${\mathcal{E}}({{\mathbf{x}}})$ and a label ${\mathcal{E}}({{\mathbf{z}}}_{l})$, the attention block uses a standard attention mechanism parameterized by four $D\times D$ matrices, namely ${{\mathbf{Q}}},{{\mathbf{K}}},{{\mathbf{V}}},{{\mathbf{O}}}$ and outputs an alternate data point embedding that is adapted to that label $\hat{{\mathbf{x}}}^{l}\overset{\mathrm{def}}{=}{\mathcal{A}}_{c}({\mathcal{E}}
({{\mathbf{x}}}),{\mathcal{E}}({{\mathbf{z}}}_{l}))$ (see Figure 2 for details). Along with the cross attention block RAMEN uses an 1-vs-all-style classifier architecture as ${{\mathbf{W}}}\overset{\mathrm{def}}{=}\{{{\mathbf{w}}}_{l}\}_{l\in[L]}$ where ${{\mathbf{w}}}_{l}$ is the classifier for label $l$ to rank the labels.

Metadata Graph Regularizers: Given an anchor set ${\mathcal{A}}$ and graphs ${{\mathbf{G}}}_{XA},{{\mathbf{G}}}_{ZA}$, we define the following two regularization functions over the encoder parameters:

$$ (3) $\displaystyle{\mathcal{R}}_{x}(\boldsymbol{\theta})$ $\displaystyle=\textstyle\sum\limits_{i=1}^{N}\sum\limits_{\begin{subarray}{c}p :e_{ip}=1\\ n:e_{in}=0\end{subarray}}[{\mathcal{E}}_{\boldsymbol{\theta}}({{\mathbf{x}}}_{ i})^{\top}{\mathcal{E}}_{\boldsymbol{\theta}}({{\mathbf{a}}}_{n})-{\mathcal{E} }_{\boldsymbol{\theta}}({{\mathbf{x}}}_{i})^{\top}{\mathcal{E}}_{\boldsymbol{ \theta}}({{\mathbf{a}}}_{p})+\gamma]_{+}$ (6) $\displaystyle{\mathcal{R}}_{z}(\boldsymbol{\theta})$ $\displaystyle=\textstyle\sum\limits_{l=1}^{L}\sum\limits_{\begin{subarray}{c}p :e_{lp}=1\\ n:e_{ln}=0\end{subarray}}[{\mathcal{E}}_{\boldsymbol{\theta}}({{\mathbf{z}}}_{ l})^{\top}{\mathcal{E}}_{\boldsymbol{\theta}}({{\mathbf{a}}}_{n})-{\mathcal{E} }_{\boldsymbol{\theta}}({{\mathbf{z}}}_{l})^{\top}{\mathcal{E}}_{\boldsymbol{ \theta}}({{\mathbf{a}}}_{p})+\gamma]_{+}$ $$

Here, $p$ is the positive anchor and $n$ are in-batch negatives anchors (explained in later section). Note that these two regularizers encourage the encoder to keep data points and labels closely embedded to their related anchor points and far away from unrelated anchor points. If we have more than one anchor set, say ${\mathcal{A}}^{1},{\mathcal{A}}^{2}$, we can define corresponding regularizers ${\mathcal{R}}^{t}_{x}(\boldsymbol{\theta}),{\mathcal{R}}^{t}_{z}(\boldsymbol{
\theta}),t{=}1,2$.

RAMEN Training: RAMEN performs modular training involving two modules. In the first module the encoder is pre-trained all by itself. Then the encoder is fixed and the classifiers and cross-attention block are jointly trained in the second module. The details of the two modules are given below. Hyperparameter tuning is discussed in Section 4.

Module M1 (Encoder Training): Encoder is trained using Document-label loss (${\mathcal{L}}(\boldsymbol{\theta})$) regularized using two components: a) anchor set on document side (${\mathcal{R}}_{x}(\boldsymbol{\theta})$) and b) anchor sent on label side (${\mathcal{R}}_{z}(\boldsymbol{\theta})$) as discussed in the previous section. The ${\mathcal{L}}(\boldsymbol{\theta})$ function takes the following formulation:

$$ ${\mathcal{L}}(\boldsymbol{\theta})=\sum_{i=1}^{N}\sum_{\begin{subarray}{c}l:y_ {il}=+1\\ k:y_{ik}=-1\end{subarray}}[{\mathcal{E}}_{\boldsymbol{\theta}}({{\mathbf{z}}}_ {k})^{\top}{\mathcal{E}}_{\boldsymbol{\theta}}({{\mathbf{x}}}_{i})-{\mathcal{E }}_{\boldsymbol{\theta}}({{\mathbf{z}}}_{l})^{\top}{\mathcal{E}}_{\boldsymbol{ \theta}}({{\mathbf{x}}}_{i})+\gamma]_{+},$ $$

Note that this loss function encourages the encoder to embed a data point close to its relevant labels and far from irrelevant ones. The encoder is trained by minimizing the following regularized objective

$$ $\min_{\boldsymbol{\theta}}\lambda_{l}\cdot{\mathcal{L}}(\boldsymbol{\theta})+ \sum_{t=1,2}(\lambda^{t}_{x}\cdot{\mathcal{R}}^{t}_{x}(\boldsymbol{\theta})+ \lambda^{t}_{z}\cdot{\mathcal{R}}^{t}_{z}(\boldsymbol{\theta}))$ $$

where $\lambda_{l},\lambda^{t}_{x},\lambda^{t}_{z}$ are regularization constants that are estimated using a bandit optimization strategy described below. This step can accommodate multiple anchor sets as well as regularizers.

Bandit Learning for Regularization Constants:
The simple *gradient descent without a gradient* approach (Flaxman et al., ) was adopted to tune the regularization constants $\lambda_{l},\lambda_{t,x},\lambda_{t,z}$ in an online manner. $\lambda_{l}$ was initialized to 1 and $\lambda_{t,x},\lambda_{t,z}$ to 0.1. Below we describe the process for a single constant $\lambda$ and the same is independently replicated for all the constants.

After every 30 iterations, the value of lambda is perturbed as $\hat{\lambda}=\lambda+z,z\sim{\mathcal{N}}(0,0.01)$, where ${\mathcal{N}}(0,0.01)$ denotes a unidimensional Gaussian with zero mean and variance 0.01. Then $\hat{\lambda}$ is used as the regularization constant in the loss expression for the next 30 iterations. The mini-batch objective values ($\lambda_{l}\cdot{\mathcal{L}}+\sum_{t=1,2}(\lambda^{t}_{x}\cdot{\mathcal{R}}^{
t}_{x}+\lambda^{t}_{z}\cdot{\mathcal{R}}^{t}_{z})$) incurred in these 30 iterations is calculated as say $P$. Afterward, $\lambda$ is updated using an estimated gradient as follows

$$ $\lambda=\lambda-\eta\cdot\frac{P}{\hat{\lambda}-\lambda},$ $$

where $\eta$ is a learning rate. This is justified by a simple but surprising application of the Stokes theorem (Flaxman et al., ) that states that for any function $f:{\mathbb{R}}\rightarrow{\mathbb{R}}$ (which can itself be non-convex or even non-differentiable), we have $\frac{d\hat{f}(x)}{dx}=\frac{1}{\delta}\cdot\underset{u\sim\left\{{-1,+1}
\right\}}{{\mathbb{E}}}\left[{{f(x+\delta u)u}}\right]$ where $\hat{f}:{\mathbb{R}}\rightarrow{\mathbb{R}}$ is a *smoothed* version of $f$ defined as $\hat{f}(x)\overset{\mathrm{def}}{=}\underset{v\sim[-1,1]}{{\mathbb{E}}}\left[{
{f(x+\delta v)}}\right]$. Note $\hat{f}$ is always differentiable even if $f$ is not. In order to compute mini-batch objectives, $P$, RAMEN mines hard negatives. The negative mining technique is explained below.

Negative Mining: The loss function and regularizers contain ${\mathcal{O}}\left({{NL\log L+(N+L)M\log M}}\right)$ terms where $M=\max\left\{{M_{1},M_{2}}\right\}$ is the maximum number of anchors in any of the anchor sets. This is because the number of relevant labels per data point is usually limited by $|l:y_{il}=+1|\leq{\mathcal{O}}\left({{\log L}}\right)$ in XC applications (Jain et al., ) and we can construct the metadata graphs to have at most $\log M$ relevant anchors per data point or label. Performing optimization with respect to all these terms is expensive which is why RAMEN utilizes in-batch negative mining (Dahiya et al., ; Chen et al., ; Dahiya et al., ; Faghri et al., ; Guo et al., ; He et al., ). Specifically, a set of data points is identified and for each data point, a random relevant label and random related anchor is chosen (from each anchor set if there are multiple anchor sets). For the chosen labels a random related anchor is chosen from each anchor set. Then hard negative labels for a data point are chosen only among labels selected for this mini-batch. Similarly, hard negative anchors for a data point or label are chosen only among anchors selected for this mini-batch. Once the encoder is learned, the parameters are frozen and RAMEN learns extreme classifiers in module 2 which is explained next.

Module M2 (Cross Attention and Classifier Training): Once the encoder is trained, it is frozen and a maximum inner product search (MIPS) data structure is established over the label embeddings ${\mathcal{E}}({{\mathbf{z}}}_{l}),l\in[L]$. For each training data point $i\in[N]$, a set of $100\approx\log L$ labels with the highest label similarity score ${\mathcal{E}}_{\boldsymbol{\theta}}({{\mathbf{z}}}_{l})^{\top}{\mathcal{E}}_{
\boldsymbol{\theta}}({{\mathbf{x}}}_{i})$ by firing MIPS queries. This returns a shortlist $\hat{\mathcal{N}}_{i}\subset[L]$ of labels for each data point. Relevant labels present in this set are removed so that $y_{ik}=-1$ for all $k\in\hat{\mathcal{N}}_{i}$. Next, the classifiers ${{\mathbf{w}}}_{l},l\in[L]$ and attention block parameters ${{\mathbf{Q}}},{{\mathbf{K}}},{{\mathbf{V}}},{{\mathbf{O}}}$ are trained. The classifiers are initialized to ${{\mathbf{w}}}_{l}\overset{\mathrm{init}}{\leftarrow}{\mathcal{E}}({{\mathbf{z
}}}_{l})$. Training is done by minimizing the triplet loss function:

$$ (9) $\displaystyle{\mathcal{L}}(\left\{{{{\mathbf{w}}}_{l}}\right\}_{l\in[L]},{{ \mathbf{Q}}},{{\mathbf{K}}},{{\mathbf{V}}},{{\mathbf{O}}})=\textstyle\sum_{i=1 }^{N}\sum_{\begin{subarray}{c}l:y_{il}=+1\\ k:y_{ik}=-1\end{subarray}}[{{\mathbf{w}}}_{k}^{\top}\hat{{\mathbf{x}}}_{i}^{k} -{{\mathbf{w}}}_{l}^{\top}\hat{{\mathbf{x}}}_{i}^{l}+\gamma]_{+},$ $$

where $\hat{{\mathbf{x}}}^{l}\overset{\mathrm{def}}{=}{\mathcal{A}}_{c}({\mathcal{E}}
({{\mathbf{x}}}),{\mathcal{E}}({{\mathbf{z}}}_{l}))$ is the label-adapted embedding for the data point $i$ with respect to label $l$ (see Figure 2 for details). Note that equivalently, we could have parameterized the classifier as ${{\mathbf{w}}}_{l}={\mathcal{E}}({{\mathbf{z}}}_{l})+\boldsymbol{\eta}_{l}$, initialized $\boldsymbol{\eta}_{l}={\mathbf{0}}$ and trained $\boldsymbol{\eta}_{l}$ instead by minimizing ${\mathcal{L}}(\left\{{\boldsymbol{\eta}_{l}}\right\}_{l\in[L]},{{\mathbf{Q}}},
{{\mathbf{K}}},{{\mathbf{V}}},{{\mathbf{O}}})$. Figure 2 uses this parameterization of the classifier to emphasize the initialization. Also note that negative mining is not needed in this module since training is already done with respect to a shortlist of negative labels leaving us with just ${\mathcal{O}}\left({{N\log^{2}L}}\right)$ terms in total.

Inference with RAMEN: Given a test point ${{\mathbf{x}}}_{t}$, its embedding ${\mathcal{E}}({{\mathbf{x}}}_{t})$ is computed and used to fire a MIPS query to retrieve a set $\hat{\mathcal{N}}_{t}$ of the $100\leq{\mathcal{O}}\left({{\log L}}\right)$ labels with the highest label similarity score i.e. $s^{s}_{tl}\overset{\mathrm{def}}{=}{\mathcal{E}}_{\boldsymbol{\theta}}({{
\mathbf{z}}}_{l})^{\top}{\mathcal{E}}_{\boldsymbol{\theta}}({{\mathbf{x}}}_{t}
),l\in\hat{\mathcal{N}}_{t}$. Next, for each of these labels, the label adapted embedding of the test point is calculated for each shortlisted label ${{\mathbf{x}}}^{l}_{t}\overset{\mathrm{def}}{=}{\mathcal{A}}_{c}({\mathcal{E}}
({{\mathbf{x}}}_{t}),{\mathcal{E}}({{\mathbf{z}}}_{l})),l\in\hat{\mathcal{N}}_
{t}$. Then the classifier score is computed as $s^{c}_{tl}\overset{\mathrm{def}}{=}{{\mathbf{w}}}_{l}^{\top}{{\mathbf{x}}}^{l}
_{t},l\in\hat{\mathcal{N}}_{t}$. The classifier and similarity scores are then combined linearly as $s_{tl}=\beta\cdot s^{c}_{tl}+(1-\beta)\cdot s^{s}_{tl}$. A fixed value of $\beta=0.7$ was used. Final predictions are made in descending order of the scores $s_{tl}$. RAMEN performs predictions in time ${\mathcal{O}}\left({{B+D\log L}}\right)$ where $B=|\boldsymbol{\theta}|$ is the size of the encoder architecture and $D$ is the embedding dimensionality. In practice, RAMEN offers predictions within 4 milliseconds. It is notable that even though RAMEN uses a graph at training time, inference does not require the bulky graph, making it highly suitable for large-scale applications.

Table: Table 1. Results on short-text benchmark datasets. RAMEN is up to 15% more accurate as compared to both text-based and graph-based baselines. RAMEN-M1 indicates accuracies obtained after module M1 i.e. without training the classifier and cross-attention architecture to offer a fair comparison to other methods that do not adopt a classifier. Note that including the classifier and cross-attention architecture offers a 2.5 – 4.5% improvement in P@1.

Table: Table 2. Results on full-text benchmark datasets. RAMEN is up to 15% more accurate as compared to both text-based and graph-based baselines. RAMEN-M1 indicates accuracies obtained after module M1 i.e. without training the classifier and cross-attention architecture to offer a fair comparison to other methods that do not adopt a classifier. Note that including the classifier and cross-attention architecture offers up to 6% and 4% improvement in PSP@1 and P@1 respectively.

Table: Table 3. Results on the proprietary dataset (G-EPM-1M). RAMEN is up to 10% more accurate than the leading method NGAME which is also RAMEN’s closest competitor on public datasets.

###### Theorem 1 (Informal).

## 4. Experiments

The XML Repository (Bhatia et al., ) provides various public XC datasets which are thoroughly studied and benchmarked by plethora of papers. These datasets are curated from Wiki dumps [link](https://dumps.wikimedia.org/enwiki/20220520/) and Amazon dump (Ni et al., ) but metadata, which was readily available, was ignored. RAMEN crawel these dumps and curated meta data for all public datasets. The details are as follows:

LF-WikiSeeAlsoTitles-320K: The dataset was curated from Wiki dump [link](https://dumps.wikimedia.org/enwiki/20220520/). The scenario involved recommending related articles. Articles under the “See Also” section were used as ground truth labels. Internal hyperlinks and category links were used to create two sets of metadata graphs, one using Wikipedia articles as anchors and the other using Wikipedia categories as anchors. For the additional full text version (LF-WikiSeeAlso-320K), first 128 words in the main text were used along with page title for the document.

LF-WikiTitles-500K: The dataset was also curated from Wiki dump [link](https://dumps.wikimedia.org/enwiki/20220520/). The scenario involved recommending relevant “categories” for an article. Internal hyperlinks and category-to-category links were used to create two sets of metadata graphs as described above. For the additional full text version (LF-Wikipedia-500K), first 128 words in the main text were used along with page title for the document.

LF-AmazonTitles-1.3M: The dataset was curated from Amazon dump (Ni et al., ). The scenario involved recommending relevant “product” for a product. The “similar_items” links given in the data dump were used to create metadata graph.

G-EPM-1M: Matching user queries with relevant advertiser keywords is a critical component of sponsored search. One type of matching is Extended Phrase Match (EPM), which aims to match a user query with advertiser keywords that have a subset of the query’s intent. This means that only keywords with similar intent to the query are considered. For example, for the query "cheap nike shoes", a valid EPM keyword is "nike sneakers" but "adidas shoes" or "nike shorts" are not.

Maintaining this intent-subset requirement is challenging but important for advertisers who may bid differently on different match types for the same keyword. Improving the effectiveness of this matching process, particularly for less common queries and keywords, can enhance the search experience for users and benefit small advertisers such as mom-and-pop businesses. To study the effectiveness of RAMEN in this application, a dataset called G-EPM-1M was curated by analyzing the click logs of a popular search engine. The click logs were mined to gather graph metadata for RAMEN, including three types of signals:

- (1)
Co-session queries: Queries that were asked in the same search session by multiple users.
- (2)
Co-clicked queries: Queries that resulted in clicks on the same webpage.
- (3)
Co-asked queries: Queries that were clicked in the "users also ask" section on the search engine in response to a specific query.

These metadata were collected over an extended period of time and used to provide additional information to RAMEN.

Dataset Statistics: Please refer to Tab. 10 in supplementary material for dataset statistics. For all datasets, test data points were removed from the graph if ever present as nodes to prevent train-test leaks.

Evaluation Metrics: For public datasets and offline proprietary tasks, standard evaluation metrics were used including recall@$k$ (R@$k$), precision@$k$ (P@$k$), nDCG@$k$ (N@$k$), their propensity scored variants (which give more weightage to accurate prediction of tail/rare labels) (Jain et al., ) and false-negatives@$k$ (FN@$k$). Note that predicting tail labels in more rewarding in real-world scenarios. Therefore, we focus on gains in propensity scored metrics. Please refer to Appendix B in the supplementary for definitions of these metrics. Instructions on the XML repository (Bhatia et al., ) were closely followed to ensure fair evaluation.

Implementation details: Links obtained on the metadata graph from raw data suffer from missing links in much the same way there are missing labels in the ground truth. To deal with this, RAMEN performs a random walk with restart on each anchor node. The random walk was performed for 400 hops with a restart probability of 0.8, thus ensuring that the walk did not wander too far from the starting node. This random walk could also introduce noisy edges, leading to poor model performance. To deal with such edges, in-batch pruning was performed and edges to only those anchors were retained which had a cosine similarity of $>0$ based on the embeddings given the encoder. To get the encoder, RAMEN initialize the encoder with a pre-trained DistilBERT and fine-tuned it for 10 epochs(warmup phase) using unpruned metadata graphs. Then the metadata graphs were pruned using the fine-tuned encoder. Encoder fine-tuning was then was continued for 5 epochs using the pruned graphs after which the graphs were re-pruned. These alternations of 5 epochs of encoder fine-tuning followed by re-pruning were repeated till convergence. The learning rate for each bandit was set to $0.001$. Table 11 in supplementary material summarizes all hyper-parameters for each dataset.
It is notable that even though RAMEN uses a graph at training time, inference does not require any such information, making it highly suitable for long-tail queries. RAMEN uses the PyTorch (Paszke et al., ) framework and model on each benchmark datasets and was trained on $2\times$ Nvidia V100 GPUs.

Results on benchmark datasets: Table 1 compares RAMEN with graph and XC methods. RAMEN can be up to 5% more accurate over the best baseline numbers. In particular RAMEN can be 16% more accurate than traditional graph-based methods. Additionally, RAMEN can be 3-4% more accurate over PINA (Chien et al., ), which uses both XC and same anchor sets with the encoder 2$\times$ that of RAMEN. Figure 3 shows that RAMEN outperforms baseline methods in each quantile, showing its overall superior embedding quality. RAMEN’s improvement in all quantiles can also be attributed to the fact that RAMEN can make correct predictions on head and tail alike compared to baselines which focused mostly on the tail as indicated by the t-SNE plot in figure 4. RAMEN outperforms baseline methods on all datasets however, low gains in LF-AmazonTitles-1M can be attributed the low volume of metadata (“similar_items” graph edges) available for training (ref to Table 10 in supp. material). Please refer to ablation study section where we show that lower volume of metadata leads to lower gains. Note that, RAMEN’s primary focus is short-text documents but RAMEN is also state-of-the-art in full text counter parts of the dataset (Table 2).

Table 4 shows that RAMEN could make predictions such as “Crown group” which were missing labels in the training, by exploiting metadata graph links. Apart from standard metrics, the error rate plays a crucial role in deployment. Tab. 4 compares the difference in RAMEN’s false negative rate ($\text{FN}@k$) with the best-performing baseline (NGAME) when each method was allowed to make $k$ predictions i.e., $\text{Diff}@k\overset{\mathrm{def}}{=}\text{FN}@k$(RAMEN) - $\text{FN}@k$(NGAME). It is notable that RAMEN consistently outperforms NGAME over all label quantiles (i.e. over head/popular as well as tail/rare labels) and performs even better at higher values of $k$ such as $k=50$.

**Table 4. A subjective comparison of predictions made by RAMEN, the leading text-based method NGAME, and the leading graph-based method GraphFormers on LF-WikiSeeAlsoTitles-320K. Labels that are a part of the ground truth are formatted in black color. Labels not a part of the ground truth are formatted in light gray color. Relevant labels that are missing from the ground truth are marked in bold black. RAMEN could make predict highly relevant labels such as “Crown group”, which were missing from the ground truth as well as omitted by other methods.**
| Method | Prediction |
| --- | --- |
| Document: Clade |  |
| RAMEN | Cladistics, Phylogenetics, Crown group, Paraphyly, Polyphyly |
| NGAME | Cladistics,<br>Linnaean taxonomy, Polyphyly,<br>Paragroup,<br>Molecular phylogenetics |
| GraphFormers | SUPERFAMILY, Phylogenetic network, Phylogenetics<br>Phylogenetic tree,<br>Phylogeny |

Figure: Figure 3. Quantile wise-comparison of RAMEN and other methods. RAMEN gives consistent gains in each bin (see Appendix B for binning details). The left-most bin contains the most rare/tail labels whereas the rightmost bin contains the most popular/head labels.
Refer to caption: x3.png

**Table 5. Comparing the difference in false negative rates between RAMEN and NGAME on LF-WikiSeeAlsoTitles-320K. Results are presented in a quantile-wise manner. The #5K label quantile contains the most popular/head labels whereas the #729K quantile contains the most rare/tail labels. See Appendix B for definitions of metrics and quantiles. RAMEN’s false negative rate is always superior to that of NGAME but the gap widens significantly when compared on tail labels.**
| Quantile<br>(#L) Avg. Doc. | DIFF@5 | DIFF@10 | DIFF@20 | DIFF@50 | DIFF@100 |
| --- | --- | --- | --- | --- | --- |
| (#1K) 200.78 | -0.019 | -0.026 | -0.027 | -0.021 | -0.010 |
| (#9K) 30.98 | 0.013 | -0.050 | -0.107 | -0.123 | -0.049 |
| (#31K) 9.14 | 0.036 | -0.124 | -0.272 | -0.443 | -0.423 |
| (#74K) 3.94 | -0.455 | -0.757 | -1.091 | -1.551 | -1.854 |
| (#195K) 1.49 | -2.246 | -2.722 | -3.529 | -4.763 | -6.075 |
| complete | -2.671 | -3.679 | -5.025 | -6.901 | -8.411 |

Figure: Figure 4. t-SNE of retrieved labels of document “terrestrial locomotion” and “Cladistics” by RAMEN, NGAME, GraphFormers. RAMEN has a much higher number of correct retrievals and retrieves a healthy mix of both head (H) and tail (T) labels, while other methods retrieve far fewer relevant labels and focus on predicting tail labels.
Refer to caption: x4.png

Results on proprietary datasets: Table 3 compares RAMEN against NGAME on the G-EPM-1M dataset. RAMEN was found to be 3% better on the P@5 metric. RAMEN was further found to be 15% better than NGAME on the propensity scored PSP@5 metric, indicating that RAMEN could match tail keywords more accurately. The quality of the two models was further measured using an in-production, large cross-encoder oracle quality model that was trained on an extensive set of manually labeled data. The oracle quality model found predictions made by RAMEN to be 43% more accurate than those made by NGAME.

Ablation: Experiments were conducted to understand the impact of the design choices made by RAMEN as well as the impact of metadata on the performance of RAMEN. Table 6 complies these experiments. In particular, experiment “No-Bandits” explored the effects of different choices of giving weights to different sources of metadata on RAMEN’s performance. A key finding was that when uniform weights were assigned to all graphs, there was a substantial 18% drop in P@1. This highlights the importance of bandit learning, where each graph’s contribution is determined dynamically.
To understand the impact of noisy edges in metadata, experiment "No Pruning" disabled the trimming of noisy edges using cosine similarity filtering. A 1.5% loss in P@1 was observed which underscores the necessity of pruning unhelpful edges during training to maintain high performance.

RAMEN uses multiple meta-data graphs for both document and label. To ascertain the contributions of the anchor-doc and anchor-label metadata graphs, the ablations "No Doc. Graph" and "No Lbl. Graph" were conducted. These experiments reveal that information from these graphs plays a significant role, as disabling either leads to a 1.5–2% reduction in P@1. The information from these graphs can be incorporated in baseline methods like NGAME. To understand its impact, experiment “AugGT’ trains NGAME with augmented ground truth. The ground truth was expanded by using label propagation wherein a label is given an edge to a training point if the label shares a neighbor in the metadata graph with said training point. RAMEN outperformed the “AugGT” setup by 15%. This suggests that while leveraging graph information for ground truth enhancement is convenient, it may not be as effective due to noisy edges.

Further Analysis: RAMEN’s robust training strategy extends benefits beyond its own performance. SiameseXML and ECLARE, baseline methods, experienced improvements of 3% and 5% in P@1, respectively, when leveraging RAMEN’s metadata regularizer (Table 7). Further experiments on the LF-WikiSeeAlsoTitles-320K dataset evaluate the influence of metadata volume. Reducing metadata to 50% and 20% results in performance drops of 1–2.5% in propensity scored precision and 3–4% in precision. This emphasizes the importance of metadata in enhancing performance, particularly for tail labels (Table 8). Additionally RAMEN can predict meta-data graph links with high accuracy (Table 9) and therefore validate the proposed theorem 1.

These experiments collectively shed light on the intricate interplay between design choices and metadata utilization, underscoring the effectiveness and nuances of RAMEN’s approach.

Table: Table 6. Ablations were done on module M1 (RAMEN-M1) on LF-WikiSeeAlsoTitles-320K to understand the impact of design choices on the quality of encoder training. RAMEN’s design choices are seen to be optimal and offer 2.5–13% improvement in the P@1 metric over alternate design choices.

Table: Table 7. Results of RAMEN as a regularizer in baseline algorithms on LF-WikiSeeAlsoTitles-320K. RAMEN’s regularization algorithm improves the performance of the base algorithm by 1–2%

Table: Table 8. Impact of metadata on the performance of RAMEN on LF-WikiSeeAlsoTitles-320K. RAMEN’s performance on P and PSP decreases as we decrease the volume of metadata.

**Table 9. RAMEN’s encoder ${\mathcal{E}}$ can predict links in the meta-data graph with extremely high recall (R@100).**
| Link type | LF-WikiSeeAlsoTitles-320K | LF-WikiTitles-500K |
| --- | --- | --- |
| hyper_link | 99.88 | 94.20 |
| category | 99.88 | 99.96 |

## 5. Conclusion

This paper presented RAMEN, a novel approach for leveraging metadata to enhance the accuracy of recommendation systems w.r.t. rare labels. A key takeaway from the study is that opting for graph-based regularization instead of the more prevalent GCN architectures, can yield gains of up to 15% in PSP@1/P@1 compared to graph-based methodologies, and up to 6% when compared with XC techniques tailored for recommendation systems. The bandit-style regularization technique adopted by RAMEN was found to offer performance boosts to RAMEN as well as other baseline methods and can be of independent interest. Notably, RAMEN offers state-of-the-art performance without incurring any computational overhead during inference.

## 6. Ethical Considerations

Our usage of data and terms of providing service to people around the world has been approved by our legal and ethical boards. In terms of social relevance, our research is helping millions of people find the goods and services that they are looking for online with increased efficiency and a significantly improved user experience. This facilitates purchase and delivery without any physical contact which is important given today’s social constraints. Furthermore, our research is increasing the revenue of many small and medium businesses including mom and pop stores while also helping them grow their market and reduce the cost of reaching new customers.

## Appendix A Data stats

Table: Table 10. Dataset statistics summary for benchmark datasets used by RAMEN. Entries marked with $\ddagger$ were not disclosed because the dataset is proprietary.

Table: Table 11. Hyper-parameter values for RAMEN on all datasets to enable reproducibility. RAMEN code will be released publicly. Most hyperparameters were set to their default values across all datasets. LR is learning rate. Multiple clusters were chosen to form a batch hence $B>C$. Clusters were refreshed after $5$ epochs. Cluster size $C$ was doubled after every 25 epochs. Margin $\gamma=0.3$ was used for contrastive loss. For training M2 number of positive samples and negative samples were kept at 2 and 12 respectively. A cell containing the symbol $\uparrow$ indicates that that cell contains the same hyperparameter value present in the cell directly above it.

## Appendix B Evaluation metrics

Performance has been evaluated using propensity scored precision@$k$ and nDCG@$k$, which are unbiased and more suitable metric in the extreme multi-labels setting [Jain et al., , Babbar and Schölkopf, , Prabhu et al., , ]. The propensity model and values available on The Extreme Classification Repository [Bhatia et al., ] were used. Performance has also been evaluated using vanilla precision@$k$ and nDCG@$k$ (with $k$ = 1, 3 and 5) for extreme classification.

Let $\hat{\mathbf{y}}\in{\mathbb{R}}^{L}$ denote the predicted score vector and $\mathbf{y}\in\{0,1\}^{L}$ denote the ground truth vector (with $\left\{{0,1}\right\}$ entries this time instead of $\pm 1$ entries, for sake of convenience). The notation $rank_{k}(\hat{{\mathbf{y}}})\subset[L]$ denotes the set of $k$ labels with highest scores in the prediction score vector $\hat{{\mathbf{y}}}$ and $\left\lVert{{{\mathbf{y}}}}\right\rVert_{1}$ denotes the number of relevant labels in the ground truth vector. Then we have:

$$ $P@k=\frac{1}{k}{\sum_{l\in rank_{k}(\hat{\mathbf{y}})}}y_{l}$ $$

$$ $PSP@k=\frac{1}{k}{\sum_{l\in rank_{k}(\hat{\mathbf{y}})}}\frac{y_{l}}{p_{l}}$ $$

$$ $DCG@k=\frac{1}{k}{\sum_{l\in rank_{k}(\hat{\mathbf{y}})}}\frac{y_{l}}{\log(l+1)}$ $$

$$ $PSDCG@k=\frac{1}{k}{\sum_{l\in rank_{k}(\hat{\mathbf{y}})}}\frac{y_{l}}{p_{l} \log(l+1)}$ $$

$$ $nDCG@k=\frac{DCG@k}{\sum_{l=1}^{\min(k,||\mathbf{y}||_{0})}\frac{1}{\log(l+1)}}$ $$

$$ $PSnDCG@k=\frac{PSDCG@k}{\sum_{l=1}^{k}\frac{1}{\log l+1}}$ $$

$$ $FN@k=1-\frac{{\sum_{l\in rank_{k}(\hat{\mathbf{y}})}}y_{l}}{\left\lVert{{{ \mathbf{y}}}}\right\rVert_{1}}$ $$

Here, $p_{l}$ is propensity score of the label $l$ calculated as described in Jain et al. [].

### B.1. Label Quantile Creation

For Figure 3 and Table 4, labels were divided into 5 equi-voluminous quantiles. To each label $l\in[L]$, a popularity score $V_{l}=\left\lvert{i:y_{il}=+2}\right\rvert$ was assigned by counting number of training datapoints tagged with that label. The total volume of all labels was computed as $V_{\text{tot}}\overset{\mathrm{def}}{=}\sum_{l\in[L]}V_{l}$. Labels were arranged in decreasing order of their popularity score $V_{l}$. 5 label quantiles were then created so that the volume of labels in each bin is roughly $\approx V_{\text{tot}}/5$. Thus, labels were collected in the first bin in decreasing order of popularity till the total volume of labels in that bin exceeded $V_{\text{tot}}/5$ at which point the first bin was complete and the second bin was created by selecting remaining labels in decreasing order or popularity till the total volume of labels in the second bin exceeded $V_{\text{tot}}/5$ and so on. For example, for the LF-WikiTitles-500K dataset, the five bins were found to contain approximately $1K,9K,30K,84K,375K$ labels respectively. Note that the first bin contains very few $\approx 1K$ labels since these are head labels and a small number of them quickly racked up a total volume of $\approx V_{\text{tot}}/5$ whereas the last quantile contains more than $100\times$ more labels at around $375K$ labels since these are tail labels and so a lot more of them are needed to add up to a total volume of $\approx V_{\text{tot}}/5$.

## Appendix C Theoretical Analysis

We first recall the notation, then specify Theorem 1 formally, prove the result, and finally extend the result to show that even multiple GCN layers can be approximated using non-GCN networks.

Let $X\in{\mathbb{R}}^{N\times D}=[{{\mathbf{x}}}_{1},\ldots,{{\mathbf{x}}}_{N}]^{\top}$ be the initial embeddings of the $N$ data points over which a graph with adjacency matrix $A\in[0,1]^{N\times N}$ is present. A typical convolution layer in a GCN can be represented as $\phi(AXW)\in{\mathbb{R}}^{N\times D}$ where $W\in{\mathbb{R}}^{D\times D}$ is a transformation matrix and $\phi:{\mathbb{R}}\rightarrow{\mathbb{R}}$ is some activation function applied coordinate-wise.

###### Theorem 1 0 (Formal Restatement).

Suppose the activation function used in the GCN layer $\phi$ is $\beta$-Lipschitz, i.e., $\left\lvert{\phi(u)-\phi(v)}\right\rvert\leq\beta\cdot\left\lvert{u-v}\right\rvert$ for all $u,v\in{\mathbb{R}}$. Also suppose there exists a non-GCN (e.g. feedforward, transformer etc.) network ${\mathcal{F}}:{\mathcal{X}}\rightarrow S^{P-1}$ where $S^{P-1}$ is the the unit sphere in say, $P$ dimensions, that effectively predicts edges in the metadata graph. Specifically, let $\hat{A}=[\hat{a}_{ij}]\in[0,1]^{N\times N}$ with $\hat{a}_{ij}\overset{\mathrm{def}}{=}(1+{\mathcal{F}}({{\mathbf{x}}}_{i})^{
\top}{\mathcal{F}}({{\mathbf{x}}}_{j}))/2$ be the approximated adjacency matrix. Then for any transformation matrix $W$ utilized by the GCN, there exists exists a non-GCN network ${\mathcal{H}}:{\mathcal{X}}\rightarrow{\mathbb{R}}^{D}$ that well-approximates the embeddings of the GCN layer as well. Specifically, if we abuse notation to let ${\mathcal{H}}(X)\overset{\mathrm{def}}{=}[{\mathcal{H}}({{\mathbf{x}}}_{1}),
\ldots,{\mathcal{H}}({{\mathbf{x}}}_{N})]^{\top}\in{\mathbb{R}}^{N\times D}$, then we have

$$ $\frac{1}{\sqrt{N}}\left\lVert{\phi(AXW)-{\mathcal{H}}(X)}\right\rVert_{F}\leq \beta R\cdot\left\lVert{W}\right\rVert_{2}\cdot\left\lVert{\hat{A}-A}\right \rVert_{F},$ $$

where $R=\max_{i\in[N]}\left\lVert{{{\mathbf{x}}}_{i}}\right\rVert_{2}$ and $\left\lVert{W}\right\rVert_{2}$ denotes the spectral norm of the matrix $W$.

Theorem 1 effectively assures us that as $\hat{A}\rightarrow A$, we have ${\mathcal{H}}(X)\rightarrow\phi(AXW)$ as well, i.e., the augmented embeddings obtained using the GCN layer can be well-approximated by those offered by the non-GCN network ${\mathcal{H}}$ if there exists a way to predict the adjacency matrix accurately.

###### Theorem 1 0 (Formal Restatement).

### C.1. Proof for a Single-layer GCN

###### Proof of Theorem 1 .

Consider the network

$$ ${\mathcal{H}}:{{\mathbf{x}}}\mapsto\phi(T{\mathcal{F}}({{\mathbf{x}}})+{{ \mathbf{c}}})\in{\mathbb{R}}^{D},$ $$

where $T\in{\mathbb{R}}^{D\times P},{{\mathbf{c}}}\in{\mathbb{R}}^{D}$ defined as

$$ $\displaystyle T\overset{\mathrm{def}}{=}$ $\displaystyle\frac{1}{2}\cdot W^{\top}\left({\sum_{j\in[N]}{{\mathbf{x}}}_{j}{ \mathcal{F}}({{\mathbf{x}}}_{j})^{\top}}\right)\in{\mathbb{R}}^{D\times P}$ $\displaystyle{{\mathbf{c}}}\overset{\mathrm{def}}{=}$ $\displaystyle\frac{1}{2}\cdot W^{\top}\left({\sum_{j\in[N]}{{\mathbf{x}}}_{j}} \right)\in{\mathbb{R}}^{D}$ $$

Note that ${\mathcal{H}}$ is a non-GCN network since it merely places a fully connected layer $T$ and a bias term ${{\mathbf{c}}}$ on top of a non-GCN network ${\mathcal{F}}$. Recall that ${\mathcal{F}}:{\mathcal{X}}\rightarrow S^{P-1}$ and $W\in{\mathbb{R}}^{D\times D}$ so the dimensionality of $T,{{\mathbf{c}}}$ do make sense. Note that the values of the fully connected layer $T$ and the bias term ${{\mathbf{c}}}$ depend on the transformation matrix $W$ used by the GCN which implies that for every choice of $W$ made by the GCN layer, there exists a choice of $T,{{\mathbf{c}}}$ for the non-GCN network as well.

To prove the result, note that the $i\text{${}^{\text{th}}$}$ row of $\phi(AXW)$ can be written as

$$ $\phi\left({W^{\top}\left({\sum_{j\in[N]}a_{ij}{{\mathbf{x}}}_{j}}\right)}\right)$ $$

whereas the $i\text{${}^{\text{th}}$}$ row of ${\mathcal{H}}(X)$ can be written as

$$ $\displaystyle\phi\left({T{\mathcal{F}}({{\mathbf{x}}}_{i})+{{\mathbf{c}}}}\right)$ $\displaystyle=\phi\left({\frac{1}{2}\cdot W^{\top}\left({\sum_{j\in[N]}{{ \mathbf{x}}}_{j}{\mathcal{F}}({{\mathbf{x}}}_{j})^{\top}}\right){\mathcal{F}}( {{\mathbf{x}}}_{i})+\frac{1}{2}\cdot W^{\top}\left({\sum_{j\in[N]}{{\mathbf{x} }}_{j}}\right)}\right)$ $\displaystyle=\phi\left({W^{\top}\left({\sum_{j\in[N]}\frac{1+{\mathcal{F}}({{ \mathbf{x}}}_{j})^{\top}{\mathcal{F}}({{\mathbf{x}}}_{i})}{2}}\right){{\mathbf {x}}}_{j}}\right)=\phi\left({W^{\top}\left({\sum_{j\in[N]}\hat{a}_{ij}{{ \mathbf{x}}}_{j}}\right)}\right)$ $$

This gives us

$$ $\displaystyle\left\lVert{\phi(AXW)-{\mathcal{H}}(X)}\right\rVert_{F}^{2}$ $\displaystyle=\sum_{i\in[N]}\left\lVert{\phi\left({W^{\top}\left({\sum_{j\in[N ]}a_{ij}{{\mathbf{x}}}_{j}}\right)}\right)-\phi\left({W^{\top}\left({\sum_{j \in[N]}\hat{a}_{ij}{{\mathbf{x}}}_{j}}\right)}\right)}\right\rVert_{2}^{2}$ $\displaystyle\leq\beta^{2}\cdot\sum_{i\in[N]}\left\lVert{W^{\top}\left({\sum_{ j\in[N]}a_{ij}{{\mathbf{x}}}_{j}}\right)-W^{\top}\left({\sum_{j\in[N]}\hat{a}_ {ij}{{\mathbf{x}}}_{j}}\right)}\right\rVert_{2}^{2}$ $\displaystyle=\beta^{2}\cdot\left\lVert{(A-\hat{A})XW}\right\rVert_{F}^{2}\leq \beta^{2}\cdot\left\lVert{XW}\right\rVert_{2}^{2}\cdot\left\lVert{A-\hat{A}} \right\rVert_{F}^{2}$ $$

where the second step follows since $\phi$ is applied coordinate-wise and is an $L$-Lipschitz function and the last step follows from standard linear algebraic inequalities. We finish the proof by noticing that the spectral norm is submultiplicative and $\left\lVert{X}\right\rVert_{2}\leq R\sqrt{N}$.
∎

###### Proof of Theorem 1 .

### C.2. Extension to GCNs with Multiple Layers

We note that this result can be extended to multiple layers. For example, suppose we wish to utilize two graph convolution layers i.e.

$$ $\phi(A\phi(AXW)\tilde{W}),$ $$

where $\tilde{W}\in{\mathbb{R}}^{D\times D}$ is the transformation matrix for the second GCN layer. The proof technique presented above can be extended to show that the following non-GCN network would approximate the above two-layer GCN.

$$ ${\mathcal{K}}:{{\mathbf{x}}}\mapsto\phi(\tilde{T}{\mathcal{F}}({{\mathbf{x}}}) +\tilde{{\mathbf{c}}})\in{\mathbb{R}}^{D}$ $$

where

$$ $\displaystyle\tilde{T}\overset{\mathrm{def}}{=}$ $\displaystyle\frac{1}{2}\cdot\tilde{W}^{\top}\left({\sum_{j\in[N]}{\mathcal{H} }({{\mathbf{x}}}_{j}){\mathcal{F}}({{\mathbf{x}}}_{j})^{\top}}\right)\in{ \mathbb{R}}^{D\times P}$ $\displaystyle\tilde{{\mathbf{c}}}\overset{\mathrm{def}}{=}$ $\displaystyle\frac{1}{2}\cdot\tilde{W}^{\top}\left({\sum_{j\in[N]}{\mathcal{H} }({{\mathbf{x}}}_{j})}\right)\in{\mathbb{R}}^{D}$ $$

where ${\mathcal{H}}$ is the non-GCN network explicated in the proof of Theorem 1. This technique can be extended to cases with more than 2 GCN layers as well.

## Peer Reviews

confidence: 2
contribution: 2
initial_rating: 5
presentation: 1
questions: 1. In the metadata graph regularization, is the graph primarily used to define positive and negative links for the contrastive loss? Please clarify if the positive and negative examples come solely from this graph.

2. Theorem 1: If I understand correctly, the theorem suggests that if an adjacency matrix can be approximated by a non-GCN (e.g., feedforward network or transformer), it implies the existence of another non-GCN that can approximate $\phi(AXW)$ However, is this new network permutation invariant? The usual motivation for using GCNs is precisely their permutation invariance across the matrix $A$. Therefore, I am not fully convinced by this argument based on my current understanding of the theorem.
soundness: 3
strengths: **Evaluation and Performance**: The experimental results are promising. RAMEN demonstrates  improvements in multi-labels performance over multiple baseline methods.

**Effective method**: Table 3 shows that RAMEN show impressive gain in term of inference and training.
summary: The goal of the RAMEN model is to leverage graph metadata during training without introducing extra inference time costs. The graph data is used to regularize the encoder $\mathcal{E}$ by embedding points close to the representations of correct labels and distant from the representations of incorrect labels. The authors propose a contrastive regularization loss function that utilizes this graph metadata to improve classification accuracy, especially for rare labels.
weaknesses: **Presentation**: The model figure could be more detailed. Currently, it repeats parts of the abstract verbatim, and a more informative figure would have helped clarify the steps, especially how the graph metadata regularizes the encoder through the loss function. Similarly, an introductory figure outlining the overall method would improve readability. Table 4 also needs cropping; important parts are not visible, making it hard to interpret.

**Clarity of Contributions:** The contributions of the paper are difficult to follow. From what I understand, there is a contrastive loss that uses the graph metadata to define positive and negative examples, but this is not explained in sufficient detail, making it hard to fully grasp the model’s novelty and mechanisms. Also the training with 

**Typos**: There are some typo errors. For example, Line 1035 has a "(?)" and Line 1036 seems to have an incomplete reference "Lem[...]".

---

confidence: 4
contribution: 1
initial_rating: 3
presentation: 3
questions: Shown in weakness
soundness: 1
strengths: 1. Graph Regularization Approach: Instead of using complex GCN, the paper proposes a simpler yet effective approach of using graph data for regularization. The method is theoretically supported and mathematically sound.
2. Inference Efficiency: RAMEN achieves faster prediction by eliminating graph traversal during test time, while maintaining accuracy. The two-stage comparison with GCN methods is clearly visualized and demonstrates practical advantages.
3. Multi-Graph Flexibility: The system can handle multiple graph types simultaneously and integrates easily with existing systems. This versatility is well-demonstrated through experimental results and architectural design
summary: This paper presents RAMEN, a method for extreme classification with graph metadata, primarily focusing on ranking and recommendation scenarios. While the authors address the challenge of handling new users and items without graph edges, **they notably overlook the well-established concept of "cold-start" recommendation - a significant oversight in the recommendation systems literature**. The absence of comparisons with existing cold-start solutions and related work makes it difficult to properly evaluate the paper's true contributions to the field. Additionally, the experimental validation is limited by the relatively small dataset size of 1.3 million samples, which fails to demonstrate the method's efficacy in large-scale, real-world applications. Without addressing these fundamental concerns - namely, the missing cold-start comparisons and limited dataset scale - the paper's claims of superiority over existing methods remain inadequately supported. These limitations significantly impact the paper's potential contribution to the field and its suitability for publication at a prestigious venue like ICLR 2025.
weaknesses: 1. Critical Cold-Start Problem Oversight:The paper fundamentally fails to acknowledge or address the cold-start problem, despite directly tackling scenarios where new items have no graph connections. This is not merely a terminology issue - it's a severe oversight that ignores decades of research in recommendation systems. The absence of comparisons with established cold-start solutions makes it impossible to validate the authors' claims of superiority.
2. Inadequate Dataset Scale: Using only a 1.3M dataset in an era where real-world recommendation systems handle hundreds of millions of users/items is a critical limitation. This small-scale evaluation raises serious doubts about RAMEN's practical applicability and scalability claims. The paper's claims about handling "extreme" classification become questionable when tested on such modest datasets.
Missing Technical Validation
3. The paper lacks crucial technical validations, including ablation studies, complexity analysis, and detailed parameter sensitivity tests. The implementation details are vague, making reproduction difficult. Without these essential technical components, the paper's theoretical contributions remain unsubstantiated by empirical evidence, particularly for real-world deployment scenarios.

---

confidence: 4
contribution: 2
initial_rating: 3
presentation: 2
questions: Terms like "in-batch negatives anchors" and the specific way the loss function  and regularization functions interact to encourage the encoder to embed data points and labels in a certain way could be better explained.
soundness: 3
strengths: 1. The paper presents a novel method, RAMEN, for leveraging graph metadata in extreme classification (XC) settings. It offers an alternative to Graph Convolutional Networks (GCNs) by using graph data to regularize encoder training.
2. The paper conducts extensive experiments on multiple benchmark datasets and a proprietary dataset.
summary: This paper presents a novel approach, RAMEN, for extreme classification (XC) that effectively utilizes graph metadata to regularize encoder training. The method shows significant performance improvements over state-of-the-art techniques, with up to 15% higher prediction accuracies on benchmark datasets. The theoretical foundation provided by Theorem 1 and its extensions is a strong aspect of the paper, validating the approach. The extensive experimental results, including ablation studies, further demonstrate the effectiveness of RAMEN. However, the paper could benefit from addressing some weaknesses.
weaknesses: 1. The process of tuning the regularization constants using the bandit learning approach may be hard to follow for some readers. The initialization of the constants and the perturbation process every 30 iterations, along with the update rule using the estimated gradient, involves multiple steps and concepts.
2. The Related Work of this paper lists many references related to XC methods without providing in-depth analysis of how the proposed method in this paper (RAMEN) overcomes the limitations of these existing methods in a more detailed and unique way. While it gives an overview of the field's development, it doesn't clearly distinguish the novelty and superiority of the new approach in a concise manner.
3. The method and its associated theoretical concepts may be complex for some readers to understand. The notation and mathematical derivations, especially in the sections related to Theorem 1 and its proof, could be a barrier to a broader audience. Simplifying or providing more intuitive explanations could enhance the paper's accessibility

---

confidence: 3
contribution: 2
initial_rating: 6
presentation: 1
questions: 1. **Concrete Examples of Graph Metadata:**  
   Can the authors provide specific examples of the types of graph metadata utilized in their experiments? For instance, what defines an anchor set in the different datasets (e.g., LF-WikiSeeAlsoTitles-320K, LF-WikiTitles-500K, LF-AmazonTitles-1.3M), and how are these metadata graphs constructed and integrated within the RAMEN framework?

2. **Robustness to Noisy Graphs:**  
   How does RAMEN perform when exposed to explicitly added noisy graph metadata? Specifically, if additional irrelevant or incorrect edges are introduced into the metadata graphs, what impact does this have on RAMEN's accuracy and robustness compared to traditional GCN-based methods? Have the authors conducted any experiments to evaluate RAMEN's resilience to such noise?

3. **Adaptability to Other Domains:**  
   The experiments presented focus on datasets derived from Wikipedia and Amazon. How adaptable is RAMEN to other domains that have different types of graph metadata, such as social networks, biomedical data, or recommendation systems in other industries? Have the authors conducted any preliminary tests in these diverse domains, or are there plans to evaluate RAMEN's performance in such settings?
soundness: 3
strengths: 1. **Innovative Methodology:** The paper proposes a novel graph-regularized training framework, RAMEN, specifically designed for extreme classification tasks. This method effectively mitigates the limitations of traditional GCN-based approaches, such as high computational overhead and sensitivity to noisy graph structures. By regularizing the encoder with graph metadata during training, RAMEN enhances model robustness and efficiency, enabling scalability to datasets with millions of labels without increasing inference costs.
   
2. **Comprehensive Experimental Validation:** The authors conduct extensive experiments across multiple benchmark datasets, including LF-WikiSeeAlsoTitles-320K, LF-WikiTitles-500K, and LF-AmazonTitles-1.3M, as well as a proprietary dataset (G-EPM-1M). RAMEN consistently outperforms baseline methods, including both text-based and graph-based approaches, by up to 15% in precision metrics. Additionally, ablation studies demonstrate the effectiveness of key components such as bandit learning for regularization constants and graph pruning for handling noisy metadata. The real-world application in sponsored search further validates RAMEN's practical utility, showcasing significant improvements in impression and click yields during A/B testing.
summary: The paper introduces RAMEN, a novel approach designed to enhance extreme classification (XC) tasks by leveraging graph metadata to regularize encoder training. RAMEN effectively addresses the limitations of GNN-based methods, such as computational inefficiency and vulnerability to noisy graph data. By utilizing graph metadata as a regularizer rather than integrating GCN layers directly, RAMEN achieves significant performance improvements, up to 15% higher accuracy on benchmark datasets, while maintaining scalability and minimizing inference costs. The method demonstrates robust performance across various datasets, including proprietary recommendation systems, underscoring its applicability and effectiveness in handling both dense and sparse label scenarios.
weaknesses: 1. **Related Work Presentation:** The related work section primarily lists references without adequate categorization or in-depth analysis. This approach limits the ability to understand how RAMEN differentiates itself from existing methodologies and fails to provide insightful connections between prior studies and the proposed approach. A more structured review, categorizing related works based on their methodologies and highlighting comparative strengths and weaknesses, would enhance the comprehensiveness and clarity of the literature context.
   
2. **Clarity and Formal Description:** The presentation of certain concepts, particularly the comparison between GCN-based extreme classification methods and RAMEN, lacks clarity. The paper would benefit from a more precise formal description of GCN-based extreme classification methods, including explicit definitions and step-by-step explanations. Additionally, outlining the limitations of these methods in a clear, point-wise manner would aid readers in better understanding the motivations behind RAMEN and the specific challenges it addresses.