Sie sind auf Seite 1von 6

12/13/2017 Reverse Engineering The YouTube Algorithm




By Matt Gielen ( On February 16, 2017

[Editors Note: You can readReverse Engineering the YouTubeAlgorithm: Part I (
algorithm/) right here ( You dont need to read it before reading Part II, but you
should check it out at some point. Its excellent.]

A team of Google researchers presented a paper in Boston, Massachusetts on September 18, 2016 ( Deep
Neural Networks for YouTube Recommendations ( the 10th annual Association for Computing
Machinery conference on Recommender Systems (or, as the cool kids would call it, the ACMs RecSys 16).

This paper was written by Paul Covington (http://Senior Software Engineer at Google) (currently a Senior Software Engineer at Google), Jay Adams
( a Software Engineer at Google), and Embre Sargin (
sargin-0665047) (currently a SeniorSoftware Engineer at Google) to show other engineers how YouTube uses Deep Neural Networks
( for Machine Learning ( nition/machine-learning). It gets into some pretty
technical, high-level stuff, but what thispaper ultimately illustrates is how the entire YouTube recommendation algorithm works(!!!). It gives a careful and
prudent reader insight into how YouTubes Browse, Suggested Videos, and Recommended Videos features actually function.

An Engineering Paper On The YouTube Algorithm For Dummies

While it was not necessarily the intent of the authors, it is our belief the Deep Neural paper can be read and interpreted by and for YouTube video publishers.
The below is how we (and when I say we, I mean me and my team at my shiny new companyLittle Monster Media Co.
( interpret this paper as a video publisher. 1/7
12/13/2017 Reverse Engineering The YouTube Algorithm
In a previous post I co-wrote here on Tube lter, Reverse Engineering The YouTube Algorithm (
youtube-algorithm/), we focused on the primary driver of the algorithm, Watch Time (
algorithm-statistics/). We looked at the data from our videos on ourchannel to try to gain insight into how the YouTube algorithm worked. One of the limiting
factors to this approach, however, is that its coming from a video publishers point of view. In an attempt to gain some insight into the YouTube algorithm we
asked ourselves andthen answeredthe question, Why are our videos successful? Wewere doing our best with the information we had, butour initial
premise wasnt ideal. And while I stand by our ndings 100%, the problem with ourprevious approachis primarily twofold:

1. Looking at an individual set of channel metrics means theres a massive blind spot in our data, as we dont have access to competitive metrics, session
metrics, and clickthrough rates.
2. The YouTube algorithm gives very little weight to video publisher-based metrics. Its far more concerned with audience and individual-video-based
metrics. Or, in laymensterms, the algorithm doesnt really care about the videos youre posting, but it cares a LOT about the videos you (and everyone
else) are watching.

But at the time we wrote our original paper, there had been nothing released from YouTube or Google in years that would shed any light onto the algorithm in a
meaningful way. Again, we did what we could with what we had. Fortunately for us though, the paper recently released by Google gives us a glimpse into
exactly how the algorithm works and some of its most important metrics. Hopefully this begins to allow us to answer the more poignant question, Why are
videos successful?

Staring Into The Deep Learning Abyss

The big takeaway from the papers introduction is that YouTube is using Deep Learning to power its algorithm. This isnt exactly news, but its a con rmation of
what many have believed for some time. The authors make the reveal in their intro:

In this paper we will focus on the immense impact deep learning has recently had on the YouTube video
recommendations system.In conjugation with other product areas across Google, YouTube has undergone a
fundamental paradigm shift towards using deep learning as a general-purpose solution for nearly all learning problems.

What this means is that with an increasing likelihoodtheres going to be no humans actually making algorithmic tweaks, measuring those tweaks, and then
implementing those tweaks across the worlds largest video sharing site. The algorithm is ingestingdata in real time, ranking videos, and then providing
recommendations based on those rankings. So, when YouTube claims they cant really say why the algorithm does what it does, they probably mean that very

The Two Neural Networks

The paper beginsby laying out the basic structure of the algorithm. This is the authors rstillustration:

( 2/7
12/13/2017 Reverse Engineering The YouTube Algorithm
Essentially there are two large lters, with varying inputs. The authorswrite:

The system is comprised of two neural networks: one for candidate generation and one for ranking.

These two lters and their inputs essentially decide every video a viewer sees in YouTubesSuggested Videos, Recommend Videos, and Browse features.

The rst lter is Candidate Generation. The paper states thisis determined by the users YouTube activity history, which can be read as the users Watch
History and Watch Time. Candidate Generation is also determined by what other similar viewers have watched, which the authors refer to as Collaborative
Filtering. This algorithm decides whos asimilar viewer through coarse features such as IDs of video watches, search query tokens, and demographics.

To boil this down, in order for a video to be one of the hundreds of videos that makes it through rst lter of Candidate Generation, that video must be
relevant to the users Watch History and it must also be a video that similar viewers have watched.

The second lter is the Ranking lter. The paper goes into a lot of depth around the Ranking Filterand cites a few meaningful factors of which its composed.
The Ranking lter, the authors write, ranks videos by:

assigning a score to each video according to a desired objective function using a rich set of features describing the
video and user. The highest scoring videos are presented to the user, ranked by their score.

Since Watch Time is the top objective of YouTube for viewers, we have to assume itsthe desired objective function referenced. Therefore, the score is based
on how well a video, given the various user inputs, is going to be at generating Watch Time.But, unfortunately, its not quite that simple. The authors reveal
theres a lotmore that goes into the algorithms calculus.

We typically use hundreds of features in our ranking models.

How the algorithm ranks videos is where the math gets really complex. The paper also isnt explicit about the hundreds of factors consideredin the ranking
models, nor how those factors are weighted. It does cite the three elements mentioned in the Candidate Generation lter, however, (which are Watch History,
Search History, and Demographic Inforomation) and several others including freshness:

Many hours worth of videos are uploaded each second to YouTube. Recommending this recently uploaded (fresh)
content is extremely important for YouTube as a product. We consistently observe that users prefer fresh content,
though not at the expense of relevance.

One interesting wrinkle the paper notesis that the algorithm isnt necessarily in uenced by the very last thing you watched (unless you have a very limited
history). The authors write:

We rollback a users history by choosing a random watch and only input actions the user took before the held-out
label watch.

In a later section of the paper they discuss clickthrough rates (aka CTR) on video impressions (aka Video Thumbnails and Video Titles)
( nitive-guide/). It states:

For example, a user may watch a given video with high probability generally but is unlikely to click on the speci c
homepage impression due to the choice of thumbnail image.Our nal ranking objective is constantly being tuned
based on live A/B testing results but is generally a simple function of expected watch time per impression.

Its not a surprise clickthrough ratesare called out here. In order to generate Watch Timea video has to get someone to watch it in the rst place, and the
most sure re way to do that is with a great thumbnail and a great title. This gives credenceto many creators claims (
v=iMeNF9I_nIs)thatclickthrough rate areextremely important to a videos ranking within the algorithm.

YouTube knows that CTR can be exploited ( so they

provide a counterbalance. This paper acknowledges this when it statesthe following:

Ranking by click-through rate often promotes deceptive videos that the user does not complete (clickbait) whereas
watch time better captures engagement [13, 25].

While this might seem encouraging, the authors go on to write:

If a user was recently recommended a video but did not watch it then the model will naturally demote this impression
on the next page load.

These statements support the idea that if viewers are not clicking a certain video, the algorithm will stop serving that video to similar viewers. There is
evidence in this paper that this happens at the channel as well. It states (with my added emphasis): 3/7
12/13/2017 Reverse Engineering The YouTube Algorithm

We observe that the most important signals are those that describe a users previous interaction with the item itself
and other similar items As an example, consider the users past history with the channel that uploaded the video
being scored how many videos has the user watched from this channel? When was the last time the user watched a
video on this topic? These continuous features describing past user actions on related items are particularly powerful

In addition, the paper notes all YouTube watch sessions are considered when training the algorithm, including those that are not part of the

Training examples are generated from all YouTube watches (even those embedded on other sites) rather than just
watches on the recommendations we produce. Otherwise, it would be very di cult for new content to surface and the
recommender would be overly biased towards exploitation. If users are discovering videos through means other than
our recommendations, we want to be able to quickly propagate this discovery to others via collaborative ltering.

Ultimately though, it all comes back to Watch Time for the algorithm. As we saw at the beginning of the paper when itstated the algorithm is designed to
meet a desired objective function, the authors concludewith Our Goal is to predict expected watch time, and Our nal ranking objective is constantly being
tuned based on live A/B testing results but is generally a simple function of expected watch time per impression.

This con rms, once again, that Watch Time is what all of the factors that go into the algorithm are designed to create and prolong. The algorithm is weighted
to encourage the greatest amount of time on site andlonger watch sessions.

To Recap

Thats a lot to take in. Lets quickly review.

1. YouTube uses three primary viewer factors to choose which videos to promote. These inputs are Watch History, Search History, and Demographic
2. There are two lters a video must get through in order to be promoted by way of YouTubes Browse, Suggested Videos, and Recommended Videos
Candidate Generation Filter
Ranking Filter
3. The Ranking Filter uses the viewer inputs, as well as other factors such as Freshness and Clickthrough Rates.
4. The promotional algorithm is designed to continually increase watch time on site by continually A/B testing videos and then feeding that data back into
the neural networks, so that YouTube can promote videos that lead to longer viewing sessions.

Still Confused? Heres An Example.

To help explain how this works, lets look at an example of the system in action.

Josh really likes YouTube. He has a YouTube account and everything! Hes already logged into YouTube when he visits the site one day. And when he does,
YouTube assigns threetokens toJoshs YouTube browsing sessions. These three tokens are given to Josh behind the scenes. He doesnt even know about
them! Theyre his Watch History, Search History, and Demographic Information.

Now is where the Candidate Generation lter comes into play.YouTube takes the value of thosetokens and combines it with the Watch History of viewers
who like to watch the same kind of stuff Josh likes to watch ( Whats left over ishundreds of videos that
Joshmight be interested in viewing, ltered out from the millions and millions of videoson YouTube.

Next, these hundreds of videos are ranked based on their relevancy toJosh. The algorithm asks and answers the following questions in fractions of a second:
How likely is it that Josh will watch the video? How likely is it the video will lead to Josh spending a lot of time on YouTube? How fresh is the video? How has
Josh recently interacted with YouTube? Plus hundreds of other questions!

The top ranked videos are then served toto Josh in YouTubesBrowse, Suggested Videos, and Recommended Videos features. And Joshs decision on what
towatch (and what not watch) is sent back into the Neural Network so the algorithm can use that data for future viewers. Videos that get clicked, and keep the
user watching for long periods of time, continue to be served. Those that dont get clicks may not make it through the Candidate Generation lter the next time
Josh (or a viewer like Josh) visits the site.


Deep Neural Networks for YouTube Recommendations ( a fascinating read. Its the rst real glimpse into
the algorithm, directly from source(!!!), that weve seen in a very long time. I hope we continue to see more papers like it sopublishers can make better choices
about what content they createfor the platform. And thatsultimately why I write these blogs in the rst place. Making content suited for the platform means
creators will generate more views, and therefore more revenue, which ultimately means we can make more and betterprogramming and provide more
entertainment for the billions of viewers who rack up signi cant Watch Time on YouTube each and every month. 4/7
12/13/2017 Reverse Engineering The YouTube Algorithm
( Gielen is the founder and CEO of Little Monster Media Co
(, a video agency specializing in audience development on YouTube and Facebook. Founded in the summer of 2016
Little Monster has already helped dozens of clients big and small grow their audiences. Formerly, Matt was Vice President of Programming
and Audience Development at Frederator Networks where he oversaw the building of the audiences for Cartoon Hangover, Channel
Frederator and the Channel Frederator Network.

And in a personal plug, Matt willbe diving into a lot of this and more at hisVidCon presentations this year in Amsterdam, Anaheim, and
Australia ( Hell be exploring what these new ndings mean for publishers and more importantly how publishers can capitalize on the
information this paper has revealed. Hes excited to see you you there (

You can read more of Matts articles on Tube lter here (, and follow Matt on Twitter

FacebookComments 5/7
12/13/2017 Reverse Engineering The YouTube Algorithm

9 Comments Sort by Top

Add a comment...

Chad Wild Clay

Fantastic article Matthew Gielen! And thank you for referencing my video as well. The biggest takeaway for me is, if a creator is making something truly
original, they are going to have a more difcult time getting past that candidate generation lter. In other words, if your video is not related to a topic/keyword
that viewers have previoiusly watched, YouTube may have a hard time nding an audience to recommend your video to. I only hope YouTube is factoring this
in, otherwise I fear it'll become even more of an echo-chamber of being recommended the same video topics & same creators.
Like Reply 7 Feb 17, 2017 6:16am

Dane Golden Digital Marketing Strategist Specializing in YouTube Marketing at

You're the boss Matthew Gielen! I will be referring to this for months, just as I have for Part 1. Thanks for making my job easier.
Like Reply 4 Feb 17, 2017 1:14am

Jeff Martin Senior Vice President at Touchstorm

Nice coverage Matt.

From my POV it shows the validy of and provides job security to those of us in audeince development.

I've been doing SEO for, well let's just say since ames on websites were cool, contruction pages were a good idea and web rings were how you drove trafc.
The principle that has stuck through the years is that the more things change, the more they stay the same. That is, if you only focus on the core "right stuff"
everything else will fall into place. Time and time again.

Kevin is more right than he knows. If you make content similar in genre/topic, with the same or better quality as that which is already popular, keep up with
what "popular" is, and follow the known principles that are part of certication then you will be successful, in time.

Papers like this and led patents tend to get folks excited when released. However, after the excitement and newness has passed you'll nd yourself asking
"but what did that really mean I need to change my focus on." If you've been focusing on the right things that Google in general puts out and repeats like a
mantra, you will probably be surprised at your own answer.

In regards to machine-learning/AI specically, Matt's observation is interesting when he says "So, when YouTube claims they cant really say why the
algorithm does what it does, they probably mean that very literally."

That is a problem I thought of around the more machine-learning/AI info I come across. ML/AI will become too complex for even the most intelligent people to
fully grasp. It's playing chess, we're playing checkers. If that holds to be true, then we will eventually lose the ability to know how an ML/AI system works. if
that happens, then we will lose control of them and that opens the door to some posibilites, not all of which are good.
Like Reply 3 Feb 18, 2017 1:56am Edited

Kevin Ross Los Angeles, California

Great work! I agree with Chad and recommendations feel narrower than ever. With that said the emphasis on user behaviors, retention and topic afnity
rather than "channel scores" and publisher metrics does lend itself to innovation as a creator matures and builds community. In the end it's all about the
audience and what they want to consume. True innovatation will come from creators who can work within, data driven, creative constarints.
Like Reply 1 Feb 21, 2017 5:49am

James Shamsi Co-Founder & CMO at Runway Inuence

Love this!
Like Reply Feb 18, 2017 7:23am

Caught my attention, interesting article. A bit confusing at some points but really important for content creators.
Like Reply Feb 16, 2017 9:50pm

Kevin Peters Music Producer/Engineer/Mixer - Youtuber at Anemic Studios

Basically just make videos everyone else is making
Like Reply 2 Feb 16, 2017 11:50pm

Facebook Comments Plugin