THE ALGORITHM
"Our goal is to build a global platform for creation and discovery. The algorithm is the product. Everything else is a container." — Zhang Yiming
ONE
THE ENGINEER
INT. NANKAI UNIVERSITY, TIANJIN - COMPUTER LAB - NIGHT (2001)
A dimly lit university computer lab. Most terminals are dark. YOUNG YIMING, 18, sits alone at a screen, coding. Empty instant noodle cups surround him. He has been here for twelve hours.
Nankai University, Tianjin, China. 2001. Zhang Yiming is a first-year computer science student.
CLASSMATE
(entering, yawning)
Yiming, it's three in the morning. What are you still doing?
YOUNG YIMING
(not looking up)
I'm writing a program that recommends articles to people based on what they've read before.
CLASSMATE
Like a search engine?
YOUNG YIMING
No. The opposite of a search engine. A search engine waits for you to ask a question. My program doesn't wait. It already knows what you want to read. It brings the content to you.
CLASSMATE
How does it know what I want to read?
YOUNG YIMING
(finally looking up)
By watching what you do. What you click. What you skip. How long you look at something. Every action is a data point. Enough data points, and the algorithm knows you better than you know yourself.
CLASSMATE
(uneasy)
That sounds a little creepy.
YOUNG YIMING
It sounds like the future.
INT. SMALL APARTMENT, BEIJING - DAY (2005)
A cramped apartment doubling as a home office. YOUNG YIMING, 22, has just graduated and is working at a series of startups. He sits at a desk covered in technical papers about machine learning and recommendation algorithms.
Beijing, 2005. Zhang Yiming joins a series of startups. He is obsessed with one problem: how does information find the right person at the right time?
YOUNG YIMING
(V.O.)
I worked at four companies in seven years. Travel search, real estate, social networking. Every company had the same problem: they had content and they had users, but they didn't know how to connect them efficiently. The existing model was editorial — human editors decided what users should see. But human editors are slow, biased, and cannot scale. An algorithm can serve a billion users simultaneously, each with a personalized feed. That was the idea I couldn't let go of.
INT. SMALL OFFICE, ZHICHUN ROAD, BEIJING - DAY (MARCH 2012)
A tiny office with six desks. ZHANG YIMING, 29, stands at a whiteboard. He has written one word in large characters: "BYTEDANCE." A team of five ENGINEERS sits before him.
March 2012. Zhang Yiming founds ByteDance with a team of six people. He is 29 years old.
YIMING
The company is called ByteDance. Because bytes of information will dance to the right person at the right time. Our first product will be a news app called Toutiao — "Headlines." But it will not be a news app in the traditional sense. There will be no editors. No editorial judgment. Only the algorithm.
ENGINEER #1
How do we build a recommendation algorithm better than Baidu's? Better than Tencent's?
YIMING
We don't start with the content. We start with the user. Every swipe, every pause, every share, every skip — that is a signal. We build a model that learns from millions of signals per second. The algorithm doesn't care about the content's quality. It cares about the user's behavior. What people actually do, not what they say they want.
YIMING (breaking the fourth wall)
Every technology company talks about users. But they don't actually watch them. They survey them. They ask them questions. They hold focus groups. That is like asking a fish to describe water. We didn't ask. We observed. Billions of observations, processed in real time, forming a picture of human attention more precise than anything ever built. That was the algorithm. And the algorithm would change the world.
CUT TO:
TWO
TOUTIAO
INT. BYTEDANCE OFFICES, BEIJING - DAY (2013)
The office has grown. Fifty employees now. Screens everywhere showing Toutiao's metrics. The numbers are exploding. YIMING watches the dashboard.
2013. Toutiao reaches 100 million users in its first year. No advertising. No marketing. Just the algorithm, feeding people exactly what they want to see.
KELLY ZHANG
Yiming, the average user spends seventy-four minutes per day on Toutiao. Seventy-four minutes. WeChat is at thirty minutes. We're destroying every competitor on engagement.
YIMING
(studying the data)
Seventy-four minutes is good. But it means the algorithm is not yet perfect. If it were perfect, they would never close the app.
KELLY ZHANG
That's a terrifying goal.
YIMING
It is an engineering goal. The algorithm's job is to minimize the distance between a user's desire and the content that satisfies it. Perfect means zero distance. We are not there yet.
INT. BYTEDANCE HEADQUARTERS - CONFERENCE ROOM - DAY (2016)
A modern conference room. YIMING, 33, meets with his leadership team. On the screen: data showing short video consumption exploding globally. Vine, Musical.ly, Snapchat stories — all point to the same trend.
2016. Short-form video is emerging as the dominant content format. Zhang Yiming sees an opportunity to apply ByteDance's algorithm to video.
YIMING
Text-based recommendations are solved. We proved it with Toutiao. The next frontier is video. Short video. Fifteen seconds to sixty seconds. The attention span of a generation compressed into a format that the algorithm can learn from even faster than text.
PRODUCT MANAGER
Kuaishou already dominates short video in China. And Musical.ly is growing fast in the US.
YIMING
Then we will build something better. We will launch Douyin — a short video app powered by our algorithm. The same engine that made Toutiao addictive for news will make Douyin addictive for video. And then we will take it global.
PRODUCT MANAGER
No Chinese tech company has ever succeeded globally.
YIMING
(quietly)
Then we will be the first.
INT. BYTEDANCE HEADQUARTERS - YIMING'S OFFICE - DAY (2017)
YIMING sits across from ALEX ZHU, the co-founder of Musical.ly, the short-video app popular with American teenagers.
November 2017. ByteDance acquires Musical.ly for $1 billion. It will be merged into TikTok — the international version of Douyin.
YIMING
Alex, Musical.ly has the users. We have the algorithm. Together, we will build the most engaging app in the world.
ALEX ZHU
The kids on Musical.ly create content for fun. They dance, they lip-sync, they do comedy. It's joy. How do you algorithm-ize joy?
YIMING
You don't algorithm-ize joy. You algorithm-ize discovery. The algorithm finds the most joyful video for each user. A dance video for someone who loves dancing. A cooking video for someone who loves cooking. A comedy video for someone who needs to laugh. The joy is in the content. The algorithm is the delivery mechanism.
CUT TO:
THREE
TIKTOK
INT. BYTEDANCE HEADQUARTERS - DATA ROOM - DAY (2019)
A massive screen shows a world map. TikTok downloads are represented by pulsing lights. The map is nearly solid light — every continent, every country.
2019. TikTok is downloaded 2 billion times. It is the most downloaded app on earth. It accomplished in two years what Facebook took seven years and Instagram took six years to achieve.
KELLY ZHANG
We have one billion monthly active users. One billion. In two years. This has never happened in the history of technology.
YIMING
(staring at the map)
The algorithm works. Every user who opens TikTok trains the algorithm. Every second of watch time makes the recommendations more precise. It is a flywheel. More users produce more data. More data produces better recommendations. Better recommendations produce more users. The flywheel has no natural stopping point.
KELLY ZHANG
Washington is getting nervous. They're talking about a ban. They say we're a national security threat.
YIMING
(his expression darkening)
We are an entertainment app. Teenagers use us to share dance videos. How is that a national security threat?
KELLY ZHANG
Because the algorithm is Chinese, and the data is American. And America is afraid of what China might do with American data.
YIMING
(quietly)
We built the best recommendation algorithm in the world. And now the world is afraid of it. I suppose that means it works.
INT. BYTEDANCE HEADQUARTERS - EMERGENCY MEETING - DAY (2020)
A tense boardroom. YIMING and his executive team face a screen showing President Trump signing an executive order to ban TikTok in the United States.
August 2020. President Trump issues executive orders threatening to ban TikTok in the US unless ByteDance sells its American operations to a US company. Oracle and Walmart emerge as potential buyers.
GENERAL COUNSEL
The executive order gives us forty-five days to divest TikTok's US operations or face a ban. Microsoft, Oracle, and Walmart have all expressed interest.
YIMING
They don't want TikTok. They want the algorithm. TikTok without the algorithm is just another video app. The algorithm is ByteDance. I will not sell ByteDance's core technology to an American company.
GENERAL COUNSEL
Beijing agrees. The Chinese government has added recommendation algorithms to the export-control list. The algorithm cannot be transferred.
YIMING
(rubbing his forehead)
So America wants us to sell, and China won't let us sell. We are caught between two superpowers, and the prize they are fighting over is an app where teenagers dance.
YIMING (breaking the fourth wall)
I built ByteDance to organize information for people. I did not build it to become a pawn in a geopolitical war between the United States and China. But when your company is worth $400 billion and your app is on a billion phones, you are no longer just a company. You are a strategic asset. And strategic assets become targets.
INT. BYTEDANCE HEADQUARTERS - YIMING'S OFFICE - DAY (MAY 2021)
YIMING, 38, sits alone in his office. On his desk: a letter. He picks it up and reads it aloud to himself.
May 20, 2021. Zhang Yiming announces he is stepping down as CEO of ByteDance.
YIMING
(reading from his internal letter)
"I'm not very social. I prefer� �looking at data to attending meetings. I prefer reading papers to managing people. The truth is, I lack some of the skills that make a good CEO. ByteDance needs a leader who enjoys the daily work of running a global company. I do not enjoy it. I want to explore new things. I want to learn."
He sets down the letter. Looks out the window at Beijing's skyline.
YIMING
(to himself)
I built the algorithm. The algorithm built the company. The company doesn't need me anymore. The algorithm is self-improving. I am not.
CUT TO:
FOUR
THE GHOST
INT. U.S. CONGRESS, HEARING ROOM - DAY (MARCH 2023)
SHOU ZI CHEW, TikTok's CEO, testifies before Congress. Five hours of hostile questioning. Behind him, the ghost of Zhang Yiming — the man who built the machine that brought Chew to this room — is nowhere to be seen.
March 2023. TikTok CEO Shou Zi Chew testifies before the U.S. Congress for five hours. Zhang Yiming is not present. He has retreated from public life entirely.
CONGRESSMAN
Mr. Chew, does ByteDance have access to American user data?
CHEW
We have created Project Texas to store all American data on Oracle servers in the United States —
CONGRESSMAN
That's not what I asked. Does ByteDance, a Chinese company, have access to American user data? Yes or no?
Chew navigates carefully. In a quiet apartment somewhere in Beijing, Zhang Yiming does not watch the hearing. He is reading a paper on large language models.
INT. PRIVATE APARTMENT, BEIJING - EVENING (2024)
A minimalist apartment. Books on artificial intelligence, philosophy, and neuroscience. YIMING, 41, sits at a desk, reading. No TikTok. No Douyin. No screens showing metrics. Just a man and his thoughts.
2024. Zhang Yiming's net worth exceeds $50 billion. ByteDance is the most valuable private company in the world at over $250 billion. TikTok has over 1.5 billion monthly active users. Zhang Yiming has not given a public interview in years.
YIMING
(V.O.)
I am told that ByteDance is now worth more than any private company in history. I am told that TikTok has changed the way a generation communicates. I am told that governments fear the algorithm I created. I do not think about these things. I think about what I always thought about: how does information find the right person at the right time? The question has not changed. Only the scale.
EXT. BEIJING SKYLINE - NIGHT (PRESENT DAY)
The Beijing skyline at night. Millions of lights. Millions of phones. On each phone, an algorithm is making decisions — what to show, what to hide, what to recommend next. The algorithm never sleeps.
YIMING (breaking the fourth wall)
I built an algorithm that learned human desire better than any technology in history. It watches a billion people every day. It learns from every second of their attention. It evolves without me. It grows without me. I stepped down because I realized something that no engineer wants to admit: the best algorithm is the one that no longer needs its creator. TikTok doesn't need Zhang Yiming. The algorithm is the product. I was just the first person to believe that.
FADE TO BLACK.
Zhang Yiming founded ByteDance in 2012 with six employees. TikTok became the most downloaded app in the world in under two years. ByteDance is valued at over $250 billion, making it the most valuable private company in history. Zhang Yiming stepped down as CEO in 2021 at age 38. He has largely disappeared from public life, reportedly pursuing interests in artificial intelligence and philosophy. The US TikTok ban debate continues.