How Meta's ad ranking reads long histories without slowing down
Meta says its ad ranking system now looks up the most useful parts of a person's past activity instead of reading all of it. The company reports about a 1% rise in ad clicks on Facebook Feed and Reels. All figures are Meta's own, and it did not say how long the histories are.
What it is: Meta's engineering blog describes Long Memory Search Modeling, a way for ad ranking models to use far more of a person's engagement history. Each ad request acts as a search query, and the history is treated as an indexed set of documents.
How it works inside: History is split into units across time and topic, with consecutive days grouped into weekly chunks. A retrieval model scores these units against the request, and a method called Maximal Marginal Relevance (MMR) keeps the picks varied so near-duplicates don't crowd out other interests. Retrieved entries then feed the ranking models as extra features. During training, older examples are retrieved and replayed in a second pass so the model doesn't forget them. Indexing happens ahead of time, off the latency-critical path.
Why it was built this way: Reading a full history costs more as it grows, and ad ranking has a tight time budget. Compact stored representations, nearest-neighbor search and weekly chunks keep the cost down. Meta reports about 1% more ad clicks in production and 5 to 10 times better compute efficiency than simply feeding in longer histories.
Limits: All numbers come from Meta. The post does not give the history length, the retriever design, the vector database, latency or confidence intervals. Compression and weekly chunks may lose fine detail.
New to this? The key idea
Retrieval means fetching only the pieces you need from a big pile, like pulling three relevant pages from a library instead of reading every book. Meta applies the same trick that chatbots use to look up documents, but to a person's past activity.
Use it at work
Use it for: Anyone building recommendation, search or personalization systems with long user logs. The post shows that retrieving selectively can beat feeding in everything.
Copy this: Treat user history as a searchable index. Chunk it by time and topic, retrieve per request, add a diversity rule such as MMR so results don't repeat, and build the index before requests arrive. Replay older training examples to reduce forgetting.
Before you roll it out: Meta published no code, so you would build your own index and retriever. The figures are self-reported and the setup is specific to Meta's ads systems.
Summaries are written by AI from the linked source. Always check the original.