SlideShare a Scribd company logo
Zero Shot Recommenders,
LLMs and Prompt Engineering
PRS Workshop, Net
fl
ix, 2023
June 9th, 2023
Hao Ding (haodin haoding2019 ) and Anoop Deoras (adeoras )
AWS AI, Amazon
1
Towards Building Foundation Models in Recommender Systems
Our Mission at AWS
Put Machine Learning in the Hands of Every Developer
2
The AWS ML Stack
Broadest and Most Complete Set of ML Capabilities
GenAI
NEW
Bedrock
CodeWhisperer
3
Amazon Personalize
Who are we in a nutshell ?
• Customers can elevate the user experience with ML-powered personalization
• We cater to many thousands of customers from many diverse domains
• Such as: Retail, News and Media, Video on Demand, Travel and Hospitality, ..
• We provide recommendations that respond in real-time to changing user behavior
• In short, we provide the concierge service for all things personalization
4
Amazon Personalize
Who are we in a nutshell ?
5
Customer Obsessed Science
Applied Research at AWS AI
• Constantly innovating on behalf of the customers
• Amazon fundamentally believes that scienti
fi
c innovation is essential to being the most customer-
centric company in the world
• Science at Amazon enables new customer experiences, addresses existing customer pain points,
complements engineering and product disciplines.
6
3 Anchors for the Discussion Today
ColdStart, Foundation Models in RecSys and LLMs
• Cold Start Problems in Recommender Systems
• Foundation Models in Recommender Systems
• Role Large Language Models (LLMs) can play in Recommender Systems
7
3 Cold Start Problems in Recommender System
• Cold Users: Users during inference are unseen during training and model needs to generalize
• Cold Items: New items get introduced to catalogue
• Cold Domains: Target data available only for inference. No Models can be built.
• Less extreme case: Domains with very little training data / less frequent training cadence
• Performance of RecSys relies heavily on the amount of training data available
8
Foundation Models in Recommender Systems
Why should we talk about them ?
• De
fi
nition of a Foundation Model: A model trained on broad data that can be adapted to a wide range of
downstream tasks.
• Why Foundation Models in RecSys? Two main selling points:
• They encode “world knowledge”, thus complementary to models on domain’s behavioral data
• LLM Foundation Models’ interactive nature can potentially help with explaining away the recommendations
9
Two Approaches for Building Foundation Models
RecSys from Other Domains, Large Language Models
• We will talk about 2 research e
ff
ort
• ZeroShot Learning: Can we leverage the knowledge in one domain to kick start a
recommendation in a completely di
ff
erent domain
• ZeroShot Inference: We will further assume that we have no source domain to rely on. How can
we kick start a recommendation with large language models
10
ZeroShot Learning
Kind of Like Domain Adaptation but with zero User/Item overlap
11
The Status-Quo
Collaborative Filtering, Item IDs and their Embeddings
• Current RecSys models learn item ID embeddings through interactions
• Item ID Embeddings are parameters of your neural network and we learn them via BackProp
• These embeddings are indexed by categorical domain speci
fi
c item ID
• These are transductional and not generalizable to unseen items
12
Concept of Universal Item Embeddings
Collaborative Filtering, Item IDs and their Embeddings
• The idea behind universal item embeddings is to tap into item’s content information.
• e.g. Natural Language product description / movie synopsis etc
• Strong NLP models are used to obtain continuous universal item representations
• Universal user representations can then be built on top of these universal item representations.
13
Introducing ZESRec [1]
Zero Shot Recommender System
[1] “Zero Shot Recommender Systems”, Hao Ding, Anoop Deoras, Yuyang Wang, Hao Wang. ICLR Workshop 2022
• ZESRec learns the universal item embeddings based on domain-agnostic generic features — text;
• ZESRec adopts sequential recommenders which generates the universal user embeddings
14
We want to ask 2 questions about ZESRec
Relevance, Lead Time
• How relevant are ZESRec recommendations compared to a fully trained systems ?
• How much in domain data is needed to outperform ZESRec
• How much is the lead time ?
15
High Level Approach
ZESRec Training
SEQ
SEQ
SEQ
… User Universal
Embedding
1-Layer NN
Pretrained BERT
Model
X
1-Layer NN
Pretrained BERT
Model
…
0.36
0.29
…
0.09
0.02
Prediction
Score
Item Universal
Embedding
Pretrained BERT
Model
1-Layer NN
Item Universal
Embedding
Pretrained BERT
Model
1-Layer NN
Item Universal
Embedding
Item Universal
Embedding
Item Universal
Embedding
…
…
Latent Item
Offset Vector
+
Latent Item
Offset Vector
+
Latent Item
Offset Vector
+
Latent Item
Offset Vector
… Latent Item
Offset Vector
+
+
Latent User
Offset Vector
16
High Level Approach
ZESRec Inference
SEQ
SEQ
SEQ
… User Universal
Embedding
1-Layer NN
Pretrained BERT
Model
X
1-Layer NN
Pretrained BERT
Model
…
0.36
0.29
…
0.09
0.02
Prediction
Score
Item Universal
Embedding
Pretrained BERT
Model
1-Layer NN
Item Universal
Embedding
Pretrained BERT
Model
1-Layer NN
Item Universal
Embedding
Item Universal
Embedding
Item Universal
Embedding
…
…
17
Results
Efficacy
18
Results
How long before In-Domain Model Takes over ?
19
10K 10K
5K
5K
2.5K 2.5K
0
0
Number of Interactions Number of Interactions
0.04
0.02
0
0.04
0.02
0
0.06
0.08
Recall@20 Recall@20
MIND dataset
Amazon dataset
ZeroShot Inference
No reference recommender system at hand
20
From ZeroShot Learning to ZeroShot Inference
Task and Limitations
• Now lets imagine we don’t have the luxury of even having any source domain RecSys
• How realistic this assumption is ? Answer: Quite Realistic (startups, new business lines ..)
• What can we do ?
• There is no learning part left for ZeroShot Learning
• We need to resort to ZeroShot Inference
21
LLM Foundation Models to the rescue
Can we kick start recommendations using Large Language Models ?
• Pre-trained language models such as BERT and GPT learn general text representations
• They encode “world knowledge”
• Question we want to ask: Can we leverage these powerful LLMs as recommender systems
• Use prompts to reformulate session based recommendation task
22
Introducing LMRecSys[3]
Converting user’s interaction history into a text inquiry — Prompts
science fiction film directed by Peter Weir. The screenplay by Andrew Nicole was
adapted from Nicole’s 1997 novel of the same name. The film tells the story of
Truman Burbank, a man who is unwittingly placed in a televised reality show that
broadcasts every aspect of his life without his knowledge.
A user watched Jaws, Saving Private Ryan, The Good, the Bad, and the Ugly, Run Lola
Run, Goldfinger. Now the user may want to watch something funny and light-hearted
comfort him after having seen some horrors.
Knowledge
Reasoning
J1-Jumbo
Large Pre-trained Language
Model
(178B Parameters)
Bolded texts are generated by the
model.
A user watched Jaws, Saving Private Ryan, The Good, the Bad, and the Ugly, Run Lola Run, Goldfinger.
Now the user may want to watch __ __ __
p(d(xt)| f([d(x1), . . . , d(xt−1)]))
Item 372 Item 168 Item 413 Item 77 Item 952
p(xt |x1, . . . , xt−1)
Item 1
Item 2
Item N
…
Recommended Item
Token 1
Token 2
Token V
…
Token 1
Token 2
Token V
…
Token 1
Token 2
Token V
…
Item 1
Item 2
Item N
…
Recommended Item
Predicted Token Distributions from Language Models
Enable zero-shot recommendation
Improve data efficiency
Goal
GRU4Rec
Traditional Recommender System
LMRecSys
PLMs as Recommender System
[3] “Language Models as Recommender Systems: Evaluations and Limitations”,
Yuhui Zhang, Hao Ding, Zeren Shui, Yifei Ma, James Zou, Anoop Deoras, Hao Wang. NeurIPS Workshop 2021
23
Generation OR Multi-Token Inference
Answering the question of how to be faithful to one’s catalogue
• Sequence of item ID can be mapped to a long prompt
• How do we obtain ranked list of next item recommendation ?
• Generation of free form text — Need to be careful with Hallucination
• Probability Assignment on available catalogue
24
A Few Open Questions
Linguistic & Seq. Length Biases, Scales of LM and Creative Prompts
• Multi-Token Inference: Length normalization is important. Recommendations highly sensitive to
inference methods.
• Linguistic Biases Disentanglement: Item names need not be
fl
uent English.
• Scales of Language Models: Model size has signi
fi
cant impact on performance and latency
• Prompt Engineering: Its important to design the right prompts
25
Some Results
Experiments, Setup and Observations
26
ML 1M
The world after ChatGPT
Unleashing the immense power of Large Language Models
27
Recent Advances in Merging LLMs with RecSys
FineTuning an LLM
M6-Rec[5]:
P5[4]: designed a text to text
fi
ne-tuning
paradigm based on the pre-trained T5.
[4] “Recommendation as language processing (rlp): A uni
fi
ed pretrain, personalized prompt & predict paradigm (p5)”,
Geng Shijie et.al.. RecSys 2022
[5] “M6-Rec: Generative Pretrained Language Models are Open-Ended Recommender Systems”,
Zeyu Cui et.al.. ArXiv 2022
28
Recent Advances in Merging LLMs with RecSys
Inference with LLM
[6] "Zero-Shot Next-Item Recommendation using Large Pretrained Language Models." Wang, Lei, and Ee-Peng Lim. ArXiv 2023.
[7] “Chat-REC: Towards Interactive and Explainable LLMs-Augmented Recommender System”, Yunfan Gao et.al. ArXiv 2023
Zeyu Cui et.al.. ArXiv 2022
• NIR [6], Chat-REC[7] and [8] propose to directly recommend using LLMs — Inference only.
• Most e
ff
ort spent around “Prompt Engineering”
• Optimal encoding of user context in the prompts
• “Out of Vocabulary” problems solved using techniques such as candidate pools, text-matching
• Mixed success. Still a long way to go.
[8] “Is ChatGPT a Good Recommender? A Preliminary Study ”, Junling Liu et.al. ArXiv 2023
Concluding Remarks
• With the goal of building foundation models in RecSys, our e
ff
orts have been made in two directions:
• Extract Knowledge from data in similar domains
• Use Generic World Knowledge
• We believe, the ultimate path is the hybrid of both: ZESRec + LMRecSys
30
Thank you
Happy to take questions now
31

