GRAM : F ast F ine-tuning of P re-trained L anguage M odels for C ontent-based C ollaborative F iltering (2022)

Abstract: Content-based collaborative filtering (CCF) predicts user-item interactions based on both users’ interaction history and items’ content information. Recently, pre-trained language models (PLM) have been used to extract high-quality item encodings for CCF. However, it is resource-intensive to train a PLM-based CCF model in an end-to-end (E2E) manner, since optimization involves back-propagating through every content encoding within a given user interaction sequence. To tackle this issue, we propose GRAM (GRadient Accumulation for Multi-modality in CCF), which exploits the fact that a given item often appears multiple times within a batch of interaction histories. Specifically, Single-step GRAM aggregates each item encoding’s gradients for back-propagation, with theoretic equivalence to the standard E2E training. As an extension of Single-step GRAM, we propose Multi-step GRAM, which increases the gradient update latency, achieving a further speedup with drastically less GPU memory. GRAM significantly improves training efficiency (up to 146x) on five datasets from two task domains of Knowledge Tracing and News Recommendation. Our code is available at https://github.com/yoonseok312/GRAM .

## introduction collaborative filtering (cf) is a popular technique used for mining relationships between items and users. recently, cf has been successfully applied to various tasks including knowledge tracing and recommender systems @xcite @xcite . however, conventional cf only considers item-user interactions, and disregards any item-/user-specific information. this leads to the so-called cold-start problem @xcite , where the cf model however, fine-tuning plms for ccf requires prohibitive computational resources in terms of (1) training time and (2) gpu memory footprint. this issue arises due to ccf's multi-modal nature, where item representations are learned from both tabular user records and their textual information. as a given item appears multiple times within a batch of users' records, its textual encoding needs to be computed every time it appears within the batch. moreover, the need to store intermediate activations for hundreds of millions of parameters in plm requires high gpu memory footprint @xcite . to that end, we propose single-step gram, gradient accumulation for multi-modality in ccf, which alternately trains the task specific module and content encoder module. accumulating gradients for repeated items in a training step, singlestep gram provides 4 times faster training while being theoretically equivalent to standard e2e training. as a natural extension of single-step gram, we also propose multi-step gram which accumulates gradients across multiple training steps. multi-step gram (1) provides an even higher ratio of acceleration without significant performance loss and (2) consumes less than 40% gpu memory of e2e. results show that the computational speed can increase up to 146× (45× on avg.) with less than 1% drop in auc. the contributions of our paper are as follows: ## preliminaries notation description in this section, we formally setup ccf framework and its notations for efficient discussion. ccf framework consists of two major components: content-encoder (ce) and collaborative filter (cf) components connected in an end-to-end fashion. ## proposed method while gram trains cf module and ce module separately, it guarantees a theoretically equivalent parameter update with e2e as shown in the proposition (proof in appendix a). yielding identical outcome of e2e back-propagation with fewer gradient computation, single-step gram enables efficient training under hierarchical multi-modal setting like ccf by accumulating gradient buffer in the pseudo-target for items that are updated multiple times in a mini-batch. ## experimental settings we first define the scope of tasks and metrics used in the experiments. detailed description of datasets and methods are provided in section 5.1 and section 5.2, respectively. tasks: experiments are conducted on two major task domains of ccf: knowledge tracing(kt) and news recommendation(nr), where models predict whether a student/reader will solve/click an question/article, as a classification task. metrics: overall auc and cold-start item auc (csauc) are measured for kt. auc, mrr, ndcg@5, ndcg@10 are measured for nr. as cold start problem is intrinsically abundant in news recommendation environment @xcite al. (2019) ), we did not measure csauc separately. wall-clock training time until convergence is reported for all experiments. for fair comparison of training time, all models are run on equivalent device (nvidia a100 gpu) in an isolated manner. ## conclusion and future work in this paper, we proposed gram as an efficient method to train content-based collaborative filtering models. single-step gram splits the ce module and cf module during training, accumulating gradients for items appearing repeatedly in a batch. this effectively reduces the number of ce module's gradient computation and negates the need to store the intermediate activations for both of the modules at once. extending single-step gram, we increase the gradient accumulation latency for multi-step gram, gaining additional training speed boost and memory footprint reduction. gram was empirically evaluated on 5 different tasks to demonstrate its efficiency and comparable prediction power. utilizing gram's efficiency, knowledge tracing model trained with gram 1e will be deployed in santa foot_1 , an ai-powered english learning platform with 4 million users. a limitation of our method is that we introduce an additional hyperparameter of gradient accumulation latency for multi-step gram. we expect a more sophisticated gradient accumulation scheme may adaptively choose the gradient accumulation latency. another potential extension of our research is to scale up gram for ccf tasks involving higher-dimensional inputs, such as images and videos.