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

Maxim Salnikov
Maxim SalnikovDeveloper Engagement Lead um Microsoft
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 von 28

Recomendados

[DSC DACH 23] ChatGPT and Beyond: How generative AI is Changing the way peopl... von
[DSC DACH 23] ChatGPT and Beyond: How generative AI is Changing the way peopl...[DSC DACH 23] ChatGPT and Beyond: How generative AI is Changing the way peopl...
[DSC DACH 23] ChatGPT and Beyond: How generative AI is Changing the way peopl...DataScienceConferenc1
294 views16 Folien
Let's talk about GPT: A crash course in Generative AI for researchers von
Let's talk about GPT: A crash course in Generative AI for researchersLet's talk about GPT: A crash course in Generative AI for researchers
Let's talk about GPT: A crash course in Generative AI for researchersSteven Van Vaerenbergh
861 views71 Folien
Using the power of Generative AI at scale von
Using the power of Generative AI at scaleUsing the power of Generative AI at scale
Using the power of Generative AI at scaleMaxim Salnikov
920 views31 Folien
Large Language Models - Chat AI.pdf von
Large Language Models - Chat AI.pdfLarge Language Models - Chat AI.pdf
Large Language Models - Chat AI.pdfDavid Rostcheck
720 views19 Folien
How ChatGPT and AI-assisted coding changes software engineering profoundly von
How ChatGPT and AI-assisted coding changes software engineering profoundlyHow ChatGPT and AI-assisted coding changes software engineering profoundly
How ChatGPT and AI-assisted coding changes software engineering profoundlyPekka Abrahamsson / Tampere University
418 views45 Folien
Prompt Engineering.pptx von
Prompt Engineering.pptxPrompt Engineering.pptx
Prompt Engineering.pptxahmedmishfaq
110 views6 Folien

Más contenido relacionado

Was ist angesagt?

