• Core Concepts AI
  • Posts
  • How Does TikTok Know You So Well? A Look into Its Recommendation Engine

How Does TikTok Know You So Well? A Look into Its Recommendation Engine

"How Does TikTok Know You So Well? A Deep Dive into Its Recommendation Engine"

The TikTok Algorithm

Well, well, well…just look at you.

Here you are scrolling TikTok at 2 AM despite telling—PROMISING—yourself you would get a good night sleep.

But each video seems more perfect than the last, uncannily matching your interests. I mean, is it a cake or isn’t it a cake? And what new silly antics can these cats get themselves into today?

The secret behind this addictive precision isn't only clever AI. To get this magic, TikTok uses an innovative system called Monolith, which was outlined in a 2022 research paper from ByteDance, TikTok’s parent company.

In this edition of Core Concepts, we’re going to skip a stone over the surface of this research to look more closely at what makes TikTok’s recommendation system different than many others. We won’t spend too much time on the controvery around TikTok in the US, but if you are interested in that you can check out this article here.

Before we continue, here’s some context about Bytedance:

Their Products:

  • TikTok/Douyin - short video platform

  • Toutiao - news and information platform

  • Lark/Feishu - workplace collaboration tool

  • Other apps and services focused on content and social media

Scale and Reach:

  • Has offices globally

  • Serves users in over 150 markets

  • TikTok alone has more than 1 billion monthly active users globally

Business Impact:

  • One of the fastest-growing and most valuable private companies

  • First truly global consumer app company from China

The Real Innovation: Dynamic Memory

Traditional recommendation systems use a fixed-size table…you can imagine a giant spreadsheet with a predetermined number of rows. Each row stores a user's preferences, interests, and behaviors.

The problem?

Essentially, the system needs to decide the size of this table upfront.

This creates two bad options:

  1. Make the table too small, and you'll run out of space as new users join

  2. Make it too large, and you waste memory and resources

To deal with this limitation, most systems use "hashing,” essentially cramming multiple users into the same row when they run out of space. This is like having roommates share a mailbox.

It works, sort of, but sometimes people's mail gets mixed up.

TikTok's innovation was building a system that can grow and shrink dynamically, giving each user their own unique space without wasteful overallocation. No more sharing metaphorical mailboxes! Monolith is like having a magical apartment building that adds exactly as many mailboxes as needed, when needed.

This architectural choice solves a fundamental problem in recommendation systems. Users and content come and go constantly. A static system either runs out of space or starts mixing up user data.

Smart Forgetting

But storing everything forever isn't practical. Monolith incorporates several clever filtering mechanisms:

  • Frequency filtering drops data points that appear too rarely to be meaningful. Each recommendation model can set its own threshold for what counts as "too rare"… popular video recommendations might keep more data than niche interest models

  • Probabilistic filtering prevents the system from getting bogged down with edge cases

  • Time-based expiration gradually removes stale data, with different expiration periods for different types of features

These filters work together to keep the system focused on active, relevant patterns rather than hoarding outdated information. The ability to tune these filters for different recommendation models is crucial: what counts as "rare" or "stale" for one type of recommendation might be valuable data for another.

Speed Over Perfect Reliability

One surprising revelation from ByteDance's paper: TikTok deliberately trades some reliability for speed.

The system synchronizes most user interaction data every minute but only backs up its full state daily (at least as of the date of this paper). Testing showed that even losing a full day's data from a small user segment barely impacts recommendation quality.

This makes sense when you do the math. With over 15 million daily active users in the USA alone at the time of this paper (it’s up to 50 million now), losing one day's worth of data from 0.001% of users only affects a small piece of interactions. The system has enough redundancy in its patterns that this small gap doesn't meaningfully impact its ability to make good recommendations.

Handling the Negative Space

Peace Out Lol GIF by America's Funniest Home Videos

Gif by afv on Giphy

Most content on TikTok isn't relevant to any given user. The system deals with this through "log odds correction,” a mathematical technique that helps maintain accurate predictions despite the massive imbalance between positive interactions (videos you engage with) and negative ones (everything else).

