Skip to content

Commit 1de1542

Browse files
committed
Upload chapter 10 recommender system
1 parent 207511f commit 1de1542

28 files changed

+942
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Chapter Summary
2+
3+
- A recommender system is underpinned by a complex architecture that
4+
incorporates a multitude of system components such as message
5+
queues, feature stores, neural networks, embedding tables, parameter
6+
servers, training servers, and inference servers.
7+
8+
- A recommendation decision typically proceeds through a pipeline that
9+
includes both the retrieval and ranking stages. The ranking stage
10+
can be further dissected into pre-ranking, ranking, and
11+
post-ranking.
12+
13+
- To ensure high-quality recommendations, a recommendation model
14+
requires continual updates. Generally, the more frequent the model
15+
updates, the higher the quality of the recommendations.
16+
17+
- Modern recommender systems are delving into the possibilities of
18+
real-time machine learning. To make this concept practically
19+
feasible, researchers are exploring how to leverage the unique data
20+
characteristics of recommender systems to address several critical
21+
system challenges. This exploration has led to new system designs
22+
that include application-specific synchronization protocols,
23+
application-aware network update scheduling, and online model state
24+
management.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Further Reading
2+
3+
- Recommendation model: Wide & Deep[^1]
4+
5+
- Message queue introduction: What Is a Message Queue?[^2]
6+
7+
- Feature store introduction: What Is the Feature Store in Machine
8+
Learning?[^3]
9+
10+
[^1]: <https://arxiv.org/abs/1606.07792>
11+
12+
[^2]: https://aws.amazon.com/message-queue/
13+
14+
[^3]: https://www.featurestore.org/what-is-a-feature-store
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Recommender System
2+
3+
Recommender systems serve as intelligent agents, offering suggestions
4+
for items most relevant to a specific user. To do so, they scrutinize
5+
data items such as user characteristics, item features, and the
6+
interactions between the two. Over the past few years, powerhouse
7+
companies like Google, Facebook, and Alibaba have harnessed deep
8+
learning technologies to enhance the capabilities of recommender models.
9+
By deploying deep learning methodologies, these systems are endowed with
10+
the capability to effectively learn from data through gradient-based
11+
methods. Moreover, these systems are able to exploit large neural
12+
networks, including transformers and emerging large language models.
13+
This, in turn, bolsters the system's proficiency in dissecting complex,
14+
multi-modal data.
15+
16+
In this chapter, we will delve into the foundational elements of deep
17+
learning recommender systems (DLRSs). We will elucidate key operational
18+
processes within these systems, primarily focusing on the multi-stage
19+
generation of recommendations and the updating of model parameters.
20+
Lastly, we will delve into a real-world recommender system, shedding
21+
light on strategic approaches used to tackle practical challenges.
22+
23+
This chapter has the following learning objectives:
24+
25+
1. Understand the architecture of a recommender system and its
26+
essential components.
27+
28+
2. Understand multi-stage recommendation and model update in a
29+
recommender system.
30+
31+
3. Attain insights into the challenges faced by practical recommender
32+
systems and discover their corresponding solutions.
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Model Update
2+
3+
In a real-world setting, it is crucial for these systems to routinely
4+
update their model parameters. However, maintaining seamless user
5+
experience while concurrently updating ultra-large-scale recommendation
6+
models becomes a daunting task, especially when catering to a large
7+
number of online users. This section primarily addresses why continuous
8+
updates to model parameters are necessary for recommender systems,
9+
before delving into the offline update methodology and a recommender
10+
system capable of online updates.
11+
12+
## Necessity for Model Updates
13+
14+
Recommendation models employed in online services encounter highly
15+
dynamic factors in their datasets:
16+
17+
1. **New users and items**: Both the users targeted by a recommendation
18+
model and the items encompassed within the model are in constant
19+
flux. New users and items can emerge at any given time. As depicted
20+
in Figure [1](#fig:embedding missing){reference-type="ref"
21+
reference="fig:embedding missing"}, the recommender model will be
22+
unable to cater to a new user if the embedding table lacks the
23+
corresponding embedding item. Similarly, if a newly added item is
24+
absent from the model's embedding table, it will not surface in the
25+
recommendation pipeline, rendering it impossible to recommend to the
26+
intended users.
27+
28+
2. **Shifting user interests**: Recommendation models must adapt to
29+
continually shifting user interests. Should a model fail to swiftly
30+
adjust its weights to mirror evolving user interests, the quality of
31+
its recommendations may suffer. As an example, in a news
32+
recommendation application, trending news topics alter daily. If the
33+
model consistently suggests outdated trends, the click-through rate
34+
(CTR) of users will progressively decline.
35+
36+
<figure id="fig:embedding missing">
37+
<p> </p>
38+
<figcaption>Examples of Missing Embedding Items</figcaption>
39+
</figure>
40+
41+
While empirical rule formulation (such as directly incorporating new or
42+
statistically popular items into the recommendation results) can
43+
potentially address the above dynamic factors, it only provides a
44+
temporary and partial solution. Such empirical methods cannot entirely
45+
rectify the problems, mainly due to the substantial performance gap
46+
between learning-based recommendation models and experience-based
47+
recommendation rules.
48+
49+
## Offline Process of Model Update
50+
51+
To keep up with the evolving dynamics of datasets, recommender systems
52+
need to consistently accumulate new training data and harness this
53+
information to refine their models. This process, known as model
54+
updating, is integral to improving the efficacy of these systems.
55+
Typically, the trained model is saved as a checkpoint, which is then put
56+
through an offline validation process. This updated model is only
57+
deployed onto the inference servers if it can effectively enhance the
58+
quality of recommendation. A depiction of this offline model update
59+
process can be seen in Figure
60+
[2](#fig:offline update){reference-type="ref"
61+
reference="fig:offline update"}.
62+
63+
![Offline Process of UpdatingModels](../img/ch_recommender/offline_update.png)
64+
:label:`offline`
65+
66+
To break it down, when a model completes a training period, the
67+
subsequent steps unfold:
68+
69+
1. **Checkpoint step**: The model checkpoint is retrieved from the
70+
parameter server in the training data center and stored on the disk.
71+
72+
2. **Validation step**: This checkpoint undergoes validation against an
73+
offline dataset. If it does not pass this validation, the model
74+
continues its training.
75+
76+
3. **Dissemination step**: If the model checkpoint passes the offline
77+
validation, it is then disseminated to the parameter servers which
78+
host the replicas of this model in different inference data centers.
79+
80+
## Needs for Low-latency Model Updates
81+
82+
Using an offline process of updating models described above can vary in
83+
duration, ranging from several minutes to hours. Nevertheless, some
84+
systems have streamlined the procedures for storing and propagating
85+
checkpoints, which allows updates to occur on a minute-by-minute basis.
86+
Despite this, the existing minute-level latency in model updates still
87+
falls short of the requirements for several key scenarios that involve
88+
recommender systems.
89+
90+
### Incorporating Fresh Content
91+
92+
There are needs in which applications prioritize the delivery of fresh
93+
content. For example, in the context of short video recommendations, a
94+
content creator might generate videos relevant to the latest trending
95+
topics. If these videos are not recommended in a timely manner, the
96+
topics may become obsolete, resulting in a lower-than-anticipated number
97+
of views.
98+
99+
### Servicing Anonymous Users
100+
101+
There are often needs where user features are either unavailable or
102+
scarce. Users are increasingly opting for anonymous usage of
103+
applications and sharing minimal data due to heightened privacy concerns
104+
(e.g., Internet browsers prohibit recommender systems from collecting
105+
user cookies) and stricter data protection regulations (e.g., the
106+
General Data Protection Regulation -- GDPR -- in Europe). As a result,
107+
recommender systems are compelled to learn user interests online within
108+
a very narrow timeframe.
109+
110+
### Adopting Online Machine Learning Techniques
111+
112+
There are needs that call for the application of online machine learning
113+
techniques. Traditional recommender systems often employ offline
114+
training where data gathered over a specified timeframe (e.g., one day)
115+
is used to train a model, which is subsequently deployed online during
116+
off-peak periods (e.g., early morning). However, recent research and
117+
practice suggest that increasing the training frequency can notably
118+
improve the quality of recommendations. The logical endpoint of
119+
increasing training frequency is online training, where data is
120+
processed in a streaming fashion and fed to the model. The model then
121+
continually fine-tunes its parameters based on these online samples.
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Overview
2+
3+
The central component of a recommender system is the recommendation
4+
model, which generates prospective items of interest for users based on
5+
given input data. For a large-scale recommender system to function
6+
seamlessly and deliver high-quality results, it needs additional
7+
supporting modules built around this central model.
8+
9+
Figure [1](#fig:recommender systems){reference-type="ref"
10+
reference="fig:recommender systems"} illustrates the essential modules
11+
of a typical recommender system. A messaging queue accepts logs uploaded
12+
from the client-side of the recommendation service. These logs capture
13+
user feedback on previously recommended items, such as a record of
14+
whether users clicked on the suggested items. A separate data processing
15+
module handles the raw data from these logs, generating new training
16+
samples that are subsequently added to another message queue.
17+
18+
Training servers extract these training samples from the message queue
19+
and use them to update model parameters. A typical recommendation model
20+
comprises two components: embedding tables and neural networks. During
21+
the training phase, each training server retrieves the model parameters
22+
from parameter servers, calculates gradients, and then uploads these
23+
gradients back to parameter servers. Parameter servers integrate the
24+
results from each training server and update the parameters accordingly.
25+
26+
Inference servers handle user requests, procure the necessary model
27+
parameters from parameter servers based on these requests, and calculate
28+
the recommendation outcomes.
29+
30+
![Architecture of a recommendersystem](../img/ch_recommender/recommender_system.png)
31+
:label:`recommender`

0 commit comments

Comments
 (0)