Best Practice on using Azure OpenAI Service von
Best Practice on using Azure OpenAI ServiceBest Practice on using Azure OpenAI Service
Best Practice on using Azure OpenAI ServiceKumton Suttiraksiri
527 views45 Folien
How Does Generative AI Actually Work? (a quick semi-technical introduction to... von
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...ssuser4edc93
975 views14 Folien
Unlocking the Power of Generative AI An Executive's Guide.pdf von
Unlocking the Power of Generative AI An Executive's Guide.pdfUnlocking the Power of Generative AI An Executive's Guide.pdf
Unlocking the Power of Generative AI An Executive's Guide.pdfPremNaraindas1
2.2K views29 Folien
Generative AI, WiDS 2023.pptx von
Generative AI, WiDS 2023.pptxGenerative AI, WiDS 2023.pptx
Generative AI, WiDS 2023.pptxColleen Farrelly
3K views16 Folien
AI and ML Series - Introduction to Generative AI and LLMs - Session 1 von
AI and ML Series - Introduction to Generative AI and LLMs - Session 1AI and ML Series - Introduction to Generative AI and LLMs - Session 1
AI and ML Series - Introduction to Generative AI and LLMs - Session 1DianaGray10
1.3K views38 Folien
The Rise of the LLMs - How I Learned to Stop Worrying & Love the GPT! von
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 views13 Folien

Was ist angesagt?(20)

How Does Generative AI Actually Work? (a quick semi-technical introduction to... von 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...
ssuser4edc93975 views
Unlocking the Power of Generative AI An Executive's Guide.pdf von PremNaraindas1
Unlocking the Power of Generative AI An Executive's Guide.pdfUnlocking the Power of Generative AI An Executive's Guide.pdf
Unlocking the Power of Generative AI An Executive's Guide.pdf
PremNaraindas12.2K views
AI and ML Series - Introduction to Generative AI and LLMs - Session 1 von DianaGray10
AI and ML Series - Introduction to Generative AI and LLMs - Session 1AI and ML Series - Introduction to Generative AI and LLMs - Session 1
AI and ML Series - Introduction to Generative AI and LLMs - Session 1
DianaGray101.3K views
The Rise of the LLMs - How I Learned to Stop Worrying & Love the GPT! von 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 views
An Introduction to Generative AI - May 18, 2023 von CoriFaklaris1
An Introduction  to Generative AI - May 18, 2023An Introduction  to Generative AI - May 18, 2023
An Introduction to Generative AI - May 18, 2023
CoriFaklaris1955 views
GENERATIVE AI, THE FUTURE OF PRODUCTIVITY von Andre Muscat
GENERATIVE AI, THE FUTURE OF PRODUCTIVITYGENERATIVE AI, THE FUTURE OF PRODUCTIVITY
GENERATIVE AI, THE FUTURE OF PRODUCTIVITY
Andre Muscat6.6K views
intro chatGPT workshop.pdf von peterpur
intro chatGPT workshop.pdfintro chatGPT workshop.pdf
intro chatGPT workshop.pdf
peterpur1.1K views
Generative Models and ChatGPT von Loic Merckel
Generative Models and ChatGPTGenerative Models and ChatGPT
Generative Models and ChatGPT
Loic Merckel652 views
Prompting is an art / Sztuka promptowania von Michal Jaskolski
Prompting is an art / Sztuka promptowaniaPrompting is an art / Sztuka promptowania
Prompting is an art / Sztuka promptowania
Michal Jaskolski290 views
The Future of AI is Generative not Discriminative 5/26/2021 von Steve Omohundro
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 Omohundro979 views
ChatGPT, Foundation Models and Web3.pptx von Jesus Rodriguez
ChatGPT, Foundation Models and Web3.pptxChatGPT, Foundation Models and Web3.pptx
ChatGPT, Foundation Models and Web3.pptx
Jesus Rodriguez816 views
And then there were ... Large Language Models von Leon Dohmen
And then there were ... Large Language ModelsAnd then there were ... Large Language Models
And then there were ... Large Language Models
Leon Dohmen2.4K views
Generative-AI-in-enterprise-20230615.pdf von Liming Zhu
Generative-AI-in-enterprise-20230615.pdfGenerative-AI-in-enterprise-20230615.pdf
Generative-AI-in-enterprise-20230615.pdf
Liming Zhu857 views
Responsible Generative AI von CMassociates
Responsible Generative AIResponsible Generative AI
Responsible Generative AI
CMassociates249 views

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

Prompt Engineering - an Art, a Science, or your next Job Title? von
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
70 views33 Folien
Eco 365 Inspiring Innovation--tutorialrank.com von
Eco 365 Inspiring Innovation--tutorialrank.comEco 365 Inspiring Innovation--tutorialrank.com
Eco 365 Inspiring Innovation--tutorialrank.comPrescottLunt391
21 views15 Folien
Marketing Plan For A New Factory von
Marketing Plan For A New FactoryMarketing Plan For A New Factory
Marketing Plan For A New FactoryMaggie Turner
3 views46 Folien
CSSA KZN Chapter 2007 AGM von
CSSA KZN Chapter 2007 AGMCSSA KZN Chapter 2007 AGM
CSSA KZN Chapter 2007 AGMlokes
439 views61 Folien
Chapter One Notes von
Chapter One NotesChapter One Notes
Chapter One NotesMrRedAHS
1.1K views80 Folien
EIA 2015 Validating Revenue Model Assumptions von
EIA 2015 Validating Revenue Model AssumptionsEIA 2015 Validating Revenue Model Assumptions
EIA 2015 Validating Revenue Model AssumptionsEuropean Innovation Academy
1.1K views149 Folien

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? von 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 Salnikov70 views
Eco 365 Inspiring Innovation--tutorialrank.com von PrescottLunt391
Eco 365 Inspiring Innovation--tutorialrank.comEco 365 Inspiring Innovation--tutorialrank.com
Eco 365 Inspiring Innovation--tutorialrank.com
PrescottLunt39121 views
Marketing Plan For A New Factory von Maggie Turner
Marketing Plan For A New FactoryMarketing Plan For A New Factory
Marketing Plan For A New Factory
Maggie Turner3 views
CSSA KZN Chapter 2007 AGM von lokes
CSSA KZN Chapter 2007 AGMCSSA KZN Chapter 2007 AGM
CSSA KZN Chapter 2007 AGM
lokes439 views
Chapter One Notes von MrRedAHS
Chapter One NotesChapter One Notes
Chapter One Notes
MrRedAHS1.1K views
BUSI 620 MENTOR Education Your Life--busi620mentor von thomashard44
BUSI 620 MENTOR Education Your Life--busi620mentorBUSI 620 MENTOR Education Your Life--busi620mentor
BUSI 620 MENTOR Education Your Life--busi620mentor
thomashard44265 views
BUSI 620 MENTOR Education Planning--busi620mentor.com von agathachristie298
BUSI 620 MENTOR Education Planning--busi620mentor.comBUSI 620 MENTOR Education Planning--busi620mentor.com
BUSI 620 MENTOR Education Planning--busi620mentor.com
agathachristie298214 views
Apple Inc. An American Multinational Organization Essay von Jenny Mancini
Apple Inc. An American Multinational Organization EssayApple Inc. An American Multinational Organization Essay
Apple Inc. An American Multinational Organization Essay
Jenny Mancini2 views
Chapter One Powerpoint von MrRed
Chapter One PowerpointChapter One Powerpoint
Chapter One Powerpoint
MrRed1.7K views
BUSI 620 Inspiring Innovation/tutorialrank.com von jonhson108
 BUSI 620 Inspiring Innovation/tutorialrank.com BUSI 620 Inspiring Innovation/tutorialrank.com
BUSI 620 Inspiring Innovation/tutorialrank.com
jonhson10832 views
Busi 620 Enhance teaching / snaptutorial.com von HarrisGeorg50
Busi 620  Enhance teaching / snaptutorial.comBusi 620  Enhance teaching / snaptutorial.com
Busi 620 Enhance teaching / snaptutorial.com
HarrisGeorg5028 views
Innovators &amp; Innovation von DD D
Innovators &amp; InnovationInnovators &amp; Innovation
Innovators &amp; Innovation
DD D470 views

Más de Maxim Salnikov

ChatGPT and not only: how can you use the power of Generative AI at scale von
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
42 views42 Folien
Using the power of OpenAI with your own data: what's possible and how to start? von
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
61 views38 Folien
If your code could speak, what would it tell you? Let GitHub Copilot Chat hel... von
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
34 views23 Folien
ChatGPT and not only: How to use the power of GPT-X models at scale von
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
88 views32 Folien
How Azure helps to build better business processes and customer experiences w... von
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 views24 Folien
The Status of Angular v13 von
The Status of Angular v13The Status of Angular v13
The Status of Angular v13Maxim Salnikov
101 views35 Folien

Más de Maxim Salnikov(11)

ChatGPT and not only: how can you use the power of Generative AI at scale von 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 Salnikov42 views
Using the power of OpenAI with your own data: what's possible and how to start? von 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 Salnikov61 views
If your code could speak, what would it tell you? Let GitHub Copilot Chat hel... von 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 Salnikov34 views
ChatGPT and not only: How to use the power of GPT-X models at scale von 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 Salnikov88 views
How Azure helps to build better business processes and customer experiences w... von 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 views
Azure cloud for the web frontend developers von Maxim Salnikov
Azure cloud for the web frontend developersAzure cloud for the web frontend developers
Azure cloud for the web frontend developers
Maxim Salnikov77 views
[Russian] Сервис-воркеры: используем накопленные знания для светлого будущего... von Maxim Salnikov
[Russian] Сервис-воркеры: используем накопленные знания для светлого будущего...[Russian] Сервис-воркеры: используем накопленные знания для светлого будущего...
[Russian] Сервис-воркеры: используем накопленные знания для светлого будущего...
Maxim Salnikov309 views
[Russian] Прогрессивные веб-приложения: по-настоящему кросс-платформенный опыт von Maxim Salnikov
[Russian] Прогрессивные веб-приложения: по-настоящему кросс-платформенный опыт[Russian] Прогрессивные веб-приложения: по-настоящему кросс-платформенный опыт
[Russian] Прогрессивные веб-приложения: по-настоящему кросс-платформенный опыт
Maxim Salnikov224 views
Securing Connected Cars Requires Digital Identity von Maxim Salnikov
Securing Connected Cars Requires Digital IdentitySecuring Connected Cars Requires Digital Identity
Securing Connected Cars Requires Digital Identity
Maxim Salnikov189 views
How to Make Your IoT Devices Secure, Act Autonomously & Trusted Subjects von 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 views

Último

TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... von
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...TrustArc
170 views29 Folien
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T von
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TShapeBlue
152 views34 Folien
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... von
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...ShapeBlue
198 views20 Folien
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue von
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlueShapeBlue
147 views23 Folien
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue von
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueShapeBlue
263 views23 Folien
State of the Union - Rohit Yadav - Apache CloudStack von
State of the Union - Rohit Yadav - Apache CloudStackState of the Union - Rohit Yadav - Apache CloudStack
State of the Union - Rohit Yadav - Apache CloudStackShapeBlue
297 views53 Folien

Último(20)

TrustArc Webinar - Managing Online Tracking Technology Vendors_ A Checklist f... von 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...
TrustArc170 views
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T von ShapeBlue
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&TCloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
CloudStack and GitOps at Enterprise Scale - Alex Dometrius, Rene Glover - AT&T
ShapeBlue152 views
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or... von ShapeBlue
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
Zero to Cloud Hero: Crafting a Private Cloud from Scratch with XCP-ng, Xen Or...
ShapeBlue198 views
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue von ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
2FA and OAuth2 in CloudStack - Andrija Panić - ShapeBlue
ShapeBlue147 views
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue von ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlueWhat’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
What’s New in CloudStack 4.19 - Abhishek Kumar - ShapeBlue
ShapeBlue263 views
State of the Union - Rohit Yadav - Apache CloudStack von ShapeBlue
State of the Union - Rohit Yadav - Apache CloudStackState of the Union - Rohit Yadav - Apache CloudStack
State of the Union - Rohit Yadav - Apache CloudStack
ShapeBlue297 views
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT von ShapeBlue
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBITUpdates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
Updates on the LINSTOR Driver for CloudStack - Rene Peinthor - LINBIT
ShapeBlue206 views
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P... von ShapeBlue
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
Developments to CloudStack’s SDN ecosystem: Integration with VMWare NSX 4 - P...
ShapeBlue194 views
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ... von ShapeBlue
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
Backroll, News and Demo - Pierre Charton, Matthias Dhellin, Ousmane Diarra - ...
ShapeBlue186 views
Business Analyst Series 2023 - Week 4 Session 7 von DianaGray10
Business Analyst Series 2023 -  Week 4 Session 7Business Analyst Series 2023 -  Week 4 Session 7
Business Analyst Series 2023 - Week 4 Session 7
DianaGray10139 views
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading... von The Digital Insurer
Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...Webinar : Desperately Seeking Transformation - Part 2:  Insights from leading...
Webinar : Desperately Seeking Transformation - Part 2: Insights from leading...
Confidence in CloudStack - Aron Wagner, Nathan Gleason - Americ von ShapeBlue
Confidence in CloudStack - Aron Wagner, Nathan Gleason - AmericConfidence in CloudStack - Aron Wagner, Nathan Gleason - Americ
Confidence in CloudStack - Aron Wagner, Nathan Gleason - Americ
ShapeBlue130 views
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue von ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlueCloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
CloudStack Object Storage - An Introduction - Vladimir Petrov - ShapeBlue
ShapeBlue138 views
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue von ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlueMigrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
Migrating VMware Infra to KVM Using CloudStack - Nicolas Vazquez - ShapeBlue
ShapeBlue218 views
"Surviving highload with Node.js", Andrii Shumada von Fwdays
"Surviving highload with Node.js", Andrii Shumada "Surviving highload with Node.js", Andrii Shumada
"Surviving highload with Node.js", Andrii Shumada
Fwdays56 views
GDG Cloud Southlake 28 Brad Taylor and Shawn Augenstein Old Problems in the N... von 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 Anderson160 views
Future of AR - Facebook Presentation von Rob McCarty
Future of AR - Facebook PresentationFuture of AR - Facebook Presentation
Future of AR - Facebook Presentation
Rob McCarty64 views

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