
Posted by Wei Wei, Developer Advocate
as ‘public preview’ so that many developers can start building apps with it. While PaLM API already has excellent documentation on its to learn about building a fullstack movie recommendation system using TensorFlow and Flutter.
![]() |
We will discuss how LLMs can be incorporated into this retrieval-ranking pipeline.
Conversational recommendations
If you already have access to with minimal effort:
prompt = """You are a movie recommender and your job is to recommend new movies based on user input. |
The PaLM API also allows you to help your user continue the exploration and interactively refine the recommendations (e.g., asking to swap The Florida Project for another one) in a dialogue, which is what ) to achieve this. But now with the power of LLMs, you can also do this with the with 4 movies that have been watched and asks the PaLM API to generate new recommendations based on the sequence of past movies.
Rating predictions
In the ranking phase of modern recommendation engines, a list of candidates needs to be sorted based on certain criteria. This is usually done by using a learning-to-rank library (such as, ’. You can even leverage the PaLM API to do , if you adjust the prompt accordingly.
For a more comprehensive study on rating prediction with LLMs, you can refer to this can help you out in this case. The basic idea is to embed text associated with your items (for example, product description, movie plot) into vectors and use / with all news articles using the pre-computed embeddings, and then identifies 5 news articles most similar to what your user is reading.
This approach is often a quick and effective way to generate candidates and create recommendations based on item similarities. It may be sufficient for many use cases and can be particularly useful in the could be a helpful augment for the retrieval stage in your existing recommendation system.
![]() |
Text embeddings as side features
In addition, you could also use the text embeddings as side features in a recommendation model. The text embeddings capture the semantic information of the candidate items via the description text and can potentially help improve the model accuracy. For example, in this layer with the movie plot embedding matrix and then stacking a fully connected layer on top of it to project it down to fewer dimensions.
Conclusion
We have shared several ideas on leveraging LLMs to augment recommenders. Obviously, this is just scratching the surface as there are more not covered here. Also note that there may still be a long way before they can make it into production (i.e., latency and cost issues). But we hope this blog inspires you to start thinking about how you can improve your own recommendation systems with LLMs.
Lastly, we are holding an online Developer Summit on Recommendation Systems on June 9, 2023. If you want to learn more about Google products related to building recommendation systems, feel free to sign up here to attend.


SOCIAL SHARE CARD GENERATOR