N Neurarch Try it See it Changes Bot Pricing API Open app

Comparisons / Two-Tower vs Neural Collaborative Filtering

Two-Tower vs Neural Collaborative Filtering

Retrieval by dot product against a learned interaction.

Neural Collaborative Filtering has 35M fewer parameters than Two-Tower: 3 layers added, 6 removed, 5 changed.

Baseline

Two-Tower

Layers
12
Parameters
70M
Input
1
Output
1 × 1
Forward-passes
yes
Est. train cost
$0.065
Compared

Neural Collaborative Filtering

Layers
9
Parameters
35M
Input
1
Output
1 × 1
Forward-passes
yes
Est. train cost
$0.053

The deltas

Every number is Neural Collaborative Filtering relative to Two-Tower.

Parameters
-35M (-50.0%)
Layers
-3
Added
3
Removed
6
Changed
5
Unchanged
4

Which GPUs each one fits

Memory for the graph at the input shape both declare. A highlighted row is a card one of them fits and the other does not, which is the difference that decides a purchase.

GPUTwo-TowerNeural Collaborative Filtering
T4 16GBfitsfits
A100 40GBfitsfits
H100 80GBfitsfits

Layer by layer

Aligned in topological order. 4 of 18 rows are the same layer with the same parameters.

Hide all 18 rows
Two-TowerNeural Collaborative Filtering
LayerParamsOutputLayerParamsOutput
1sameUser Input
Input
1User ID
Input
1
2sameItem Input
Input
1Item ID
Input
1
3changed
embeddingDim
User Embed
Embedding
6.4M1 × 64User Embedding
Embedding
3.2M1 × 32
4changed
embeddingDim
Item Embed
Embedding
64M1 × 64Item Embedding
Embedding
32M1 × 32
5removedUser FC 1
Linear
8.3K1 × 128—
6added—Concat [u; i]
Concatenate
1 × 64
7changed
outFeatures
Item FC 1
Linear
8.3K1 × 128MLP 1
Linear
4.2K1 × 64
8removedUser ReLU
Relu
1 × 128—
9sameItem ReLU
Relu
1 × 128ReLU 1
Relu
1 × 64
10changed
inFeatures, outFeatures
User Tower Out
Linear
8.3K1 × 64MLP 2
Linear
2.1K1 × 32
11added—ReLU 2
Relu
1 × 32
12changed
inFeatures, outFeatures
Item Tower Out
Linear
8.3K1 × 64Score Head
Linear
331 × 1
13removedUser Projection (owns temperature)
Contrastive Head
1 × 64—
14removedItem Projection (shared temperature)
Contrastive Head
1 × 64—
15removedItem Transpose
Permute
64 × 1—
16removedDot Score
Matmul
1 × 1—
17added—Sigmoid
Sigmoid
1 × 1
18sameScore
Output
1 × 1P(click)
Output
1 × 1

What this is not

Take it further

Open either graph in the editor, change it, and check it again: Two-Tower · Neural Collaborative Filtering

Compare any two models of your own, including anything on Hugging Face: the comparison tool.

Machine-readable: this page as markdown · the pair index · POST https://www.neurarch.com/api/v1/plan for a graph of your own.

Related comparisons

Neural Collaborative Filtering vs NeuMF (Fused GMF + MLP)
Neural collaborative filtering against its generalised-matrix-factorisation hybrid.
Wide & Deep vs Neural Collaborative Filtering
The memorisation-plus-generalisation recommender against a purely neural one.