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

Microsoft + OpenAI: Recent Updates (Machine Learning 15minutes! Broadcast #74) por
Microsoft + OpenAI: Recent Updates (Machine Learning 15minutes! Broadcast #74)Microsoft + OpenAI: Recent Updates (Machine Learning 15minutes! Broadcast #74)
Microsoft + OpenAI: Recent Updates (Machine Learning 15minutes! Broadcast #74)Naoki (Neo) SATO
1.3K vistas47 diapositivas
Unlocking the Power of Generative AI An Executive's Guide.pdf por
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 vistas29 diapositivas
Blueprint ChatGPT Lunch & Learn por
Blueprint ChatGPT Lunch & LearnBlueprint ChatGPT Lunch & Learn
Blueprint ChatGPT Lunch & Learngnakan
1.5K vistas25 diapositivas
Prompt Engineering.pptx por
Prompt Engineering.pptxPrompt Engineering.pptx
Prompt Engineering.pptxahmedmishfaq
111 vistas6 diapositivas
Leveraging Generative AI & Best practices por
Leveraging Generative AI & Best practicesLeveraging Generative AI & Best practices
Leveraging Generative AI & Best practicesDianaGray10
1.8K vistas21 diapositivas
An Introduction to Generative AI por
An Introduction  to Generative AIAn Introduction  to Generative AI
An Introduction to Generative AICori Faklaris
11.7K vistas28 diapositivas

Más contenido relacionado

La actualidad más candente

Episode 2: The LLM / GPT / AI Prompt / Data Engineer Roadmap por
Episode 2: The LLM / GPT / AI Prompt / Data Engineer RoadmapEpisode 2: The LLM / GPT / AI Prompt / Data Engineer Roadmap
Episode 2: The LLM / GPT / AI Prompt / Data Engineer RoadmapAnant Corporation
664 vistas25 diapositivas
CHATGPT.pptx por
CHATGPT.pptxCHATGPT.pptx
CHATGPT.pptxSajedRahman2
301 vistas13 diapositivas
How Does Generative AI Actually Work? (a quick semi-technical introduction to... por
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
982 vistas14 diapositivas
How to Teach and Learn with ChatGPT - BETT 2023 por
How to Teach and Learn with ChatGPT - BETT 2023How to Teach and Learn with ChatGPT - BETT 2023
How to Teach and Learn with ChatGPT - BETT 2023Dominik Lukes
1.5K vistas155 diapositivas
Best Practice on using Azure OpenAI Service por
Best Practice on using Azure OpenAI ServiceBest Practice on using Azure OpenAI Service
Best Practice on using Azure OpenAI ServiceKumton Suttiraksiri
529 vistas45 diapositivas
ChatGPT Use- Cases por
ChatGPT Use- Cases ChatGPT Use- Cases
ChatGPT Use- Cases Bluechip Technologies
1K vistas35 diapositivas

La actualidad más candente(20)

Episode 2: The LLM / GPT / AI Prompt / Data Engineer Roadmap por Anant Corporation
Episode 2: The LLM / GPT / AI Prompt / Data Engineer RoadmapEpisode 2: The LLM / GPT / AI Prompt / Data Engineer Roadmap
Episode 2: The LLM / GPT / AI Prompt / Data Engineer Roadmap
Anant Corporation664 vistas
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...
ssuser4edc93982 vistas
How to Teach and Learn with ChatGPT - BETT 2023 por Dominik Lukes
How to Teach and Learn with ChatGPT - BETT 2023How to Teach and Learn with ChatGPT - BETT 2023
How to Teach and Learn with ChatGPT - BETT 2023
Dominik Lukes1.5K vistas
Let's talk about GPT: A crash course in Generative AI for researchers por Steven Van Vaerenbergh
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 researchers
Chat GPT and Generative AI in Higher Education - Empowering Educators and Lea... por Alain Goudey
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 Goudey2.4K vistas
ChatGPT Evaluation for NLP por XiachongFeng
ChatGPT Evaluation for NLPChatGPT Evaluation for NLP
ChatGPT Evaluation for NLP
XiachongFeng781 vistas
intro chatGPT workshop.pdf por peterpur
intro chatGPT workshop.pdfintro chatGPT workshop.pdf
intro chatGPT workshop.pdf
peterpur1.1K vistas
A comprehensive guide to prompt engineering.pdf por AnastasiaSteele10
A comprehensive guide to prompt engineering.pdfA comprehensive guide to prompt engineering.pdf
A comprehensive guide to prompt engineering.pdf
AnastasiaSteele10240 vistas
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 vistas
ChatGPT Cheatsheet 2023 por SaahilThakur
ChatGPT Cheatsheet 2023ChatGPT Cheatsheet 2023
ChatGPT Cheatsheet 2023
SaahilThakur137 vistas
Everything to know about ChatGPT por Knoldus Inc.
Everything to know about ChatGPTEverything to know about ChatGPT
Everything to know about ChatGPT
Knoldus Inc.7.2K vistas
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 vistas
AI and ML Series - Introduction to Generative AI and LLMs - Session 1 por 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 vistas

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
70 vistas33 diapositivas
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 vistas15 diapositivas
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
3 vistas46 diapositivas
CSSA KZN Chapter 2007 AGM por
CSSA KZN Chapter 2007 AGMCSSA KZN Chapter 2007 AGM
CSSA KZN Chapter 2007 AGMlokes
439 vistas61 diapositivas
Chapter One Notes por
Chapter One NotesChapter One Notes
Chapter One NotesMrRedAHS
1.1K vistas80 diapositivas
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 vistas149 diapositivas

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 Salnikov70 vistas
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 vistas
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 Turner3 vistas
CSSA KZN Chapter 2007 AGM por lokes
CSSA KZN Chapter 2007 AGMCSSA KZN Chapter 2007 AGM
CSSA KZN Chapter 2007 AGM
lokes439 vistas
Chapter One Notes por MrRedAHS
Chapter One NotesChapter One Notes
Chapter One Notes
MrRedAHS1.1K vistas
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 vistas
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 vistas
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 vistas
Chapter One Powerpoint por MrRed
Chapter One PowerpointChapter One Powerpoint
Chapter One Powerpoint
MrRed1.7K vistas
APEC issue1 por Don Azcona
APEC issue1APEC issue1
APEC issue1
Don Azcona150 vistas
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 vistas
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 vistas
Innovators &amp; Innovation por DD D
Innovators &amp; InnovationInnovators &amp; Innovation
Innovators &amp; Innovation
DD D470 vistas

Más 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
45 vistas42 diapositivas
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
62 vistas38 diapositivas
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
34 vistas23 diapositivas
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
88 vistas32 diapositivas
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 vistas24 diapositivas
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
923 vistas31 diapositivas

Más 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 Salnikov45 vistas
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 Salnikov62 vistas
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 Salnikov34 vistas
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 Salnikov88 vistas
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 vistas
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 Salnikov923 vistas
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 Salnikov77 vistas
[Russian] Сервис-воркеры: используем накопленные знания для светлого будущего... por Maxim Salnikov
[Russian] Сервис-воркеры: используем накопленные знания для светлого будущего...[Russian] Сервис-воркеры: используем накопленные знания для светлого будущего...
[Russian] Сервис-воркеры: используем накопленные знания для светлого будущего...
Maxim Salnikov309 vistas
[Russian] Прогрессивные веб-приложения: по-настоящему кросс-платформенный опыт por Maxim Salnikov
[Russian] Прогрессивные веб-приложения: по-настоящему кросс-платформенный опыт[Russian] Прогрессивные веб-приложения: по-настоящему кросс-платформенный опыт
[Russian] Прогрессивные веб-приложения: по-настоящему кросс-платформенный опыт
Maxim Salnikov224 vistas
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 vistas
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 vistas

Último

Deep Tech and the Amplified Organisation: Core Concepts por
Deep Tech and the Amplified Organisation: Core ConceptsDeep Tech and the Amplified Organisation: Core Concepts
Deep Tech and the Amplified Organisation: Core ConceptsHolonomics
17 vistas21 diapositivas
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdf por
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdfAdopting Karpenter for Cost and Simplicity at Grafana Labs.pdf
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdfMichaelOLeary82
13 vistas74 diapositivas
Bronack Skills - Risk Management and SRE v1.0 12-3-2023.pdf por
Bronack Skills - Risk Management and SRE v1.0 12-3-2023.pdfBronack Skills - Risk Management and SRE v1.0 12-3-2023.pdf
Bronack Skills - Risk Management and SRE v1.0 12-3-2023.pdfThomasBronack
31 vistas31 diapositivas
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」 por
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」PC Cluster Consortium
25 vistas12 diapositivas
Evaluation of Quality of Experience of ABR Schemes in Gaming Stream por
Evaluation of Quality of Experience of ABR Schemes in Gaming StreamEvaluation of Quality of Experience of ABR Schemes in Gaming Stream
Evaluation of Quality of Experience of ABR Schemes in Gaming StreamAlpen-Adria-Universität
38 vistas34 diapositivas
GDSC GLAU Info Session.pptx por
GDSC GLAU Info Session.pptxGDSC GLAU Info Session.pptx
GDSC GLAU Info Session.pptxgauriverrma4
15 vistas28 diapositivas

Último(20)

Deep Tech and the Amplified Organisation: Core Concepts por Holonomics
Deep Tech and the Amplified Organisation: Core ConceptsDeep Tech and the Amplified Organisation: Core Concepts
Deep Tech and the Amplified Organisation: Core Concepts
Holonomics17 vistas
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdf por MichaelOLeary82
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdfAdopting Karpenter for Cost and Simplicity at Grafana Labs.pdf
Adopting Karpenter for Cost and Simplicity at Grafana Labs.pdf
MichaelOLeary8213 vistas
Bronack Skills - Risk Management and SRE v1.0 12-3-2023.pdf por ThomasBronack
Bronack Skills - Risk Management and SRE v1.0 12-3-2023.pdfBronack Skills - Risk Management and SRE v1.0 12-3-2023.pdf
Bronack Skills - Risk Management and SRE v1.0 12-3-2023.pdf
ThomasBronack31 vistas
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」 por PC Cluster Consortium
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」
PCCC23:日本AMD株式会社 テーマ2「AMD EPYC™ プロセッサーを用いたAIソリューション」
GDSC GLAU Info Session.pptx por gauriverrma4
GDSC GLAU Info Session.pptxGDSC GLAU Info Session.pptx
GDSC GLAU Info Session.pptx
gauriverrma415 vistas
"Running students' code in isolation. The hard way", Yurii Holiuk por Fwdays
"Running students' code in isolation. The hard way", Yurii Holiuk "Running students' code in isolation. The hard way", Yurii Holiuk
"Running students' code in isolation. The hard way", Yurii Holiuk
Fwdays36 vistas
Innovation & Entrepreneurship strategies in Dairy Industry por PervaizDar1
Innovation & Entrepreneurship strategies in Dairy IndustryInnovation & Entrepreneurship strategies in Dairy Industry
Innovation & Entrepreneurship strategies in Dairy Industry
PervaizDar135 vistas
Initiating and Advancing Your Strategic GIS Governance Strategy por Safe Software
Initiating and Advancing Your Strategic GIS Governance StrategyInitiating and Advancing Your Strategic GIS Governance Strategy
Initiating and Advancing Your Strategic GIS Governance Strategy
Safe Software184 vistas
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」 por PC Cluster Consortium
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」
PCCC23:日本AMD株式会社 テーマ1「AMD Instinct™ アクセラレーターの概要」
Mobile Core Solutions & Successful Cases.pdf por IPLOOK Networks
Mobile Core Solutions & Successful Cases.pdfMobile Core Solutions & Successful Cases.pdf
Mobile Core Solutions & Successful Cases.pdf
IPLOOK Networks14 vistas
Discover Aura Workshop (12.5.23).pdf por Neo4j
Discover Aura Workshop (12.5.23).pdfDiscover Aura Workshop (12.5.23).pdf
Discover Aura Workshop (12.5.23).pdf
Neo4j15 vistas
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De... por Moses Kemibaro
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Don’t Make A Human Do A Robot’s Job! : 6 Reasons Why AI Will Save Us & Not De...
Moses Kemibaro35 vistas
The Power of Heat Decarbonisation Plans in the Built Environment por IES VE
The Power of Heat Decarbonisation Plans in the Built EnvironmentThe Power of Heat Decarbonisation Plans in the Built Environment
The Power of Heat Decarbonisation Plans in the Built Environment
IES VE84 vistas

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