Computer Science
Computer Science-2021.gz:143484
Computer Science
8ee053a74cf980a0fd48270fb0a4325a1ca56eb7
Bidirectional Distillation for Top-K Recommender System

Recommender systems (RS) have started to employ knowledge distillation, which is a model compression technique training a compact model (student) with the knowledge transferred from a cumbersome model (teacher). The state-of-the-art methods rely on unidirectional distillation transferring the knowledge only from the teacher to the student, with an underlying assumption that the teacher is always superior to the student. However, we demonstrate that the student performs better than the teacher on a significant proportion of the test set, especially for RS. Based on this observation, we propose Bidirectional Distillation (BD) framework whereby both the teacher and the student collaboratively improve with each other. Specifically, each model is trained with the distillation loss that makes to follow the other's prediction along with its original loss function. For effective bidirectional distillation, we propose rank discrepancy-aware sampling scheme to distill only the informative knowledge that can fully enhance each other. The proposed scheme is designed to effectively cope with a large performance gap between the teacher and the student. Trained in the bidirectional way, it turns out that both the teacher and the student are significantly improved compared to when being trained separately. Our extensive experiments on real-world datasets show that our proposed framework consistently outperforms the state-of-the-art competitors. We also provide analyses for an in-depth understanding of BD and ablation studies to verify the effectiveness of each proposed component.


INTRODUCTION
Nowadays, the size of recommender systems (RS) is continuously increasing, as they have adopted deep and sophisticated model architectures to better understand the complex relationships between users and items [16,23]. A large recommender with many learning parameters usually has better performance due to its high capacity, but it also has high computational costs and long inference time. This problem is exacerbated for web-scale applications having numerous users and items, since the number of the learning parameters increases proportionally to the number of users and items. Therefore, it is challenging to adopt such a large recommender for real-time and web-scale platforms.
To tackle this problem, a few recent work [9,16,23] has adopted Knowledge Distillation (KD) to RS. KD is a model-agnostic strategy that trains a compact model (student) with the guidance of a pretrained cumbersome model (teacher). The distillation is conducted in two stages; First, the large teacher recommender is trained with user-item interactions in the training set with binary labels (i.e., 0 for unobserved interaction and 1 for observed interaction.). Second, the compact student recommender is trained with the recommendation list predicted by the teacher along with the binary training set. Specifically, in [23], the student is trained to give high scores on the top-ranked items of the teacher's recommendation list. Similarly, in [16], the student is trained to imitate the teacher's prediction scores with particular emphasis on the high-ranked items in the teacher's recommendation list. The teacher's predictions provide additional supervision, which is not explicitly revealed from the binary training set, to the student. By distilling the teacher's knowledge, the student can achieve comparable performance to the teacher with fewer learning parameters and lower inference latency.
Despite their effectiveness, they still have some limitations. First, they rely on unidirectional knowledge transfer, which distills knowledge only from the teacher to the student, with an underlying assumption that the teacher is always superior to the student. However, based on the in-depth analyses provided in Section 2, we argue that the knowledge of the student also could be useful for the teacher. Indeed, we demonstrate that the teacher is not always superior to the student and further the student performs better than the teacher on a significant proportion of the test set. In specific, the student recommender better predicts 36∼42% of the test interactions than the teacher recommender. These proportions are remarkably large compared to 4∼9% from our experiment on the computer vision task. In this regard, we claim that both the student and the teacher can take advantage of each other's complementary knowledge, and be improved further. Second, the existing methods have focused on distilling knowledge of items ranked highly by the teacher. However, we observe that most of the items ranked highly by the teacher are already ranked highly by the student (See Section 2 for details). Therefore, merely high-ranked items may not (a) Rank difference between teacher and student (b) Rank comparison between teacher and student Figure 1: Performance analyses of the teacher and the student. In (a), rank differences are computed on the test interactions and the test interactions (x-axis) are sorted in increasing order by the rank difference. In (b), each dot represents a sampled unobserved interaction.
be informative to fully enhance the other model, which leads to limiting the effectiveness of the distillation. We propose a novel Bidirectional Distillation (BD) framework for RS. Unlike the existing methods that transfer the knowledge only from the pre-trained teacher recommender, both the teacher and the student transfer their knowledge to each other within our proposed framework. Specifically, they are trained simultaneously with the distillation loss that makes to follow the other's predictions along with the original loss function. Trained in the bidirectional way, it turns out that both the teacher and the student are significantly improved compared to when being trained separately. In addition, the student recommender trained with BD achieves superior performance compared to the student trained with conventional distillation from a pre-trained teacher recommender.
For effective bidirectional distillation, the remaining challenge is to design an informative distillation strategy that can fully enhance each other, considering the different capacities of the teacher and the student. As mentioned earlier, items merely ranked highly by the teacher cannot give much information to the student. Also, it is obvious that the student's knowledge is not always helpful to improve the teacher, as the teacher has a much better overall performance than the student. To tackle this challenge, we propose rank discrepancy-aware sampling scheme differently tailored for the student and the teacher. In the scheme, the probability of sampling an item is defined based on its rank discrepancy between the two recommenders. Specifically, each recommender focuses on learning the knowledge of the items ranked highly by the other recommender but ranked lowly by itself. Taking into account the performance gap between the student and the teacher, we enable the teacher to focus on the items that the student has very high confidence in, whereas making the student learn the teacher's broad knowledge on more diverse items.
The proposed BD framework can be applicable in many application scenarios. Specifically, it can be used to maximize the performance of the existing recommender in the scenario where there is no constraint on the model size (in terms of the teacher), or to train a small but powerful recommender as targeted in the conventional KD methods (in terms of the student). The key contributions of our work are as follows: • Through our exhaustive analyses on real-world datasets, we demonstrate that the knowledge of the student recommender also could be useful for the teacher recommender. Based on the results, we also point out the limitation of the existing distillation methods for RS under the assumption that the teacher is always superior to the student. • We propose a novel bidirectional KD framework for RS, named BD, enabling that the teacher and the student can collaboratively improve with each other during the training. BD also adopts the rank discrepancy-aware sampling scheme differently designed for the teacher and the student considering their capacity gap. • We validate the superiority of the proposed framework by extensive experiments on real-world datasets. BD considerably outperforms the state-of-the-art KD competitors. We also provide both qualitative and quantitative analyses to verify the effectiveness of each proposed component 1 .

