Three users, three items, and one rating nobody ever entered. Every other model in this course was trained on a complete table of examples — what does gradient descent even optimize when part of the table is simply missing?
Toggle between one latent factor and two. With one, the reconstructed grid never quite matches the real ratings — it's making the same kind of mistake in the same place, no matter how long it trains. With two, it locks onto the real pattern.
Give every user and every item a small vector of latent factors, and predict a rating as their dot product:
- — the predicted rating of item by user .
- — user 's latent factor vector.
- — item 's latent factor vector.
- — the actual observed rating, when one exists.
- — the total squared-error loss, summed only over ratings that are actually observed.
- Train only on ratings that exist
Gradient descent updates every and to reduce that squared error — but only summing over ratings that actually exist. The missing entry never appears in the loss at all.
- Predicting a missing entry is just the same dot product
Once training finishes, predicting a rating that was never observed is nothing special — just plugging its user and item vectors into the same used everywhere else.
With one factor, 's rating of — a genuine — comes out well under , and no amount of extra training time fixes it. With two factors, the same entry reconstructs almost exactly. One number wasn't enough to describe two people who like opposite things.
Two real taste groups: and like / and dislike ; is the mirror image:
- One factor plateaus at a real error, not a training failure
A single number per user and per item can only express "more of one thing," not two independent directions of taste. Training converges — the loss stops moving — but it converges to a genuinely wrong answer, because a rank-1 model cannot represent this data no matter how long it runs.
- Two factors reconstruct every observed rating almost exactly
With one extra dimension — and a starting point that isn't identical across dimensions, so the second one doesn't just copy the first — the total squared error over all 8 known ratings drops to essentially .
- The missing rating gets a specific, sensible prediction
's hidden rating of comes out to about — between 's and something lower, exactly reflecting that likes slightly less than does.
Find the number of latent factors that reconstructs every observed rating with total error under 0.01.
Two things had to be true for this to work at all: enough latent factors to represent the real structure in the data, and a starting point that actually lets each factor learn something different from the others — the same symmetry-breaking problem Part III's weight-initialization chapter ran into, one level removed. Real recommender systems scale this to millions of users and items and dozens of latent factors, but the mechanism — dot products, squared error, gradient descent, summed only over what's actually observed — is exactly this.