<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>mendation System With Collisionless Embedding Table</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Zhuoran Liu</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Leqi Zou</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Xuan Zou</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Caihua Wang</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Biao Zhang</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Da Tang</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Bolin Zhu</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Yijie Zhu</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Peng Wu</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ke Wang</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Youlong Cheng</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Bytedance Inc.</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Workshop Proce dings</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>Building a scalable and real-time recommendation system is vital for many businesses driven by time-sensitive customer feedback, such as short-videos ranking or online ads. Despite the ubiquitous adoption of production-scale deep learning frameworks like TensorFlow or PyTorch, these general-purpose frameworks fall short of business demands in recommendation scenarios for various reasons: on one hand, tweaking systems based on static parameters and dense computations for recommendation with dynamic and sparse features is detrimental to model quality; on the other hand, such frameworks are designed with batch-training stage and serving stage completely separated, preventing the model from interacting with customer feedback in real-time. These issues led us to reexamine traditional approaches and explore radically diferent design choices. In this paper, we present Monolith1, a system tailored for online training. Our design has been driven by observations of our application workloads and production environment that reflects a marked departure from other recommendations systems. Our contributions are manifold: first, we crafted a collisionless embedding table with optimizations such as expirable embeddings and frequency filtering to reduce its memory footprint; second, we provide an production-ready online training architecture with high fault-tolerance; finally, we proved that system reliability could be traded-of for real-time learning. Monolith has successfully landed in the BytePlus Recommend2 product.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>The past decade witnessed a boom of businesses powered
by recommendation techniques. In pursuit of a better
customer experience, delivering personalized content for
each individual user as real-time response is a common
goal of these business applications. To this end,
information from a user’s latest interaction is often used as
the primary input for training a model, as it would best
depict a user’s portrait and make predictions of user’s
interest and future behaviors.</p>
      <p>Deep learning have been dominating
recommendation models [1, 2, 3, 4, 5, 6] as the gigantic amount of
user data is a natural fit for massively data-driven neural
models. However, eforts to leverage the power of deep
learning in industry-level recommendation systems are
constantly encountered with problems arising from the
unique characteristics of data derived from real-world
user behavior. These data are drastically diferent from
those used in conventional deep learning problems like
language modeling or computer vision in two aspects:
1. The features are mostly sparse, categorical and</p>
      <p>dynamically changing;
†
Work done during internship at Bytedance Inc.
growing of IDs. This relies on an over-idealistic
assumption that IDs in the embedding table is distributed evenly
quality. Unfortunately this is rarely true for a real-world
© 2022 Copyright for this paper by its authors. Use permitted under Creative Commons License in frequency, and collisions are harmless to the model
Historical batch data
aMnoddbealcfokrwwaarrddpass
Online streaming</p>
      <p>data
aMnoddbealcfokrwwaarrddpass</p>
      <p>Data of
features and
user reactions</p>
      <p>Feature IDs</p>
      <p>Embedding table
lookup</p>
      <p>Feature embeddings
Feature IDs and gradients</p>
      <p>Apply gradient
updates
Feature IDs</p>
      <p>Embedding table
lookup</p>
      <p>Feature embeddings
Feature IDs and gradients</p>
      <p>Apply
gradient
updates
recommendation system, where a small group of users
or items have significantly more occurrences. With the
organic growth of embedding table size, chances of hash
key collision increases and lead to deterioration of model
quality [10].</p>
      <p>Therefore it is a natural demand for production-scale
recommendation systems to have the capacity to capture
as many features in its parameters, and also have the
capability of elastically adjusting the number of users
and items it tries to book-keep.</p>
      <sec id="sec-1-1">
        <title>1.2. Non-stationary Distribution</title>
        <p>Visual and linguistic patterns barely develop in a time
scale of centuries, while the same user interested in one
topic could shift their zeal every next minute. As a result,
the underlying distribution of user data is non-stationary,
a phenomenon commonly referred to as Concept Drift
[7].</p>
        <p>Intuitively, information from a more recent history
can more efectively contribute to predicting the change
in a user’s behavior. To mitigate the efect of Concept
Drift, serving models need to be updated from new user
feedback as close to real-time as possible to reflect the
latest interest of a user.
Batch
Training
Stage
Online
Training
Stage
Parameter</p>
        <p>Sync