ANALYSIS: TEACHER VS STUDENT
In this section, we provide detailed analyses of comparison between the teacher and the student on two real-world datasets: CiteULike [26] and Foursquare [28]. Following [16], we hold out the last interaction of each user as test interaction, and the rest of the user-item interactions are used for training data (see Section 5.1 for details of the experiment setup). We use NeuMF [5] as a base model, and adopt NeuMF-50 as the teacher and NeuMF-5 as the student. The number indicates the dimension of the user and item embedding; the number of learning parameters of the teacher is 10 times bigger than that of the student, and accordingly, the teacher shows a much better overall performance than the student (reported in Table 2). Note that the teacher and the student are trained separately without any distillation technique in the analyses.
The teacher is not always superior to the student. Figure 1a shows bar graphs of the rank difference between the teacher and the student on the test interactions (the bars in the graphs are sorted in increasing order along with the x-axis). The rank difference on a test interaction ( , ) is defined as follows: where ( ) and ( ) denote the ranks assigned by the teacher and the student on the item for the user respectively, and * ( ) = 1 is the highest ranking. If the rank difference is bigger than zero, it means that the student assigns a higher rank than the teacher on the test interaction; the student better predicts the test interaction than the teacher. We observe that the student model assigns higher ranks than the teacher model on the significant proportion of the entire test interactions: 36% for CiteULike and 42% for Foursquare. These proportions are remarkably large compared to 4% for CIFAR-10 and 9% for CIFAR-100 from our experiments on computer vision task 2 .
The results raise a few questions. Why the student can perform better than the teacher on the test data and why this phenomenon is intensified for RS? We provide some possible reasons as follows: Firstly, not all user-item interactions require sophisticated calculations in high-dimensional space for correct prediction. As shown in the computer vision [11], a simple image without complex background or patterns can be better predicted at the lower layer than the final layer in a deep neural network. Likewise, some user-item relationships can be better captured based on simple operations without expensive computations. Moreover, unlike the image classification task, RS has very high ambiguity in nature; in many applications, the user's feedback on an item is given in the binary form: 1 for observed interaction, 0 for unobserved interaction. However, the binary labels do not explicitly show the user's preference. For example, "0" does not necessarily mean the user's negative preference for the item. It can be that the user may not be aware of the item. Due to the ambiguity in the ground-truth labels, the lower training loss does not necessarily guarantee a better ranking performance. Specifically, in the case of NeuMF, which is trained with the binary cross-entropy loss, the teacher can better minimize the training loss and thus better discriminate the observed/unobserved interactions in the training set. However, this may not necessarily result in better predicting user's preference on all the unobserved items due to the ambiguity of supervision.
The high-ranked items are not that informative as expected. Figure 1b shows the rank comparison between the teacher and the student. We plot the high-ranked items in the recommendation list from the teacher and that from the student for all users 3 . Each point corresponds to ( ( ), ( )). We observe that most of the points are located near the lower-left corner, which means that most of the items ranked highly by the teacher are already ranked highly by the student. In this regard, unlike the motivation of the previous work [16,23], items merely ranked highly by the teacher may be not informative enough to fully enhance the student, and thus may limit the effectiveness of the distillation. We argue that each model can be further improved by focusing on learning the knowledge of items ranked highly by the other recommender but ranked lowly by itself (e.g., points located along the x-axis and y-axis).
In summary, the teacher is not always superior to the student, so the teacher can also learn from the student. Their complementarity should be importantly considered for effective distillation in RS. Also, the distillation should be conducted with consideration of the rank discrepancy between the two recommenders. Based on the observations, we are motivated to design a KD framework that the teacher and the student can collaboratively improve with each other based on the rank discrepancy.

