English

Memory Layer: Train the In-Model Cache for Recommendation Models

Information Retrieval 2026-07-27 v1 Machine Learning

Abstract

Early ranking stages in recommendation systems precompute item embeddings and cache them in-model for scoring within strict latency constraints. Because this cache exists only at serving time, outside the training loop, training and serving use different item representations, a structural discrepancy that limits quality and adds operational fragility. We show that co-designing the training and serving paths removes this representation discrepancy at its source. We introduce the memory layer, an in-model key-value embedding cache co-trained with the model: the item tower writes embeddings during training and the model reads them at serving, one source of truth for item representations by construction. Always-on embeddings cover items not yet cached, so every item receives a prediction, and the design consolidates three separate trainer-to-predictor update paths into a single self-contained pipeline. Deployed in production on Instagram Reels, the memory layer raises prediction coverage from 96% to 100%, improves embedding freshness from O(5 min)O(5\text{ min}) to O(20 s)O(20\text{ s}), and narrows the training-serving Normalized Entropy (NE) gap by up to 86%, yielding over 2×2\times recall for the freshest content and a 5-6% cold start engagement lift. Because embeddings are produced during training, the system needs no separate bulk-evaluation or publish-time recomputation, cutting training-and-publish computational cost by 30% at neutral serving computational cost.

Cite

@article{arxiv.2607.25110,
  title  = {Memory Layer: Train the In-Model Cache for Recommendation Models},
  author = {Liangyuan Na and Gufan Yin and Yixin Bao and Xianjie Chen and Justin Lin and Ziheng huang and Xinyuan Zhang and Wen Zhang and Hao Lin and Xiaoheng Mao and Shuo Tang and Min Yu and Lei Chen and Chao yang and Ziliang Zhao and Mengjiao Zhou and Zheng Qi and Dmitry Barablin and Chuo-Yun Yang and Kaustubh Vartak and Tingting Zhang and Arun Kumar Singh},
  journal= {arXiv preprint arXiv:2607.25110},
  year   = {2026}
}