Embedding
table lookup
Sync
interval
Parameter</p>
        <p>Sync</p>
        <p>Feature IDs
Feature
embeddings</p>
        <p>Model
forward
pass</p>
        <p>User Request
Ranking Result</p>
        <p>User Actions
that arises from our production, we designed Monolith,
a large-scale recommendation system to address these
pain-points. We did extensive experiments to verify and
iterate our design in the production environment.
Monolith is able to
1. Provide full expressive power for sparse features
by designing a collisionless hash table and a
dynamic feature eviction mechanism;
2. Loop serving feedback back to training in
realtime with online training.</p>
        <p>Empowered by these architectural capacities, Monolith
consistently outperforms systems that adopts hash-tricks
with collisions with roughly similar memory usage, and
achieves state-of-the-art online serving AUC without
overly burdening our servers’ computation power.</p>
        <p>The rest of the paper is organized as follows. We first
elaborate design details of how Monolith tackles
existing challenge with collisionless hash table and realtime
training in Section 2. Experiments and results will be
presented in Section 3, along with production-tested
conclusions and some discussion of trade-ofs between
timesensitivity, reliability and model quality. Section 4
summarizes related work and compares them with Monolith.
Section 5 concludes this work.</p>
      </sec>
      <sec id="sec-1-2">
        <title>2.1. Hash Table</title>
        <p>1. IDs that appears only a handful of times have
limited contribution to improving model quality.
An important observation is that IDs are long-tail
distributed, where popular IDs may occur
millions of times while the unpopular ones appear
no more than ten times. Embeddings
corresponding to these infrequent IDs are underfit due to
lack of training data and the model will not be
able to make a good estimation based on them.
At the end of the day these IDs are not likely to
afect the result, so model quality will not sufer
from removal of these IDs with low occurrences;
2. Stale IDs from a distant history seldom contribute
to the current model as many of them are never
visited. This could possibly due to a user that
is no longer active, or a short-video that is
outof-date. Storing embeddings for these IDs could
not help model in any way but to drain our PS
memory in vain.</p>
        <p>Based on these observation, we designed several
feature ID filtering heuristics for a more memory-eficient
implementation of HashTable:
1. IDs are filtered before they are admitted into
embedding tables. We have two filtering methods:
First we filter by their occurrences before they
A
B A
h0(A)</p>
        <p>D C</p>
        <p>G
h1(D)
h1(B)</p>
        <p>h0(C)
D</p>
        <p>E</p>
        <p>F</p>
        <p>C B</p>
        <p>T0
T1
Generate</p>
        <p>Features
Model Server
Online
Training
Training Worker
Batch Training Data</p>
        <p>HDFS
Batch Training
are inserted as keys, where the threshold of
occurrences is a tunable hyperparameter that varies for
each model; In addition we utilize a probabilistic
iflter which helps further reduce memory usage;
2. IDs are timed and set to expire after being inactive
for a predefined period of time. The expire time is
also tunable for each embedding table to allow for
distinguishing features with diferent sensitivity
to historical information.
enters the online training stage. Instead of
reading mini-batch examples from the storage, a
training worker consumes realtime data on-the-fly and
updates the training PS. The training PS
periodically synchronizes its parameters to the serving
PS, which will take efect on the user side
immediately. This enables our model to interactively
adapt itself according to a user’s feedback in
realtime.</p>
      </sec>
      <sec id="sec-1-3">
        <title>2.2. Online Training</title>
        <p>In Monolith, training is divided into two stages (Figure
1):</p>
        <p>In our implementation, HashTable is implemented as
a TensorFlow resource operation. Similar to Variable, 2.2.1. Streaming Engine
look-ups and updates are also implemented as native
TensorFlow operations for easier integration and better
compatibility.</p>
        <p>Monolith is built with the capability of seamlessly
switching between batch training and online training. This is
enabled by our design of streaming engine as illustrated
by Figure 4.</p>
        <p>In our design, we use one Kafka [ 12] queue to log
