Prompt Engineering - an Art, a Science, or your next Job Title?

Maxim Salnikov
Maxim SalnikovDeveloper Engagement Lead
Prompt Engineering -
an Art, a Science, or
your next Job Title?
Maxim Salnikov
Developer Productivity Lead
Microsoft
• Building on web platform since 90s
• Organizing developer communities and technical conferences
• Speaking, training, blogging: Webdev, Cloud, OpenAI
Helping developers to succeed with the Cloud & AI technology
I’m Maxim Salnikov
• Generative AI’s impact on productivity could add up to
$4.4 trillion annually in value to the global economy.
• About 75% of the value that generative AI use cases
could deliver falls across customer
operations, marketing, sales, software engineering,
and R&D .
• Generative AI can revolutionize work by automating a
significant portion of employees' activities, up to 60-
70% of their current workload. This augmentation of
individual capabilities has the potential to transform
the way we work.
Artificial Intelligence
1956
Artificial Intelligence
The field of computer science that seeks to create
intelligent machines that can replicate or exceed
human intelligence
Machine Learning
1997
Machine Learning
Subset of AI that enables machines to learn from
existing data and improve upon that data to make
decisions or predictions
Deep Learning
2017
Deep Learning
A machine learning technique in which layers of neural
networks are used to process data and make decisions
Generative AI
2021
Generative AI powered by foundation
models
Create new written, visual, and auditory content given
prompts or existing data
Path to impact and usecases
Source: IDC, IDC PlanScape: Developing Your Path to Impact with Generative AI, #US51157323
Emerging model landscape
• OpenAI's GPT2, ChatGPT, GPT-3, GPT3.5, GPT4.0 (language) DALL-E 2 (image),
and Whisper (speech)
• Stability.ai's Stable Diffusion (image)
• Midjourney (image)
• Google's PaLM, PaLM2, LaMDA, Minerva, UL2, Bard (language), and Imagen
(image)
• Google/DeepMind's Chinchilla, Retro-7B, AlphaCode (language), Flamingo,
and Gato (multimodal)
• Meta's LLaMa, NLLB, OPT-175B, Sparse all-MLP (language), Make-a-Video
(video), and data2vec (multimodal)
• Microsoft's DeepNet (language) and MetaLM (multimodal)
• BigScience's BLOOM (language)
• AI21 Labs' Jurassic-X (language)
• Dolly 2.0 (language)
• …
One common thing…
Prompt Engineering
Process of designing, refining, and
optimizing input prompts to guide a
model toward producing more accurate
outputs while keeping cost efficiency
Prompt anatomy
<
Write a product launch email for new headphones.
This product is AI-powered and priced at $79.99.
The tone is friendly and exciting.
Output as a JSON object with "subject" and "body" fields.
Example:
{
"subject": "Introducing Our New AI-Powered Headphones!",
"body": "We are thrilled to announce the launch of our new AI-
powered headphones"
}
Output:
Instruction
Input data
Context
Target format
Example
Cue
<
Tokens
Prompts and cost efficiency
• Prompt and completion length
• Number of API calls in production
• Number of API calls during development
(experimentation stage)
• Type of deployed model
Model selection strategy: Start with heaviest models and gradually ramp down to cheaper ones
while the result is satisfactory
•
• Tokens can sometimes be counter-intuitive
• Tabular data is space-efficient
Space efficiency
General recommendations
• Be specific
• Order matters
• Double down
• Give the model an “out”
Technical recommendations
• Start with clear instructions and repeat the
instructions at the end
• Add clear syntax: headers, separators
• Break the task down
• Adjust parameters: Temperature and Top
probabilities
Zero-shot VS few-shot prompts
Zero-shot
The model predicts the answer given only a natural language description
of the task.
Few-shot
In addition to the task description, the model sees a few examples of the
task.
Customer question: Hi there, do you know how to choose
flood insurance?​
Classified topic: 2​
Customer question: Hi there, I have a question on my auto insurance.​
Classified topic: 1​
Classify customer's question. Classify between category 1 to 3.
Detailed guidelines for how to choose:
choose 1 if the question is about auto insurance.
choose 2 if the question is about home flood insurance.
choose 3 if the question is not relevant to insurance.
Classify customer's question. Classify between category 1 to 3.
Detailed guidelines for how to choose:
choose 1 if the question is about auto insurance.
choose 2 if the question is about home flood insurance.
choose 3 if the question is not relevant to insurance.
Customer question: {insert new question here}
Classified topic:
Customer question: What packages do you have in auto insurance?
Classified topic:
Zero Shot - Reasoning
Before
What is the annual water demand of a single-family
household containing four people who are at home an
average of 200 days per year and use an average of 100
liters of water per day?
The annual water demand of a single-family household
containing four people who are at home an average of
200 days per year and use an average of 100 liters of
water per day is 8,000,000 liters per year.
After
What is the annual water demand of a single-family
household containing four people who are at home an
average of 200 days per year and use an average of 100
liters of water per day?
Let’s think step by step and explain the calculation
step by step.
Step 1: Calculate the total number of days in a year:
There are 365 days in a year.
Step 2: Calculate the total number of days the family is at home:
The family is at home an average of 200 days per year.
Step 3: Calculate the total water demand of the family:
The family uses an average of 100 liters of water per day. Therefore, the total water
demand of the family is 100 liters x 200 days = 20,000 liters per year.
Step 4: Calculate the annual water demand of the single-family household:
The annual water demand of the single-family household is 20,000 liters per year.
Few Shot Reasoning – Example 1
1st prompt
Roger has 5 tennis balls. He buys 2 more cans of tennis
balls. Each can has 3 tennis balls. How many tennis balls
does he have now?
Answer: The answer is 11.
The cafeteria has 23 apples. If they used 20 to make lunch
and bought 6 more, how many do they have?
The answer is 27
2nd prompt—provide reasoning
Roger has 5 tennis balls. He buys 2 more cans of tennis
balls. Each can has 3 tennis balls. How many tennis balls
does he have now?
Answer: Roger started with 5 balls. 2 cans of 3 tennis balls
each is 6 tennis balls. 5+6 = 11. The answer is 11.
The cafeteria has 23 apples. If they used 20 to make lunch
and bought 6 more, how many do they have?
The cafeteria had 23 apples originally. They used 20 to
make lunch. So they had 23-20 = 3. They bought 6
more apples, so they have 3 + 6 = 9. The answer is 9.
Prompt Chaining
Entity Extraction
Please extract entities from the
following news article: 'The new
iPhone model is set to be released
next month. It has been highly
anticipated by Apple fans and is
expected to feature a larger screen
and improved camera
{'text': 'iPhone', 'type’:
'PRODUCT'}, {'text': 'Apple’,
'type': 'ORGANIZATION'}]
Summarization
Please summarize the information
about the product
[{'text': 'iPhone', 'type': 'PRODUCT'},
{'text': 'Apple', 'type':
'ORGANIZATION’}]
The iPhone is a line of smartphones
designed and marketed by Apple
Inc. These devices combine a
computer, camera, and internet
connectivity in a single device, and
are known for their sleek design and
user-friendly interface.
Sentiment Analysis
Please provide a sentiment for the
following text:
The iPhone is a line of smartphones
designed and marketed by Apple
Inc. These devices combine a
computer, camera, and internet
connectivity in a single device,
and are known for their sleek
design and user-friendly interface.
Positive
Few Shot Reasoning – Example 2
1st prompt—Reason Extraction
On average Joe throws 25 punches per minute.
A fight lasts 5 rounds of 3 minutes. How many
punches did he throw?
Let’s think step by step and explain the calculation
step by step.
In one minute, Joe throws 25 punches.
In three minutes, Joe throws 3 * 25 = 75 punches.
In five rounds, Joe throws 5*75 = 375 punches.
2nd prompt—Answer Extraction
One average Joe throws 25 punches per minute.
A fight lasts 5 rounds of 3 minutes. How many
punches did he throw?
In one minute, Joe throws 25 punches.
In three minutes, Joe throws 3 * 25 = 75 punches.
In five rounds, Joe throws 5*75 = 375 punches.
The cafeteria has 23 apples. If they used 20 to make lunch
and bought 6 more, how many do they have?
Therefore, the answer (Arabic numerals) is
The cafeteria had 23 apples originally. They used 20
to make lunch. So they had 23-20 = 3. They bought 6
more apples, so they have 3 + 6 = 9. The answer is 9.
Prompt Chunking (token limit)
Large Text
Beyond
Token
Limit
Chunks
Please summarize and extract topic: Global warming refers to
the gradual increase in the overall temperature of the Earth's
atmosphere, primarily caused by the burning of fossil fuels
such as coal, oil, and natural gas. This burning releases
carbon dioxide and other greenhouse gases into the
atmosphere, which trap heat and cause the Earth's
temperature to rise.
Climate change is a pressing issue that needs to be addressed
immediately. Governments around the world need to take
immediate action to reduce carbon emissions and invest in
renewable energy sources. Failure to do so will have dire
consequences for future generations
The text is discussing global warming, which is the gradual increase in
the overall temperature of the Earth's atmosphere caused by the
burning of fossil fuels. This burning releases greenhouse gases, such as
carbon dioxide, into the atmosphere which trap heat and cause the
temperature to rise. The text also highlights the urgency of the issue of
climate change and the need for governments to take action to reduce
carbon emissions and invest in renewable energy sources. Failure to
address this issue will have negative consequences for future
generations.
Topic: Climate change and Global warming.
Continue to
next prompt
Please summarize the following text:
'Climate change is a pressing issue that
needs to be addressed immediately. The
increasing levels of carbon dioxide in the
atmosphere are causing the Earth's
temperature to rise, which is leading to
more frequent and severe natural disasters.
Governments around the world need to take
immediate action to reduce carbon
emissions and invest in renewable energy
sources. Failure to do so will have dire
consequences for future generations'"
Climate change is a pressing issue that needs to
be addressed immediately. Governments
around the world need to take immediate
action to reduce carbon emissions and invest in
renewable energy sources. Failure to do so will
have dire consequences for future generations
Then all summaries are passed to GPT again to
summarize, i.e. second round of summarization. The sum
of the summaries has to fit within the token limit.
Retrieval Augmented Generation (RAG)
Extract precise answers from your unstructured documents with Azure OpenAI + Cognitive Search: article + repo
https://learn.microsoft.com/en-us/azure/search/retrieval-augmented-generation-overview
https://enterprise.promptengineering.rocks
App or
Copilot agent
API & SDK
Azure OpenAI
Service on your data
Data Sources
(search, files, databases, storage etc.)
Additional 3P Data Sources
(files, databases, storage data etc.)
Recently Announced
Azure OpenAI Service
on your data
https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/use-your-data
LangChain Semantic Kernel
https://github.com/microsoft/semantic-kernel
https://github.com/langchain-ai/langchain
Prompt Flow – streamline dev cycle of LLM-based apps
https://github.com/microsoft/promptflow
Learning resources
• Learn Prompting Community
• Prompting Guide by DAIR.AI
• Prompt Engineering for the developers on Deep Learning
• Prompt Examples on OpenAI
• Introduction to Prompt Engineering on Microsoft Learn
https://promptengineering.rocks
Maxim.Salnikov@microsoft.com
Let’s connect and chat!
Thank you!
1 de 28

Recomendados

ChatGPT 101 - Vancouver ChatGPT Experts por
ChatGPT 101 - Vancouver ChatGPT ExpertsChatGPT 101 - Vancouver ChatGPT Experts
ChatGPT 101 - Vancouver ChatGPT ExpertsAli Tavanayan
1.1K visualizações29 slides
Chat GPT TEL Community of Practice por
Chat GPT TEL Community of PracticeChat GPT TEL Community of Practice
Chat GPT TEL Community of PracticePeter Windle
623 visualizações49 slides
ChatGPT Deck.pptx por
ChatGPT Deck.pptxChatGPT Deck.pptx
ChatGPT Deck.pptxomornahid1
4.1K visualizações17 slides
200109-Open AI Chat GPT-4-3.pptx por
200109-Open AI Chat GPT-4-3.pptx200109-Open AI Chat GPT-4-3.pptx
200109-Open AI Chat GPT-4-3.pptxandre241421
561 visualizações26 slides
ChatGPT vs. GPT-3.pdf por
ChatGPT vs. GPT-3.pdfChatGPT vs. GPT-3.pdf
ChatGPT vs. GPT-3.pdfAddepto
495 visualizações4 slides
Chat GPT and Generative AI in Higher Education - Empowering Educators and Lea... por
Chat GPT and Generative AI in Higher Education - Empowering Educators and Lea...Chat GPT and Generative AI in Higher Education - Empowering Educators and Lea...
Chat GPT and Generative AI in Higher Education - Empowering Educators and Lea...Alain Goudey
2.4K visualizações22 slides

Mais conteúdo relacionado

Mais procurados

The Rise of the LLMs - How I Learned to Stop Worrying & Love the GPT! por
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
1K visualizações13 slides
Uses of AI text bot.pdf por
Uses of AI text bot.pdfUses of AI text bot.pdf
Uses of AI text bot.pdfSreeNivas983124
1.3K visualizações17 slides
openai-chatgpt sunumu por
openai-chatgpt sunumuopenai-chatgpt sunumu
openai-chatgpt sunumuglkabakc
152 visualizações26 slides
ChatGPT_Cheatsheet_Costa.pdf por
ChatGPT_Cheatsheet_Costa.pdfChatGPT_Cheatsheet_Costa.pdf
ChatGPT_Cheatsheet_Costa.pdfssuser3e5d3a
146 visualizações30 slides
ChatGPT, Foundation Models and Web3.pptx por
ChatGPT, Foundation Models and Web3.pptxChatGPT, Foundation Models and Web3.pptx
ChatGPT, Foundation Models and Web3.pptxJesus Rodriguez
801 visualizações48 slides
ChatGPT-the-revolution-is-coming.pdf por
ChatGPT-the-revolution-is-coming.pdfChatGPT-the-revolution-is-coming.pdf
ChatGPT-the-revolution-is-coming.pdfLiang Yan
2.9K visualizações8 slides

Mais procurados(20)

The Rise of the LLMs - How I Learned to Stop Worrying & Love the GPT! por taozen
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!
taozen1K visualizações
Uses of AI text bot.pdf por SreeNivas983124
Uses of AI text bot.pdfUses of AI text bot.pdf
Uses of AI text bot.pdf
SreeNivas9831241.3K visualizações
openai-chatgpt sunumu por glkabakc
openai-chatgpt sunumuopenai-chatgpt sunumu
openai-chatgpt sunumu
glkabakc152 visualizações
ChatGPT_Cheatsheet_Costa.pdf por ssuser3e5d3a
ChatGPT_Cheatsheet_Costa.pdfChatGPT_Cheatsheet_Costa.pdf
ChatGPT_Cheatsheet_Costa.pdf
ssuser3e5d3a146 visualizações
ChatGPT, Foundation Models and Web3.pptx por Jesus Rodriguez
ChatGPT, Foundation Models and Web3.pptxChatGPT, Foundation Models and Web3.pptx
ChatGPT, Foundation Models and Web3.pptx
Jesus Rodriguez801 visualizações
ChatGPT-the-revolution-is-coming.pdf por Liang Yan
ChatGPT-the-revolution-is-coming.pdfChatGPT-the-revolution-is-coming.pdf
ChatGPT-the-revolution-is-coming.pdf
Liang Yan2.9K visualizações
Introduction to ChatGPT por annusharma26
Introduction to ChatGPTIntroduction to ChatGPT
Introduction to ChatGPT
annusharma261.5K visualizações
Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap... por Applitools
Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...
Unlocking the Power of ChatGPT and AI in Testing - NextSteps, presented by Ap...
Applitools1.7K visualizações
A brief primer on OpenAI's GPT-3 por Ishan Jain
A brief primer on OpenAI's GPT-3A brief primer on OpenAI's GPT-3
A brief primer on OpenAI's GPT-3
Ishan Jain2K visualizações
Revolutionary-ChatGPT por 9 series
Revolutionary-ChatGPTRevolutionary-ChatGPT
Revolutionary-ChatGPT
9 series1.2K visualizações
Webinar on ChatGPT.pptx por Abhilash Majumder
Webinar on ChatGPT.pptxWebinar on ChatGPT.pptx
Webinar on ChatGPT.pptx
Abhilash Majumder1.3K visualizações
How Does Generative AI Actually Work? (a quick semi-technical introduction to... por ssuser4edc93
How Does Generative AI Actually Work? (a quick semi-technical introduction to...How Does Generative AI Actually Work? (a quick semi-technical introduction to...
How Does Generative AI Actually Work? (a quick semi-technical introduction to...
ssuser4edc93955 visualizações
OpenAI Chatgpt.pptx por Nawroz University
OpenAI Chatgpt.pptxOpenAI Chatgpt.pptx
OpenAI Chatgpt.pptx
Nawroz University851 visualizações
ChatGPT in Education por Victor del Rosal
ChatGPT in EducationChatGPT in Education
ChatGPT in Education
Victor del Rosal911 visualizações
How AI is going to change the world _M.Mujeeb Riaz.pdf por Mujeeb Riaz
How AI is going to change the world _M.Mujeeb Riaz.pdfHow AI is going to change the world _M.Mujeeb Riaz.pdf
How AI is going to change the world _M.Mujeeb Riaz.pdf
Mujeeb Riaz756 visualizações
Prompt Engineering por Manjunatha Sai
Prompt EngineeringPrompt Engineering
Prompt Engineering
Manjunatha Sai938 visualizações
5 BENIFITES OF CHAT GPT.pptx por shailesh sangle
5 BENIFITES OF CHAT GPT.pptx5 BENIFITES OF CHAT GPT.pptx
5 BENIFITES OF CHAT GPT.pptx
shailesh sangle1.5K visualizações
LLMs Bootcamp por Fiza987241
LLMs BootcampLLMs Bootcamp
LLMs Bootcamp
Fiza987241129 visualizações
The updated non-technical introduction to ChatGPT SEDA March 2023.pptx por Sue Beckingham
The updated non-technical introduction to ChatGPT SEDA March 2023.pptxThe updated non-technical introduction to ChatGPT SEDA March 2023.pptx
The updated non-technical introduction to ChatGPT SEDA March 2023.pptx
Sue Beckingham806 visualizações
Introduction to ChatGPT por Damian T. Gordon
Introduction to ChatGPTIntroduction to ChatGPT
Introduction to ChatGPT
Damian T. Gordon4.8K visualizações

Similar a Prompt Engineering - an Art, a Science, or your next Job Title?

Prompt Engineering - an Art, a Science, or your next Job Title? por
Prompt Engineering - an Art, a Science, or your next Job Title?Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Maxim Salnikov
62 visualizações33 slides
Eco 365 Inspiring Innovation--tutorialrank.com por
Eco 365 Inspiring Innovation--tutorialrank.comEco 365 Inspiring Innovation--tutorialrank.com
Eco 365 Inspiring Innovation--tutorialrank.comPrescottLunt391
21 visualizações15 slides
Marketing Plan For A New Factory por
Marketing Plan For A New FactoryMarketing Plan For A New Factory
Marketing Plan For A New FactoryMaggie Turner
2 visualizações46 slides
CSSA KZN Chapter 2007 AGM por
CSSA KZN Chapter 2007 AGMCSSA KZN Chapter 2007 AGM
CSSA KZN Chapter 2007 AGMlokes
439 visualizações61 slides
Chapter One Notes por
Chapter One NotesChapter One Notes
Chapter One NotesMrRedAHS
1.1K visualizações80 slides
EIA 2015 Validating Revenue Model Assumptions por
EIA 2015 Validating Revenue Model AssumptionsEIA 2015 Validating Revenue Model Assumptions
EIA 2015 Validating Revenue Model AssumptionsEuropean Innovation Academy
1.1K visualizações149 slides

Similar a Prompt Engineering - an Art, a Science, or your next Job Title?(20)

Prompt Engineering - an Art, a Science, or your next Job Title? por Maxim Salnikov
Prompt Engineering - an Art, a Science, or your next Job Title?Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?
Maxim Salnikov62 visualizações
Eco 365 Inspiring Innovation--tutorialrank.com por PrescottLunt391
Eco 365 Inspiring Innovation--tutorialrank.comEco 365 Inspiring Innovation--tutorialrank.com
Eco 365 Inspiring Innovation--tutorialrank.com
PrescottLunt39121 visualizações
Marketing Plan For A New Factory por Maggie Turner
Marketing Plan For A New FactoryMarketing Plan For A New Factory
Marketing Plan For A New Factory
Maggie Turner2 visualizações
CSSA KZN Chapter 2007 AGM por lokes
CSSA KZN Chapter 2007 AGMCSSA KZN Chapter 2007 AGM
CSSA KZN Chapter 2007 AGM
lokes439 visualizações
Chapter One Notes por MrRedAHS
Chapter One NotesChapter One Notes
Chapter One Notes
MrRedAHS1.1K visualizações
BUSI 620 MENTOR Education Your Life--busi620mentor por thomashard44
BUSI 620 MENTOR Education Your Life--busi620mentorBUSI 620 MENTOR Education Your Life--busi620mentor
BUSI 620 MENTOR Education Your Life--busi620mentor
thomashard44265 visualizações
BUSI 620 MENTOR Education Planning--busi620mentor.com por agathachristie298
BUSI 620 MENTOR Education Planning--busi620mentor.comBUSI 620 MENTOR Education Planning--busi620mentor.com
BUSI 620 MENTOR Education Planning--busi620mentor.com
agathachristie298214 visualizações
Richard Thaler Econs por Lorie Harris
Richard Thaler EconsRichard Thaler Econs
Richard Thaler Econs
Lorie Harris2 visualizações
Apple Inc. An American Multinational Organization Essay por Jenny Mancini
Apple Inc. An American Multinational Organization EssayApple Inc. An American Multinational Organization Essay
Apple Inc. An American Multinational Organization Essay
Jenny Mancini2 visualizações
Sustainable Building Material... por Jennifer Wright
Sustainable Building Material...Sustainable Building Material...
Sustainable Building Material...
Jennifer Wright4 visualizações
Chapter One Powerpoint por MrRed
Chapter One PowerpointChapter One Powerpoint
Chapter One Powerpoint
MrRed1.7K visualizações
APEC issue1 por Don Azcona
APEC issue1APEC issue1
APEC issue1
Don Azcona150 visualizações
The Insight of Social por Yves Van Seters
The Insight of SocialThe Insight of Social
The Insight of Social
Yves Van Seters622 visualizações
Decision Making Process por sherif AL-Kammash
Decision Making ProcessDecision Making Process
Decision Making Process
sherif AL-Kammash2.1K visualizações
BUSI 620 Inspiring Innovation/tutorialrank.com por jonhson108
 BUSI 620 Inspiring Innovation/tutorialrank.com BUSI 620 Inspiring Innovation/tutorialrank.com
BUSI 620 Inspiring Innovation/tutorialrank.com
jonhson10832 visualizações
Busi 620 Enhance teaching / snaptutorial.com por HarrisGeorg50
Busi 620  Enhance teaching / snaptutorial.comBusi 620  Enhance teaching / snaptutorial.com
Busi 620 Enhance teaching / snaptutorial.com
HarrisGeorg5028 visualizações
Innovators &amp; Innovation por DD D
Innovators &amp; InnovationInnovators &amp; Innovation
Innovators &amp; Innovation
DD D470 visualizações

Mais de Maxim Salnikov

ChatGPT and not only: how can you use the power of Generative AI at scale por
ChatGPT and not only: how can you use the power of Generative AI at scaleChatGPT and not only: how can you use the power of Generative AI at scale
ChatGPT and not only: how can you use the power of Generative AI at scaleMaxim Salnikov
37 visualizações42 slides
Using the power of OpenAI with your own data: what's possible and how to start? por
Using the power of OpenAI with your own data: what's possible and how to start?Using the power of OpenAI with your own data: what's possible and how to start?
Using the power of OpenAI with your own data: what's possible and how to start?Maxim Salnikov
56 visualizações38 slides
If your code could speak, what would it tell you? Let GitHub Copilot Chat hel... por
If your code could speak, what would it tell you? Let GitHub Copilot Chat hel...If your code could speak, what would it tell you? Let GitHub Copilot Chat hel...
If your code could speak, what would it tell you? Let GitHub Copilot Chat hel...Maxim Salnikov
32 visualizações23 slides
ChatGPT and not only: How to use the power of GPT-X models at scale por
ChatGPT and not only: How to use the power of GPT-X models at scaleChatGPT and not only: How to use the power of GPT-X models at scale
ChatGPT and not only: How to use the power of GPT-X models at scaleMaxim Salnikov
87 visualizações32 slides
How Azure helps to build better business processes and customer experiences w... por
How Azure helps to build better business processes and customer experiences w...How Azure helps to build better business processes and customer experiences w...
How Azure helps to build better business processes and customer experiences w...Maxim Salnikov
79 visualizações24 slides
Using the power of Generative AI at scale por
Using the power of Generative AI at scaleUsing the power of Generative AI at scale
Using the power of Generative AI at scaleMaxim Salnikov
910 visualizações31 slides

Mais de Maxim Salnikov(12)

ChatGPT and not only: how can you use the power of Generative AI at scale por Maxim Salnikov
ChatGPT and not only: how can you use the power of Generative AI at scaleChatGPT and not only: how can you use the power of Generative AI at scale
ChatGPT and not only: how can you use the power of Generative AI at scale
Maxim Salnikov37 visualizações
Using the power of OpenAI with your own data: what's possible and how to start? por Maxim Salnikov
Using the power of OpenAI with your own data: what's possible and how to start?Using the power of OpenAI with your own data: what's possible and how to start?
Using the power of OpenAI with your own data: what's possible and how to start?
Maxim Salnikov56 visualizações
If your code could speak, what would it tell you? Let GitHub Copilot Chat hel... por Maxim Salnikov
If your code could speak, what would it tell you? Let GitHub Copilot Chat hel...If your code could speak, what would it tell you? Let GitHub Copilot Chat hel...
If your code could speak, what would it tell you? Let GitHub Copilot Chat hel...
Maxim Salnikov32 visualizações
ChatGPT and not only: How to use the power of GPT-X models at scale por Maxim Salnikov
ChatGPT and not only: How to use the power of GPT-X models at scaleChatGPT and not only: How to use the power of GPT-X models at scale
ChatGPT and not only: How to use the power of GPT-X models at scale
Maxim Salnikov87 visualizações
How Azure helps to build better business processes and customer experiences w... por Maxim Salnikov
How Azure helps to build better business processes and customer experiences w...How Azure helps to build better business processes and customer experiences w...
How Azure helps to build better business processes and customer experiences w...
Maxim Salnikov79 visualizações
Using the power of Generative AI at scale por Maxim Salnikov
Using the power of Generative AI at scaleUsing the power of Generative AI at scale
Using the power of Generative AI at scale
Maxim Salnikov910 visualizações
The Status of Angular v13 por Maxim Salnikov
The Status of Angular v13The Status of Angular v13
The Status of Angular v13
Maxim Salnikov101 visualizações
Azure cloud for the web frontend developers por Maxim Salnikov
Azure cloud for the web frontend developersAzure cloud for the web frontend developers
Azure cloud for the web frontend developers
Maxim Salnikov75 visualizações
[Russian] Сервис-воркеры: используем накопленные знания для светлого будущего... por Maxim Salnikov
[Russian] Сервис-воркеры: используем накопленные знания для светлого будущего...[Russian] Сервис-воркеры: используем накопленные знания для светлого будущего...
[Russian] Сервис-воркеры: используем накопленные знания для светлого будущего...
Maxim Salnikov309 visualizações
[Russian] Прогрессивные веб-приложения: по-настоящему кросс-платформенный опыт por Maxim Salnikov
[Russian] Прогрессивные веб-приложения: по-настоящему кросс-платформенный опыт[Russian] Прогрессивные веб-приложения: по-настоящему кросс-платформенный опыт
[Russian] Прогрессивные веб-приложения: по-настоящему кросс-платформенный опыт
Maxim Salnikov224 visualizações
Securing Connected Cars Requires Digital Identity por Maxim Salnikov
Securing Connected Cars Requires Digital IdentitySecuring Connected Cars Requires Digital Identity
Securing Connected Cars Requires Digital Identity
Maxim Salnikov189 visualizações
How to Make Your IoT Devices Secure, Act Autonomously & Trusted Subjects por Maxim Salnikov
How to Make Your IoT Devices Secure, Act Autonomously & Trusted SubjectsHow to Make Your IoT Devices Secure, Act Autonomously & Trusted Subjects
How to Make Your IoT Devices Secure, Act Autonomously & Trusted Subjects
Maxim Salnikov139 visualizações

Último

Unit 1_Lecture 2_Physical Design of IoT.pdf por
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdfStephenTec
12 visualizações36 slides
MVP and prioritization.pdf por
MVP and prioritization.pdfMVP and prioritization.pdf
MVP and prioritization.pdfrahuldharwal141
31 visualizações8 slides
HTTP headers that make your website go faster - devs.gent November 2023 por
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023Thijs Feryn
22 visualizações151 slides
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... por
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...Bernd Ruecker
40 visualizações69 slides
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... por
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...James Anderson
92 visualizações32 slides
Vertical User Stories por
Vertical User StoriesVertical User Stories
Vertical User StoriesMoisés Armani Ramírez
14 visualizações16 slides

Último(20)

Unit 1_Lecture 2_Physical Design of IoT.pdf por StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec12 visualizações
MVP and prioritization.pdf por rahuldharwal141
MVP and prioritization.pdfMVP and prioritization.pdf
MVP and prioritization.pdf
rahuldharwal14131 visualizações
HTTP headers that make your website go faster - devs.gent November 2023 por Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn22 visualizações
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas... por Bernd Ruecker
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
iSAQB Software Architecture Gathering 2023: How Process Orchestration Increas...
Bernd Ruecker40 visualizações
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... por James Anderson
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N...
James Anderson92 visualizações
Special_edition_innovator_2023.pdf por WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2218 visualizações
PRODUCT PRESENTATION.pptx por angelicacueva6
PRODUCT PRESENTATION.pptxPRODUCT PRESENTATION.pptx
PRODUCT PRESENTATION.pptx
angelicacueva615 visualizações
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... por TrustArc
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f...
TrustArc11 visualizações
Kyo - Functional Scala 2023.pdf por Flavio W. Brasil
Kyo - Functional Scala 2023.pdfKyo - Functional Scala 2023.pdf
Kyo - Functional Scala 2023.pdf
Flavio W. Brasil400 visualizações
Piloting & Scaling Successfully With Microsoft Viva por Richard Harbridge
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft Viva
Richard Harbridge12 visualizações
Five Things You SHOULD Know About Postman por Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman36 visualizações
Mini-Track: Challenges to Network Automation Adoption por Network Automation Forum
Mini-Track: Challenges to Network Automation AdoptionMini-Track: Challenges to Network Automation Adoption
Mini-Track: Challenges to Network Automation Adoption
Network Automation Forum13 visualizações
Microsoft Power Platform.pptx por Uni Systems S.M.S.A.
Microsoft Power Platform.pptxMicrosoft Power Platform.pptx
Microsoft Power Platform.pptx
Uni Systems S.M.S.A.53 visualizações
Info Session November 2023.pdf por AleksandraKoprivica4
Info Session November 2023.pdfInfo Session November 2023.pdf
Info Session November 2023.pdf
AleksandraKoprivica413 visualizações
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院 por IttrainingIttraining
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
IttrainingIttraining58 visualizações
Mini-Track: AI and ML in Network Operations Applications por Network Automation Forum
Mini-Track: AI and ML in Network Operations ApplicationsMini-Track: AI and ML in Network Operations Applications
Mini-Track: AI and ML in Network Operations Applications
Network Automation Forum10 visualizações
6g - REPORT.pdf por Liveplex
6g - REPORT.pdf6g - REPORT.pdf
6g - REPORT.pdf
Liveplex10 visualizações
PharoJS - Zürich Smalltalk Group Meetup November 2023 por Noury Bouraqadi
PharoJS - Zürich Smalltalk Group Meetup November 2023PharoJS - Zürich Smalltalk Group Meetup November 2023
PharoJS - Zürich Smalltalk Group Meetup November 2023
Noury Bouraqadi132 visualizações
Powerful Google developer tools for immediate impact! (2023-24) por wesley chun
Powerful Google developer tools for immediate impact! (2023-24)Powerful Google developer tools for immediate impact! (2023-24)
Powerful Google developer tools for immediate impact! (2023-24)
wesley chun10 visualizações

Prompt Engineering - an Art, a Science, or your next Job Title?

  • 1. Prompt Engineering - an Art, a Science, or your next Job Title? Maxim Salnikov Developer Productivity Lead Microsoft
  • 2. • Building on web platform since 90s • Organizing developer communities and technical conferences • Speaking, training, blogging: Webdev, Cloud, OpenAI Helping developers to succeed with the Cloud & AI technology I’m Maxim Salnikov
  • 3. • Generative AI’s impact on productivity could add up to $4.4 trillion annually in value to the global economy. • About 75% of the value that generative AI use cases could deliver falls across customer operations, marketing, sales, software engineering, and R&D . • Generative AI can revolutionize work by automating a significant portion of employees' activities, up to 60- 70% of their current workload. This augmentation of individual capabilities has the potential to transform the way we work.
  • 4. Artificial Intelligence 1956 Artificial Intelligence The field of computer science that seeks to create intelligent machines that can replicate or exceed human intelligence Machine Learning 1997 Machine Learning Subset of AI that enables machines to learn from existing data and improve upon that data to make decisions or predictions Deep Learning 2017 Deep Learning A machine learning technique in which layers of neural networks are used to process data and make decisions Generative AI 2021 Generative AI powered by foundation models Create new written, visual, and auditory content given prompts or existing data
  • 5. Path to impact and usecases Source: IDC, IDC PlanScape: Developing Your Path to Impact with Generative AI, #US51157323
  • 6. Emerging model landscape • OpenAI's GPT2, ChatGPT, GPT-3, GPT3.5, GPT4.0 (language) DALL-E 2 (image), and Whisper (speech) • Stability.ai's Stable Diffusion (image) • Midjourney (image) • Google's PaLM, PaLM2, LaMDA, Minerva, UL2, Bard (language), and Imagen (image) • Google/DeepMind's Chinchilla, Retro-7B, AlphaCode (language), Flamingo, and Gato (multimodal) • Meta's LLaMa, NLLB, OPT-175B, Sparse all-MLP (language), Make-a-Video (video), and data2vec (multimodal) • Microsoft's DeepNet (language) and MetaLM (multimodal) • BigScience's BLOOM (language) • AI21 Labs' Jurassic-X (language) • Dolly 2.0 (language) • …
  • 8. Prompt Engineering Process of designing, refining, and optimizing input prompts to guide a model toward producing more accurate outputs while keeping cost efficiency
  • 9. Prompt anatomy < Write a product launch email for new headphones. This product is AI-powered and priced at $79.99. The tone is friendly and exciting. Output as a JSON object with "subject" and "body" fields. Example: { "subject": "Introducing Our New AI-Powered Headphones!", "body": "We are thrilled to announce the launch of our new AI- powered headphones" } Output: Instruction Input data Context Target format Example Cue <
  • 11. Prompts and cost efficiency • Prompt and completion length • Number of API calls in production • Number of API calls during development (experimentation stage) • Type of deployed model Model selection strategy: Start with heaviest models and gradually ramp down to cheaper ones while the result is satisfactory
  • 12. • • Tokens can sometimes be counter-intuitive • Tabular data is space-efficient Space efficiency
  • 13. General recommendations • Be specific • Order matters • Double down • Give the model an “out”
  • 14. Technical recommendations • Start with clear instructions and repeat the instructions at the end • Add clear syntax: headers, separators • Break the task down • Adjust parameters: Temperature and Top probabilities
  • 15. Zero-shot VS few-shot prompts Zero-shot The model predicts the answer given only a natural language description of the task. Few-shot In addition to the task description, the model sees a few examples of the task. Customer question: Hi there, do you know how to choose flood insurance?​ Classified topic: 2​ Customer question: Hi there, I have a question on my auto insurance.​ Classified topic: 1​ Classify customer's question. Classify between category 1 to 3. Detailed guidelines for how to choose: choose 1 if the question is about auto insurance. choose 2 if the question is about home flood insurance. choose 3 if the question is not relevant to insurance. Classify customer's question. Classify between category 1 to 3. Detailed guidelines for how to choose: choose 1 if the question is about auto insurance. choose 2 if the question is about home flood insurance. choose 3 if the question is not relevant to insurance. Customer question: {insert new question here} Classified topic: Customer question: What packages do you have in auto insurance? Classified topic:
  • 16. Zero Shot - Reasoning Before What is the annual water demand of a single-family household containing four people who are at home an average of 200 days per year and use an average of 100 liters of water per day? The annual water demand of a single-family household containing four people who are at home an average of 200 days per year and use an average of 100 liters of water per day is 8,000,000 liters per year. After What is the annual water demand of a single-family household containing four people who are at home an average of 200 days per year and use an average of 100 liters of water per day? Let’s think step by step and explain the calculation step by step. Step 1: Calculate the total number of days in a year: There are 365 days in a year. Step 2: Calculate the total number of days the family is at home: The family is at home an average of 200 days per year. Step 3: Calculate the total water demand of the family: The family uses an average of 100 liters of water per day. Therefore, the total water demand of the family is 100 liters x 200 days = 20,000 liters per year. Step 4: Calculate the annual water demand of the single-family household: The annual water demand of the single-family household is 20,000 liters per year.
  • 17. Few Shot Reasoning – Example 1 1st prompt Roger has 5 tennis balls. He buys 2 more cans of tennis balls. Each can has 3 tennis balls. How many tennis balls does he have now? Answer: The answer is 11. The cafeteria has 23 apples. If they used 20 to make lunch and bought 6 more, how many do they have? The answer is 27 2nd prompt—provide reasoning Roger has 5 tennis balls. He buys 2 more cans of tennis balls. Each can has 3 tennis balls. How many tennis balls does he have now? Answer: Roger started with 5 balls. 2 cans of 3 tennis balls each is 6 tennis balls. 5+6 = 11. The answer is 11. The cafeteria has 23 apples. If they used 20 to make lunch and bought 6 more, how many do they have? The cafeteria had 23 apples originally. They used 20 to make lunch. So they had 23-20 = 3. They bought 6 more apples, so they have 3 + 6 = 9. The answer is 9.
  • 18. Prompt Chaining Entity Extraction Please extract entities from the following news article: 'The new iPhone model is set to be released next month. It has been highly anticipated by Apple fans and is expected to feature a larger screen and improved camera {'text': 'iPhone', 'type’: 'PRODUCT'}, {'text': 'Apple’, 'type': 'ORGANIZATION'}] Summarization Please summarize the information about the product [{'text': 'iPhone', 'type': 'PRODUCT'}, {'text': 'Apple', 'type': 'ORGANIZATION’}] The iPhone is a line of smartphones designed and marketed by Apple Inc. These devices combine a computer, camera, and internet connectivity in a single device, and are known for their sleek design and user-friendly interface. Sentiment Analysis Please provide a sentiment for the following text: The iPhone is a line of smartphones designed and marketed by Apple Inc. These devices combine a computer, camera, and internet connectivity in a single device, and are known for their sleek design and user-friendly interface. Positive
  • 19. Few Shot Reasoning – Example 2 1st prompt—Reason Extraction On average Joe throws 25 punches per minute. A fight lasts 5 rounds of 3 minutes. How many punches did he throw? Let’s think step by step and explain the calculation step by step. In one minute, Joe throws 25 punches. In three minutes, Joe throws 3 * 25 = 75 punches. In five rounds, Joe throws 5*75 = 375 punches. 2nd prompt—Answer Extraction One average Joe throws 25 punches per minute. A fight lasts 5 rounds of 3 minutes. How many punches did he throw? In one minute, Joe throws 25 punches. In three minutes, Joe throws 3 * 25 = 75 punches. In five rounds, Joe throws 5*75 = 375 punches. The cafeteria has 23 apples. If they used 20 to make lunch and bought 6 more, how many do they have? Therefore, the answer (Arabic numerals) is The cafeteria had 23 apples originally. They used 20 to make lunch. So they had 23-20 = 3. They bought 6 more apples, so they have 3 + 6 = 9. The answer is 9.
  • 20. Prompt Chunking (token limit) Large Text Beyond Token Limit Chunks Please summarize and extract topic: Global warming refers to the gradual increase in the overall temperature of the Earth's atmosphere, primarily caused by the burning of fossil fuels such as coal, oil, and natural gas. This burning releases carbon dioxide and other greenhouse gases into the atmosphere, which trap heat and cause the Earth's temperature to rise. Climate change is a pressing issue that needs to be addressed immediately. Governments around the world need to take immediate action to reduce carbon emissions and invest in renewable energy sources. Failure to do so will have dire consequences for future generations The text is discussing global warming, which is the gradual increase in the overall temperature of the Earth's atmosphere caused by the burning of fossil fuels. This burning releases greenhouse gases, such as carbon dioxide, into the atmosphere which trap heat and cause the temperature to rise. The text also highlights the urgency of the issue of climate change and the need for governments to take action to reduce carbon emissions and invest in renewable energy sources. Failure to address this issue will have negative consequences for future generations. Topic: Climate change and Global warming. Continue to next prompt Please summarize the following text: 'Climate change is a pressing issue that needs to be addressed immediately. The increasing levels of carbon dioxide in the atmosphere are causing the Earth's temperature to rise, which is leading to more frequent and severe natural disasters. Governments around the world need to take immediate action to reduce carbon emissions and invest in renewable energy sources. Failure to do so will have dire consequences for future generations'" Climate change is a pressing issue that needs to be addressed immediately. Governments around the world need to take immediate action to reduce carbon emissions and invest in renewable energy sources. Failure to do so will have dire consequences for future generations Then all summaries are passed to GPT again to summarize, i.e. second round of summarization. The sum of the summaries has to fit within the token limit.
  • 21. Retrieval Augmented Generation (RAG) Extract precise answers from your unstructured documents with Azure OpenAI + Cognitive Search: article + repo https://learn.microsoft.com/en-us/azure/search/retrieval-augmented-generation-overview
  • 23. App or Copilot agent API & SDK Azure OpenAI Service on your data Data Sources (search, files, databases, storage etc.) Additional 3P Data Sources (files, databases, storage data etc.) Recently Announced Azure OpenAI Service on your data https://learn.microsoft.com/en-us/azure/ai-services/openai/concepts/use-your-data
  • 25. Prompt Flow – streamline dev cycle of LLM-based apps https://github.com/microsoft/promptflow
  • 26. Learning resources • Learn Prompting Community • Prompting Guide by DAIR.AI • Prompt Engineering for the developers on Deep Learning • Prompt Examples on OpenAI • Introduction to Prompt Engineering on Microsoft Learn