A two-tower recommendation model learns separate vector representations for users and items, then finds items whose vectors closely match a user's vector. It is mainly a candidate-retrieval architecture: its job is to narrow a large catalog before a separate ranking and policy layer decides what appears.

For engineers, the appeal is practical. Item representations can be computed ahead of time, allowing online requests to search a vector index without evaluating every user-item pair through a large neural network.

#basics

What is a Two-Tower Recommendation Model?

A two-tower model, also called a dual encoder, contains two encoders trained to produce compatible embeddings.

Two-tower recommendation architecture showing separate query and candidate encoders producing embeddings for similarity-based retrieval.
Two-tower recommendation architecture showing separate query and candidate encoders producing embeddings for similarity-based retrieval.

The query tower represents a user, session, or search query. The candidate tower represents a product, article, creator, or other item. Each maps its inputs into a shared vector space, where matching pairs should receive higher similarity scores than unrelated pairs.

Their architectures can differ, but outputs must support a shared similarity measure.

NVIDIA Merlin's retrieval-model documentation describes this separation and why precomputing item embeddings makes large-catalog retrieval practical.

#intuition

Why Are There Two Towers Instead of One?

Imagine a job marketplace with a million listings. A naive personalized model could examine every job together with a particular candidate's profile on each request. That potentially repeats expensive computation a million times.

A two-tower model splits the work. One encoder creates a representation of the candidate's interests and skills. The other creates representations of job descriptions and requirements independently.

Because item vectors do not depend on the current user, the platform can precompute and index them. At request time, it computes the user's vector and retrieves nearby job vectors.

That separation enables approximate nearest-neighbor search. It also limits direct user-item feature interactions inside retrieval, which is one reason more expressive downstream ranking remains useful.

#inputs

What Data Goes Into Each Tower?

Query / user
Recent interests, followed topics, session actions, language, search context
Candidate / item
Title, category, description, creator, metadata, content embeddings

Features must be available consistently at training and serving time. Do not put user-specific features into the item tower if its embeddings must be reused across users.

For cold-start items, rich descriptive features can generate useful vectors even before the item has interactions. An encoder based only on known item IDs cannot do this for unseen IDs without an additional fallback.

The distinction between interaction-based and metadata-based signals is also central to collaborative, content-based, and hybrid recommendation algorithms, which can provide training features or complementary retrieval sources.

#mechanics

How Do Embeddings and Similarity Work?

An embedding is a compact numeric representation learned from examples. Suppose a user tower produces the vector [0.8, 0.6], while an article tower produces [0.9, 0.2].

Their dot product is:

0.8 × 0.9 + 0.6 × 0.2 = 0.84

Dot-product similarity calculation comparing a user embedding against two article vectors and producing scores of 0.84 and 0.70.
Dot-product similarity calculation comparing a user embedding against two article vectors and producing scores of 0.84 and 0.70.

For a second article with [0.2, 0.9], the score becomes 0.70. The first article ranks higher by this illustrative dot-product measure. These are illustrative scores, not probabilities.

If embeddings are normalized, dot product corresponds to cosine similarity. Without normalization, vector magnitude also affects the score.

The model learns vector geometry through training, rather than engineers assigning semantic meanings to individual coordinates.

#training

How Does a Two-Tower Model Learn?

Training typically starts with observed positive pairs: a user and an item they clicked, saved, purchased, or otherwise meaningfully engaged with.

The two encoders create embeddings, then a similarity function scores the observed pair against alternatives. A contrastive loss encourages the positive pair to score higher than negative examples.

Contrastive training of two-tower recommendation models using observed positive user-item interactions and sampled negatives to update encoder weights.
Contrastive training of two-tower recommendation models using observed positive user-item interactions and sampled negatives to update encoder weights.

TensorFlow Recommenders' retrieval tutorial provides a working illustration of separate query and candidate encoders and top-K retrieval evaluation.

Negative sampling matters. Random negatives may be trivially unrelated; difficult negatives can reveal subtle differences between plausible recommendations. Yet an unclicked item was not necessarily disliked: perhaps the user never saw it.

Distinguish exposure from engagement, prevent label leakage, and use time-based validation. Labels define relevance.

#serving

What Happens During a Real Recommendation Request?

Production serving separates offline catalog preparation from the online lookup:

  1. Train the two towers using paired interaction data.

  2. Run the candidate tower over items and store versioned embeddings.

  3. Build an approximate nearest-neighbor index from those vectors.

  4. Encode the current user or query when a request arrives.

  5. Retrieve nearby item IDs and apply required eligibility checks.

  6. Send candidates to a ranker and re-ranking policies before display.

Two-tower production architecture showing offline item-embedding computation and ANN indexing connected to online query encoding and nearest-neighbor retrieval.
Two-tower production architecture showing offline item-embedding computation and ANN indexing connected to online query encoding and nearest-neighbor retrieval.

The retrieval output is a shortlist, not necessarily the final feed. A marketplace may still remove unavailable listings, diversify sellers, or apply surface-specific objectives.

Two-tower retrieval and final ranking serve different purposes. Retrieval identifies relevant candidates from a large catalog, while downstream ranking evaluates those candidates using additional context, relevance signals, and platform policies before determining the final order.

#example

How Would This Work in a Creator App?

Consider an illustrative platform with 500,000 available posts. Its candidate tower encodes posts from text and topic attributes and updates the vector index as inventory changes.

When a user opens a discovery feed, the query tower summarizes recent interests into one embedding. The ANN index retrieves 100 likely matches. That number is an example, not a platform benchmark or a Gortex integration recommendation.