PROBLEM FORMULATION
Let the set of users and items be denoted as U = { 1 , 2 , ..., } and I = { 1 , 2 , ..., }, where is the number of users and is the number of items. Let R ∈ {0, 1} × be the user-item interaction matrix, where = 1 if the user has an interaction with the item , otherwise = 0. Also, for a user , I − = { ∈ I| = 0} denotes the set of unobserved items and I + = { ∈ I| = 1} denotes the set of interacted items. A top-recommender system aims to find a recommendation list of unobserved items for each user. To make the recommendation list, the system predicts the scoreˆ= ( = 1| , ) for each item in I − for each user , then ranks the unobserved items according to their scores.

METHOD
We propose a novel Bidirectional Distillation (BD) framework for top-recommender systems. Within our proposed framework, both the teacher and the student transfer their knowledge to each other. We first provide an overview of BD (Section 4.1). Then, we formalize the distillation loss to transfer the knowledge between the two recommenders (Section 4.2). We also propose rank discrepancyaware sampling scheme differently tailored for the teacher and the student to fully enhance each other (Section 4.3). Lastly, we provide the details of the end-to-end training process within the proposed framework (Section 4.4). Figure 2 shows an overview of BD. Unlike the existing KD methods for RS, both the teacher and the student are trained simultaneously by using each other's knowledge (i.e., recommendation list) along with the binary training set (i.e., user-item interactions). First, the teacher and the student produce the recommendation list for each user. Second, BD decides what knowledge to be transferred for each distillation direction based on the rank discrepancy-aware sampling scheme. Lastly, the teacher and the student are trained with the distillation loss along with the original collaborative filtering loss. To summarize, each of them is trained as follows:

Overview
where and denote the teacher and the student respectively, * is the model parameters. L is the collaborative filtering loss depending on the base model which can be any existing recommender, and L is the bidirectional distillation loss. Lastly, → and → are the hyperparameters that control the effects of the distillation loss in each direction.
Within BD, the teacher and the student are collaboratively improved with each other based on their complementarity. Also, during the training, the knowledge distilled between the teacher and the student gets gradually evolved along with the recommenders; the improvement of the teacher leads to the acceleration of the student's learning, and the accelerated student again improves the teacher's learning. Trained in the bidirectional way, both the teacher and the student are significantly improved compared to when being trained separately. As a result, the student trained with BD outperforms the student model trained with the conventional distillation that relies on a pre-trained and fixed teacher.

