Cracking the code behind TikTok’s ‘For You’ algorithm

Taylor Swift. Northeastern memes. That concert you went to last weekend. Endless scrolling through countless short videos until you zone back into reality. This is a typical experience on TikTok’s “For You” page. Somehow, the mysterious TikTok algorithm never fails to yield an entertaining assortment of content, stealing hundreds of precious active hours with its ability to captivate, entertain, and even educate audiences across the globe.

The elusive TikTok algorithm is a powerful feat of computer science developed by the Chinese company ByteDance. This computer program creates AI-generated content recommendations based on user interests. It pays attention to what a user likes, rewatches, searches, and comments on, and it also factors in their location and the time spent on particular videos. Under the hood, the algorithm uses natural language processing and computer vision to analyze hashtags, comments, and video content to classify videos and appropriately recommend them.

TikTok is a relatively unique social media in that the user experience is mainly algorithm-driven and not connection-driven. Unlike other platforms, TikTok relies less on users to find content by “following” users and instead leverages artificial intelligence to power content recommendation.

The For You algorithm starts working the second a user creates an account to discover what they are interested in. Users are initially presented with a set of generic, highly-viewed videos to gauge interest. Every interaction with a video is taken into account, especially the length of time spent engaging. The algorithm preferentially ranks video topics and hashtags that the user interacts with more frequently, but also regularly incorporates new content to help discover new facets of the user’s personality.

“TikTok is a relatively unique social media in that the user experience is mainly algorithm-driven and not connection-driven.”

The Wall Street Journal conducted an experiment using newly created bot accounts with pre-programmed interests to uncover how quickly the algorithm can figure out its users. This study found that the TikTok algorithm could start delivering highly personalized content after just 40 minutes of analyzing these bot accounts.

Users tend to find themselves in specific subcommunities on TikTok based on their interests. For example, #BookTok has a significant user base and offers a space for people to discuss their literary interests. A study described how this leads to “the experience of ‘silosociality’ — an intensely communal and localized sociality of subcommunities on TikTok.” The phenomenon of silosociality highlights how TikTok’s powerful recommendation system can actually unite users who ordinarily would not have connected. Additionally, TikTok references are a form of social currency in real-life friend groups, almost representing a unique cultural language.

“No singular person can make a definitive claim toward how the TikTok algorithm works; perceptions of what the ‘TikTok algorithm’ is, are quite clearly culturally specific, temporally-bound, and socially constructed as ‘folk theories.”

Despite being a collection of application code, this powerful algorithm is often humanized by users, who discuss it with personifying language. A study analyzing user perception of the algorithm noted users describing how the algorithm “got to know” them after improving its recommendations based on user data. This places the algorithm in a unique role — “rather than being merely an element or building block in the infrastructure of the platform … or another independent ego with whom users can interact (as they would with a friend), the algorithm exists somewhere in between,” the researchers say in the study.

Adding to this mystique, much of the algorithm’s implementation details are secret. According to a study analyzing the social perception of algorithms, “No singular person can make a definitive claim toward how the TikTok algorithm works; perceptions of what the ‘TikTok algorithm’ is, are quite clearly culturally specific, temporally-bound, and socially constructed as ‘folk theories.’” Although the public knows very little about how this powerful algorithm works, it has garnered considerable status and attention, demonstrating the enigmatic intersection of technology and culture.

“An ultra-personalized For You feed comes with the drawback of user privacy concerns. Most users are aware of this and willing to accept this as a tradeoff for a high-quality, relevant feed.”

An ultra-personalized For You feed comes with the drawback of user privacy concerns. Most users are aware of this and willing to accept this as a tradeoff for high-quality, relevant content. However, this is definitely a concern for some users and the app has come under intense governmental scrutiny. Congress recently passed the “No TikTok on Government Devices Act” in December 2022 in an attempt to protect state secrets. Ultimately, TikTok is working hard to reassure users their data is safe and keep them engaged with this AI-powered application, highlighting the delicate balance between privacy and personalization in today’s digital age.