actions of users (E.g. Click on an item or like an item etc.)
and another Kafka queue for features. At the core of the
engine is a Flink [13] streaming job for online feature
1. Batch training stage. This stage works as an or- Joiner. The online joiner concatenates features with
ladinary TensorFlow training loop: In each train- bels from user actions and produces training examples,
ing step, a training worker reads one mini-batch which are then written to a Kafka queue. The queue for
of training examples from the storage, requests training examples is consumed by both online training
parameters from PS, computes a forward and a and batch training:
backward pass, and finally push updated
parameters to the training PS. Slightly diferent from • For online training, the training worker directly
other common deep learning tasks, we only train reads data from the Kafka queue;
our dataset for one pass. Batch training is useful • For batch training, a data dumping job will first
for training historical data when we modify our dump data to HDFS [14]; After data in HDFS
acmodel architecture and retrain the model; cumulated to certain amount, training worker
2. Online training stage. After a model is deployed will retrieve data from HDFS and perform batch
to online serving, the training does not stop but training.</p>
        <p>Log Kafka
(User Actions)
In-memory</p>
        <p>Cache
On-disk
KV-Store</p>
        <p>Found in Cache
Read from KV-Store</p>
        <p>Join</p>
        <p>Negative
Sampling</p>
        <p>Training Example</p>
        <p>Kafka</p>
        <p>Updated parameters in training PS will be pushed to
serving PS according to the parameter synchronization
schedule.</p>
        <sec id="sec-1-3-1">
          <title>2.2.2. Online Joiner</title>
          <p>In real-world applications, user actions log and features
are streamed into the online joiner (Figure 5) without
guarantee in time order. Therefore we use a unique key
for each request so that user action and features could
correctly pair up.</p>
          <p>The lag of user action could also be a problem. For
example, a user may take a few days before they decide
to buy an item they were presented days ago. This is a
challenge for the joiner because if all features are kept in
cache, it would simply not fit in memory. In our system,
an on-disk key-value storage is utilized to store features
that are waiting for over certain time period. When a
user action log arrives, it first looks up the in-memory
cache, and then looks up the key-value storage in case of
a missing cache.</p>
          <p>Another problem that arise in real-world application
is that the distribution of negative and positive examples
are highly uneven, where number of the former could be
magnitudes of order higher than the latter. To prevent
positive examples from being overwhelmed by negative
ones, a common strategy is to do negative sampling. This
would certainly change the underlying distribution of the
trained model, tweaking it towards higher probability of
making positive predictions. As a remedy, we apply log
odds correction [15] during serving, making sure that
the online model is an unbiased estimator of the original
distribution.</p>
        </sec>
        <sec id="sec-1-3-2">
          <title>2.2.3. Parameter Synchronization</title>
          <p>During online training, the Monolith training cluster
keeps receiving data from the online serving module and
updates parameters on the training PS. A crucial step to
enable the online serving PS to benefit from these newly
trained parameters is the synchronization of updated
model parameters. In production environment, we are
encountered by several challenges:
• Models on the online serving PS must not stop
serving when updating. Our models in
production is usually several terabytes in size, and as a
result replacing all parameters takes a while. It
would be intolerable to stop an online PS from
serving the model during the replacement
process, and updates must be made on-the-fly;
• Transferring a multi-terabyte model of its entirety
from training PS to the online serving PS would
pose huge pressure to both the network
bandwidth and memory on PS, since it requires
doubled model size of memory to accept the newly
arriving model.</p>
          <p>For the online training to scale up to the size of our
business scenario, we designed an incremental
on-thelfy periodic parameter synchronization mechanism in
Monolith based on several noticeable characteristic of
our models:
1. Sparse parameters are dominating the size of
rec</p>
          <p>ommendation models;
2. Given a short range of time window, only a small
subset of IDs gets trained and their embeddings
updated;
3. Dense variables move much slower than sparse
embeddings. This is because in momentum-based
optimizers, the accumulation of momentum for
dense variables is magnified by the gigantic size of
recommendation training data, while only a few
sparse embeddings receives updates in a single
data batch.</p>
          <p>FM
. . .</p>
          <p>Output
Embeddings</p>
          <p>IDs