Distillation Loss
We formalize the distillation loss that transfers the knowledge between the recommenders. By following the original distillation loss that matches the class distributions of two classifiers for a given image [7], we design the distillation loss for the user as follows: where is the prediction of a recommender and RDS * (I − ) is a set of the unobserved items sampled by the rank discrepancy-aware sampling.ˆis computed by ( / ) where (·) is the sigmoid function, is the logit, and is the temperature that controls the smoothness.
Our distillation loss is a binary version of the original KD loss function. Similar to the original KD loss transferring the knowledge of class probabilities, our loss transfers a user's potential positive and negative preferences on the unobserved items. Specifically, in the binary training set, the unobserved interaction is only labeled as "0". However, as mentioned earlier, it is ambiguous whether the user actually dislikes the item or potentially likes the item. Through the distillation, each recommender can get the other's opinion of how likely (and unlikely) the user would be interested in the item, and such information helps the recommenders to better cope with the ambiguous nature of RS.

Rank Discrepancy-aware Sampling
We propose the rank discrepancy-aware sampling scheme that decides what knowledge to be transferred for each distillation direction. As we observed in Section 2, most of the items ranked highly by the teacher are already ranked highly by the student and vice versa. Thus, the existing methods [16,23] that simply choose the high-ranked items cannot give enough information to the other recommender. Moreover, for effective bidirectional distillation, the performance gap between the teacher and the student should be carefully considered in deciding what knowledge to be transferred, as it is obvious that not all knowledge of the student is helpful to improve the teacher.
In this regard, we develop a sampling scheme based on the rank discrepancy of the teacher and the student, and tailor it differently for each distillation direction with consideration of their different capacities. The underlying idea of the scheme is that each recommender can get informative knowledge by focusing on the items ranked highly by the other recommender, but ranked lowly by itself. The sampling strategy for each distillation direction is defined as follows: Distillation from the teacher to the student. As the teacher has a much better overall performance than the student, the opinion of the teacher should be considered more reliable than that of the student in most cases. Thus, for this direction of the distillation, we make the student follow the teacher's predictions on many rankdiscrepant items. Formally, for each user , the probability of an item to be sampled is computed as follows: where ( ) and ( ) denote the ranks assigned by the teacher and the student on the item for the user respectively, and * ( ) = 1 is the highest ranking 4 . We use a hyper-parameter (> 0) to control the smoothness of the probability. With this probability function, we sample the items ranked highly by the teacher but ranked lowly by the student. Since ℎ(·) is a saturated function, items with rank discrepancy above a particular threshold would be sampled almost uniformly. As a result, the student learns the teacher's broad knowledge of most of the rank-discrepant items.
Distillation from the student to the teacher. As shown in Section 2, the teacher is not always superior to the student, especially for RS. That is, the teacher can be also further improved by learning from the student. However, at the same time, the large performance gap between the teacher and the student also needs to be considered for effective distillation. For this direction of the distillation, we make the teacher follow the student's predictions on only a few selectively chosen rank-discrepant items. The distinct probability function is defined as follows: where (> 0) is a hyper-parameter to control the smoothness of the probability. We use the exponential function to put particular emphasis on the items that have large rank discrepancies. Therefore, this probability function enables the teacher to follow the student's 4 we omit the superscript from * ( ) for the simplicity. Draw RDS → (I − ) with probability → (·) 10 Compute L ( ) and L ( ; ) 11 Update predictions only on the rank-discrepant items that the student has very high confidence in.

Model Training
Algorithm 1 describes a pseudo code for the end-to-end training process within BD framework. The training data D consists of observed interactions ( , ). First, the model parameters and are warmed up only with the collaborative filtering loss (line 1), as the predictions during the first few epochs are very unstable. Second, we make the recommenders produce the recommendation lists for the subsequent sampling. Since it is time-consuming to produce the recommendation lists every epoch, we conduct this step every epochs (line 3-4). Next, we decide what knowledge to be transferred in each distillation direction via the rank discrepancy-aware sampling. It is worth noting that the unobserved items sampled by the rank discrepancy-aware sampling can be used also for the collaborative filtering loss. Finally, we compute the losses with the sampled items for the teacher and the student, respectively, and update the model parameters.

