AI
New technique accelerates constrained AI decoding for video recommendations at scale
Researchers have developed STATIC, a method that uses sparse matrix operations to enable large language models to generate recommendations while respecting business rules on GPUs and TPUs.
Generative retrieval—using large language models to power recommendation systems—offers new possibilities for finding and suggesting content. Yet production systems often need to enforce constraints: freshness requirements, category restrictions, or other business rules that limit which items can be recommended in any given scenario. Standard LLM decoding cannot handle these restrictions efficiently, and existing workarounds tend to slow down inference significantly on hardware accelerators.
The challenge of constrained generation#
Generative retrieval systems built on LLMs typically guide output through prefix trees (Tries), which map permissible recommendation tokens and enforce valid suggestions at each decoding step. However, traversing these tree structures on GPUs and TPUs creates irregular memory access patterns that hardware accelerators handle poorly, introducing substantial latency penalties that can make production deployment impractical.
How STATIC works#
Researchers introduced STATIC (Sparse Transition Matrix-Accelerated Trie Index for Constrained Decoding), which reimagines the prefix tree as a static Compressed Sparse Row matrix. By converting irregular tree traversals into fully vectorized sparse matrix operations, STATIC transforms a computation poorly suited to modern hardware into one that leverages accelerator parallelism effectively.
The result is dramatic: in production testing on a large-scale video recommendation platform, STATIC added only 0.033 milliseconds of overhead per decoding step—just 0.25% of total inference time. When benchmarked against alternatives, it achieved 948x speedup over CPU-based trie implementations and 47–1033x speedup over hardware-accelerated binary-search baselines.
Production impact and cold-start gains#
STATIC has been deployed on an industrial video recommendation system serving billions of users. The method not only delivers minimal latency overhead across a wide range of real-world configurations but also shows meaningful improvements in cold-start recommendation scenarios on academic benchmarks. Researchers believe this represents the first production-scale deployment of constrained generative retrieval that meets the stringent performance requirements of large-scale systems.
Research code is publicly available for further exploration and adoption.

