Taewoo Park

Writing

Taking Apart the X Algorithm

🧠 Taking apart the X recommendation algorithm

After Elon Musk posted about X’s public algorithm repository, I took a closer look. Running Trendchaser, an AI trend site and community, means spending a fair amount of time thinking about what makes a piece of information valuable to one person. I wanted to see what I could learn from X’s recommendation system and where Trendchaser might go from here.

The most impressive thing was that the publicly released code was not about one giant model, but about "how well the process of selecting information is divided and combined". x's For You feed is divided into Source, which brings candidates, Hydrator, which adds user/content information, Filter, which removes inappropriate or already seen content, Scorer, which sums up the probabilities of various actions, and Selector, which mixes ads or modules into the final feed. If you look at the recommendation system as a model that simply finds articles you might like, the operational complexity that is easy to overlook is decomposed into a pipeline that is quite clear.

The particularly interesting part was that "information that is valuable to an individual" is not simply determined by its timeliness or popularity. For some information to be valuable, there must first be a sufficiently diverse pool of candidates, the candidates must be interpreted in the context of the user, and the user must continue to weed out what has already been seen/unnecessary/repeated excessively. The algorithm of x eventually solved this problem by mixing several candidate sources such as in-network, out-of-network, topic, and cache, and then passing through common filters and rankings.

Personally, I felt that the candidate pipeline structure was a more practical reference than the Phoenix model itself. It is difficult for individual developers to reproduce an x-level model directly, but the structure of gathering multiple information sources, attaching user-specific context, separating filtering and scoring, and finally applying diversity correction can be applied enough even in small products. For example, Trendchaser seems to be able to provide much more sophisticated information recommendations if it deals with frequently viewed topics, missed signals, repeatedly exposed information, and newly emerging surrounding topics as separate steps, beyond simply showing what is popular these days.

Another noticeable thing was the design called candidate isolation. It calculates scores so that candidates don't affect each other, and diversity and deduplication are handled after separate ranking post-processing. This seemed to be a pretty important principle when creating a recommendation system. Although "how valuable this content is to this user" and "what order to show it in this feed" seem similar, they are actually different problems.

Of course, this repo is not a fully functional open source that can be executed as it is. The Rust service side has a lot of internal xai dependencies, and the publicly available code is close to a snapshot of the production system. But from the perspective of designing a recommendation system, there were plenty of things to learn. In the end, I thought that a good recommendation is not just a matter of model performance, but a collection of product judgments about where to bring in candidates, what to discard, what signals to leave, and how to mix them.

You can check the relevant repo at the public link below.

https://lnkd.in/guYMP5rq