EXPERIMENTS
In this section, we validate our proposed framework on 9 experiment settings (3 real-world datasets × 3 base models). We first introduce our experimental setup (Section 5.1). Then, we provide a performance comparison supporting the superiority of the BD (Section 5.2). We also provide two analyses for the in-depth understanding of BD (Section 5.3, 5.4). Lastly, We provide an ablation study to verify the effectiveness of rank discrepancy-aware sampling (Section 5.5) and analyses for important hyperparameters of BD (Section 5.6).  [26], Foursquare 6 (Tokyo Check-in) [28] and Yelp 7 [6]. We only keep users who have at least five ratings for CiteULike and Foursquare, ten ratings for Yelp as done in [5,21]. Data statistics after the preprocessing are presented in Table 1. We also report the experimental results on ML100K and AMusic, which are used for CD [16], in Appendix for the direct comparison.

Evaluation Protocol and Metrics.
We adopt the widely used leave-one-out evaluation protocol. For each user, we hold out the last interacted item for testing and the second last interacted item for validation as done in [5,16]. If there is no timestamp in the dataset, we randomly take two observed items for each user. Then, we evaluate how well each method can rank the test item higher than all the unobserved items for each user (i.e., I − ). Note that instead of randomly choosing a predefined number of candidates (e.g., 99), we adopt the full-ranking evaluation that uses all the unobserved items as candidates. Although it is time-consuming, it enables a more thorough evaluation compared to using random candidates [14,16].
As we focus on top-recommendation for implicit feedback, we employ two widely used metrics for evaluating the ranking performance of recommenders: Hit Ratio (H@ ) [18] and Normalized Discounted Cumulative Gain (N@ ) [8]. H@ measures whether the test item is present in the top-list and N@ assigns a higher score to the hits at higher rankings in the top-list. We compute those two metrics for each user, then compute the average score. Lastly, we report the average value of five independent runs for all methods.

Base Models
. BD is a model-agnostic framework applicable for any top-RS. We validate BD with three base models that have different model architectures and learning strategies. Specifically, we choose two widely used deep learning models and one latent factor model as follows: • NeuMF [5]: A deep recommender that adopts Matrix Factorization (MF) and Multi-Layer Perceptron (MLP) to capture complex and non-linear user-item relationships. NeuMF uses the pointwise loss function for the optimization. • CDAE [27]: A deep recommender that adopts Denoising Autoencoders (DAE) [25] for the collaborative filtering. CDAE uses the point-wise loss function for the optimization. • BPR [21]: A learing-to-rank recommender that adopts MF [13] to model the user-item interaction. BPR uses the pair-wise loss function for the optimization under the assumption that observed items are more preferred than unobserved items.

Methods Compared.
The proposed framework is compared with the state-of-the-art KD methods for top-RS.
• Ranking Distillation (RD) [23]: A pioneering KD method for top-RS. RD makes the student give high scores on top-ranked items by the teacher. • Collaborative Distillation (CD) [16]: A state-of-the-art KD method for top-RS. CD makes the student imitate the teacher's scores on the items ranked highly by the teacher.

Implementation Details.
For all the base models and baselines, we use PyTorch [20] for the implementation. For each dataset, hyperparameters are tuned by using grid searches on the validation set. We use Adam optimizer [12] with L2 regularization and the learning rate is chosen from {0.00001, 0.0001, 0.001, 0.002}, and we set the batch size as 128. For NeuMF, we use 2-layer MLP for the network. For CDAE, we use 2-layer MLP for the encoder and the decoder, and the dropout ratio is set to 0.5. The number of negative samples is set to 1 for NeuMF and BPR, 5 * |I + | for CDAE as suggested in the original paper [27]. For the distillation, we adopt as many learning parameters as possible for the teacher model until the ranking performance is no longer increased on each dataset. Then, we build the student model by employing only one-tenth of the learning parameters used by the teacher. The number of model parameters of each base model is reported in Table 3  implementation and the original papers [16,23]. For BD, → and → are set to 0.5, the number of items sampled by rank discrepancy-aware sampling is chosen from {1, 5, 10}, is chosen from {10 −2 , 10 −3 , 10 −4 , 10 −5 }, is chosen from {10 −3 , 10 −4 , 10 −5 }, the temperature for logits is chosen from {2, 5, 10} and the rank updating period (in Algorithm 1) is set to 10. Table 2 shows the recommendation performance of each KD method on three real-world datasets and three different base models. In Table 2, "Teacher" and "Student" indicate the base models trained separately without any distillation technique, "BD-Teacher" and "BD-Student" are the teacher and the student trained simultaneously with BD. "CD" and "RD" denote the student trained with CD and RD, respectively. We analyze the experimental results from various perspectives. We first observe that the teacher recommender is consistently improved by the knowledge transferred from the student with BD by up to 20.79% (for H@50 on CiteULike). This result verifies our claim that the knowledge of the student also could be useful for improving the teacher. Also, this result strongly indicates that the distillation process of BD effectively resolves the challenge of a large performance gap, and successfully transfer the informative knowledge from the student. In specific, the ranking discrepancyaware sampling enables the teacher to focus on the items that the student has very high confidence in. This strategy can minimize the adverse effects from the performance gap, making the teacher be further improved based on the complementary knowledge from the student.

