---
title: "Advancing Generative Recommendation Inference: our collaboration with NVIDIA on TensorRT LLM"
description: "Spotify consolidated its LLM-based generative recommendation inference onto TensorRT LLM, working with NVIDIA to add the features it had been splitting across engines. vLLM handled beam search for semantic-ID candidate generation, but its beam search runs outside the core GPU engine and recomputes partially filled KV blocks."
url: "https://swe.quest/articles/advancing-generative-recommendation-inference-our-collaboration-with-nvidia-on-edd2a66abab4a278"
canonical: "https://engineering.atspotify.com/2026/10/advancing-generative-recommendation-inference-our-collaboration-with-nvidia-on-tensorrt-llm/"
source: "Spotify Engineering"
published: "2026-10-16"
difficulty: "hard"
kind: "Case study"
reading_minutes: 7
tags: ["inference","recommendation-systems","llms","cost-optimization"]
---

# Advancing Generative Recommendation Inference: our collaboration with NVIDIA on TensorRT LLM

A post on [Spotify Engineering](https://swe.quest/sources/spotify.md), published 2026-10-16, 7 min read, Case study. Original: [https://engineering.atspotify.com/2026/10/advancing-generative-recommendation-inference-our-collaboration-with-nvidia-on-tensorrt-llm/](https://engineering.atspotify.com/2026/10/advancing-generative-recommendation-inference-our-collaboration-with-nvidia-on-tensorrt-llm/)

## Summary

Spotify consolidated its LLM-based generative recommendation inference onto TensorRT LLM, working with NVIDIA to add the features it had been splitting across engines. vLLM handled beam search for semantic-ID candidate generation, but its beam search runs outside the core GPU engine and recomputes partially filled KV blocks. SGLang supplied multi-item candidate scoring, and personalization came from soft tokens that project existing user embeddings into the LLM's embedding space. The upstream additions were multi-sequence beam search, out-of-tree models for a custom Qwen3 soft-token plugin, embedding injection and multi-item scoring, which cut costs on Qwen3 1.7B by up to 54% for beam search and 7% for scoring.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Inference & serving](https://swe.quest/tags/inference.md) (AI & ML)
- [Recommendations & ranking](https://swe.quest/tags/recommendation-systems.md) (AI & ML)
- [LLMs](https://swe.quest/tags/llms.md) (AI & ML)
- [Cost optimization](https://swe.quest/tags/cost-optimization.md) (Reliability & operations)

## Prerequisites

- LLM inference engines ([easy posts on Inference & serving](https://swe.quest/tags/inference.md?difficulty=easy))
- beam search decoding ([easy posts on Elixir & Erlang](https://swe.quest/tags/elixir-erlang.md?difficulty=easy))
- KV cache ([easy posts on Caching](https://swe.quest/tags/caching.md?difficulty=easy))
- embedding-based recommenders

## Keywords

TensorRT LLM, vLLM, SGLang, Qwen3, beam search, semantic IDs, PLUM, Embedding to Prefix

## Related posts

- [Shopify’s generative discovery model](https://swe.quest/articles/shopify-s-generative-discovery-model-99e5ac502d9a8c68.md): Shopify Engineering · 2026-11-11 · Hard · 12 min read · Recommendations & ranking, Search, LLMs, Inference & serving, Model training
  Shopify trained a single generative model, adapted from an open-weight LLM, that emits semantic-ID tokens to generate product candidates for both personalized search and recommendation across a catalog of billions.
- [Welcome Beam: a 501B open model you can own, customize, and scale](https://swe.quest/articles/welcome-beam-a-501b-open-model-you-can-own-customize-and-scale-4761377efc334b45.md): Hugging Face · 2026-10-16 · Hard · 21 min read · LLMs, Inference & serving, Model training
  Beam is a 501B-parameter mixture-of-experts model from Reflection with 23B active parameters per token, a 1M-token context window, and an Apache 2.0 license, aimed at coding and agentic workloads.
- [From Scoring to Spelling: Rebuilding Ads Retrieval at Instacart](https://swe.quest/articles/from-scoring-to-spelling-rebuilding-ads-retrieval-at-instacart-1eba18ee15c15a7e.md): Instacart Tech · 2026-06-02 · Hard · 13 min read · Recommendations & ranking, Ads, Inference & serving, ML platforms
  Instacart replaced its BERT-based ads retrieval model, which scored every atomic product ID in a fixed vocabulary, with a generative model that autoregressively decodes Semantic IDs (RQ-VAE codeword sequences) via beam search.
- [Bypassing inference bottlenecks: Accelerating complex AI search with Retrieve-for-Train](https://swe.quest/articles/bypassing-inference-bottlenecks-accelerating-complex-ai-search-with-retrieve-95676e43f1ce9cc3.md): Google Research · 2026-09-15 · Hard · 8 min read · Search, Model training, Inference & serving, LLMs, Recommendations & ranking
  Retrieve-for-Train replaces expensive inference-time LLM reasoning for query fan-out with a one-time offline RL stage.
- [Assisted Generation: a new direction toward low-latency text generation](https://swe.quest/articles/assisted-generation-a-new-direction-toward-low-latency-text-generation-46c4fea13508392f.md): Hugging Face · 2023-05-11 · Medium · 12 min read · Inference & serving, LLMs, Performance engineering, Python
  Assisted generation cuts autoregressive LLM latency by letting a much smaller assistant model with the same tokenizer greedily draft candidate tokens, then verifying them all in a single forward pass of the large model.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
