Prompt engineering for developers

Google Cloud Tech · Beginner ·✍️ Prompt Engineering ·1y ago

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 I’m going for it #GoogleCloudCertified
I’m going for it #GoogleCloudCertified
Google Cloud Tech
2 I had to get #GoogleCloudCertified
I had to get #GoogleCloudCertified
Google Cloud Tech
3 Be better overall at what you do #GoogleCloudCertified
Be better overall at what you do #GoogleCloudCertified
Google Cloud Tech
4 Cloud Monitoring on our radar #Analysis #Uptime
Cloud Monitoring on our radar #Analysis #Uptime
Google Cloud Tech
5 Introduction to Generative AI Studio
Introduction to Generative AI Studio
Google Cloud Tech
6 How to use Github Actions with Google's Workload Identity Federation
How to use Github Actions with Google's Workload Identity Federation
Google Cloud Tech
7 Introduction to Responsible AI
Introduction to Responsible AI
Google Cloud Tech
8 Networking updates and CDMC-certified architecture
Networking updates and CDMC-certified architecture
Google Cloud Tech
9 Create and use a Cloud Storage bucket
Create and use a Cloud Storage bucket
Google Cloud Tech
10 How to digitize text from documents
How to digitize text from documents
Google Cloud Tech
11 Faster analytical queries with AlloyDB
Faster analytical queries with AlloyDB
Google Cloud Tech
12 Next ‘23 sessions and FaaS Wave
Next ‘23 sessions and FaaS Wave
Google Cloud Tech
13 Introduction to Assured Open Source Software
Introduction to Assured Open Source Software
Google Cloud Tech
14 BigQuery Cost Optimization: Storage
BigQuery Cost Optimization: Storage
Google Cloud Tech
15 BigQuery Cost Optimization: Compute
BigQuery Cost Optimization: Compute
Google Cloud Tech
16 BigQuery Cost Optimization: Select Queries
BigQuery Cost Optimization: Select Queries
Google Cloud Tech
17 Remote Field Equipment Management with Manufacturing Data Engine
Remote Field Equipment Management with Manufacturing Data Engine
Google Cloud Tech
18 Supercharging your applications with Cloud SQL Enterprise Plus
Supercharging your applications with Cloud SQL Enterprise Plus
Google Cloud Tech
19 Vector Support on our radar #GenAI
Vector Support on our radar #GenAI
Google Cloud Tech
20 Architecting a blockchain startup with Google Cloud
Architecting a blockchain startup with Google Cloud
Google Cloud Tech
21 Kubernetes and multitasking updates!
Kubernetes and multitasking updates!
Google Cloud Tech
22 GKE: Using Kubernetes Events
GKE: Using Kubernetes Events
Google Cloud Tech
23 How to configure firewall rules for Cloud Composer
How to configure firewall rules for Cloud Composer
Google Cloud Tech
24 Vertex AI Embeddings API + Matching Engine: Grounding LLMs made easy
Vertex AI Embeddings API + Matching Engine: Grounding LLMs made easy
Google Cloud Tech
25 Geospatial analytics on our radar #EarthEngine #BigQuery
Geospatial analytics on our radar #EarthEngine #BigQuery
Google Cloud Tech
26 Ensuring requests are set in Kubernetes
Ensuring requests are set in Kubernetes
Google Cloud Tech
27 Cloud Next 2023, Google research program, and more!
Cloud Next 2023, Google research program, and more!
Google Cloud Tech
28 How to migrate projects between organizations with Resource Manager
How to migrate projects between organizations with Resource Manager
Google Cloud Tech
29 How to run #MySQL in Google Cloud
How to run #MySQL in Google Cloud
Google Cloud Tech
30 #GenerativeAI for enterprises and #Next2023
#GenerativeAI for enterprises and #Next2023
Google Cloud Tech
31 How Google Photos scales to store 4 trillion photos and videos
How Google Photos scales to store 4 trillion photos and videos
Google Cloud Tech
32 Google Cross-Cloud Interconnect (Demo 2)
Google Cross-Cloud Interconnect (Demo 2)
Google Cloud Tech
33 GKE Cost Optimization Golden Signals: Introduction
GKE Cost Optimization Golden Signals: Introduction
Google Cloud Tech
34 GKE Cost Optimization Golden Signals: Workload Rightsizing
GKE Cost Optimization Golden Signals: Workload Rightsizing
Google Cloud Tech
35 GKE Load Balancing: Overview
GKE Load Balancing: Overview
Google Cloud Tech
36 GKE Load Balancing: Best Practices
GKE Load Balancing: Best Practices
Google Cloud Tech
37 Disaster Recovery in GKE
Disaster Recovery in GKE
Google Cloud Tech
38 How to configure IP masquerade agent in GKE Standard clusters
How to configure IP masquerade agent in GKE Standard clusters
Google Cloud Tech
39 Enable and use GKE Control plane logs
Enable and use GKE Control plane logs
Google Cloud Tech
40 Compliance in Australia with Assured Workloads
Compliance in Australia with Assured Workloads
Google Cloud Tech
41 Creating budgets and budget alerts in Google Cloud #FinOps
Creating budgets and budget alerts in Google Cloud #FinOps
Google Cloud Tech
42 Cloud SQL Enterprise Plus on our radar #mySQL
Cloud SQL Enterprise Plus on our radar #mySQL
Google Cloud Tech
43 What's Next for Google Cloud?
What's Next for Google Cloud?
Google Cloud Tech
44 How Loveholidays scaled with Contact Center AI
How Loveholidays scaled with Contact Center AI
Google Cloud Tech
45 What is fleet team management in GKE?
What is fleet team management in GKE?
Google Cloud Tech
46 Troubleshoot VPC Network Peering
Troubleshoot VPC Network Peering
Google Cloud Tech
47 Introduction to DocAI and Contact Center AI
Introduction to DocAI and Contact Center AI
Google Cloud Tech
48 Cloud Run Direct VPC egress explained
Cloud Run Direct VPC egress explained
Google Cloud Tech
49 Database deployment options in GKE
Database deployment options in GKE
Google Cloud Tech
50 Analyze cloud billing data with #BigQuery
Analyze cloud billing data with #BigQuery
Google Cloud Tech
51 Tips to becoming a world-class Prompt Engineer
Tips to becoming a world-class Prompt Engineer
Google Cloud Tech
52 Serverless is simple. Do I need CI/CD?
Serverless is simple. Do I need CI/CD?
Google Cloud Tech
53 Accelerating model deployment with MLOps
Accelerating model deployment with MLOps
Google Cloud Tech
54 How Hawaii's Department of Human Services scaled with CCAI
How Hawaii's Department of Human Services scaled with CCAI
Google Cloud Tech
55 Pricing API on our #Radar
Pricing API on our #Radar
Google Cloud Tech
56 How Recommendations AI for Media can boost customer retention
How Recommendations AI for Media can boost customer retention
Google Cloud Tech
57 Troubleshooting: Node Not Ready Status
Troubleshooting: Node Not Ready Status
Google Cloud Tech
58 One weekend until Cloud Next 2023!
One weekend until Cloud Next 2023!
Google Cloud Tech
59 #GoogleCloudNext starts tomorrow!
#GoogleCloudNext starts tomorrow!
Google Cloud Tech
60 #GoogleCloudNext will be demand!
#GoogleCloudNext will be demand!
Google Cloud Tech

This video teaches developers how to improve the quality of responses from generative AI models by using techniques such as Persona, task, and context, few-shot and multi-shot prompting, and Chain of Thought prompting. By applying these techniques, developers can unlock more accurate and relevant responses from generative AI models.

Key Takeaways
  1. Apply Persona, task, and context to prompts
  2. Use few-shot and multi-shot prompting for specific response formats
  3. Use Chain of Thought prompting to break down complex tasks
  4. Update system prompts with new techniques
  5. Test and refine prompts for improved response quality
💡 Providing more information and context to the AI model through effective prompts can significantly improve the quality of responses from generative AI models.

Related AI Lessons

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
Up next
I Built an AI Agent in 6 Minutes (No Code, No Developer)
HubSpot Marketing
Watch →