Sequential Recommender System for Video Recommendations

Sequential Recommender System for Video Recommendations

← Home

Sequential Recommender System for Video Recommendations

Role
AI Engineer
Keywords
Recommender Systems
Machine Learning
pytorch
API
FastAPI
Year
2026
notion image

Table of Contents

About

page icon
Github
page icon
Tech Stack
  • Python
  • pytorch
  • FastAPI

Introduction

This project implements a production-style sequential recommendation pipeline on the
MovieLens dataset. The system follows the two-stage retrieve-then-rank architecture
standard in industry, where a fast retrieval model narrows the full item catalogue
to a candidate set, and a precise ranking model reorders those candidates for the
final recommendation.
Results (MovieLens-small, @K=10):
Model
Recall@10
NDCG@10
Retriever A (Item2Vec + FAISS)
0.0139
0.0064
Ranker A (LACLRec)
0.1125
0.0557
Combined B (Retriever → Ranker)
0.0769
0.0360
The standalone LACLRec ranker achieved the best performance.

Objective

The goal is to simulate a real-world production recommendation pipeline by implementing
every stage end-to-end:
  • Data preprocessing — convert raw interaction logs into padded user sequences
  • Retrieval model — Item2Vec (skip-gram) trained on interaction sequences
  • Approximate nearest neighbour search — FAISS index over item embeddings
  • Ranking model — LACLRec, a transformer trained with self-supervised contrastive learning
  • REST API serving — FastAPI server with endpoints for each model and the combined pipeline
  • Offline evaluation — Recall@K and NDCG@K with ablation across all three configurations
The pipeline covers all mandatory requirements from the bootcamp specification.
The optional LLM reranker stage is not implemented in this version.

Models

This project uses multiple model architectures to bechmark. They are described below.

Retriever A — Item2Vec

A Word2Vec model trained on user interaction sequences. Each item is treated as a
"word" and each user session as a "sentence". At inference time, the mean-pooled
embedding of the input sequence is used to query a FAISS index for fast approximate
nearest-neighbour retrieval.

Ranker A — LACLRec

A transformer-based sequential recommender trained with a self-supervised contrastive
learning objective. The model produces two augmented views of each sequence (one
learned, one random) and aligns their representations using NT-Xent loss, alongside
standard next-item cross-entropy loss.

Combined B — RetrieverRankerRec

A two-stage pipeline that composes Retriever A and Ranker A. No additional training
is required — the two models are loaded from their existing checkpoints and wired
together at inference time.
page icon
Description for this project is coming soon … Meanwhile, please check out the demo links above, or check out other projects!

Other Projects

Gallery view
 

Let’s Work Together

 

Contact Mai

Name
Email*
Phone Number
Message*