The Soul of TikTok: Its Algorithm

TikTok became one of the most well-known applications in 2020 after President Trump’s attempt to ban it, citing national security concerns. It is a mobile application which launched in September 2016. TikTok, known as Dou-Yin in China, allows users and content creators to create short videos (up to one minute) with music, and then distributes these videos to their users, based on their interests and preferences. TikTok had 689 million monthly active users in July 2020, a 35% increase compared to the 507 million users it had in December 2019. According to a market research report from Sensor Tower, TikTok and Dou-Yin have generated more than 1.3 billion USD in revenue this year from the App store (iOS) and Google Play (Android), which is 7.9 times more than last year.

TikTok is very popular and users have been known to become addicted to it. According to a report published by California-based venture capital fund, Kleiner Perkins, in 2018 TikTok users on average spent 52 minutes on the app each day. Why do users like it so much? The secret is TikTok’s technology. The main part of its technology is its recommendation system which analyses videos uploaded by users and then pushes those videos to other users based on their preferences. In the following paragraph, I will explain more about TikTok’s recommendation system (named the “For You” feed in TikTok) with a simple graph and then explain its video analysis technology in a simplified way.

The recommendation system in TikTok is based on user interaction with the app. The more a user interacts with TikTok, the greater the probability that future videos pushed to that user will match their interests. The recommendation system is divided into two parts, content filtering and collaborative filtering.

Content filtering means TikTok will feed the user with videos that have the tags that fit the user’s profile. When a user signs up with TikTok, he/she needs to enter age information. This will create the first tag in the user profile. Other tags will include the user’s mobile operating system (e.g. iOS, Android), location, or mobile service provider (T-Mobile, AT&T, etc.). According to this initial profile tag, the recommendation system will start feeding the user videos which have the same tags. The following graph explains how to pick videos from a database to feed the users.

There are two users (A and B) in Column “user”, two age tags in Column “age tag”, and a few videos with different tags in Column “video”. Each user will be connected to an age tag with true (1) or false (0), and each video is connected to age tags with true (1) or false (0).

To find out which video should be pushed to user A, we can simply find out the age tag related to user A’s age, which would be 11–20, then we can search the database and filter with tags “age 11–20”, as a result, the system will push videos of “school life” to user A. The same process will be conducted for user B. As a result of content filtering, videos of “family Love” will be pushed to user B’s account.

To explain in a logical way, we just need to find a positive (1) output. For example, user A to ageTag 11–20 is positive (1), ageTag 11–20 to school life is positive (1), therefore videos of “school life” should be pushed to user A. The following input should have the corresponding output:

The other part of the recommendation system, collaborative filtering, relies on the user’s interaction with the app. Every time a user (for example, user A) performs any action, their behavior and activity (such as the time spent on any video, whether or not the user “liked”❤️ or commented on a video, etc.) will be logged and taken into account by the TikTok machine learning system to create tags for this user. The recommendation system will then search the TikTok user database to look for another user (for example, user B) with similar tags and push user B’s liked videos to user A.

The following chart is a simplified version of collaborative filtering. Our goal is to predict if the question mark (❓) will be yes✅ or no❌. To predict this, we first have to find other users with similar interests.

In this example, user A has similar interests with user E since they both like three of the same videos (tagged “School life”, “Dinosaur”, and “Kung Fu”). We can use this similarity to predict that user A will have the same reaction with user E regarding the video “Family love”, which is that user A will like it too.

Next, we want to predict if user B will like “Kung Fu” videos. User B has similar interests to user D, since they both like “Family love” and “Dinosaur” videos, and both dislike “School life” videos, therefore, we can predict user B will have the same reaction towards “Kung Fu” videos as user D did, which was dislike.

Finally, for user C, there are two users similar to user C, user A and user E. However, the prediction for user C might not be as accurate as the other cases because user C and the other two user’s interests are not an exact match. Although user C does have some similarities to Users A and E (which can serve as a reference), we would need user C to interact with the app more to learn more about his/her preferences.

On top of the above two filtering systems, TikTok has more rules on their recommendation system to make sure it gives users the best experience. The “For You” feed will not push videos with the same sound or from the same users(who uploaded the video)or duplicate content multiple times in a row in order to avoid homogenous videos. TikTok tends to feed diverse types of content to users.

Here is a list of activities that TikTok will track in order to better recommend videos to its users:

· User’s location, operating system, age (for signed up users), language setting, country setting

· User interaction with one video: comment, like, watching time, video caption, video labels, video sound, video image

· User posted videos: video audio, video image, hashtag, video effects

Now that I’ve explained how the recommendation system works for users who mainly receive and watch videos, let’s go to another group of TikTok users: the content creators. When a content creator uploads a video, how would the TikTok system analyze the videos?

When a video is uploaded to the platform, it will be analyzed by TikTok’s highly trained machine learning system. The system uses natural language processing to analyze the audio and uses computer vision to analyze the video. All other metadata such as the video’s name, hashtag, description, etc. will also be taken into account. After analyzing the video, the system will approve the video with related tags/labels or reject the video if it might be in breach of TikTok’s regulations. If the video is approved, it will be pushed to 300 users with the same interest tags and according to these 300 users’ responses, the system might add more tags to the video and push it to other users with the same interest tags. If the video is very popular, TikTok will initially circulate it widely, but will stop pushing the video after a week in order to ensure the pushed content remains fresh and new.

If the video is not very popular, the system will stop sharing the video for some time but will restart to push to users again after some time. This is designed to keep up the energy of the content creator, to encourage them to create more videos and engage with the app. On the other hand, if the video is rejected by the approval system, a human will review the video manually and determine if the video should be ultimately approved or rejected.

All in all, TikTok’s engineering team created a highly trained machine learning system which can analyze videos to assign tags, predict users’ interests, and feed related videos to users based on their interests. This system has gotten both parties (users and content creators) hooked on the application and made TikTok a unicorn in a highly competitive industry.