More Related Content

What's hot

Generative AI at the edge.pdf
Generative AI at the edge.pdfGenerative AI at the edge.pdf
Generative AI at the edge.pdf
Qualcomm Research
 
Generative-AI-in-enterprise-20230615.pdf
Generative-AI-in-enterprise-20230615.pdfGenerative-AI-in-enterprise-20230615.pdf
Generative-AI-in-enterprise-20230615.pdf
Liming Zhu
 
Use MLflow to manage and deploy Machine Learning model on Spark
Use MLflow to manage and deploy Machine Learning model on Spark Use MLflow to manage and deploy Machine Learning model on Spark
Use MLflow to manage and deploy Machine Learning model on Spark
Herman Wu
 
Episode 2: The LLM / GPT / AI Prompt / Data Engineer Roadmap
Episode 2: The LLM / GPT / AI Prompt / Data Engineer RoadmapEpisode 2: The LLM / GPT / AI Prompt / Data Engineer Roadmap
Episode 2: The LLM / GPT / AI Prompt / Data Engineer Roadmap
Anant Corporation
 
Cavalry Ventures | Deep Dive: Generative AI
Cavalry Ventures | Deep Dive: Generative AICavalry Ventures | Deep Dive: Generative AI
Cavalry Ventures | Deep Dive: Generative AI
Cavalry Ventures
 