Performance Comparison
Second, the student recommender is significantly improved by the knowledge transferred from the teacher with BD by up to 39.88% (for N@50 on CiteULike). Especially, the student trained with BD considerably outperforms the student trained with the existing KD methods (i.e., RD, CD) by up to 13.94% (for H@100 on Yelp). The superiority of BD comes from the two contributions; BD makes the student follow the teacher's predictions on the rank-discrepant items which are more informative than the merely high-ranked items. Also, within BD, the improvement of the teacher leads to the acceleration of the student's learning, and the accelerated student again improves the teacher's learning. With better guidance from the improved teacher, the student with BD can achieve superior performance than the student with the existing KD methods. To verify the effectiveness of each contribution, we conduct in-depth analyses in the next sections.
Lastly, Table 3 shows the model size and online inference efficiency for each base model. For making the inferences, we use PyTorch with CUDA on GTX Titan X GPU and Intel i7-7820X CPU. As the student has only one-tenth of the learning parameters used by the teacher, the student requires less computational costs, thus achieves lower inference latency. Moreover, the student trained with BD shows comparable or even better recommendation performance to the teacher (e.g., NeuMF and CDAE on Foursquare). On CiteULike, we observe that the student achieves comparable performance by employing 20∼30% of learning parameters used by the teacher. These results show that BD can be effectively adopted to train a small but powerful recommender. Moreover, as mentioned earlier, BD is also applicable in setting where there is no constraint on the model size or inference time. Specifically, BD can be adopted to maximize the performance of a large recommender with numerous learning parameters (i.e., the teacher).

Model Size Analysis
We control the size of the teacher and the student to analyze the effects of the capacity gap between two recommenders on BD. We report the results of a deep model and a latent factor model (i.e., NeuMF and BPR) on CiteULike. Figure 3a shows the performance of the teacher trained with the student of varying sizes and Figure  3b shows the performance of the student trained with the teacher of varying sizes. "S" indicates the size of the student (10% of the teacher), "M" indicates the medium size (50% of the teacher), and "T" indicates the size of the teacher. Also, "fixed S" refers to the pretrained student recommender with the size of "S", "fixed T" refers to the pre-trained teacher recommender with the size of "T". Note that "fixed S/T" are not updated during the training (i.e., unidirectional knowledge distillation).
First, we observe that both the teacher and the student achieves the greatest performance gain when the capacity gap between two recommenders is largest; the teacher shows the best performance with the smallest student (i.e., S in Fig. 3a) and the student performs best with the largest teacher (i.e., T in Fig. 3b). As mentioned in Section 2, the teacher and the student have complementarity as some user-item relationships can be better captured without expensive computations. In this regard, such complementarity can be maximized when the capacity gap between the two recommenders is large enough. This result supports our claim that the performance gain comes from the different but reciprocal knowledge of two recommenders. Also, it is worth noting that there are still performance improvements when two recommenders have identical sizes (i.e., T in Fig. 3a, S in Fig. 3b). This can be understood as a kind of self-distillation effect [2,30] when the teacher has the same size as the student. Although they have very similar kinds of knowledge, they can still regularize each other, preventing its counterpart from being overfitted to a few observed interactions.
Second, the teacher is more improved when it is trained along with the learning student than when it is trained with the fixed student (i.e., S vs. fixed S in Fig. 3a). Similarly, the student is more improved when it is trained together with the learning teacher than when it is trained with the fixed teacher (i.e., T vs. fixed T in Fig. 3b). In the unidirectional distillation, the pre-trained recommender (i.e., fixed S/T) is no longer improved, thus always conveys the same knowledge during the training. On the contrary, within BD, both recommenders are trained together, thus the knowledge distilled between the recommenders gets gradually evolved as they are improved during the training. As a result, each recommender can be further improved based on the evolved knowledge of its  counterparts. This result again shows the superiority of our bidirectional distillation over the unidirectional distillation of the existing methods.