Eligibility filtering removes blocked or unavailable posts. A separate ranker can compare remaining items using freshness, relationship strength, content quality, and product-specific signals. Re-ranking limits repetition from one creator.

The user sees a small ordered set, while impression and engagement events flow asynchronously into future data preparation. Training happens separately.

#comparison

Two-Tower vs Matrix Factorization vs Cross-Encoder

Matrix factorization
Learns user and item vectors, often from IDs and interactions; simple and efficient.
Two-tower neural model
Uses separate encoders that can incorporate rich user and item features; supports indexed retrieval.
Cross-encoder / interaction model
Processes user and item together for richer interactions; costly across an entire catalog.
Two-stage system
Uses efficient retrieval followed by more detailed ranking of the shortlist.
Comparison of independent two-tower retrieval, joint cross-encoder scoring, and a two-stage recommendation system that uses retrieval before rich ranking.
Comparison of independent two-tower retrieval, joint cross-encoder scoring, and a two-stage recommendation system that uses retrieval before rich ranking.

Simple ID-embedding towers can behave much like matrix factorization. Two-tower is not synonymous with a huge neural network, and cross-encoders are not inherently better for every workload.

Choose the architecture according to recall, candidate freshness, serving cost, and the value of additional user-item interactions.

#evidence

How Are Two-Tower Models Used in 2026?

Recent engineering work illustrates both the continued value and limitations of dual encoders.

In an August 2026 LinkedIn feed-retrieval study, engineers describe a causal language model adapted as a dual encoder for member and post embeddings. Their system retrieves roughly 2,000 candidates from several million possibilities within a few milliseconds, according to the paper. This is a reported platform-specific setup, not a general latency guarantee.

Pinterest Engineering's September 2026 discussion of a three-tower model shows another trade-off: keeping a fast two-tower path while adding richer cross-interaction scoring for selected candidates.

The lesson is not that every app needs a third tower. It is that fast retrieval and expensive interaction modeling can be allocated to different stages.

#limitations

What Can a Two-Tower Model Miss?

Independent encoders are efficient because item vectors can be reused. The cost is restricted interaction between the particular user and item before similarity is calculated.

A single user embedding may also blur distinct interests: someone following both architecture and cooking may receive overly generic neighbors. Session-aware representations, multiple interest vectors, or additional retrieval sources can help.

Four two-tower recommendation retrieval limitations illustrated: stale embeddings, combined interests, biased item exposure, and missed nearest neighbors.
Four two-tower recommendation retrieval limitations illustrated: stale embeddings, combined interests, biased item exposure, and missed nearest neighbors.

Popular items can dominate training data, making underexposed content harder to discover. Stale item vectors can miss new inventory; stale user features can misread current intent.

Finally, ANN search trades some exact-neighbor recall for efficiency. Measure this trade-off instead of assuming the index always returns the mathematically closest items.

#evaluation

How Do You Measure Retrieval Quality?

Use Recall@K to measure whether relevant items reach the shortlist, and examine coverage across creators, sellers, and item categories. Compare ANN results against exact vector search on a representative sample when tuning the index.

Google Cloud's two-tower implementation reference, reviewed in November 2026, details offline candidate embeddings, vector indexing, and recall-versus-latency evaluation.

Also track embedding freshness, empty-result rate, query-tower latency, index latency, and feature missingness. Keep model and index versions aligned: mixing embeddings from incompatible tower versions can silently degrade results.

Offline retrieval metrics are not retention metrics. A randomized product experiment is still needed to establish whether the new pipeline improves user outcomes.

#implementation

When Should You Build a Two-Tower Model?

Consider it when the catalog is too large for exhaustive pairwise scoring, user-item behavior is reasonably informative, and retrieval quality limits the product.

Start by benchmarking simpler retrieval: filtered search, content similarity, popularity, or collaborative baselines. Estimate engineering costs for label pipelines, training, index updates, serving, and monitoring.

If metadata is strong but interactions are sparse, a content-based index may be sufficient initially. If a two-tower retriever wins offline, shadow-test it and measure how many useful candidates it contributes beyond existing sources.

For most teams, adding a second retrieval source is safer than replacing all candidate generation in one release.

#gortex

How Gortex Connects Recommendation and Monetization

At Gortex, we're building decision infrastructure that helps marketplaces, social networks, and creator platforms rank content and monetize discovery through a unified API.

Our decision engine brings organic ranking and sponsored-placement decisions into one workflow. Using calibrated linear scoring, recipient context, and platform-defined policies, Gortex helps determine which eligible items appear and how sponsored content fits naturally into the discovery experience.

Through POST /v1/decide, platforms can submit candidate items and request context, then receive ranked results, sponsored-placement decisions, and decision identifiers for tracking and measurement.

This unified approach helps engineering teams simplify ranking and monetization logic, maintain consistent placement policies, and create new advertising opportunities within existing feeds, search results, and recommendation surfaces.

Our goal is to make every discovery surface more relevant, measurable, and monetizable.

#takeaway

Conclusion

Two-tower models solve an important scaling problem: match a user or query against a large catalog without repeating expensive joint inference for every possible item. Separate encoders produce reusable embeddings, while ANN search retrieves a manageable shortlist.

They do not eliminate the need for strong training labels, fresh indexes, eligibility rules, or downstream ranking. The right architecture pairs retrieval quality with measurable user outcomes and reliable serving.

For platforms already building that retrieval layer, Gortex connects the next decision: ranking eligible results and coordinating sponsored placements under platform-controlled policies. Explore Gortex's decision infrastructure when that becomes part of your discovery roadmap.