Prompt engineering for developers
Key Takeaways
The video discusses prompt engineering for developers, focusing on techniques to improve the quality of responses from generative AI models, including Persona, task, and context, few-shot and multi-shot prompting, and Chain of Thought prompting.
Full Transcript
I have built a gen AI application on cloud run but it doesn't produce the results I expect your problems may need tuning let Ryan and I show you [Music] how it's so good to have you back on serus Expeditions again land and Ryan we are happy to be here Martin what uh Google team are you guys on we are customer Solutions Engineers based in Google Singapore office our job is to drive technical Innovation and deploy customized AI Solutions in advertising sales cool as part of our job we teach a workshop on how to write effective promt for AI applications just what I need I've built an application for an online store the application helps customer service reps deal with emails coming in from customers but it isn't very helpful what is your current problem here's an example email from a customer of the online store and I want the llm to help the customer service rep with it and here is the prompt uh that my software sends to the llm and here is a typical reply for the llm uh there's a lot about why the customer is disappointed and frustrated but this reply from the llm does not help the customer service reps deal with the customer email to have a better response from the llm here's the trick be specific and provide sufficient context in our Workshop we teach three ways to make your proms better they are one Persona task and context two one F and multi-shot and three Shanel thought let's apply each of those your application all right sounds great uh tell me more about the first one uh Persona task context let about each one of those first you'll get better results if you tell the llm what Persona it should adop shaping its communication style and output this could be like you are a helpful customer support agent got it and what does task mean you need to tell the llm what to do exactly this might be a good description of the task you are trying to achieve I see and then uh context context provides the specific background for the task it equips the AI to generate relevant responses tailor to the situation for example you could describe a goal or a metric it might look like this all right so you gave me good texts for Persona task and context H do I just add that to the prompt if you're going to use them over and over again you can add them to a system prompt the llm will be guided by the system prompt and your regular prompts afterwards if you fit the into the llm you will get a more Health response excellent that is a better result next on your list was one few multi-shot yeah shot here means examples if you need the a to gener response in a certain structure you would need to give examples to guide the L for example if I need the L to follow this particular format for sentiment analysis I would write an example input and an examp output and include them in the system instruction as you can see here the generate response is very similar to my example the first sentence explains the overall sentiment of the email and the second sentence explained with words or phrases from the email that convey that sentiment got it another popular use case for multi-shop prompting is to format the response to certain data type for example Jason this format can make it easier for people to understand it can also make it easier for other application to process the response for example we can ask the a to provide output in Json format by updating the system prompt yeah Json format would actually make it easier for my application to process the llms response yeah if we use a system prompt with your customer email we may get this response with a shorter and easier for other software to par and now we can feed the a multiple emails at one time and get them back as a list in Json I like that uh the last item on your list was Chain of Thought I've heard that term before but I don't know what it means typically when you're training a new cork in a task it often helps to divide the work into steps LMS can also use the same kind of support to improve their accuracy and what might that look like in my application here's one way of doing it you tell the llm to think about the customer's core request their tone and how to show empathy with them when responding after getting a better understanding of the customer let the LM decide on the most helpful action to take and what tone to adapt finally if you're telling the llm to check for clarity in spense and those Chain of Thought instructions would be added to the system prompt that's right if you do that and feed the customer email to the llm we get this back the llm formatted each reply as ajacent and it propos a response email I like how it proposes a response email my application could show that to the customer service representative so they could edit it and send it back to the customer and my application could also let the customer service view the reasoning if needed this would really help them do a better job and faster when I work with Cloud customers I often see them using AI to help their employees an llm can be a powerful tool if it's inte integrated with an employees regular applications and processes I agree computers and people can accomplish a lot if they work together all right let's recap how do I create a better prompt first apply Persona task and context to your prompt tell the L what Persona it should adopt then tell the L what to do this is Task and then give LM the context for example by describing a goal or a metric next is one few and multi-shot often we want a specific format to the response for example we can ask the a to provide output in Json format we would do it by including the examples in assistant BR and then there CH of thought think of L as a new coworker who needs you to break down their work in simple steps ultimately the more information we provide the better equi the AI is to understand our intent and generate a more daad response thank you for showing us this Lon Ryan and now I should go back and update the prompt in my application thanks for having me Martin it was great to be here and thank you everyone for watching if you have questions for Lan Ryan or me please add them to the comment section also let me know if there are any other servus topics you'd like to hear about in future episodes I read every single comment until next time time [Music]
Original Description
Are you using chatbots and receiving high quality responses? It may be your prompt that is affecting the chatbot’s response. Take your generative AI skills to the next level by improving your prompts. Watch along and learn how to unlock more accurate and relevant responses from generative AI with chain of thought, few-shot, and multi-shot prompting techniques.
Chapters:
0:00 - Intro
0:47 - Inexperienced prompting
1:37 - Effective prompt techniques
3:06 - One-shot & few-shot prompts
4:31 - Chain of thought prompting
6:10 - Conclusion
Watch more Serverless Expeditions → https://goo.gle/ServerlessExpeditions
Subscribe to Google Cloud Tech → https://goo.gle/GoogleCloudTech
#ServerlessExpeditions #GoogleCloud
Speaker: Martin Omander, Lan Tran, Ryan Sibbaluca
Products Mentioned: Cloud Run, Gemini
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Google Cloud Tech · Google Cloud Tech · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
I’m going for it #GoogleCloudCertified
Google Cloud Tech
I had to get #GoogleCloudCertified
Google Cloud Tech
Be better overall at what you do #GoogleCloudCertified
Google Cloud Tech
Cloud Monitoring on our radar #Analysis #Uptime
Google Cloud Tech
Introduction to Generative AI Studio
Google Cloud Tech
How to use Github Actions with Google's Workload Identity Federation
Google Cloud Tech
Introduction to Responsible AI
Google Cloud Tech
Networking updates and CDMC-certified architecture
Google Cloud Tech
Create and use a Cloud Storage bucket
Google Cloud Tech
How to digitize text from documents
Google Cloud Tech
Faster analytical queries with AlloyDB
Google Cloud Tech
Next ‘23 sessions and FaaS Wave
Google Cloud Tech
Introduction to Assured Open Source Software
Google Cloud Tech
BigQuery Cost Optimization: Storage
Google Cloud Tech
BigQuery Cost Optimization: Compute
Google Cloud Tech
BigQuery Cost Optimization: Select Queries
Google Cloud Tech
Remote Field Equipment Management with Manufacturing Data Engine
Google Cloud Tech
Supercharging your applications with Cloud SQL Enterprise Plus
Google Cloud Tech
Vector Support on our radar #GenAI
Google Cloud Tech
Architecting a blockchain startup with Google Cloud
Google Cloud Tech
Kubernetes and multitasking updates!
Google Cloud Tech
GKE: Using Kubernetes Events
Google Cloud Tech
How to configure firewall rules for Cloud Composer
Google Cloud Tech
Vertex AI Embeddings API + Matching Engine: Grounding LLMs made easy
Google Cloud Tech
Geospatial analytics on our radar #EarthEngine #BigQuery
Google Cloud Tech
Ensuring requests are set in Kubernetes
Google Cloud Tech
Cloud Next 2023, Google research program, and more!
Google Cloud Tech
How to migrate projects between organizations with Resource Manager
Google Cloud Tech
How to run #MySQL in Google Cloud
Google Cloud Tech
#GenerativeAI for enterprises and #Next2023
Google Cloud Tech
How Google Photos scales to store 4 trillion photos and videos
Google Cloud Tech
Google Cross-Cloud Interconnect (Demo 2)
Google Cloud Tech
GKE Cost Optimization Golden Signals: Introduction
Google Cloud Tech
GKE Cost Optimization Golden Signals: Workload Rightsizing
Google Cloud Tech
GKE Load Balancing: Overview
Google Cloud Tech
GKE Load Balancing: Best Practices
Google Cloud Tech
Disaster Recovery in GKE
Google Cloud Tech
How to configure IP masquerade agent in GKE Standard clusters
Google Cloud Tech
Enable and use GKE Control plane logs
Google Cloud Tech
Compliance in Australia with Assured Workloads
Google Cloud Tech
Creating budgets and budget alerts in Google Cloud #FinOps
Google Cloud Tech
Cloud SQL Enterprise Plus on our radar #mySQL
Google Cloud Tech
What's Next for Google Cloud?
Google Cloud Tech
How Loveholidays scaled with Contact Center AI
Google Cloud Tech
What is fleet team management in GKE?
Google Cloud Tech
Troubleshoot VPC Network Peering
Google Cloud Tech
Introduction to DocAI and Contact Center AI
Google Cloud Tech
Cloud Run Direct VPC egress explained
Google Cloud Tech
Database deployment options in GKE
Google Cloud Tech
Analyze cloud billing data with #BigQuery
Google Cloud Tech
Tips to becoming a world-class Prompt Engineer
Google Cloud Tech
Serverless is simple. Do I need CI/CD?
Google Cloud Tech
Accelerating model deployment with MLOps
Google Cloud Tech
How Hawaii's Department of Human Services scaled with CCAI
Google Cloud Tech
Pricing API on our #Radar
Google Cloud Tech
How Recommendations AI for Media can boost customer retention
Google Cloud Tech
Troubleshooting: Node Not Ready Status
Google Cloud Tech
One weekend until Cloud Next 2023!
Google Cloud Tech
#GoogleCloudNext starts tomorrow!
Google Cloud Tech
#GoogleCloudNext will be demand!
Google Cloud Tech
More on: Prompt Craft
View skill →Related AI Lessons
⚡
⚡
⚡
⚡
5 prompt engineering techniques to get the best out of a legacy project
Dev.to · Marco Coelho
The Real Reason Prompt Engineering Isn't Going Away
Dev.to AI
Common Prompt Engineering Mistakes and How to Avoid Them
Medium · ChatGPT
Day 5: Prompt Engineering Basics (For DevOps & Cloud Engineers)
Medium · AI
Chapters (6)
Intro
0:47
Inexperienced prompting
1:37
Effective prompt techniques
3:06
One-shot & few-shot prompts
4:31
Chain of thought prompting
6:10
Conclusion
🎓
Tutor Explanation
DeepCamp AI