. . .</p>
          <p>MLP
(1) and (2) allows us to exploit the sparse updates across
all feature IDs. In Monolith, we maintain a hash set of
touched keys, representing IDs whose embeddings get Figure 6: DeepFM model architecture.
trained since the last parameter synchronization. We
push the subset of sparse parameters whose keys are in
the touched-keys set with a minute-level time interval from diferent aspects. We aim to answer the following
from the training PS to the online serving PS. This rel- questions by our experiments:
atively small pack of incremental parameter update is
lightweight for network transmission and will not cause
a sharp memory spike during the synchronization.</p>
          <p>We also exploit (3) to further reduce network I/O and
memory usage by setting a more aggressive sync
schedule for sparse parameters, while updating dense
parameters less frequently. This could render us a situation
where the dense parameters we serve is a relatively stale
version compared to sparse part. However, such incon- In this section, we first present our experimental
setsistency could be tolerated due to the reason mentioned tings and then discuss results and our findings in detail.
in (3) as no conspicuous loss has been observed.
1. How much can we benefit from a collisionless</p>
          <p>HashTable?
2. How important is realtime online training?
3. Is Monolith’s design of parameter
synchronization robust enough in a large-scale production
scenario?</p>
        </sec>
      </sec>
      <sec id="sec-1-4">
        <title>2.3. Fault Tolerance</title>
        <p>As a system in production, Monolith is designed with the
ability to recover a PS in case it fails. A common choice
for fault tolerance is to snapshot the state of a model
periodically, and recover from the latest snapshot when
PS failure is detected. The choice of snapshot frequency
has two major impacts:
1. Model quality. Intuitively, model quality sufers
less from loss of recent history with increased
snapshot frequency.
2. Computation overhead. Snapshotting a
multiterabyte model is not free. It incurs large chunks
of memory copy and disk I/O.</p>
        <p>As a trade-of between model quality and computation
overhead, Monolith snapshots all training PS every day.
Though a PS will lose one day’s worth of update in case of
a failure, we discover that the performance degradation
is tolerable through our experiments. We will analyze
the efect of PS reliability in the next section.</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>3. Evaluation</title>
      <p>For a better understanding of benefits and trade-ofs
brought about by our proposed design, we conducted
several experiments at production scale and A/B test
with live serving trafic to evaluate and verify Monolith</p>
      <sec id="sec-2-1">
        <title>3.1. Experimental Setup</title>
        <sec id="sec-2-1-1">
          <title>3.1.1. Embedding Table</title>
          <p>As described in Section 2.1, embedding tables in Monolith
are implemented as collisionless HashTables. To prove
the necessity of avoiding collisions in embedding tables
and to quantify gains from our collisionless
implementation, we performed two groups of experiments on the
Movielens dataset and on our internal production dataset
respectively:
1. MovieLens ml-25m dataset [16]. This is a
standard public dataset for movie ratings, containing
25 million ratings that involves approximately
162000 users and 62000 movies.</p>
          <p>
            • Preprocessing of labels. The original labels
are ratings from 0.5 to 5.0, while in
production our tasks are mostly receiving binary
signals from users. To better simulate our
production models, we convert scale labels
to binary labels by treating scores ≥ 3.5 as
positive samples and the rest as negative
samples.
• Model and metrics. We implemented a
standard DeepFM [
            <xref ref-type="bibr" rid="ref1">17</xref>
            ] model, a commonly
used model architecture for
recommendation problems. It consist of an FM
component and a dense component (Figure 6).
          </p>
          <p>
            Predictions are evaluated by AUC [
            <xref ref-type="bibr" rid="ref2">18</xref>
            ] as
this is the major measurement for real mod- 3.1.2. Online Training
els.
• Embedding collisions. This dataset
contains approximately 160K user IDs and
60K movie IDs. To compare with the
collisionless version of embedding table
implementation, we performed another group
of experiment where IDs are preprocessed
with MD5 hashing and then mapped to a
smaller ID space. As a result, some IDs will
share their embedding with others. Table 1
shows detailed statistics of user and movie
IDs before and after hashing.
          </p>
        </sec>
        <sec id="sec-2-1-2">
          <title>User IDs</title>
        </sec>
        <sec id="sec-2-1-3">
          <title>Movie IDs</title>
          <p># Before Hashing