Generative AI, WiDS 2023.pptx
Generative AI, WiDS 2023.pptxGenerative AI, WiDS 2023.pptx
Generative AI, WiDS 2023.pptx
Colleen Farrelly
 
AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...
AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...
AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...
DianaGray10
 
An Introduction to Generative AI - May 18, 2023
An Introduction  to Generative AI - May 18, 2023An Introduction  to Generative AI - May 18, 2023
An Introduction to Generative AI - May 18, 2023
CoriFaklaris1
 
The Future of AI is Generative not Discriminative 5/26/2021
The Future of AI is Generative not Discriminative 5/26/2021The Future of AI is Generative not Discriminative 5/26/2021
The Future of AI is Generative not Discriminative 5/26/2021
Steve Omohundro
 
Customizing LLMs
Customizing LLMsCustomizing LLMs
Customizing LLMs
Jim Steele
 
Regulating Generative AI - LLMOps pipelines with Transparency
Regulating Generative AI - LLMOps pipelines with TransparencyRegulating Generative AI - LLMOps pipelines with Transparency
Regulating Generative AI - LLMOps pipelines with Transparency
Debmalya Biswas
 
Building NLP applications with Transformers
Building NLP applications with TransformersBuilding NLP applications with Transformers
Building NLP applications with Transformers
Julien SIMON
 
Large Language Models, No-Code, and Responsible AI - Trends in Applied NLP in...
Large Language Models, No-Code, and Responsible AI - Trends in Applied NLP in...Large Language Models, No-Code, and Responsible AI - Trends in Applied NLP in...
Large Language Models, No-Code, and Responsible AI - Trends in Applied NLP in...
David Talby
 
Leveraging Generative AI & Best practices
Leveraging Generative AI & Best practicesLeveraging Generative AI & Best practices
Leveraging Generative AI & Best practices
DianaGray10
 
Using the power of Generative AI at scale
Using the power of Generative AI at scaleUsing the power of Generative AI at scale
Using the power of Generative AI at scale
Maxim Salnikov
 
Generative AI
Generative AIGenerative AI
Generative AI
lutzsuarnaba1
 
The Rise of the LLMs - How I Learned to Stop Worrying & Love the GPT!
The Rise of the LLMs - How I Learned to Stop Worrying & Love the GPT!The Rise of the LLMs - How I Learned to Stop Worrying & Love the GPT!
The Rise of the LLMs - How I Learned to Stop Worrying & Love the GPT!
taozen
 
Transformers, LLMs, and the Possibility of AGI
Transformers, LLMs, and the Possibility of AGITransformers, LLMs, and the Possibility of AGI
Transformers, LLMs, and the Possibility of AGI
SynaptonIncorporated
 
Machine Learning
Machine LearningMachine Learning
Machine Learning
Vivek Garg
 
LLMs_talk_March23.pdf
LLMs_talk_March23.pdfLLMs_talk_March23.pdf
LLMs_talk_March23.pdf
ChaoYang81
 

What's hot (20)

Generative AI at the edge.pdf
Generative AI at the edge.pdfGenerative AI at the edge.pdf
Generative AI at the edge.pdf
 
