The Recommender
A PyTorch sequential recommender built around a from-scratch Structured State-Space (S4) kernel, framing recommendation as next-item prediction and benchmarked head-to-head against a SASRec self-attention baseline.
Results at a glance
Amazon Reviews (Beauty) — timestamp leave-one-out, 100 sampled negatives:
| Model | Hit@10 | NDCG@10 |
|---|---|---|
| SASRec (baseline) | 0.0802 | 0.0412 |
| S4Rec (ours) | 0.0890 | 0.0470 |
| Δ | +11.0% | +14.1% |
S4 engine validation: 86.8% on pixel-by-pixel sequential MNIST.
Documentation
- The S4 kernel, from scratch — HiPPO → DPLR → discretization → generating function (Cauchy + Woodbury) → FFT long-convolution.
- Architecture — end-to-end data → model → metrics flow and why the timestamp leave-one-out split.
- Experiments & results — full benchmark tables and reproduction commands.
- Deployment — train → serve (FastAPI) → Docker.
Quickstart
pip install -e ".[dev]"
recommender compare --config configs/synthetic_quick.yaml # no download needed
MIT licensed · built by Madhvansh