R ES A CT : R EINFORCING L ONG - TERM E NGAGEMENT IN S EQUENTIAL R ECOMMENDATION WITH R ESIDUAL A CTOR
A BSTRACT
Long-term engagement is preferred over immediate engagement in sequential recommendation as it directly affects product operational metrics such as daily active users (DAUs) and dwell time.
Meanwhile, reinforcement learning (RL) is widely regarded as a promising framework for optimizing long-term engagement in sequential recommendation.
However, due to expensive online interactions, it is very difficult for RL algorithms to perform state-action value estimation, exploration and feature extraction when optimizing long-term engagement.
In this paper, we propose ResAct which seeks a policy that is close to, but better than, the online-serving policy.
In this way, we can collect sufficient data near the learned policy so that state-action values can be properly estimated, and there is no need to perform online interaction.
ResAct optimizes the policy by first reconstructing the online behaviors and then improving it via a Res idual Act or.
To extract long-term information, ResAct utilizes two information-theoretical regularizers to confirm the expressiveness and conciseness of features.
We conduct experiments on a benchmark dataset and a large-scale industrial dataset which consists of tens of millions of recommendation requests.
Experimental results show that our method significantly outperforms the state-of-the-art baselines in various long-term engagement optimization tasks.
I NTRODUCTION
In recent years, sequential recommendation has achieved remarkable success in various fields such as news recommendation (Wu et al., 2017; Zheng et al., 2018; de Souza Pereira Moreira et al., 2021), digital entertainment (Donkers et al., 2017; Huang et al., 2018; Pereira et al., 2019), Ecommerce (Chen et al., 2018; Tang & Wang, 2018) and social media (Zhao et al., 2020b; Rappaz et al., 2021).
Real-life products, such as Tiktok and Kuaishou, have influenced the daily lives of billions of people with the support of sequential recommender systems.
Different from traditional recommender systems which assume that the number of recommended items is fixed, a sequential recommender system keeps recommending items to a user until the user quits the current service/session (Wang et al., 2019; Hidasi et al., 2016).
In sequential recommendation, as depicted in
Figure 1, users have the option to browse endless items in one session and can restart a new session after they quit the old one (Zhao et al., 2020c).
To this end, an ideal sequential recommender system would be expected to achieve i) low return time between sessions, i.e., high frequency of user visits; and ii) large session length so that more items can be browsed in each session.
We denote these two characteristics, i.e., return time and session length, as long-term engagement, in contrast to immediate engagement which is conventionally measured by click-through rates (Hidasi et al., 2016).
Long-term engagement is preferred over immediate engagement in sequential recommendation as it directly affects product operational metrics such as daily active users (DAUs) and dwell time.
Despite great importance, unfortunately, how to effectively improve long-term engagement in sequential recommendation remains largely uninvestigated.
Relating the changes in long-term user engagement to a single recommendation is a tough problem (Wang et al., 2022).
Existing works on sequential recommendation have typically focused on estimating the probability of immediate engagement with various neural network architectures (Hidasi et al., 2016; Tang & Wang, 2018).
However, they neglect to explicitly improve user stickiness such as increasing the frequency of visits or extending the average session length.
There have been some recent efforts to optimize long-term engagement in sequential recommendation.
However, they are usually based on strong assumptions such as recommendation diversity will increase long-term engagement (Teo et al., 2016;
Zou et al., 2019).
In fact, the relationship between recommendation diversity and long-term engagement is largely empirical, and how to measure diversity properly is also unclear (Zhao et al., 2020c).
[Figure]
Recently, reinforcement learning has achieved impressive advances in various sequential decision-making tasks, such as games (Silver et al., 2017; Schrittwieser et al., 2020), autonomous driving (Kiran et al., 2021) and robotics (Levine et al., 2016).
Reinforcement learning in general focuses on learning policies which maximize cumulative reward from a long-term perspective (Sutton &
Barto, 2018).
To this end, it offers us a promising framework to optimize long-term engagement in sequential recommendation (Chen et al., 2019).
We can formulate the recommender system as an agent, with users as the environment, and assign rewards to the recommender system based on users’ response, for example, the return time between two sessions.
However, back to reality, there are significant challenges.
First, the evolvement of user stickiness lasts for a long period, usually days or months, which makes the evaluation of state-action value difficult.
Second, probing for rewards in previously unexplored areas, i.e., exploration, requires live experiments and may hurt user experience.
Third, rewards of long-term engagement only occur at the beginning or end of a session and are therefore sparse compared to immediate user responses.
As a result, representations of states may not contain sufficient information about long-term engagement.
To mitigate the aforementioned challenges, we propose to learn a recommendation policy that is close to, but better than, the online-serving policy.
In this way, i) we can collect sufficient data near the learned policy so that state-action values can be properly estimated; and ii) there is no need to perform online interaction.
However, directly learning such a policy is quite difficult since we need to perform optimization in the entire policy space.
Instead, our method, ResAct, achieves it by first reconstructing the online behaviors of previous recommendation models, and then improving upon the predictions via a Res idual Act or.
The original optimization problem is decomposed into two sub-tasks which are easier to solve.
Furthermore, to learn better representations, two informationtheoretical regularizers are designed to confirm the expressiveness and conciseness of features.
We conduct experiments on a benchmark dataset and a real-world dataset consisting of tens of millions of recommendation requests.
The results show that ResAct significantly outperforms previous stateof-the-art methods in various long-term engagement optimization tasks.
P ROBLEM S TATEMENT
In sequential recommendation, users interact with the recommender system on a session basis.
A session starts when a user opens the App and ends when he/she leaves.
As in Figure 1, when a user starts a session, the recommendation agent begins to feed items to the user, one for each recommendation request, until the session ends.
For each request, the user can choose to consume the recommended item or quit the current session.
A user may start a new session after he/she exits the old one, and can consume an arbitrary number of items within a session.
An ideal recommender system with a goal for long-term engagement would be expected to minimize the average return time between sessions while maximizing the average number of items consumed in a session.
Formally, we describe the sequential recommendation problem as a Markov Decision Process (MDP) which is defined by a tuple ⟨S , A , P , R , γ ⟩ .
S =
S
h × S l is the continuous state space.
s ∈ S indicates the state of a user.
Considering the session-request structure in sequential recommendation, we decompose S into two disjoint sub-spaces, i.e., S h and S l , which is used to represent session-level
(high-level) features and request-level (low-level) features, respectively.
A is the continuous action space (Chandak et al., 2019; Zhao et al., 2020a), where a ∈ A is a vector representing a recommended item.
P : S ×
A × S → R is the transition function, where p ( s t +1 | s t , a t ) defines the state transition probability from the current state s t to the next state s t +1 after recommending an item a t .
R : S ×
A → R is the reward function, where r ( s t , a t ) is the immediate reward by recommending a t at state s t .
The reward function should be related to return time and/or session length; γ is the discount factor for future rewards.
Given a policy π ( a | s ) : S ×A → R , we define a state-action value function Q π ( s, a ) which outputs the expected cumulative reward (return) of taking an action a at state s and thereafter following π :
[Equation]
The optimization objective is to seek a policy π ( a | s ) such that the return obtained by the recommendation agents is maximized, i.e., max π J ( π ) =
E s t ∼ d πt ( · ) ,a t ∼ π ( ·| s t )
[ Q π ( s t , a t )] .
Here d πt ( · ) denotes the state visitation frequency at step t under the policy π .
R EINFORCING L ONG - TERM E NGAGEMENT WITH R ESIDUAL A CTOR
To improve long-term engagement, we propose to learn a recommendation policy which is broadly consistent to, but better than, the online-serving policy 1 .
In this way, i) we have access to sufficient data near the learned policy so that state-action values can be properly estimated because the notorious extrapolation error is minimized (Fujimoto et al., 2019); and ii) the potential of harming the user experience is reduced as we can easily control the divergence between the learned new policy and the deployed policy (the online-serving policy) and there is no need to perform online interaction.
[Figure] [Figure]
∆ 𝒔
[Figure]
" 𝒂
Reconstruction
Prediction
Selection
Despite the advantages, directly learning such a policy is rather difficult because we need to perform optimization throughout the entire huge policy space.
Instead, we propose to achieve it by first reconstructing the onlineserving policy and then improving it.
By doing so, the original optimization problem is decomposed into two sub-tasks which are more manageable.
Specifically, let ˆ π ( a | s ) denote the policy we want to learn; we decompose it into ˆ a = a on + ∆( s, a on ) where a on is sampled from the online-serving policy π on , i.e., a on ∼ π on ( a | s ) , and ∆( s, a on ) is the residual which is determined by a deterministic actor.
We expect that adding the residual will lead to higher expected return, i.e., J (ˆ π ) ≥ J ( π on ) .
As in Figure 2, our algorithm, ResAct, works in three phases:
i) Reconstruction: ResAct first reconstructs the online-serving policy,
i
e., ˜ π on ( a | s ) ≈ π on ( a | s ) , by supervised learning.
Then ResAct samples n actions from the reconstructed policy,
i
e., { ˜ a ion ∼ ˜ π on ( a | s ) } ni =1 as estimators of a on ; ii) Prediction: For each estimator ˜ a ion , ResAct predicts the residual and applies it to ˜ a ion ,
i
e., ˜ a i = ˜ a ion + ∆( s, ˜ a ion ) .
We need to learn the residual actor to predict ∆( s, ˜ a on ) such that ˜ a is better than ˜ a on in general; iii) Selection:
ResAct selects the best action from the {
˜ a i } ni
=
as the final output, i.e., arg
max ˜ a Q ˆ π ( s, ˜ a ) for ˜ a ∈ { ˜ a i } ni =
In sequential recommendation, state representations may not contain sufficient information about long-term engagement.
To address this, we design two information-theoretical regularizers to improve the expressiveness and conciseness of the extracted state features.
The regularizers are maximizing mutual information between state features and long-term engagement while minimizing the entropy of the state features in order to filter out redundant information.
The overview of ResAct is depicted in Figure 3 and we elaborate the details in the subsequent subsections.
A formal description for ResAct algorithm is shown in Appendix A.
[Figure]
𝒔 𝒉 𝑳 𝑪𝒐𝒏 𝑳 𝑬𝒙𝒑 𝒔 𝒍 𝒂# 𝒐𝒏 𝒂# 𝒐𝒏 ∆ 𝒛 𝒍 𝒛 𝒉
[Figure]
𝒔 𝒂# 𝑸(𝒔,𝒂#)
[Figure]
3. R ECONSTRUCTING O NLINE B EHAVIORS
To reconstruct behaviors of the online-serving policy, we should learn a mapping ˜ π on ( a | s ) from states to action distributions such that ˜ π on ( a | s )
≈ π on ( a | s ) where π on ( a | s ) is the online-serving policy.
A naive approach is to use a model D ( a | s ; θ d ) with parameters θ d to approximate π on ( a | s ) and optimize θ d by minimizing
[Equation]
However, such deterministic action generation only allows for an instance of action and will cause huge deviation if the only estimator is not precise.
To mitigate this, we propose to encode a on into a latent distribution conditioned on s , and decode samples from the latent space to get estimators of a on .
By doing so, we can generate multiple action estimators by sampling from the latent distribution.
The key idea is inspired by conditional variational auto-encoder (CVAE) (Kingma & Welling, 2014).
We define the latent distribution C ( s, a on ) as a multivariate Gaussian whose parameters, i.e., mean and variance, are determined by an encoder E ( ·| s, a on ; θ e ) with parameters θ e .
Then for each latent vector c ∼ C ( s, a on ) , we can use a decoder D ( a | s, c ; θ d ) with parameters θ
d to map it back to an action.
To improve generalization ability, we apply a KL regularizer which controls the deviation between C ( s, a on ) and its prior which is chosen as the multivariate normal distribution N (0 , 1) .
Formally, we can optimize θ e and θ d by minimizing the following loss:
[Equation]
where a on ∼ π on ( a | s ) and c ∼ C ( s, a on ; θ e ) 2 .
When performing behavior reconstruction for an unknown state s , we do not know its a on and therefore cannot build C ( s, a on ; θ e ) .
As a mitigation, we sample n latent vectors from the prior of C ( s, a on ) , i.e., { c i ∼ N (0 , 1) } ni =0 .
Then for each c i , we can generate an estimator of a on by using the decoder ˜ a ion =
D ( a | s, c i ; θ d ) .
3. L EARNING TO P REDICT THE O PTIMAL R ESIDUAL
By learning the CVAE which consists of E ( ·| s, a on ; θ e ) and D ( a | s, c ; θ d ) , we can easily reconstruct the online-serving policy and sample multiple estimators of a on by { ˜ a ion =
D ( a | s, c i ; θ d ) , c i ∼
N (0 , 1) } n i =0 .
For each ˜ a i on , we should predict the residual ∆( s, ˜ a ion ) such that ˜ a
i = ˜
a i on +∆( s, ˜ a ion ) is better than ˜ a ion .
We use a model f (∆ | s, a ; θ f ) with parameters θ f to approximate the residual function ∆( s, a ) .
Particularly, the residual actor f (∆ | s, a ; θ f ) consists of a state encoder and a sub-actor, which are for extracting features from a user state and predicting the residual based on the extracted features, respectively.
Considering the bi-level session-request structure in sequential recommendation, we design a hierarchical state encoder consisting of
a high-level encoder f h
( s h ; θ h ) and a low-level encoder f l ( s l ; θ l ) for extracting features from session-level (highlevel) state s h and request-level (low-level) state s l , respectively.
To conclude, the residual actor f (∆ | s, a ; θ f ) = { f h , f l , f a } works as follows:
[Equation]
Where z h and z l are the extracted high-level and low-level features, respectively; z is the concatenation of z h and z l , and f a ( z, a ; θ a ) parameterized by θ a is the sub-actor.
Here, θ f = { θ h , θ l , θ a } .
Given a state s and a sampled latent vector c ∼ N (0 , 1) , ResAct generates an action with a deterministic policy ˆ π ( a | s, c )
=
D (˜ a on | s, c ; θ d ) + f (∆ | s, ˜ a on ; θ f ) .
We want to optimize the parameters { θ d , θ f } of ˆ π ( a | s, c ) so that the expected cumulative reward J (ˆ π ) is maximized.
Based on the Deterministic Policy Gradient (DPG) theorem (Silver et al., 2014; Lillicrap et al., 2016), we derive the following performance gradients (a detailed derivation can be found in Appendix B):
[Equation]
Here ˆ π ( a | s, c ) =
D (˜ a on | s, c ; θ d ) + f (∆ | s, ˜ a on ; θ f ) , p ( · ) is the probability function of a random variable, Q ˆ π ( s, a ) is the state-action value function for ˆ π .
To learn the state-action value function, referred to as critic , Q ˆ π ( s, a ) in Eq.
(5) and Eq.
(6), we adopt
Clipped Double Q-learning (Fujimoto et al., 2018) with two models Q 1 ( s, a ; θ q 1 ) and Q 2 ( s, a ; θ q 2 ) to approximate it.
For transitions ( s t , a t , r t , s t +1 ) from logged data, we optimize θ q 1 and θ q 2 to minimize the following Temporal Difference (TD) loss:
[Equation]
Where Q ′ 1 , Q ′ 2 , and ˆ π ′ are target models whose parameters are soft-updated to match the corresponding models (Fujimoto et al., 2018).
According to the DPG theorem, we can update the parameters θ f in the direction of ∇ θ f J (ˆ π ) to gain a value improvement in J (ˆ π ) :
[Equation]
For θ d , since it also needs to minimize L Recθ e ,θ d , thus the updating direction is
[Equation]
Based on ˆ π ( a | s, c ) , theoretically, we can obtain the policy
ˆ π ( a | s ) by marginalizing out the latent vector c : ˆ π ( a | s ) =
(cid:82) p ( c )ˆ π ( a | s, c )
d c .
This integral can be approximated as ˆ π ( a | s ) ≈n (cid:80) ni
=
ˆ π ( a | s, c i ) where { c i ∼ N (0 , 1) } ni =0 .
However, given that we already have a critic
Q 1 ( s, a ; θ q 1 ) , we can alternatively use the critic to select the final output:
[Equation]
3. F ACILITATING F EATURE E XTRACTION WITH I NFORMATION - THEORETICAL R EGULARIZERS
Good state representations always ease the learning of models (Nielsen, 2015).
Considering that session-level states s h ∈ S h contain rich information about long-term engagement, we design two information-theoretical regularizers to facilitate the feature extraction.
Generally, we expect the learned features to have Expressiveness and Conciseness .
To learn features with the desired properties, we propose to encode session-level state s h into a stochastic embedding space instead of a deterministic vector.
Specifically, s h is encoded into a multivariate Gaussian distribution
N ( µ h , σ h ) whose parameters µ h and σ h are predicted by the high-level encoder f h ( s h ; θ h ) .
Formally, ( µ h , σ h ) =
f h ( s h ; θ h ) and z h ∼ N ( µ h , σ h )
z h is the representation for session-level state s t .
Next, we introduce how to achieve expressiveness and conciseness in z h .
Expressiveness.
We expect the extracted features to contain as much information as possible about long-term engagement rewards, suggesting an intuitive approach to maximize the mutual information between z h and r ( s, a ) .
However, estimating and maximizing mutual information
I
[Equation]
h (
[Equation]
h
[Equation]
r )
= (cid:82)(cid:82)
[Equation]
z
[Equation]
d r is practically intractable.
Instead, we derive a lower bound for the mutual information objective based on variational inference (Alemi et al., 2017):
[Equation]
where o ( r | z h ; θ o ) is a variational neural estimator of p ( r | z h ) with parameters θ o , H ( r )
= − (cid:82) p ( r ) log p ( r )d r is the entropy of reward distribution.
Since H ( r ) only depends on user responses and stays fixed for the given environment, we can turn to maximize a lower bound of
I θ h
( z h ; r ) which leads to the following expressiveness loss (the derivation is in Appendix C):
[Equation]
where s is state, s h is session-level state, p θ h ( z h | s h )
=
N ( µ h , σ h ) , and H ( ·||· ) denotes the cross entropy between two distributions.
By minimizing L Expθ h ,θ o , we confirm expressiveness of z h .
Conciseness.
If maximizing I θ ( z h ; r ) is the only objective, we could always ensure a maximally informative representation by taking the identity encoding of session-level state ( z h = s h ) (Alemi et al., 2017); however, such an encoding is not useful.
Thus, apart from expressiveness, we want z h to be concise enough to filter out redundant information from s h .
To achieve this goal, we also want to minimize I θ h
( z h ; s h ) =
[Equation]
z h |
[Equation]
h ) log p θh ( z h | s h ) p θh ( z h )
d s h d z h such that z h is the minimal sufficient statistic of s h for inferring r .
Computing the marginal distribution of z h , p θ h ( z h ) , is usually intractable.
So we introduce m ( z h ) as a variational approximation to p θ
h
( z h ) , which is conventionally chosen as the multivariate normal distribution N (0 , 1) .
Since KL ( p θ h ( z h ) || m
( z h )) ≥ 0 , we can easily have the following upper bound:
[Equation]
Minimizing this upper bound leads to the following conciseness loss:
[Equation]
By minimizing L Conθ h , we achieve conciseness in z h .
E XPERIMENT
We conduct experiments on a synthetic dataset MovieLensL-1m and a real-world dataset RecL-25m to demonstrate the effectiveness of ResAct.
We are particularly interested in : Whether ResAct is able to achieve consistent improvements over previous state-of-the-art methods?
If yes, why?
4. E XPERIMENTAL S ETTINGS
[Table]
Datasets.
As there is no public dataset explicitly containing signals about long-term engagement, we synthesize a dataset named
MovieLensL-1m based on MovieLens-1m (a popular benchmark for evaluating recommendation algorithms) and collected a large-scale industrial dataset RecL-25m from a real-life streaming
[Table]
[Table]
platform of short-form videos.
MovieLensL-1m is constructed by assuming that long-term engagement is proportional to the movie ratings (5-star scale) in MovieLens-1m .
RecL-25m is collected by tracking the behaviors of 99,899 users (randomly selected from the platform) for months and recording their long-term engagement indicators, i.e., return time and session length 3 .
The statistics of RecL-25m are provided in Table 1, where 25% and 75% denote the corresponding percentile.
We did not count the average return time because there are users appearing only once whose return time may go to infinity.
The state of a user contains information about gender, age, and historical interactions such as like rate and forward rate.
The item to recommend is determined by comparing the inner product of an action and the embedding of videos (Zhao et al., 2020a).
Rewards are designed to measure the relative influence of an item on long-term engagement (details are in Appendix D).
Evaluation Metric and Baselines.
We adopt Normalised Capped Importance Sampling (NCIS) (Swaminathan & Joachims, 2015), a standard offline evaluation method (Gilotte et al., 2018;
Farajtabar et al., 2018), to assess the performance of different policies.
Given that π β is the behavior policy, π is the policy to assess, we evaluate the value by
[Equation]
Here T is the testing set with usage trajectories, ϕ π ( s ) denotes a multivariate Gaussian distribution of which mean is given by π ( s ) , c is a clipping constant to stabilize the evaluation.
We compare our method with various baselines, including classic reinforcement learning methods (DDPG, TD3), reinforcement learning with offline training (TD3_BC, BCQ, IQL), and imitation learning methods (IL, IL_CVAE).
Detailed introduction about the baselines are in
Appendix E.
Our method emphasises on the learning and execution paradigm, and is therefore orthogonal to those approaches which focus on designing neural network architectures, e.g., GRU4Rec (Hidasi et al., 2016).
4. O VERALL P ERFORMANCE
1K 2K 3K 4K 5K Steps 1.
T e s t R e t u r n
ResAct (ours) IQL
TD3_BCTD
DDPGBCQ
MovieLensL-1m. We first evaluate our method on a benchmark dataset MovieLensL-1m which contains 1,000, anonymous ratings of approximately 3,900 movies made by 6,040 MovieLens users.
We sample the data of 5000 users as the training set, and use the data of the remaining users as the test set (with 50 users as the validation set).
As in Table 2, our method, ResAct, outperforms all the baselines, indicating its effectiveness.
We also provide the learning curve in Figure 4.
It can be found that ResAct learns faster and more stable than the baselines on MovieLensL-1m .
RecL-25m. We test the performance of ResAct on RecL-25m in three modes: i) Return Time mode, where the reward signal r ( δ ) is calculated by Eq. 21; ii) Session Length mode, where the reward signal r ( η ) is calculated by Eq. 22; and iii) Both, where reward signal is generated by a convex combination of r ( δ ) and r ( η ) with weights of 0.7 and 0.3 respectively.
The weights is determined by real-world demands on the operational metrics.
We also perform sensitivity analysis on the reward weights in Appendix G. Among the 99,899 users, we randomly selected 80% of the users as the training set, of which 500 users were reserved for validation.
The remaining 20% users constitute the test set.
As shown in Table 3, our method significantly outperforms the baselines in all the settings.
The classic reinforcement learning algorithms, e.g., DDPG and TD3, perform poorly in the tasks, which indicates that directly predicting an action is difficult.
The decomposition of actions effectively facilitates the learning process.
Another finding is that the offline reinforcement learning algorithms, e.g., IQL, also perform poorly, even though they are specifically designed to learn from logged data.
By comparing with imitation learning, we find that the residual actor has successfully found a policy to improve an action, because behavior reconstruction cannot achieve good performance alone.
To compare the learning process, we provide learning curves for those RLbased algorithms.
Returns are calculated on the validation set with approximately 30,000 sessions.
As in Figure
[Figure]
the performance of ResAct increases faster and is more stable than the other methods, suggesting that it is easier and more efficient to predict the residual than to predict an action directly
[Figure] [Figure]
4. A NALYSES AND A BLATIONS
[Figure]
How does ResAct work?
To understand the working process of ResAct, we plot t-SNE (Van der Maaten & Hinton, 2008) embedding of actions generated in the execution phase of ResAct.
As in Figure 7, the reconstructed actions, denoted by the red dots, are located around the initial action (the red star), suggesting that ResAct successfully samples several online-behavior estimators.
The blue dots are the t-SNE embedding of the improved actions, which are generated by imposing residuals on the reconstructed actions.
The blue star denotes the executed action of
ResAct.
We can find that the blue dots are near the initial actions but cover a wider area then the red dots.
Effect of the CVAE.
We design the CVAE for online-behavior reconstruction because of its ability to generate multiple estimators.
To explore the effect of the CVAE and whether a deterministic action reconstructor can achieve similar performance, we disable the CVAE in ResAct and replace it with a feed-forward neural network.
The feed-forward neural network is trained by using the loss in Equation 2.
Since the feed-forward neural network is deterministic,
[Figure]
ResAct does not need to perform the selection phase as there is only one candidate action.
We provide the learning curves of ResAct with and without the CVAE in Figure 6.
As we can find, there is a significant drop in improvement if we disable the CVAE.
We deduce that this is because a deterministic behavior reconstructor can only generate one estimator, and if the prediction is inaccurate, performance will be severely harmed.
Number of Online-behavior Estimators.
Knowing that generating only one action estimator might hurt performance, we want to further investigate how the number of estimators will affect the performance of ResAct.
We first train a ResAct and then change the number of online-behavior estimators to 5, 10, 15, 20 and 25.
As in Figure 8, consistent improvement in performance can be observed across all the three tasks as we increase the number of estimators.
The fact suggests that generating more action candidates will benefit the performance, in line with our intuition.
We also perform analysis about how the quality of online-behavior estimators could affect the performance in Appendix H. Because the sampling of action estimators is independent, the parallelization of ResAct is not difficult to implement and we can easily speed up the inference.
[Table]
Information-theoretical Regularizers.
To explore the effect of the designed regularizers, we disable
L Expθ h ,θ o , L Conθ h and both of them in
ResAct, respectively.
As shown in
Table 4, the removal of any of the regularizers results in a significant drop in performance, suggesting that the regularizers facilitate the extraction of features and thus ease the learning process.
An interesting finding is that removing both of the regularizers does not necessarily results in worse performance than removing only one.
This suggests that we cannot simply expect either expressiveness or conciseness of features, but rather the combination of both.
R ELATED W ORK
Sequential Recommendation.
Sequential recommendation has been used to model real-world recommendation problems where the browse length is not fixed (Zhao et al., 2020c).
Many existing works focused on encoding user previous records with various neural network architectures.
For example, GRU4Rec (Hidasi et al., 2016) utilizes Gated Recurrent Unit to exploit users’ interaction histories; BERT4Rec (Sun et al., 2019) employs a deep bidirectional self-attention structure to learn sequential patterns.
However, these works focus on optimizing immediate engagement like click-through rates.
FeedRec (Zou et al., 2019) was proposed to improve long-term engagement in sequential recommendation.
However, it is based on strong assumption that recommendation diversity will lead to improvement in user stickiness.
Reinforcement Learning in Recommender Systems.
Reinforcement learning (RL) has attracted much attention from the recommender system research community for its ability to capture potential future rewards (Zheng et al., 2018;
Zhao et al., 2018; Zou et al., 2019;
Zhao et al., 2020b;
Chen et al., 2021;
Cai et al., 2023b;a).
Shani et al.
(2005) first proposed to treat recommendation as a Markov Decision Process (MDP), and designed a model-based RL method for book recommendation.
Dulac-Arnold et al.
(2015) brought RL to MDPs with large discrete action spaces and demonstrated the effectiveness on various recommendation tasks with up to one million actions.
Chen et al.
(2019) scaled a batch RL algorithm, i.e., REINFORCE with off-policy correction to realworld products serving billions of users.
Despite the success, previous works required RL agents to learn in the entire policy space.
Considering the expensive online interactions and huge state-action spaces, learning the optimal policy in the entire MDP is quite difficult.
Our method instead learns a policy near the online-serving policy to achieve local improvement (Kakade & Langford, 2002;
Achiam et al., 2017), which is much easier.
C ONCLUSION
In this work, we propose ResAct to reinforce long-term engagement in sequential recommendation.
ResAct works by first reconstructing behaviors of the online-serving policy, and then improving the reconstructed policy by imposing an action residual.
By doing so, ResAct learns a policy which is close to, but better than, the deployed recommendation model.
To facilitate the feature extraction, two information-theoretical regularizers are designed to make state representations both expressive and concise.
We conduct extensive experiments on a benchmark dataset MovieLensL-1m and a realworld dataset RecL-25m .
Experimental results demonstrate the superiority of ResAct over previous state-of-the-art algorithms in all the tasks.
Ethics Statement.
ResAct is designed to increase long-term user engagement, increasing the time and frequency that people use the product.
Therefore, it will inevitably cause addiction issues.
To mitigate the problem, we may apply some features, e g., the age of users, to control the strength of personalized recommendation.
This may be helpful to avoid addiction to some extent.
Reproducibility Statement.
We describe the implementation details of ResAct in Appendix F, and also provide our source code and data in the supplementary material and external link. A CKNOWLEDGEMENT
This research is supported by the National Research Foundation, Singapore under its Industry Alignment Fund – Pre-positioning (IAF-PP)
Funding Initiative.
Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not reflect the views of National Research Foundation, Singapore
A O VERALL A LGORITHM
We provide the learning process of ResAct in Algorithm 1.
Particularly, the CVAE is trained to reconstruct the online-serving policy, the residual actor is trained for predicting the optimal residual for each reconstructed action, and the critic networks is trained to guide the optimization of the decoder in CVAE and the residual actor.
For the target networks (line 2), { θ d , θ h , θ l , θ a , θ q 1 } is for the target policy, and { θ q 1 , θ q 2 } is for the target critics.
The execution process of ResAct is summarized in Algorithm 2.
Only the decoder of the CVAE, the residual actor and one of the critics are used during execution.
Input: Logged data collected by the online-serving policy D
= { ( s t , a t , r t , s t +1 ) } 1 Initialize the CVAE: { E ( c | s, a ; θ e ) , D ( a | s, c ; θ d ) } , the residual actor: { f h ( z h | s h ; θ h ) , f l ( z l | s l ; θ l ) , f a (∆ | z, a ; θ a ) } , the critic networks { Q 1 ( s, a ; θ q 1 ) , Q 2 ( s, a ; θ q 2 ) } , and the variational estimator o ( r | z h ; θ o ) 2 Set soft-update rate τ and initialize the target networks θ ′ ← θ for θ ∈ { θ d , θ h , θ l , θ a , θ q 1 , θ q 2 } 3 for k = 1 to K do
Sample a batch of transitions ( s t , a t , r t , s t +1 ) from D θ e ← θ e − ∇ θ e L Recθ e ,θ d ( L Recθ e ,θ d is in Eq. 3) θ to Eq.
Update { θ h , θ l , θ a } according to Eq.
θ q j ← θ q j − ∇ θ qj L TDθ qj , j = { 1 , 2 } ( L TDθ qj is in Eq.
θ h ← θ h − ∇ θ h L Expθ h ,θ o − ∇ θ h L Conθ h
θ o ← θ o − ∇ θ o L Expθ h ,θ o
( L Expθ h ,θ o is in Eq.
12, and L Conθ h is in Eq.
Update the target networks: θ ′ ← τθ
+ (
− τ ) θ ′ for θ ∈ { θ d , θ h , θ l , θ a , θ q 1 , θ q 2 } 12 end
Input: State s , number of estimators n // Reconstruction 1 Generate n estimators of a on : { ˜ a ion =
D ( a | s, c i ; θ d ) , c i ∼ N (0 , 1) } ni = //
Prediction 2 for ˜ a on ∈ { ˜ a ion } ni =
do
Predict the residual ∆ = f (∆ | s, ˜ a on ; θ f ) as in Eq.
Apply the residual: ˜ a = ˜ a on + ∆ 5 end //Selection
6 a ∗ =
arg max a Q
( s, a ; θ q
[Equation]
{ ˜ a i } ni =
Output: Action a ∗
B T HE D ERIVATION OF P ERFORMANCE G RADIENTS
We begin by deriving the gradients of J (ˆ π ) with respect to the parameters of the residual actor.
[Equation]
The decoder D ( a | s, c ; θ d ) also affects the policy.
The gradients of J (ˆ π ) with respect to θ d ) is derived similarly:
[Equation]
C D ERIVING THE E XPRESSIVENESS L OSS
We expect the extracted features to contain as much information as possible about long-term engagement rewards, suggesting an intuitive approach to maximize the mutual information between z h and r ( s, a ) .
The mutual information I θ h
( z h ; r ) is defined according to
[Equation]
However, estimating and maximizing mutual information is practically intractable.
Inspired by variational inference (Alemi et al., 2017), we derive a tractable lower bound for the mutual information objective.
Considering that KL ( p ( r | z h ) || q
( r | z h )) ≥ 0 , by the definition of KL-divergence, we have (cid:82)
[Equation]
| z
[Equation]
r | z h )d r where q ( r | z h ) is an arbitrary distribution.
Here, we introduce o ( r | z h ; θ o ) as a variational neural estimator with parameters θ o of p ( r | z h ) .
Then,
[Equation]
(19) where H ( r ) = − (cid:82) p ( r ) log p ( r )d r is the entropy of reward distribution.
Since H ( r ) only depends on user responses and stays fixed for the given environment, we can turn to maximize a lower bound of I θ h
( z h ; r ) which leads to the following expressiveness loss:
[Equation]
r
[Equation]
where s is state, s h is session-level state, p θ h ( z h | s h )
=
N ( µ h , σ h ) , and H ( ·||· ) denotes the cross entropy between two distributions.
By minimizing L Expθ h ,θ o , we confirm expressiveness of z h .
D D ATASETS D. MovieLensL-1m
MovieLensL-1m is synthesized from MovieLens-1m which is representative benchmark dataset for sequential recommendation.
MovieLens-1m provides 1,000,209 anonymous ratings of approximately 3,900 movies made by 6,040 MovieLens users.
Ratings are made on a 5-star scale.
As
MovieLens-1m does not contain any information about long-term user engagement, to generalize it to long-term engagement problem, we make an assumption that a user’s long-term engagement is proportional to the movie ratings.
Specifically, we assume that recommending a movie for which a user rates 2-stars will not affect engagement, a movie with 3-stars, 4-stars and 5-stars will benefit the long-term engagement by 1, 2, and 3, respectively.
Recommending a movie with 1-star is harmful to engagement and will be given a negative reward, -1.
The task in MovieLensL-1m is to maximize cumulative benefits on long-term engagement.
D. D ESIGNING OF R EWARDS IN RecL-25m
The rewards of long-term engagement in RecL-25m are designed based on the statistics of the dataset.
As a general guideline, we expect rewards to reflect the influence of recommending an item on a user.
However, behaviors of users have large variance which makes the influence difficult to measure.
For example, if we simply make rewards proportional to session length, or inversely proportional to return time, the recommender system would focus on improving the experience of high activity users, because by doing so it can obtain larger rewards.
However, in reality, it is equally if not more important to facilitate the conversion of low activity user to high activity user, which requires us to improve the experience of low activity users.
To address this issue, we turn to measuring the relative influence of an item.
Concretely, we calculate the average return time δ uavg and the average session length η uavg for a user u , and use these two statistics to quantify rewards.
For user u , given a time duration δ u between two sessions, the corresponding reward is calculated by
[Equation]
where δ 75% is the 75th percentile of the average return time for all users, which is designed to differentiate active users and inactive users.
Rewards for the session length is calculated similarly as
[Equation]
where η u is the length of a session in the logged data of user u .
Since δ u and δ can only be calculated at session-level, without loss of generality, we provide rewards at the end of each session, where rewards for return time is assigned to the previous session.
E B ASELINES
Our method is compared with various baselines, including classic reinforcement learning methods (DDPG, TD3), offline reinforcement learning algorithms (TD3_BC, BCQ, IQL), and imitation learning methods (IL, IL_CVAE):
• DDPG (Lillicrap et al., 2016):
An reinforcement learning algorithm which concurrently learns a Q-function and a policy.
It uses the Q-function to guide the optimization of the policy.
• TD3 (Fujimoto et al., 2018):
An off-policy reinforcement learning algorithm which applies clipped double-Q learning, delayed policy updates, and target policy smoothing.
• TD3_BC
(Fujimoto & Gu, 2021):
An reinforcement learning designed for offline training.
It adds a behavior cloning (BC) term to the policy update of TD3.
• BCQ (Fujimoto et al., 2019):
An off-policy algorithm which restricts the action space in order to force the agent towards behaving similar to on-policy.
• IQL (Kostrikov et al., 2022):
An offline reinforcement learning method which takes a state conditional upper expectile to estimate the value of the best actions in a state.
• IL :
Imitation learning treats the training set as expert knowledge and learns a mapping between observations and actions under demonstrations of the expert.
• IL_CVAE (Kingma & Welling, 2014): Imitation learning method with the policy controlled by a conditional variational auto-encoder.
F E XPERIMENTAL D ETAILS
Across all methods and experiments
[Table]
for fair comparison
[Table]
each network generally uses the same architecture (3-layers MLP with 256 neurons at each hidden layer) and hyper-parameters.
We provide the hyper-parameters for ResAct in Table 5.
All methods are implemented with PyTorch.
[Table]
G S ENSITIVITY A NALYSIS FOR THE R EWARD W EIGHTS
When setting the reward weights in the Both mode
[Table]
we use some usual empirical values by following the real-world requirements for operational metrics.
The reward occurs only at the end of each session
[Table]
which makes it representative for sequential recommendations.
If we try other designs
[Table]
only the value of the reward will change, not the frequency of learning signal.
To justify that our algorithm is robust to different reward weights
[Table]
we perform sensitivity analysis for the weights (return time: session length) of rewards in the Both mode.
As shown in Table
[Table]
our algorithm consistently outperforms the baselines under different reward weights
[Table]
[Table]
H Q UALITY OF O NLINE - BEHAVIOR E STIMATORS
Despite the selection phase, the quality of the online-behavior estimators, or the action candidates, still significantly affects the performance.
On the one hand, the action candidate directly constitutes the final action.
On the other hand, the sampled action candidates serve as inputs of the residual module and the selection module.
It is certain that sampling an infinite number of action candidates will cover the best action which is sampled by the CVAE.
However, action candidates which are far from online-behavior policy may be incorrectly selected.
The reason is that the residual module and the selection module are unlikely to encounter such out-of-distribution (OOD) actions and therefore cannot make accurate predictions.
The distribution of action candidates should be as close as possible to the distribution of online services to ensure that the output of the residual and selection modules is reliable.
We conduct experiments by uniformly sampling 20 action candidates and adding them to the action candidates reconstructed by the CVAE.
As in Table 7, there is a significant decrease in performance even though we increase the number of action candidates.
[Table]