Generative-AI-in-enterprise-20230615.pdf
Generative-AI-in-enterprise-20230615.pdfGenerative-AI-in-enterprise-20230615.pdf
Generative-AI-in-enterprise-20230615.pdf
 
Use MLflow to manage and deploy Machine Learning model on Spark
Use MLflow to manage and deploy Machine Learning model on Spark Use MLflow to manage and deploy Machine Learning model on Spark
Use MLflow to manage and deploy Machine Learning model on Spark
 
Episode 2: The LLM / GPT / AI Prompt / Data Engineer Roadmap
Episode 2: The LLM / GPT / AI Prompt / Data Engineer RoadmapEpisode 2: The LLM / GPT / AI Prompt / Data Engineer Roadmap
Episode 2: The LLM / GPT / AI Prompt / Data Engineer Roadmap
 
Cavalry Ventures | Deep Dive: Generative AI
Cavalry Ventures | Deep Dive: Generative AICavalry Ventures | Deep Dive: Generative AI
Cavalry Ventures | Deep Dive: Generative AI
 
Generative AI, WiDS 2023.pptx
Generative AI, WiDS 2023.pptxGenerative AI, WiDS 2023.pptx
Generative AI, WiDS 2023.pptx
 
AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...
AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...
AI and ML Series - Leveraging Generative AI and LLMs Using the UiPath Platfor...
 
An Introduction to Generative AI - May 18, 2023
An Introduction  to Generative AI - May 18, 2023An Introduction  to Generative AI - May 18, 2023
An Introduction to Generative AI - May 18, 2023
 
The Future of AI is Generative not Discriminative 5/26/2021
The Future of AI is Generative not Discriminative 5/26/2021The Future of AI is Generative not Discriminative 5/26/2021
The Future of AI is Generative not Discriminative 5/26/2021
 
Customizing LLMs
Customizing LLMsCustomizing LLMs
Customizing LLMs
 
Regulating Generative AI - LLMOps pipelines with Transparency
Regulating Generative AI - LLMOps pipelines with TransparencyRegulating Generative AI - LLMOps pipelines with Transparency
Regulating Generative AI - LLMOps pipelines with Transparency
 
Building NLP applications with Transformers
Building NLP applications with TransformersBuilding NLP applications with Transformers
Building NLP applications with Transformers
 
Large Language Models, No-Code, and Responsible AI - Trends in Applied NLP in...
Large Language Models, No-Code, and Responsible AI - Trends in Applied NLP in...Large Language Models, No-Code, and Responsible AI - Trends in Applied NLP in...
Large Language Models, No-Code, and Responsible AI - Trends in Applied NLP in...
 
Leveraging Generative AI & Best practices
Leveraging Generative AI & Best practicesLeveraging Generative AI & Best practices
Leveraging Generative AI & Best practices
 
Using the power of Generative AI at scale
Using the power of Generative AI at scaleUsing the power of Generative AI at scale
Using the power of Generative AI at scale
 
Generative AI
Generative AIGenerative AI
Generative AI
 
The Rise of the LLMs - How I Learned to Stop Worrying & Love the GPT!
The Rise of the LLMs - How I Learned to Stop Worrying & Love the GPT!The Rise of the LLMs - How I Learned to Stop Worrying & Love the GPT!
The Rise of the LLMs - How I Learned to Stop Worrying & Love the GPT!
 
Transformers, LLMs, and the Possibility of AGI
Transformers, LLMs, and the Possibility of AGITransformers, LLMs, and the Possibility of AGI
Transformers, LLMs, and the Possibility of AGI
 
Machine Learning
Machine LearningMachine Learning
Machine Learning
 
LLMs_talk_March23.pdf
LLMs_talk_March23.pdfLLMs_talk_March23.pdf
LLMs_talk_March23.pdf
 

Similar to Foundation Models in Recommender Systems

Online TechTalk  "Patterns in Embedded SW Design"
Online TechTalk  "Patterns in Embedded SW Design"Online TechTalk  "Patterns in Embedded SW Design"
Online TechTalk  "Patterns in Embedded SW Design"
GlobalLogic Ukraine
 
OWF14 - Big Data : The State of Machine Learning in 2014
OWF14 - Big Data : The State of Machine  Learning in 2014OWF14 - Big Data : The State of Machine  Learning in 2014
OWF14 - Big Data : The State of Machine Learning in 2014
Paris Open Source Summit
 
Tomáš Mikolov - Distributed Representations for NLP
Tomáš Mikolov - Distributed Representations for NLPTomáš Mikolov - Distributed Representations for NLP
Tomáš Mikolov - Distributed Representations for NLP
Machine Learning Prague
 
Conversational commerce: emerging architectures for smart & useful chatbots -...
Conversational commerce: emerging architectures for smart & useful chatbots -...Conversational commerce: emerging architectures for smart & useful chatbots -...
Conversational commerce: emerging architectures for smart & useful chatbots -...
Grid Dynamics
 