# After Hashing
Collision rate
2. Internal Recommendation dataset.</p>
          <p>We also performed experiments on a
recommendation model in production environment. This
model generally follows a multi-tower
architecture, with each tower responsible for learning to
predict a specialized kind of user behavior.</p>
          <p>During online training, we update our online serving
PS with the latest set of parameters with minute-level
intervals. We designed two groups of experiments to
verify model quality and system robustness.</p>
          <p>1. Update frequency. To investigate the necessity
of minute-level update frequency, we conducted
experiments that synchronize parameters from
training model to prediction model with diferent
intervals.</p>
          <p>
            The dataset we use is the Criteo Display Ads
Challenge dataset1, a large-scale standard dataset for
benchmarking CTR models. It contains 7 days of
chronologically ordered data recording features
and click actions. For this experiment, we use a
standard DeepFM [
            <xref ref-type="bibr" rid="ref1">17</xref>
            ] model as described in 6.
          </p>
          <p>To simulate online training, we did the following
preprocessing for the dataset. We take 7 days of
data from the dataset, and split it to two parts:
5 days of data for batch training, and 2 days for
online training. We further split the 2 days of data
into  shards chronologically. Online training is
simulated by algorithm 1.</p>
          <p>As such, we simulate synchronizing trained
parameters to online serving PS with an interval
determined by number of data shards. We
experimented with  = 10, 50, 100 , which roughly
correspond to update interval of 5ℎ , 1ℎ , and 30 .
2. Live experiment. In addition, we also
performed a live experiment with real serving trafic
to further demonstrate the importance of online
training in real-world application. This A/B
experiment compares online training to batch
training one one of our Ads model in production.</p>
          <p>Results from MovieLens dataset and the Internal
recommedation dataset both show that embedding
collisions will jeopardize model quality.</p>
          <p>1. Models with collisionless HashTable consistently
outperforms those with collision. This conclusion
holds true regardless of
• Increase of number of training epochs.</p>
          <p>As shown in Figure 7, the model with
collisionless embedding table has higher
AUC from the first epoch and converges
at higher value;
1https://www.kaggle.com/competitions/criteo-display-ad-challenge
/data
• Each model has around 1000 embedding
tables, and distribution of size of embedding
tables are very uneven;
• The original ID space of embedding table
was 248. In our baseline, we applied a
hashing trick by decomposing to curb the size
of embedding table. To be more specific,
we use two smaller embedding tables
in3.2. Results and Analysis
stead of a gigantic one to generate a unique
embedding for each ID by vector combina- 3.2.1. The Efect of Embedding Collision
tion:
   =</p>
          <p>% 224
   =   ÷ 2</p>
          <p>24
 =   +   ,
where   ,   are embeddings
corresponding to    ,    . This efectively reduces
embedding table sizes from 248 to 225;
• This model is serving in real production,
and the performance of this experiment is
measured by online AUC with real serving
trafic.</p>
          <p>Algorithm 1 Simulated Online Training.</p>
          <p>1: Input:  ℎ
2: Input:  =1⋯ ;</p>
          <p>;