Synchronization Analysis
We perform in-depth analysis to investigate how well the teacher and the student learn each other's complementary knowledge within the proposed framework. Specifically, we evaluate how much synchronized the two recommenders are within BD, which shows that they are improved based on each other's complementarity. To quantify the degree of the synchronization, we define (normalized) Average Rank Difference as follows: where and are the numbers of users and items, respectively, and D is the test set that contains the held-out observed interaction for each user. The rank difference (Rank Diff. ( )) is defined in Equation 1. Table 4 shows the change in the average rank difference after the training with BD. We observe that the average rank difference gets consistently decreased on all the datasets. This result indicates that the teacher and the student get synchronized by transferring their knowledge to each other. Figure 4 shows the rank difference between the teacher and the student after the training with BD. We adopt NeuMF as the base model as done in Section 2. Note that the (normalized) average rank difference is proportional to the extent of the blue area. We observe that the blue area in Figure 4 shrinks compared to that in Figure 1 after the training with BD. Interestingly, we observe that the teacher is significantly improved on CiteULike dataset (by up to 20.79%) which has the largest average rank difference change before and after the training with BD. The large change indicates that the two recommenders get synchronized well during the training, which leads to significant improvements based on each other's knowledge.

Sampling Scheme Analysis
We examine the effects of diverse sampling schemes on the performance of BD to verify the superiority of the proposed sampling scheme. Note that the schemes decide what knowledge to be distilled within BD. We compare five different sampling schemes as follows: 1) Rank discrepancy-aware sampling, 2) Rank-aware sampling [16], 3) Top-selection [23], 4) Uniform sampling, 5) Swapped rank discrepancy-aware sampling. The rank discrepancy-aware sampling, which is our proposed scheme, focuses on the rank-discrepant items between the teacher and the student. On the other hand, the rank-aware sampling (adopted in CD) and top-selection (adopted in RD) focus on the items ranked highly by one recommender. The uniform sampling randomly chooses items from the entire recommendation list. Finally, the swapped rank discrepancy-aware sampling, which is the ablation of the proposed scheme, swaps the sampling probability function of each distillation direction; we make the teacher follow the student on most of the rank-discrepant items (with tanh), and make the student imitate only a few predictions of the teacher (with exp). Table 5 shows the performance of BD with different sampling schemes. We first observe that the proposed scheme achieves the best result both for the teacher and the student. This result verifies the effectiveness of two components of the proposed scheme: 1) sampling based on the rank discrepancy, 2) probability functions differently designed for each distillation direction. Specifically, we can see the effectiveness of rank discrepant-based sampling by comparing our sampling scheme with rank-aware sampling. As observed in Section 2, the items merely ranked highly by the teacher may be not informative enough to fully enhance the student. With the proposed scheme, BD focuses on the rank-discrepant items, thus can further improve the recommenders. Also, we observe that swapping the probability function of each distillation direction (i.e., the swapped rank discrepancy-aware) significantly degrades the performance. This result strongly indicates that each probability function is well   designed to effectively cope with the large performance gap of two recommenders.

Hyperparameter Analysis
In this section, we provide thorough analyses that examine the effects of important hyperparameters on BD. For the sake of the space, we report the results of NeuMF on CiteULike dataset. We observe similar tendencies with other base models and datasets.
First, Figure 5 shows the performance of the teacher and the student with varying → and → which control the effects of the distillation losses. The best performance is achieved when both → and → are around 0.5. Also, we observe that both the recommenders are considerably improved when → and → have similar values (i.e., diagonal entries). Moreover, we observe that the performance of the student is more robust with respect to than that of the teacher. We believe that this is because the student has a lower overall performance than the teacher, thus can easily take advantage of the teacher in broad settings.
Second, Figure 6 shows the performance of the teacher and the student with varying and which control the smoothness of the probability functions in rank discrepancy-aware sampling. When and are small, the probability functions become smooth. The best performance is achieved when both parameters are around 10 −4 .
When is bigger than 10 −3 , the probability → (·) gets too sharp. Thus, the teacher cannot fully learn the student's complementary knowledge, which leads to degraded performance.
Lastly, Figure 7 shows the performance of the teacher and the student with varying rank updating period (in Algorithm 1). Since it is time-consuming to generate the recommendation list every epoch, we update the recommendation list of the two models every epoch. In this paper, we use = 10 which shows the comparable performance to the upper-bound ( = 1).

