How does the TikTok algorithm work?

TikTok creator Slayego. @Slayego/TikTok Screenshot

Have you ever noticed how hard it is to stop watching videos on TikTok? That’s because it’s designed that way.

The video app, released in 2017 in America by Chinese company ByteDance, features short videos about everything imaginable.

The videos range in length from 15 seconds all the way up to a laborious three minutes. Popular videos follow trends and feature things like pranks, dances, explanatory occupations and two brothers from Cuba called the Island Boys.

Media and parental groups alike have expressed concerns that the app is addictive. That’s probably due to TikTok “learning” what a person wants to see and then suggesting new content based on a person’s viewing habits. So how does it do that?

TikTok’s algorithm has four main pillars, according to The New York Times. Those are “platform value, creator value, long-term user value and user value.” Last month, the news organization got its hands on a document called “TikTok Algo 101,” created by the company’s engineering team in China.

The document revealed both the mathematical underpinnings of the app as well as how TikTok understands the nuances of human nature.

TikTok magnifies two metrics in its endless quest for more users, which currently totals more than a billion. Those are retention, which measures whether users come back, and time spent on the app. The point of TikTok is to keep the viewer on the app as long as possible.

Image via TikTok

The algorithm itself is predictably a little confusing. Videos get scored by machine learning and user behavior using four data points – playtime, comments, likes, and an indication of plays. That formula looks like this:

Plike X Vlike + Pcomment X Vcomment + Eplaytime X Vplaytime + Pplay X Vplay.

“The recommender system gives scores to all the videos based on this equation, and returns to users’ videos with the highest scores,” the document said. “For brevity, the equation shown in this doc is highly simplified. The actual equation in use is much more complicated, but the logic behind it is the same.”

The company also tries to use the algorithm to identify and suppress so-called “like bait” videos that are meant to game the algorithm.

“Some authors might have some cultural references in their videos and users can only better understand those references by watching more of the author’s videos. Therefore, the total value that a user watches all those videos is higher than the values of watching each single video added up,” the document said. “Another example: if a user likes a certain kind of video, but the app continues to push the same kind to him, he would quickly get bored and close the app. In this case, the total value created by the user watching the same kind of videos is lower than that of watching each single video, because repetitiveness leads to boredom.”

Boredom, according to the document, is what the company wants to avoid the most. Another company goal is creator monetization, so the company leans toward things that could potentially be lucrative.

A professor of computer science at the University of California San Diego named Julian McAuley said the company’s success comes from merging machine learning with “fantastic volumes of data, highly engaged users, and a setting where users are amenable to consuming algorithmically recommended content (think how few other settings have all of these characteristics!).”

It’s “not some algorithmic magic,” he said. “There seems to be some perception (by the media? Or the public?) that they’ve cracked some magic code for recommendation, but most of what I’ve seen seems pretty normal.”