Let’s think about it this way. Out of millions of videos, you might only interact with a few dozen per day in your own TikTok feed.

This creates a huge imbalance. For every video you like or watch fully, there are thousands you'd probably skip.

And this imbalance causes a problem: If the system treated all non-interactions as negative signals ("user doesn't like this"), it would become overly pessimistic because most content gets no interaction simply because users never see it, not because they actively dislike it.

Log odds correction solves this by mathematically adjusting the weight of negative signals. Instead of treating every non-interaction as a strong "no," the system scales these signals down to better reflect reality.

It's like telling the system "just because someone didn't watch this video doesn't mean they wouldn't like it; they probably just haven't seen it yet."

So when TikTok calculates what to show you next, it can make fair comparisons between videos despite this massive imbalance between the few things you've interacted with and the ocean of content you haven't seen.

Real-time Architecture

TikTok's recommendation engine actually runs two systems in parallel:

A batch system that looks at historical data: the "big picture" processor that identifies long-term trends by analyzing massive amounts of past user behavior;

AND

A real-time system that processes what's happening right now, which further splits data into two types:

Dense parameters: These track general patterns across all users - like "dance videos are trending" or "cooking tutorials are popular on weekends." These update slowly because they need lots of data to show real trends.

Sparse parameters: These track your specific, individual behaviors - like "this user suddenly got interested in urban gardening." These update almost instantly.

Here's why this matters: If you start watching cat videos, TikTok doesn't need to run a full analysis of all user data to figure out you might like cats. The real-time system can immediately adjust your recommendations.

But if TikTok notices a broad shift in how people interact with cat videos (maybe they prefer longer ones), that change happens more slowly through the batch system.

This dual approach lets TikTok be both nimble (responding to your immediate interests) and stable (maintaining reliable broader trends) without crushing its servers trying to do everything at once.

The Memory Hierarchy

Good Dish GIF by Next Level Chef

Gif by NextLevelChefFOX on Giphy

The system uses a multi-tier storage approach:

  • Hot data stays in memory for instant access

  • Warm data moves to local disk storage

  • Cold data gets archived or pruned

This hierarchy helps Monolith handle TikTok's massive scale without sacrificing speed. Recent interactions get priority treatment, older patterns provide context, and truly stale data gradually fades away.

Or to explain it with a clunky metaphor: Let’s think of TikTok's data storage like a chef organizing their kitchen.

Hot data is ingredients on the counter…you most recent activity that TikTok needs instant access to. If you just binged pottery-making videos, that information stays in fast-access memory so TikTok can immediately adjust your recommendations.

Warm data is ingredients in the fridge…recent enough to matter but not needed this second. Maybe you were really into skateboarding videos last week. This data moves to disk storage, which is slower to access but cheaper to maintain.

Cold data is old leftovers that get tossed out. If you haven't watched any cooking videos in months, TikTok eventually archives or deletes that preference data to save space.

There's no point keeping detailed records of interests you've abandoned.

This tiered approach solves a crucial problem: TikTok has billions of interactions to track, but keeping everything in fast memory would be impossibly expensive. Moving older data to slower storage and eventually pruning what's no longer relevant, they can maintain lightning-fast recommendations without endless storage costs.

Beyond the Hype

TikTok's recommendation engine succeeds because it solves real technical problems in clever ways. The collisionless hash table lets it scale smoothly. Smart filtering keeps it focused on relevant patterns. The hybrid training system balances responsiveness with stability.

These architectural choices explain why TikTok's recommendations feel more immediate and personal than other platforms. The system can maintain distinct profiles for massive numbers of users and update them almost instantly based on new interactions.

It’s one of the most sophisticated recommendation engines ever built, and its apparent simplicity masks impressive technical innovations that handle mind-boggling scale with surprising elegance.

Contact us at NorthLightAI.com to learn how we can help you build a stronger data foundation for your AI future.