RELATED WORK
Reducing inference latency of RS. Several methods have been proposed for reducing the model size and inference time of recommender systems. First, a few work adopt discretization techniques to reduce the size of recommenders [10,19,29,31,33]. They learn discrete representations of users and items to make portable recommenders and successfully reduce the model size. However, their recommendation performance is highly limited due to the restricted capability and thus the loss of recommendation performance is unavoidable [16]. Second, several methods try to accelerate the inference phase by adopting model-dependent techniques [1,17,24]. For example, the order-preserving transformations [1] and the pruning techniques [17,24] have been adopted to reduce the computational costs of the inner product. Although they can reduce the inference latency, they are applicable only to specific models (e.g., inner product-based models).
To tackle this challenge, a few recent methods [9,16,23] have adopted knowledge distillation to RS. KD is a model-agnostic strategy and we can employ any recommender system as the base model. RD [23] firstly proposes a KD method that makes the student give high scores on the top-ranked items of the teacher's recommendation list. Similarly, CD [16] makes the student imitate the teacher's prediction scores with particular emphasis on the items ranked highly by the teacher. The most recent work, RRD [9], formulates the distillation process as a relaxed ranking matching problem between the ranking list of the teacher and that of the student. Since it is daunting for the small student to learn all the prediction results from the large teacher, they focus on the high-ranked items, which can affect the top-recommendation performance [9]. By using such supplementary supervisions from the teacher, they have successfully improved the performance of the student. However, they have some critical limitations in that 1) they rely on the unidirectional distillation, 2) the high-ranked items are not informative enough. These limitations are thoroughly analyzed and resolved in this work.
Training multiple models together. There have been successful attempts to train multiple models simultaneously for better generalization performance in computer vision and natural language processing [3,22,32]. In computer vision, Deep Mutual Learning (DML) [32] trains a cohort of multiple classifiers simultaneously in a peer-teaching scenario where each classifier is trained to follow the predictions of the other classifiers along with its original loss. Since each classifier starts from a different initial condition, each classifier's predicted probabilities of the next most likely class vary. DML claims that those secondary quantities provide extra information to the other classifiers that can help them to converge to a more robust minima. Also, Collaborative Learning [22] trains several classifier heads of the same network simultaneously by sharing intermediate-level representations. Collaborative Learning argues that the consensus of multiple views from different heads on the same data provides both supplementary information and regularization to each classifier head. In natural language processing, Dual Learning [3] proposes a learning mechanism that two machine translators teach each other to reduce the costs of human labeling. Pointing out that the machine translation can be considered as a dual-task forming a closed loop (e.g., English-to-French/ French-to-English), Dual Learning generates informative feedback by transferring their outputs to each other and achieves considerable performance improvements without the involvement of a human labeler. Although the aforementioned methods have effectively increased performance by training multiple models simultaneously, they mostly employ models with the same sizes focusing only on achieving better generalization based on the consensus of various views.
In this paper, we propose a novel Bidirectional Distillation framework whereby two recommenders of different sizes are trained together by transferring their knowledge to each other. Pointing out that the large recommender and the small recommender have different but complementary knowledge, we design an effective distillation mechanism that considers their huge capacity gap.

CONCLUSION
We propose a novel Bidirectional Distillation framework for toprecommender systems whereby the teacher and the student are collaboratively improved with each other during the training. Within our proposed framework, both the teacher and the student transfer their knowledge to each other with the distillation loss. Also, our framework considers the capacity gap between the teacher and the student with differently tailored rank discrepancy-aware sampling.
Our extensive experiments on real-world datasets show that BD significantly outperforms the state-of-the-art competitors in terms of the student recommender. Furthermore, the teacher model also gets the benefit of the student and performs better than when being trained separately. We also provide analyses for the in-depth understanding of BD and verifying the effectiveness of each proposed component.