Conversational commerce: emerging architectures for smart & useful chatbots -...
Conversational commerce: emerging architectures for smart & useful chatbots -...Conversational commerce: emerging architectures for smart & useful chatbots -...
Conversational commerce: emerging architectures for smart & useful chatbots -...
Grid Dynamics
 
Software Design
Software DesignSoftware Design
Software Design
Ahmed Misbah
 
Design Patterns Summer Course 2009-2010 - Session#1
Design Patterns Summer Course 2009-2010 - Session#1Design Patterns Summer Course 2009-2010 - Session#1
Design Patterns Summer Course 2009-2010 - Session#1Muhamad Hesham
 
Global Azure Bootcamp - ML.NET for developers
Global Azure Bootcamp - ML.NET for developersGlobal Azure Bootcamp - ML.NET for developers
Global Azure Bootcamp - ML.NET for developers
Chris Melinn
 
[246]reasoning, attention and memory toward differentiable reasoning machines
[246]reasoning, attention and memory   toward differentiable reasoning machines[246]reasoning, attention and memory   toward differentiable reasoning machines
[246]reasoning, attention and memory toward differentiable reasoning machines
NAVER D2
 
NLP and Deep Learning for non_experts
NLP and Deep Learning for non_expertsNLP and Deep Learning for non_experts
NLP and Deep Learning for non_experts
Sanghamitra Deb
 
Application of Foundation Model for Autonomous Driving
Application of Foundation Model for Autonomous DrivingApplication of Foundation Model for Autonomous Driving
Application of Foundation Model for Autonomous Driving
Yu Huang
 
Andrii Belas "Modern approaches to working with categorical data in machine l...
Andrii Belas "Modern approaches to working with categorical data in machine l...Andrii Belas "Modern approaches to working with categorical data in machine l...
Andrii Belas "Modern approaches to working with categorical data in machine l...
Lviv Startup Club
 
Multiskill Conversational AI
Multiskill Conversational AIMultiskill Conversational AI
Multiskill Conversational AI
Daniel Kornev
 
Big Data in the Cloud: How the RISElab Enables Computers to Make Intelligent ...
Big Data in the Cloud: How the RISElab Enables Computers to Make Intelligent ...Big Data in the Cloud: How the RISElab Enables Computers to Make Intelligent ...
Big Data in the Cloud: How the RISElab Enables Computers to Make Intelligent ...
Amazon Web Services
 
Keras: A versatile modeling layer for deep learning
Keras: A versatile modeling layer for deep learningKeras: A versatile modeling layer for deep learning
Keras: A versatile modeling layer for deep learning
Dr. Ananth Krishnamoorthy
 
Perception.JS - A Framework for Context Acquisition Processing and Presentation
Perception.JS - A Framework for Context Acquisition Processing and PresentationPerception.JS - A Framework for Context Acquisition Processing and Presentation
Perception.JS - A Framework for Context Acquisition Processing and Presentation
Supun Dissanayake
 
Multiskill Conversational AI
Multiskill Conversational AIMultiskill Conversational AI
Multiskill Conversational AI
Daniel Kornev
 
ChatGPT-and-Generative-AI-Landscape Working of generative ai search
ChatGPT-and-Generative-AI-Landscape Working of generative ai searchChatGPT-and-Generative-AI-Landscape Working of generative ai search
ChatGPT-and-Generative-AI-Landscape Working of generative ai search
rohitcse52
 
Node wild humana deck 2014 12-03
Node wild humana deck 2014 12-03Node wild humana deck 2014 12-03
Node wild humana deck 2014 12-03
bmacwilliams
 
DDD In Agile
DDD In Agile   DDD In Agile
DDD In Agile
Skills Matter
 

Similar to Foundation Models in Recommender Systems (20)

Online TechTalk  "Patterns in Embedded SW Design"
Online TechTalk  "Patterns in Embedded SW Design"Online TechTalk  "Patterns in Embedded SW Design"
Online TechTalk  "Patterns in Embedded SW Design"
 
OWF14 - Big Data : The State of Machine Learning in 2014
OWF14 - Big Data : The State of Machine  Learning in 2014OWF14 - Big Data : The State of Machine  Learning in 2014
OWF14 - Big Data : The State of Machine Learning in 2014
 
Tomáš Mikolov - Distributed Representations for NLP
Tomáš Mikolov - Distributed Representations for NLPTomáš Mikolov - Distributed Representations for NLP
Tomáš Mikolov - Distributed Representations for NLP
 
Conversational commerce: emerging architectures for smart & useful chatbots -...
Conversational commerce: emerging architectures for smart & useful chatbots -...Conversational commerce: emerging architectures for smart & useful chatbots -...
Conversational commerce: emerging architectures for smart & useful chatbots -...
 
Conversational commerce: emerging architectures for smart & useful chatbots -...
Conversational commerce: emerging architectures for smart & useful chatbots -...Conversational commerce: emerging architectures for smart & useful chatbots -...
Conversational commerce: emerging architectures for smart & useful chatbots -...
 
Software Design
Software DesignSoftware Design
Software Design
 
