Why Two-Tower Neural Networks Forbid Cross-Features to Enable Millisecond Feed Retrieval
To serve personalized feeds from billions of posts in milliseconds, social platforms use two-tower neural networks that strictly isolate user data from item data during inference. This architectural limitation allows platforms to precompute post embeddings offline, reducing a mathematically impossible real-time calculation into a simple vector search.
By Naina Verma
In short
- Social media platforms use two-tower neural networks to filter billions of posts in milliseconds by strictly isolating user data from item data.
- Forbidding cross-features allows platforms to precompute post embeddings offline, reducing live retrieval to a simple geometric vector search.
- The two-tower model acts as a fast, blunt filter, passing a few hundred candidates to a heavier ranking model that finally applies cross-features.
In this article
Social media platforms often claim their feeds are powered by artificial intelligence that deeply understands the nuanced relationship between you and every piece of content. The reality is much more mechanical: the neural networks that retrieve your feed are strictly forbidden from mixing your data with a post's data until the very last millisecond.
This architectural limitation, known as a two-tower model, exists for pure computational survival. If an algorithm evaluated how your specific history interacted with a specific post's features, it would have to run a full neural network pass for every possible post on the platform. By keeping user data and item data isolated in separate towers, platforms can precompute the posts offline and turn a mathematically impossible real-time calculation into a simple vector search.
"The primary benefit of such an architecture is the ability to decouple the inference of query and candidate representations," Google Cloud's engineering documentation notes. That decoupling is what makes planetary-scale feeds physically possible to serve, stripping away the marketing hype to reveal a brutal, highly optimized funnel.[2]
The Combinatorial Explosion of Cross-Features
To understand why the two-tower model is necessary, you have to look at what it explicitly prevents: cross-features. A cross-feature is a data point that only exists when a specific user is paired with a specific item. For example, a cross-feature might measure how many times a user has watched a specific author's videos in the last seven days.
Cross-features are incredibly powerful predictors of engagement. If a recommendation system can use them, its accuracy skyrockets, because it can capture highly specific, conditional preferences. But calculating them requires early fusion, where user data and item data are fed into the bottom of a neural network together.
At the scale of modern social media, early fusion breaks down immediately. A platform with one billion active users and a catalog of one billion active posts has one quintillion possible combinations. If a user opens an app and the system needs to find the best content, an early-fusion model would have to run millions of complex neural network inferences in the time it takes the screen to load.
No data center on Earth can support that computational load. Evaluating a single user against a billion posts using a deep neural network would require millions of GPU hours per second globally. The system would instantly collapse under its own weight, making real-time personalization impossible.
The Two-Tower Decoupling Mechanism
The two-tower architecture solves this by splitting the neural network in half. The user tower processes only behavioral signals, demographics, and context, outputting a dense mathematical vector—an embedding—that represents the user's current state. This vector is typically an array of several hundred floating-point numbers.
The item tower operates in total isolation, processing only the post's text, image pixels, and author metadata. It outputs a separate vector of the exact same dimensions. The strict rule of the architecture is that no information can cross between the two towers during this process.
Because the item tower never sees the user data, its calculations do not depend on who is asking. This means the platform does not have to run the item tower when you open the app. It already ran it hours or days ago, the moment the post was uploaded to the server.
This separation is the defining characteristic of late fusion. The heavy lifting of processing the content—analyzing the video frames, parsing the text, and encoding the metadata—is completely removed from the critical path of the live user request.
Precomputation and the Vector Space
Precomputation is the engine of modern feed retrieval. Platforms process their entire catalog of millions or billions of items through the item tower offline. The resulting embeddings are stored in a massive, specialized database designed specifically for high-dimensional vectors.[4]
When you open your feed, the system only has to run the user tower once. It takes your recent clicks, search history, and current context, passes them through the user network, and generates your embedding. The complex neural network inference is over in a fraction of a millisecond.
The model then performs the actual late fusion. It takes your single user vector and compares it against the billions of precomputed item vectors. The comparison is usually a simple dot product or cosine similarity—basic geometric operations that determine how close two points are in a high-dimensional space.
If your user vector and a post's item vector point in roughly the same direction, the dot product is high, and the system assumes the post is relevant to your interests. The entire matching process is reduced to basic linear algebra.
Approximate Nearest Neighbor Search
Even a simple dot product is too slow if you have to calculate it one billion times per user request. To achieve real-time latency, platforms rely on Approximate Nearest Neighbor search algorithms, commonly referred to as ANN.
Instead of checking every single post, ANN algorithms use tree structures or graph networks to quickly navigate the vector space. They skip vast swaths of irrelevant content, finding the closest matches in logarithmic time rather than linear time.
One of the most common algorithms for this is Hierarchical Navigable Small World graphs, or HNSW. It builds a multi-layered graph where the top layers have very few, long-distance connections, and the bottom layers are dense with local clusters. The search takes massive leaps across the space before dropping down to find the exact matches.
"By learning separate embeddings for users and items, it enables fast candidate generation via approximate nearest neighbor search—critical for real-time personalization," notes a 2025 technical breakdown by Tullie.ai. This reduces the required compute per user request by over six orders of magnitude.[3]
The 2016 YouTube Breakthrough
The industrial standard for this architecture was largely established by a landmark 2016 paper from Google Research titled "Deep Neural Networks for YouTube Recommendations." Before this paper, many systems relied on matrix factorization, which struggled to incorporate rich metadata.[1]
The YouTube engineering team demonstrated that by using deep neural networks for both the user and the video, they could feed hundreds of disparate features into the towers. The user tower could ingest the user's watch history as a sequence of video IDs, alongside their geographic location and search query tokens.[1]
Crucially, the paper formalized the two-stage funnel that remains the industry standard a decade later. The researchers explicitly separated the fast, two-tower candidate generation model from the heavy, feature-rich ranking model, proving that scale and precision had to be handled by different architectures.[1]
The Two-Stage Recommender Pipeline
When tech companies market their algorithms, they tend to blur the lines between retrieval and ranking. The two-tower model is only the first stage of the pipeline, known as candidate generation. Its job is not to be smart; its job is to be fast.
The two-tower retrieval stage narrows the billion-post catalog down to a few hundred plausible candidates. Because it cannot use cross-features, its selections are broad and sometimes generic. It is a blunt instrument designed to filter out the obvious noise.
Once the pool is reduced to a few hundred items, the system hands them off to a heavy ranking model. This second stage is where the cross-features are finally allowed. Because it only has to score 500 posts instead of a billion, the ranker can afford to run deep, complex inferences to pick the final 10 posts you actually see.
Trade-offs and the Cold Start Reality
Forbidding cross-features during retrieval comes with severe trade-offs. The two-tower model struggles to capture fine-grained conditional preferences, like a user who loves a specific creator but only when they post about a specific topic.
"Performance can suffer for new users or items with few features or interactions," the Tullie.ai analysis warns. Because the two-tower model relies entirely on the dot product of two isolated vectors, it is highly sensitive to the quality of the initial embeddings.[3]
However, the architecture elegantly solves the cold start problem for new content. When a creator uploads a brand-new video, the item tower immediately generates its embedding based purely on its pixels and metadata. Without requiring any retraining, the video can instantly surface in the feeds of users whose vectors point to that region of the embedding space.
How we did this
- Method
- Calculated the computational complexity of early-fusion (cross-feature) inference versus late-fusion (two-tower) inference for a standard social media feed request.
- What we found
- By forbidding cross-features, the system reduces the online inference complexity from O(N) full neural network passes (where N is the catalog size) to exactly one neural network pass plus an O(log N) approximate nearest neighbor search, reducing required compute per user request by over six orders of magnitude.
- What we worked from
- Candidate pool size: Millions to billions of items — Tullie.ai
- Target retrieval latency: Milliseconds — Google Cloud
- Limits of this analysis
- This analysis models the retrieval stage in isolation and does not account for the subsequent heavy ranking stages that do use cross-features on a much smaller candidate pool.
Key terms
- Two-Tower Model
- A neural network architecture that processes user data and item data in completely separate pathways until the final calculation.
- Cross-Feature
- A data point that combines user and item information, such as a specific user's historical click rate on a specific author's posts.
- Embedding
- A dense mathematical vector of floating-point numbers that represents complex data, like a user's preferences or a video's content, in a geometric space.
- Approximate Nearest Neighbor (ANN)
- A search algorithm that finds the closest matching vectors in a database in logarithmic time by skipping irrelevant clusters.
- Late Fusion
- The practice of keeping different types of data separated during neural network processing and only combining them at the very end.
- Cold Start Problem
- The challenge recommendation systems face when trying to surface brand-new content or serve brand-new users who have no historical interaction data.
Frequently asked
Why can't recommendation systems use cross-features for the entire catalog?
Using cross-features requires running a full neural network inference for every single user-item combination. At the scale of billions of users and posts, this would require millions of GPU hours per second and make real-time loading impossible.
How do platforms recommend brand-new posts that have no views?
Because the item tower only looks at the post's intrinsic features—like text and image pixels—it can generate an embedding the moment the post is uploaded. The post can then be matched to users based on its content, solving the cold start problem.
Do social media feeds use cross-features at all?
Yes, but only in the final ranking stage. After the two-tower model filters a billion posts down to a few hundred candidates, a heavier ranking model uses cross-features to precisely score that small batch and pick the top ten.
Viewpoints in depth
Machine Learning Engineers
Engineers view the two-tower architecture as a non-negotiable survival mechanism for operating at scale.
For practitioners building live systems, theoretical accuracy is secondary to latency budgets. Engineers argue that a model that takes five seconds to load a feed is a failed product, regardless of how perfectly it predicts user behavior. The strict decoupling of the two-tower model allows them to shift 99 percent of the computational burden to offline batch processing, making it the only viable architecture for planetary-scale traffic.
Algorithm Optimization Researchers
Researchers focus on the predictive accuracy lost when cross-features are banned during the retrieval stage.
Academic researchers frequently highlight the bluntness of late fusion. Because the user and item towers cannot communicate during processing, the model cannot learn nuanced conditional relationships. Researchers argue this forces the retrieval stage to rely heavily on broad popularity metrics, potentially filtering out niche, highly relevant content before the smarter ranking stage ever gets a chance to evaluate it.
Cloud Infrastructure Providers
Infrastructure providers view the architecture as a driver for specialized vector database services.
For cloud vendors, the ubiquity of the two-tower model has created a massive market for managed vector search. Providers emphasize that the architecture's reliance on precomputed embeddings shifts the bottleneck from GPU inference to memory bandwidth. They argue that optimizing Approximate Nearest Neighbor search algorithms and in-memory vector databases is now just as critical to recommendation performance as the neural networks themselves.
- Machine Learning Engineers
- Focus on the computational necessity and latency budgets that force the adoption of two-tower models.
- Algorithm Optimization Researchers
- Focus on the limitations of late fusion and the loss of predictive accuracy when cross-features are banned during retrieval.
- Cloud Infrastructure Providers
- Focus on the hardware savings and the ability to serve planetary-scale traffic using precomputed vector databases.
Perspectives this story doesn't cover
- End Users
- Content Creators
Sources
[1]Google ResearchAlgorithm Optimization ResearchersDeep Neural Networks for YouTube Recommendations
Read on Google Research →
[2]Google CloudMachine Learning EngineersScaling deep retrieval with TensorFlow Recommenders and Vector Search
Read on Google Cloud →
[3]Tullie.aiAlgorithm Optimization ResearchersTwo-Tower Models: The Pros and Cons
Read on Tullie.ai →
[4]RedisMachine Learning EngineersBuilding a Two Tower Recommendation System with RedisVL
Read on Redis →
[5]Factlen Editorial TeamSynthesis by Factlen editorial team
Read on Factlen Editorial Team →
More in Technology
See all →ActivityPub Protocol
Replacing Per-User HTTP Delivery With Shared Inboxes: How ActivityPub Compresses Fan-Out Across Federated Social Servers
5 sources
Platform Economics
The Geographic Divide in Social Media ARPU: How Platforms Monetize Global Users
7 sources
Digital Services Act
US Justice Department Intervenes in X's Appeal Against EU Digital Services Act Fine
7 sources
Digital Regulation
EU 'Kids Act' Proposes Bloc-Wide Ban on Social Media for Under-13s and Limits Teen Access
6 sources
Comments
Every angle. Every day.
Get Technology stories with full source coverage and perspective breakdowns, free every day.




