Problem
A user types a prompt such as "old-school rock ballads to relax" and expects tracks. A common shortcut asks an off-the-shelf LLM to write "artist – title" pairs. Titles say little about mood or style. One song exists in several versions (live, acoustic, remastered), so a title does not name one catalog item. Long titles are generated token by token, which is slow and costly.
Example from the article: for the prompt "Christmas classics", the system should return the iconic holiday tracks, not generic holiday songs.
Solution in brief
Fine-tune a language model to generate short track IDs straight from the prompt (generative retrieval). No title matching is needed. Train it on pairs of playlist title and track ID, with the playlist title standing in for a user prompt. The way IDs are built matters most: IDs derived from collaborative filtering embeddings gave the best hits@10. At inference, a diversified beam search returns a varied set of IDs.
Questions this case answers
- How to retrieve catalog items for a free-text query with a language model that generates compact item identifiers, without a separate title-matching step
- How to represent items as short discrete codes so a generative model learns item similarity from co-occurrence data
- How to recommend items from a free-text prompt when an LLM that writes titles is slow, ambiguous and needs a lookup step?
- How to choose identifiers for catalog items that a fine-tuned language model can generate directly?
Tools and methods
- Generative retrieval — the model outputs item IDs directly instead of titles
- Semantic IDs from collaborative filtering embeddings — short discrete codes where similar tracks share code parts
- Fine-tuned T5-family seq2seq model (Flan-T5 base, per the paper) — maps prompt to track IDs
- Diversified beam search — decoding that trades relevance against diversity
- BM25 and bi-encoders — baselines for comparison
- hits@10 — how often top-10 predictions match expert playlists
Google or a one-time email code. No password.