N Neurarch Architectures Models Checks Data Docs Open the 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, 4 removed, 5 changed.

Baseline

Two-Tower

Layers
10
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
-1
Added
3
Removed
4
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 16 rows are the same layer with the same parameters.

Hide all 16 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
6addedConcat [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
11addedReLU 2
Relu
1 × 32
12changed
inFeatures, outFeatures
Item Tower Out
Linear
8.3K1 × 64Score Head
Linear
331 × 1
13removedItem Transpose
Permute
64 × 1
14removedDot Score
Matmul
1 × 1
15addedSigmoid
Sigmoid
1 × 1
16sameScore
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 Neural Collaborative Filtering
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.