Design Patterns Summer Course 2009-2010 - Session#1
Design Patterns Summer Course 2009-2010 - Session#1Design Patterns Summer Course 2009-2010 - Session#1
Design Patterns Summer Course 2009-2010 - Session#1
 
Global Azure Bootcamp - ML.NET for developers
Global Azure Bootcamp - ML.NET for developersGlobal Azure Bootcamp - ML.NET for developers
Global Azure Bootcamp - ML.NET for developers
 
[246]reasoning, attention and memory toward differentiable reasoning machines
[246]reasoning, attention and memory   toward differentiable reasoning machines[246]reasoning, attention and memory   toward differentiable reasoning machines
[246]reasoning, attention and memory toward differentiable reasoning machines
 
NLP and Deep Learning for non_experts
NLP and Deep Learning for non_expertsNLP and Deep Learning for non_experts
NLP and Deep Learning for non_experts
 
Application of Foundation Model for Autonomous Driving
Application of Foundation Model for Autonomous DrivingApplication of Foundation Model for Autonomous Driving
Application of Foundation Model for Autonomous Driving
 
Andrii Belas "Modern approaches to working with categorical data in machine l...
Andrii Belas "Modern approaches to working with categorical data in machine l...Andrii Belas "Modern approaches to working with categorical data in machine l...
Andrii Belas "Modern approaches to working with categorical data in machine l...
 
Multiskill Conversational AI
Multiskill Conversational AIMultiskill Conversational AI
Multiskill Conversational AI
 
Big Data in the Cloud: How the RISElab Enables Computers to Make Intelligent ...
Big Data in the Cloud: How the RISElab Enables Computers to Make Intelligent ...Big Data in the Cloud: How the RISElab Enables Computers to Make Intelligent ...
Big Data in the Cloud: How the RISElab Enables Computers to Make Intelligent ...
 
Keras: A versatile modeling layer for deep learning
Keras: A versatile modeling layer for deep learningKeras: A versatile modeling layer for deep learning
Keras: A versatile modeling layer for deep learning
 
Perception.JS - A Framework for Context Acquisition Processing and Presentation
Perception.JS - A Framework for Context Acquisition Processing and PresentationPerception.JS - A Framework for Context Acquisition Processing and Presentation
Perception.JS - A Framework for Context Acquisition Processing and Presentation
 
Multiskill Conversational AI
Multiskill Conversational AIMultiskill Conversational AI
Multiskill Conversational AI
 
ChatGPT-and-Generative-AI-Landscape Working of generative ai search
ChatGPT-and-Generative-AI-Landscape Working of generative ai searchChatGPT-and-Generative-AI-Landscape Working of generative ai search
ChatGPT-and-Generative-AI-Landscape Working of generative ai search
 
Node wild humana deck 2014 12-03
Node wild humana deck 2014 12-03Node wild humana deck 2014 12-03
Node wild humana deck 2014 12-03
 
DDD In Agile
DDD In Agile   DDD In Agile
DDD In Agile
 

Recently uploaded

Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
Osamah Alsalih
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
ChristineTorrepenida1
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
Steel & Timber Design according to British Standard
Steel & Timber Design according to British StandardSteel & Timber Design according to British Standard
Steel & Timber Design according to British Standard
AkolbilaEmmanuel1
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
Intella Parts
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
VENKATESHvenky89705
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Christina Lin
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
MdTanvirMahtab2
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
anoopmanoharan2
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
Kamal Acharya
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
gerogepatton
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 

Recently uploaded (20)

Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
MCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdfMCQ Soil mechanics questions (Soil shear strength).pdf
MCQ Soil mechanics questions (Soil shear strength).pdf
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
Steel & Timber Design according to British Standard
Steel & Timber Design according to British StandardSteel & Timber Design according to British Standard
Steel & Timber Design according to British Standard
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Forklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella PartsForklift Classes Overview by Intella Parts
Forklift Classes Overview by Intella Parts
 
road safety engineering r s e unit 3.pdf
road safety engineering  r s e unit 3.pdfroad safety engineering  r s e unit 3.pdf
road safety engineering r s e unit 3.pdf
 
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming PipelinesHarnessing WebAssembly for Real-time Stateless Streaming Pipelines
Harnessing WebAssembly for Real-time Stateless Streaming Pipelines
 
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)
 
PPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testingPPT on GRP pipes manufacturing and testing
PPT on GRP pipes manufacturing and testing
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Water billing management system project report.pdf
Water billing management system project report.pdfWater billing management system project report.pdf
Water billing management system project report.pdf
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Immunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary AttacksImmunizing Image Classifiers Against Localized Adversary Attacks
Immunizing Image Classifiers Against Localized Adversary Attacks
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 