3:</p>
          <p>←  (
4: for  = 1 ⋯  do
/* Online training.</p>
          <p>5:
6:
7:
time due to Concept Drift. As shown in
2. Data sparsity caused by collisionless embedding</p>
        </sec>
        <sec id="sec-2-1-4">
          <title>3.2.2. Online Training: Trading-of Reliability For</title>
          <p>We discovered that a higher parameter synchronization
frequency is always conducive to improving online
serving AUC, and that online serving models are more
tolerant with loss of a few shard of PS than we expect.
1. The Efect of Parameter Synchronization
Frequency.</p>
          <p>In our online streaming training experiment (1)
with Criteo Display Ads Challenge dataset, model
quality consistently improves with the increase
of parameter synchronization frequency, as is
evident by comparison from two perspectives:
• Models with online training performs
better than models without. Figure 9a, 9b, 9c
compares AUC of online training models
evaluated by the following shard of data
versus batch training models evaluated by
each shard of data;
• Models with smaller parameter
synchronization interval performs better that those
with larger interval. Figure 10 and Table 2
compares online serving AUC for models
with sync interval of 5ℎ , 1ℎ , and 30
respectively.</p>
          <p>The live A/B experiment between online training
and batch training on an Ads model in
production also show that there is a significant bump in
online serving AUC (Table 3).</p>
          <p>Inspired by this observation, we synchronize
sparse parameters to serving PS of our
production models as frequent as possible (currently
at minute-level), to the extent that the
computation overhead and system reliability could
endure. Recall that dense variables requires a less
frequent update as discussed in 2.2.3, we update
them at day-level. By doing so, we can bring
down our computation overhead to a very low
level. Suppose 100,000 IDs gets updated in a
minute, and the dimension of embedding is 1024,
the total size of data need to be transferred is
4  × 100, 000 ≈ 400  per minute. For dense
parameters, since they are synchronized daily, we
choose to schedule the synchronization when the
trafic is lowest (e.g. midnight).
2. The Efect of PS reliability.</p>
          <p>With a minute-level parameter synchronization,
AUC Improvement %
14.443
16.871
17.068
14.028
18.081
16.404
15.202
(b) For dense variables, since they are updated
slowly as we discussed in 2.2.3, losing 1 day’s
update out of 1000 PS is negligible.</p>
          <p>Based on the above observation and calculation,
we radically lowered our snapshot frequency and
thereby saved quite a bit in computation
overhead.</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>4. Related Work</title>
      <p>Ever since some earliest successful application of deep
learning to industry-level recommendation systems [1, 2],
0 10 20 30 40 50 researchers and engineers have been employing various
Hours techniques to ameliorate issues mentioned in Section 1.</p>
      <p>To tackle the issue of sparse feature representation,
[1, 10] uses fixed-size embedding table with hash-trick.</p>
      <p>
        There are also attempts in improving hashing to reduce
collision [
        <xref ref-type="bibr" rid="ref3">19, 10</xref>
        ]. Other works directly utilize native
key-value hash table to allow dynamic growth of table
we initially expect a more frequent snapshot of size [
        <xref ref-type="bibr" rid="ref4">3, 5, 20, 4</xref>
        ]. These implementations builds upon
training PS to match the realtime update. To our TensorFlow but relies either on specially designed
softsurprise, we enlarged the snapshot interval to 1 ware mechanism [
        <xref ref-type="bibr" rid="ref4 ref5">3, 21, 20</xref>
        ] or hardware [4] to access
day and still observed nearly no loss of model and manage their hash-tables. Compared to these
soluquality. tions, Monolith’s hash-table is yet another native
TensorFinding the right trade-of between model quality Flow operation. It is developer friendly and has higher
and computation overhead is dificult for person- cross-platform interoperability, which is suitable for ToB
alized ranking systems since users are extremely scenarios. An organic and tight integration with
Tensorsensitive on recommendation quality. Tradition- Flow also enables easier optimizations of computation
ally, large-scale systems tend to set a frequent performance.
snapshot schedule for their models, which sacri- Bridging the gap between training and serving and
ifces computation resources in exchange for min- alleviation of Concept Drift [ 7] is another topic of
interimized loss in model quality. We also did quite est. To support online update and avoid memory issues,
some exploration in this regard and to our sur- both [5] and [3] designed feature eviction mechanisms to
prise, model quality is more robust than expected. lfexibly adjust the size of embedding tables. Both [ 5] and
With a 0.01% failure rate of PS machine per day, [
        <xref ref-type="bibr" rid="ref5">21</xref>
        ] support some form of online training, where learned
we find a model from the previous day works parameters are synced to serving with a relatively short
embarrassingly well. This is explicable by the interval compared to traditional batch training, with fault
following calculation: Suppose a model’s parame- tolerance mechanisms. Monolith took similar approach
ters are sharded across 1000 PS, and they snapshot to elastically admit and evict features, while it has a more
every day. Given 0.01% failure rate, one of them lightweight parameter synchronization mechanism to
will go down every 10 days and we lose all up- guarantee model quality.
dates on this PS for 1 day. Assuming a DAU of
15 Million and an even distribution of user IDs
on each PS, we lose 1 day’s feedback from 15000 5. Conclusion
users every 10 days. This is acceptable because (a)
For sparse features which is user-specific, this is In this work, we reviewed several most important
chalequivalent to losing a tiny fraction of 0.01% DAU; lenges for industrial-level recommendation systems and
      </p>
    </sec>
    <sec id="sec-4">
      <title>Acknowledgements</title>
      <p>Hanzhi Zhou provided useful suggestions on revision of
this paper.
present our system in production, Monolith, to address
them and achieved best performance compared to
existing solutions.</p>
      <p>We proved that a collisionless embedding table is
essential for model quality, and demonstrated that our
implementation of Cuckoo HashMap based embedding table is
both memory eficient and helpful for improving online
serving metrics.</p>
      <p>We also proved that realtime serving is crucial in
recommendation systems, and that parameter
synchronization interval should be as short as possible for an ultimate
model performance. Our solution for online realtime
serving in Monolith has a delicately designed parameter
synchronization and a fault tolerance mechanism: In our
parameter synchronization algorithm, we showed that
consistency of version across diferent parts of
parameters could be traded-of for reducing network bandwidth
consumption; In fault tolerance design, we demonstrated
that our strategy of trading-of PS reliability for
realtimeness is a robust solution.</p>
      <p>To conclude, Monolith succeeded in providing a
general solution for production scale recommendation
systems.
[5] B. Jiang, C. Deng, H. Yi, Z. Hu, G. Zhou, Y. Zheng,</p>
      <p>S. Huang, X. Guo, D. Wang, Y. Song, L. Zhao,
Z. Wang, P. Sun, Y. Zhang, D. Zhang, J. Li, J. Xu,
X. Zhu, K. Gai, Xdl: an industrial deep learning
framework for high-dimensional sparse data,
Proceedings of the 1st International Workshop on Deep
Learning Practice for High-Dimensional Sparse</p>
      <p>Data (2019).
[6] H.-T. Cheng, L. Koc, J. Harmsen, T. Shaked, T.
Chandra, H. B. Aradhye, G. Anderson, G. S. Corrado,
W. Chai, M. Ispir, R. Anil, Z. Haque, L. Hong, V. Jain,
X. Liu, H. Shah, Wide &amp; deep learning for
recommender systems, Proceedings of the 1st
Workshop on Deep Learning for Recommender Systems
(2016).
[7] J. Gama, I. Žliobaitė, A. Bifet, M. Pechenizkiy,</p>
      <p>A. Bouchachia, A survey on concept drift
adaptation, ACM Computing Surveys (CSUR) 46 (2014)
1 – 37.
[8] M. Abadi, P. Barham, J. Chen, Z. Chen, A. Davis,</p>
      <p>J. Dean, M. Devin, S. Ghemawat, G. Irving, M.
Isard, M. Kudlur, J. Levenberg, R. Monga, S. Moore,
D. G. Murray, B. Steiner, P. A. Tucker, V. Vasudevan,
P. Warden, M. Wicke, Y. Yu, X. Zhang, Tensorflow:
A system for large-scale machine learning, ArXiv
abs/1605.08695 (2016).
[9] A. Paszke, S. Gross, F. Massa, A. Lerer, J.
Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein,
L. Antiga, A. Desmaison, A. Köpf, E. Yang, Z.
DeVito, M. Raison, A. Tejani, S. Chilamkurthy,
B. Steiner, L. Fang, J. Bai, S. Chintala, Pytorch: An
imperative style, high-performance deep learning
[1] P. Covington, J. K. Adams, E. Sargin, Deep neural library, in: NeurIPS, 2019.</p>
      <p>networks for youtube recommendations, Proceed- [10] T. Bredillet, Core modeling at instagram, 2019. URL:
ings of the 10th ACM Conference on Recommender https://instagram-engineering.com/core-modelin
Systems (2016). g-at-instagram-a51e0158aa48.
[2] U. Gupta, X. Wang, M. Naumov, C.-J. Wu, B. Reagen, [11] R. Pagh, F. F. Rodler, Cuckoo hashing, in: ESA,
D. M. Brooks, B. Cottel, K. M. Hazelwood, B. Jia, 2001.</p>
      <p>H.-H. S. Lee, A. Malevich, D. Mudigere, M. Smelyan- [12] J. Kreps, Kafka : a distributed messaging system for
skiy, L. Xiong, X. Zhang, The architectural implica- log processing, 2011.
tions of facebook’s dnn-based personalized recom- [13] P. Carbone, A. Katsifodimos, S. Ewen, V. Markl,
mendation, 2020 IEEE International Symposium on S. Haridi, K. Tzoumas, Apache flink™: Stream and
High Performance Computer Architecture (HPCA) batch processing in a single engine, IEEE Data Eng.
(2020) 488–501. Bull. 38 (2015) 28–38.
[3] M. Xie, K. Ren, Y. Lu, G. Yang, Q. Xu, B. Wu, J. Lin, [14] K. V. Shvachko, H. Kuang, S. R. Radia, R. J. Chansler,
H. Ao, W. Xu, J. Shu, Kraken: Memory-eficient The hadoop distributed file system, 2010 IEEE 26th
continual learning for large-scale real-time recom- Symposium on Mass Storage Systems and
Techmendations, SC20: International Conference for nologies (MSST) (2010) 1–10.</p>
      <p>High Performance Computing, Networking, Stor- [15] H. Wang, A. Zhang, C. Wang, Nonuniform
negage and Analysis (2020) 1–17. ative sampling and log odds correction with rare
[4] W. Zhao, J. Zhang, D. Xie, Y. Qian, R. Jia, P. Li, Ai- events data, in: Advances in Neural Information
box: Ctr prediction model training on a single node, Processing Systems, 2021.</p>
      <p>Proceedings of the 28th ACM International Confer- [16] F. M. Harper, J. A. Konstan, The movielens datasets:
ence on Information and Knowledge Management History and context, ACM Trans. Interact. Intell.
(2019). Syst. 5 (2015) 19:1–19:19.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>H.</given-names>
            <surname>Guo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Tang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Ye</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>He</surname>
          </string-name>
          ,
          <article-title>Deepfm: A factorization-machine based neural network for ctr prediction</article-title>
          ,
          <source>in: IJCAI</source>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>A. P.</given-names>
            <surname>Bradley</surname>
          </string-name>
          ,
          <article-title>The use of the area under the roc curve in the evaluation of machine learning algorithms</article-title>
          ,
          <source>Pattern Recognit</source>
          .
          <volume>30</volume>
          (
          <year>1997</year>
          )
          <fpage>1145</fpage>
          -
          <lpage>1159</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>A.</given-names>
            <surname>Egg</surname>
          </string-name>
          ,
          <article-title>Online learning for recommendations at grubhub</article-title>
          ,
          <source>Fifteenth ACM Conference on Recommender Systems</source>
          (
          <year>2021</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [20]
          <string-name>
            <surname>Meituan</surname>
          </string-name>
          ,
          <article-title>Distributed training optimization for tensorflow in recommender systems</article-title>
          (in chinese),
          <year>2021</year>
          . URL: https://tech.meituan.com/
          <year>2021</year>
          /12/09/
          <article-title>meitua n-tensorflow-in-recommender-systems</article-title>
          .html.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>X.</given-names>
            <surname>Lian</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Yuan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Zhu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>He</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Wu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Sun</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Lyu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Liu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.</given-names>
            <surname>Dong</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Liao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Luo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Zhang</surname>
          </string-name>
          , J. Xie,
          <string-name>
            <given-names>H.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Chen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Huang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Lin</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Shu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>X.-B.</given-names>
            <surname>Qiu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Liu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Kong</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Yuan</surname>
          </string-name>
          , H. bo
          <string-name>
            <surname>Yu</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          <string-name>
            <surname>Yang</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Zhang</surname>
            , J. Liu,
            <given-names>Persia:</given-names>
          </string-name>
          <article-title>An open, hybrid system scaling deep learning-based recommenders up to 100 trillion parameters</article-title>
          ,
          <source>ArXiv abs/2111</source>
          .05897 (
          <year>2021</year>
          ).
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>