Foundation Models in Recommender Systems

  • 1. Zero Shot Recommenders, LLMs and Prompt Engineering PRS Workshop, Net fl ix, 2023 June 9th, 2023 Hao Ding (haodin haoding2019 ) and Anoop Deoras (adeoras ) AWS AI, Amazon 1 Towards Building Foundation Models in Recommender Systems
  • 2. Our Mission at AWS Put Machine Learning in the Hands of Every Developer 2
  • 3. The AWS ML Stack Broadest and Most Complete Set of ML Capabilities GenAI NEW Bedrock CodeWhisperer 3
  • 4. Amazon Personalize Who are we in a nutshell ? • Customers can elevate the user experience with ML-powered personalization • We cater to many thousands of customers from many diverse domains • Such as: Retail, News and Media, Video on Demand, Travel and Hospitality, .. • We provide recommendations that respond in real-time to changing user behavior • In short, we provide the concierge service for all things personalization 4
  • 5. Amazon Personalize Who are we in a nutshell ? 5
  • 6. Customer Obsessed Science Applied Research at AWS AI • Constantly innovating on behalf of the customers • Amazon fundamentally believes that scienti fi c innovation is essential to being the most customer- centric company in the world • Science at Amazon enables new customer experiences, addresses existing customer pain points, complements engineering and product disciplines. 6
  • 7. 3 Anchors for the Discussion Today ColdStart, Foundation Models in RecSys and LLMs • Cold Start Problems in Recommender Systems • Foundation Models in Recommender Systems • Role Large Language Models (LLMs) can play in Recommender Systems 7
  • 8. 3 Cold Start Problems in Recommender System • Cold Users: Users during inference are unseen during training and model needs to generalize • Cold Items: New items get introduced to catalogue • Cold Domains: Target data available only for inference. No Models can be built. • Less extreme case: Domains with very little training data / less frequent training cadence • Performance of RecSys relies heavily on the amount of training data available 8
  • 9. Foundation Models in Recommender Systems Why should we talk about them ? • De fi nition of a Foundation Model: A model trained on broad data that can be adapted to a wide range of downstream tasks. • Why Foundation Models in RecSys? Two main selling points: • They encode “world knowledge”, thus complementary to models on domain’s behavioral data • LLM Foundation Models’ interactive nature can potentially help with explaining away the recommendations 9
  • 10. Two Approaches for Building Foundation Models RecSys from Other Domains, Large Language Models • We will talk about 2 research e ff ort • ZeroShot Learning: Can we leverage the knowledge in one domain to kick start a recommendation in a completely di ff erent domain • ZeroShot Inference: We will further assume that we have no source domain to rely on. How can we kick start a recommendation with large language models 10
  • 11. ZeroShot Learning Kind of Like Domain Adaptation but with zero User/Item overlap 11
  • 12. The Status-Quo Collaborative Filtering, Item IDs and their Embeddings • Current RecSys models learn item ID embeddings through interactions • Item ID Embeddings are parameters of your neural network and we learn them via BackProp • These embeddings are indexed by categorical domain speci fi c item ID • These are transductional and not generalizable to unseen items 12
  • 13. Concept of Universal Item Embeddings Collaborative Filtering, Item IDs and their Embeddings • The idea behind universal item embeddings is to tap into item’s content information. • e.g. Natural Language product description / movie synopsis etc • Strong NLP models are used to obtain continuous universal item representations • Universal user representations can then be built on top of these universal item representations. 13
  • 14. Introducing ZESRec [1] Zero Shot Recommender System [1] “Zero Shot Recommender Systems”, Hao Ding, Anoop Deoras, Yuyang Wang, Hao Wang. ICLR Workshop 2022 • ZESRec learns the universal item embeddings based on domain-agnostic generic features — text; • ZESRec adopts sequential recommenders which generates the universal user embeddings 14
  • 15. We want to ask 2 questions about ZESRec Relevance, Lead Time • How relevant are ZESRec recommendations compared to a fully trained systems ? • How much in domain data is needed to outperform ZESRec • How much is the lead time ? 15
  • 16. High Level Approach ZESRec Training SEQ SEQ SEQ … User Universal Embedding 1-Layer NN Pretrained BERT Model X 1-Layer NN Pretrained BERT Model … 0.36 0.29 … 0.09 0.02 Prediction Score Item Universal Embedding Pretrained BERT Model 1-Layer NN Item Universal Embedding Pretrained BERT Model 1-Layer NN Item Universal Embedding Item Universal Embedding Item Universal Embedding … … Latent Item Offset Vector + Latent Item Offset Vector + Latent Item Offset Vector + Latent Item Offset Vector … Latent Item Offset Vector + + Latent User Offset Vector 16
  • 17. High Level Approach ZESRec Inference SEQ SEQ SEQ … User Universal Embedding 1-Layer NN Pretrained BERT Model X 1-Layer NN Pretrained BERT Model … 0.36 0.29 … 0.09 0.02 Prediction Score Item Universal Embedding Pretrained BERT Model 1-Layer NN Item Universal Embedding Pretrained BERT Model 1-Layer NN Item Universal Embedding Item Universal Embedding Item Universal Embedding … … 17
  • 19. Results How long before In-Domain Model Takes over ? 19 10K 10K 5K 5K 2.5K 2.5K 0 0 Number of Interactions Number of Interactions 0.04 0.02 0 0.04 0.02 0 0.06 0.08 Recall@20 Recall@20 MIND dataset Amazon dataset
  • 20. ZeroShot Inference No reference recommender system at hand 20
  • 21. From ZeroShot Learning to ZeroShot Inference Task and Limitations • Now lets imagine we don’t have the luxury of even having any source domain RecSys • How realistic this assumption is ? Answer: Quite Realistic (startups, new business lines ..) • What can we do ? • There is no learning part left for ZeroShot Learning • We need to resort to ZeroShot Inference 21
  • 22. LLM Foundation Models to the rescue Can we kick start recommendations using Large Language Models ? • Pre-trained language models such as BERT and GPT learn general text representations • They encode “world knowledge” • Question we want to ask: Can we leverage these powerful LLMs as recommender systems • Use prompts to reformulate session based recommendation task 22
  • 23. Introducing LMRecSys[3] Converting user’s interaction history into a text inquiry — Prompts science fiction film directed by Peter Weir. The screenplay by Andrew Nicole was adapted from Nicole’s 1997 novel of the same name. The film tells the story of Truman Burbank, a man who is unwittingly placed in a televised reality show that broadcasts every aspect of his life without his knowledge. A user watched Jaws, Saving Private Ryan, The Good, the Bad, and the Ugly, Run Lola Run, Goldfinger. Now the user may want to watch something funny and light-hearted comfort him after having seen some horrors. Knowledge Reasoning J1-Jumbo Large Pre-trained Language Model (178B Parameters) Bolded texts are generated by the model. A user watched Jaws, Saving Private Ryan, The Good, the Bad, and the Ugly, Run Lola Run, Goldfinger. Now the user may want to watch __ __ __ p(d(xt)| f([d(x1), . . . , d(xt−1)])) Item 372 Item 168 Item 413 Item 77 Item 952 p(xt |x1, . . . , xt−1) Item 1 Item 2 Item N … Recommended Item Token 1 Token 2 Token V … Token 1 Token 2 Token V … Token 1 Token 2 Token V … Item 1 Item 2 Item N … Recommended Item Predicted Token Distributions from Language Models Enable zero-shot recommendation Improve data efficiency Goal GRU4Rec Traditional Recommender System LMRecSys PLMs as Recommender System [3] “Language Models as Recommender Systems: Evaluations and Limitations”, Yuhui Zhang, Hao Ding, Zeren Shui, Yifei Ma, James Zou, Anoop Deoras, Hao Wang. NeurIPS Workshop 2021 23
  • 24. Generation OR Multi-Token Inference Answering the question of how to be faithful to one’s catalogue • Sequence of item ID can be mapped to a long prompt • How do we obtain ranked list of next item recommendation ? • Generation of free form text — Need to be careful with Hallucination • Probability Assignment on available catalogue 24
  • 25. A Few Open Questions Linguistic & Seq. Length Biases, Scales of LM and Creative Prompts • Multi-Token Inference: Length normalization is important. Recommendations highly sensitive to inference methods. • Linguistic Biases Disentanglement: Item names need not be fl uent English. • Scales of Language Models: Model size has signi fi cant impact on performance and latency • Prompt Engineering: Its important to design the right prompts 25
  • 26. Some Results Experiments, Setup and Observations 26 ML 1M
  • 27. The world after ChatGPT Unleashing the immense power of Large Language Models 27
  • 28. Recent Advances in Merging LLMs with RecSys FineTuning an LLM M6-Rec[5]: P5[4]: designed a text to text fi ne-tuning paradigm based on the pre-trained T5. [4] “Recommendation as language processing (rlp): A uni fi ed pretrain, personalized prompt & predict paradigm (p5)”, Geng Shijie et.al.. RecSys 2022 [5] “M6-Rec: Generative Pretrained Language Models are Open-Ended Recommender Systems”, Zeyu Cui et.al.. ArXiv 2022 28
  • 29. Recent Advances in Merging LLMs with RecSys Inference with LLM [6] "Zero-Shot Next-Item Recommendation using Large Pretrained Language Models." Wang, Lei, and Ee-Peng Lim. ArXiv 2023. [7] “Chat-REC: Towards Interactive and Explainable LLMs-Augmented Recommender System”, Yunfan Gao et.al. ArXiv 2023 Zeyu Cui et.al.. ArXiv 2022 • NIR [6], Chat-REC[7] and [8] propose to directly recommend using LLMs — Inference only. • Most e ff ort spent around “Prompt Engineering” • Optimal encoding of user context in the prompts • “Out of Vocabulary” problems solved using techniques such as candidate pools, text-matching • Mixed success. Still a long way to go. [8] “Is ChatGPT a Good Recommender? A Preliminary Study ”, Junling Liu et.al. ArXiv 2023
  • 30. Concluding Remarks • With the goal of building foundation models in RecSys, our e ff orts have been made in two directions: • Extract Knowledge from data in similar domains • Use Generic World Knowledge • We believe, the ultimate path is the hybrid of both: ZESRec + LMRecSys 30
  • 31. Thank you Happy to take questions now 31