SlideShare a Scribd company logo
1 of 34
Download to read offline
“Prompt it”, not “Google it” :
Prompt Engineering for Stat
Programmers and Biostatisticians
Kevin Lee
Disclaimer
The views and opinions presented here represent those of
the speaker and should not be considered to represent
any companies or organizations.
Agenda
➢Prompt it, not Google it
➢What is Prompt Engineering?
➢How to Prompt Better
➢Prompt Engineering Technique
➢Use Cases in Biometrics
➢Discussion
3
Do you use
“ChatGPT”?
4
Prompt it
is the new Google it
5
What is Prompt?
6
• Prompt – A tool to communicate with Gen AI (ChatGPT)
• “Prompt It” is the new “Google it”
7
How to
prompt
better
Prompt
Engineering
What is Prompt Engineering?
8
• Prompt Engineering – the art of creating effective
communication/ prompt that guide ChatGPT to generate
desired response.
• Bad Prompt – Bad Response
• Good Prompt – Good Response
How to work with the recent, smart graduate at work?
9
ChatGPT is a very smart, capable, recent
graduate
10
=?
How to prompt better
(How to communicate better)
- Get Specific
- Add Constraints
- Add more contexts
- Set the role
- Coach with feedback
- Probe further
- Step by step introduction
Get specific
12
Generic Prompt Specific Prompt
Write an essay about flowers. Write an essay about flowers at 9th
grade level
Write me a rap song Write me a rap song using
references to SpongeBob Square
Pants.
Write me a promotion request. Write me a promotion request for
Manager of Statistical Programmer.
• Generic inquiry will provide generic (and less impressive) answers
Add Parameter or Constraints
13
Generic Prompt Prompt with parameter
Write an essay about flowers. Write an essay about flowers at 9th
grade level within 200 words
Tell me the best places to visit in
Prague.
Tell me the best places to visit in
Prague within 4 days.
Tell me the best places to visit in
Prague.
Tell me the best places to visit in
Prague with $500 budget.
• Restriction and constraints breed a creativity
• Example of parameters
• Under 100 words
• Include word of “creative” / do not use a word of “creative”
• Make it under $100
• Make it work for 15 people
Add more context
14
Generic Prompt Prompt with more context
Write a greeting email. I have not seen my friend for a
long time. I want to know how he
is doing. Write a greeting email.
• If one adds more background, ChatGPT can provide more relevant,
customized answers.
• Provide the reason that I am using ChatGPT
Set the role
15
Generic Prompt Prompt with role
Write a greeting email. I am a salesperson who markets
new medicine. Write a greeting
email.
Review this proposal and provide
your feedback.
Pretend you are the head of IT.
Review this proposal and provide
your feedback.
How do you respond below
proposal?
You are Steve Jobs. How do you
respond below proposal?
• If one gives a role to ChatGPT and ask, ChatGPT play a role given and
provide the answers.
• Example of roles : boss, parent, salesperson,
Coach ChatGPT with feedback
16
Generic Prompt Prompt with feedback
Write a greeting email.
Make it in 50 words.
Make it more formal.
Make it more persuasive.
• After ChatGPT provide an answer, one can provide a feedback and ask
again.
• By iterating, one can get the better answer
Probe further
17
Generic Prompt Prompts with probing
Tell me more about paragraph 2.
Tell me more about option 1and 2.
Please explain the attraction in
paragraph 2.
• After receiving the answers, one could probe further in the current chat.
• One can find more detail information from the certain part of previous
response.
Provide a reference
18
Generic Prompt Prompt with feedback
Write a greeting email. I want you to use #my_style to
write a greeting email.
#my_style:
………..
• This technique is called ‘Few-shot Learning’
• By providing reference/ examples, one could receive customized response.
• It will help ChatGPT to mimic writing style and format.
Provide step by step instruction
19
Generic Prompt Prompt with step by step introduction
Perform the following actions:
1. Summarize the below text
2. Translate in French
3. Convert into JSON format
• One can give step by step instruction on how ChatGPT think the answer
“step by step”
• This will help ChatGPT to perform better.
Prompt Engineering
Technique
- Zero Shot
- Few Shot
- Reflection
- Chain of Thought
- Tree of Thought
Prompt Technique : Zero-Shot
21
• Purpose : One time Query
• Method : Straight-up Query
• Examples
• Prompt : What is 2 + 8?
• Output : 2 + 8 equals 10.
Prompt Technique : Few-Shot
22
• Purpose : Teaching AI models to follow specific patterns
• Method : Feeding model with examples before asking the desired questions
• Examples
• Prompt :
2@4 = 8
3@3 = 9
4@2 = 8
5@3 = 15
4@2 =
• Output :
It seems like you have a pattern where you're using "@" as an operator. Based on
the examples you provided:
2@4 = 8 (2 multiplied by 4)
3@3 = 9 (3 multiplied by 3)
4@2 = 8 (4 multiplied by 2)
5@3 = 15 (5 multiplied by 3)
So, following this pattern, 4@2 would be equal to 4 multiplied by 2, which is 8.
Prompt Technique : Chain of Thought Example
23
• Prompt :
Classify the safety issues of the text.
Follow these steps in the classification.
1. Identify adverse event in text.
2. Identify patient information in text
3. Identify medication information in text
If text answers to “Yes” on all the steps,
classify as ‘Safety Issues’ Otherwise ‘No
Safety Issues’
Let’s think step by step for classification of
the text.
Text: Patient 001 has adverse events after
taking the medication.
• Output :
Let's follow the steps you provided to classify the safety issues in
the text:
Step 1: Identify adverse event in text
- The text mentions "Patient 001 has adverse events after taking
the medication." This indicates that there is an adverse event
mentioned in the text.
Step 2: Identify patient information in text
- The text mentions "Patient 001," which is patient information.
Step 3: Identify medication information in text
- The text mentions "taking the medication," which is medication
information.
Now, let's evaluate the results of each step:
- Step 1: Adverse event identified
- Step 2: Patient information identified
- Step 3: Medication information identified
Since all three steps have been answered "Yes," we can classify
this text as 'Safety Issues' because it contains information about a
patient experiencing adverse events after taking medication.
ChatGPT Use Cases in
Biometrics
- Simple Inquiry
- Content Development
- Coding
- Comparison
- Data Analysis
- Patient Profiles
- Safety Cases
- Image Analysis
- Art Generation
25
Simple Inquiry
Prompt :
What is
schizophrenia?
Tell me in 200
words.
Output :
Schizophrenia is a complex and chronic mental disorder that profoundly affects a person's thinking,
emotions, and behavior. It typically emerges in late adolescence or early adulthood, and its exact
cause remains unclear, though it is thought to involve a combination of genetic, environmental, and
neurobiological factors.
Individuals with schizophrenia often experience a range of symptoms, including hallucinations (false
sensory perceptions), delusions (false beliefs), disorganized thinking, and reduced emotional
expression. They may also struggle with cognitive impairments, such as difficulty with memory,
attention, and decision-making.
Schizophrenia can have a profound impact on a person's daily life and functioning, making it
challenging to maintain relationships, hold a job, or pursue personal goals. It can lead to significant
distress and impairment in social, occupational, and educational domains.
Treatment for schizophrenia typically involves a combination of antipsychotic medications,
psychotherapy, and psychosocial support. While these interventions can help manage symptoms
and improve the quality of life for individuals with schizophrenia, the condition is often chronic and
requires ongoing care and support.
Early intervention and a comprehensive, individualized treatment plan are crucial for managing
schizophrenia and helping affected individuals lead fulfilling lives while minimizing the impact of their
symptoms.
26
Content Development
Prompt :
I am salesperson.
I need to contact the doctors
about new medicine, which is
3 times more effective to lower
blood pressure.
write marketing emails within
100 words.
Output :
Subject: Revolutionize Blood Pressure Management with Our New Medicine!
Dear Dr. [Doctor's Last Name],
I hope this message finds you well. I am excited to introduce our breakthrough
medication, [Medicine Name], designed to transform blood pressure management.
With its cutting-edge formula, it is proven to be three times more effective in lowering
blood pressure compared to existing solutions.
[Medicine Name] offers a unique opportunity for your patients to achieve better
health outcomes. Its advanced technology ensures quicker results and fewer side
effects, leading to enhanced patient compliance.
We would be honored to provide you with more information and samples for your
evaluation. Together, we can make a significant impact on improving patients' lives.
Let's revolutionize hypertension treatment together. Please reply to this email, and I'll
be happy to arrange a meeting at your convenience.
Best Regards,
[Your Name]
[Your Title]
[Your Contact Information]
27
Codes conversion
Prompt :
Convert below SAS codes to R codes:
data dm;
merge demo rand;
by usubjid ;
run;
Output :
You can convert the SAS code to R using the `merge` function in R to
perform the equivalent operation. Assuming you have two data frames
`demo` and `rand` that you want to merge by the `usubjid` variable,
here's the equivalent R code:
```
# Assuming you have loaded your data into two data frames: demo
and rand
# Merge the data frames by usubjid
dm <- merge(demo, rand, by="usubjid")
```
In this code:
- `demo` and `rand` are your input data frames.
- We use the `merge` function to merge the data frames.
- The `by` parameter specifies the key variable by which to merge the
data frames, which in this case is `usubjid`.
After running this code, the merged data frame `dm` will contain the
result of the merge operation, similar to what you would achieve with
the SAS code you provided.
28
Comparison between SAS and R
Prompt :
I want you to compare SAS and R
programming. Provide me with
differences, present in a table format
Output :
29
Patient Profile Development
• Prompt :
Use below data to provide patient profiles:
{ 'patient' : '01-001', 'sex' : 'male', 'age' : 25, 'race' : 'White'}
• Output :
Based on the provided data, here is a patient profile for '01-001':
- Patient ID: 01-001
- Sex: Male
- Age: 25
- Race: White
This patient is a 25-year-old male of White race. Please let me know if you need any
additional information or if you would like to create profiles for more patients.
30
Data Analysis (1)
• Prompt :
Select patients whose sex is male. Use below "Patient Data". Provide me the answers only.
“Patient Data”:
{ 'patient' : '01-001', 'sex' : 'male', 'age' : 25, 'race' : 'White’},
{ 'patient' : '01-002', 'sex' : ‘female', 'age’ : 28, 'race' : ‘Asian’},
{ 'patient' : ‘02-001', 'sex' : ‘female', 'age’ : 50, 'race' : ‘White’},
{ 'patient' : ‘02-002', 'sex' : 'male', 'age’ : 40, 'race' : ‘Black’}
• Output :
The selected patients whose sex is male are:
1. {'patient': '01-001', 'sex': 'male', 'age': 25, 'race': 'White'}
2. {'patient': '02-002', 'sex': 'male', 'age': 40, 'race': 'Black'}
31
Data Analysis (2)
• Prompt :
Count below “Patient Data” by race
“Patient Data”:
{ 'patient' : '01-001', 'sex' : 'male', 'age' : 25, 'race' : 'White’},
{ 'patient' : '01-002', 'sex' : ‘female', 'age’ : 28, 'race' : ‘Asian’},
{ 'patient' : ‘02-001', 'sex' : ‘female', 'age’ : 50, 'race' : ‘White’},
{ 'patient' : ‘02-002', 'sex' : 'male', 'age’ : 40, 'race' : ‘Black’}
• Output :
Certainly! Let's count the number of patients by race in the given "Patient Data":
- White: 2
- Asian: 1
- Black: 1
Boston Consulting : ChatGPT Users vs Non-users
• Results of consultants
using ChatGPT
• finished 12.2% more
tasks on average
• completed tasks
25.1% more quickly
• produced 40%
higher quality results
32
33
What can we ( Stat Programmers and
Biostatisticans) when we are fully utilizing with
prompt engineering?
Discussion : Q & A

More Related Content

Similar to Prompt it, not Google it - Prompt Engineering for Data Scientists

Myself Essay In German
Myself Essay In GermanMyself Essay In German
Myself Essay In GermanErin Byers
 
Top 52 mep engineer interview questions and answers pdf
Top 52 mep engineer interview questions and answers pdfTop 52 mep engineer interview questions and answers pdf
Top 52 mep engineer interview questions and answers pdfkeyjonh724
 
88 communications interview questions and answers
88 communications interview questions and answers88 communications interview questions and answers
88 communications interview questions and answersjoangarcia512
 
APF orlando diy survey workshop 071114 final
APF orlando diy survey workshop 071114 finalAPF orlando diy survey workshop 071114 final
APF orlando diy survey workshop 071114 finalMike Courtney
 
88 dispatcher interview questions and answers
88 dispatcher interview questions and answers88 dispatcher interview questions and answers
88 dispatcher interview questions and answersdavidgest49
 
Prompt-Engineering-Lecture-Elvis learn prompt engineering
Prompt-Engineering-Lecture-Elvis learn prompt engineeringPrompt-Engineering-Lecture-Elvis learn prompt engineering
Prompt-Engineering-Lecture-Elvis learn prompt engineeringSaweraKhadium
 
Top 52 clinical nurse specialist interview questions and answers pdf
Top 52 clinical nurse specialist interview questions and answers pdfTop 52 clinical nurse specialist interview questions and answers pdf
Top 52 clinical nurse specialist interview questions and answers pdfkingmin609
 
Marketing Research, steps in preparing questionnaire, BBA Osmania University
Marketing Research, steps in preparing questionnaire, BBA Osmania UniversityMarketing Research, steps in preparing questionnaire, BBA Osmania University
Marketing Research, steps in preparing questionnaire, BBA Osmania UniversityBalasri Kamarapu
 
Top 52 chiropractic assistant interview questions and answers pdf
Top 52 chiropractic assistant interview questions and answers pdfTop 52 chiropractic assistant interview questions and answers pdf
Top 52 chiropractic assistant interview questions and answers pdfforidorich
 
How to Conduct a Survey gf form to anylyz
How to Conduct a Survey gf form to anylyzHow to Conduct a Survey gf form to anylyz
How to Conduct a Survey gf form to anylyzedenjrodrigo
 
Tim Wade - 8 Pillars of Profitable Productivity
Tim Wade - 8 Pillars of Profitable ProductivityTim Wade - 8 Pillars of Profitable Productivity
Tim Wade - 8 Pillars of Profitable ProductivityTim Wade
 
Performance Management and AppraisalMEDICAL CENTERThis healt.docx
Performance Management and AppraisalMEDICAL CENTERThis healt.docxPerformance Management and AppraisalMEDICAL CENTERThis healt.docx
Performance Management and AppraisalMEDICAL CENTERThis healt.docxkarlhennesey
 
Top 52 civil engineer interview questions and answers pdf
Top 52 civil engineer interview questions and answers pdfTop 52 civil engineer interview questions and answers pdf
Top 52 civil engineer interview questions and answers pdfHarrisonFord888
 
Behavioral interviews
Behavioral interviews   Behavioral interviews
Behavioral interviews daisyfreya
 
CSIA 485 Project #4 Detailed Assignment DescriptionDevelop a.docx
CSIA 485 Project #4 Detailed Assignment DescriptionDevelop a.docxCSIA 485 Project #4 Detailed Assignment DescriptionDevelop a.docx
CSIA 485 Project #4 Detailed Assignment DescriptionDevelop a.docxannettsparrow
 
88 transportation interview questions and answers
88 transportation interview questions and answers88 transportation interview questions and answers
88 transportation interview questions and answerszoepowell999
 
A Great Idea Isn't Enough for Successful Change - Final
A Great Idea Isn't Enough for Successful Change - FinalA Great Idea Isn't Enough for Successful Change - Final
A Great Idea Isn't Enough for Successful Change - FinalKaiNexus
 
SurveyMonkey Audience Survey Writing Guide
SurveyMonkey Audience Survey Writing GuideSurveyMonkey Audience Survey Writing Guide
SurveyMonkey Audience Survey Writing GuideBrent Chudoba
 
Business Growth Engineering
Business Growth EngineeringBusiness Growth Engineering
Business Growth EngineeringDan Russell
 
Top 52 clinical research associate interview questions and answers pdf
Top 52 clinical research associate interview questions and answers pdfTop 52 clinical research associate interview questions and answers pdf
Top 52 clinical research associate interview questions and answers pdfHarrisonFord888
 

Similar to Prompt it, not Google it - Prompt Engineering for Data Scientists (20)

Myself Essay In German
Myself Essay In GermanMyself Essay In German
Myself Essay In German
 
Top 52 mep engineer interview questions and answers pdf
Top 52 mep engineer interview questions and answers pdfTop 52 mep engineer interview questions and answers pdf
Top 52 mep engineer interview questions and answers pdf
 
88 communications interview questions and answers
88 communications interview questions and answers88 communications interview questions and answers
88 communications interview questions and answers
 
APF orlando diy survey workshop 071114 final
APF orlando diy survey workshop 071114 finalAPF orlando diy survey workshop 071114 final
APF orlando diy survey workshop 071114 final
 
88 dispatcher interview questions and answers
88 dispatcher interview questions and answers88 dispatcher interview questions and answers
88 dispatcher interview questions and answers
 
Prompt-Engineering-Lecture-Elvis learn prompt engineering
Prompt-Engineering-Lecture-Elvis learn prompt engineeringPrompt-Engineering-Lecture-Elvis learn prompt engineering
Prompt-Engineering-Lecture-Elvis learn prompt engineering
 
Top 52 clinical nurse specialist interview questions and answers pdf
Top 52 clinical nurse specialist interview questions and answers pdfTop 52 clinical nurse specialist interview questions and answers pdf
Top 52 clinical nurse specialist interview questions and answers pdf
 
Marketing Research, steps in preparing questionnaire, BBA Osmania University
Marketing Research, steps in preparing questionnaire, BBA Osmania UniversityMarketing Research, steps in preparing questionnaire, BBA Osmania University
Marketing Research, steps in preparing questionnaire, BBA Osmania University
 
Top 52 chiropractic assistant interview questions and answers pdf
Top 52 chiropractic assistant interview questions and answers pdfTop 52 chiropractic assistant interview questions and answers pdf
Top 52 chiropractic assistant interview questions and answers pdf
 
How to Conduct a Survey gf form to anylyz
How to Conduct a Survey gf form to anylyzHow to Conduct a Survey gf form to anylyz
How to Conduct a Survey gf form to anylyz
 
Tim Wade - 8 Pillars of Profitable Productivity
Tim Wade - 8 Pillars of Profitable ProductivityTim Wade - 8 Pillars of Profitable Productivity
Tim Wade - 8 Pillars of Profitable Productivity
 
Performance Management and AppraisalMEDICAL CENTERThis healt.docx
Performance Management and AppraisalMEDICAL CENTERThis healt.docxPerformance Management and AppraisalMEDICAL CENTERThis healt.docx
Performance Management and AppraisalMEDICAL CENTERThis healt.docx
 
Top 52 civil engineer interview questions and answers pdf
Top 52 civil engineer interview questions and answers pdfTop 52 civil engineer interview questions and answers pdf
Top 52 civil engineer interview questions and answers pdf
 
Behavioral interviews
Behavioral interviews   Behavioral interviews
Behavioral interviews
 
CSIA 485 Project #4 Detailed Assignment DescriptionDevelop a.docx
CSIA 485 Project #4 Detailed Assignment DescriptionDevelop a.docxCSIA 485 Project #4 Detailed Assignment DescriptionDevelop a.docx
CSIA 485 Project #4 Detailed Assignment DescriptionDevelop a.docx
 
88 transportation interview questions and answers
88 transportation interview questions and answers88 transportation interview questions and answers
88 transportation interview questions and answers
 
A Great Idea Isn't Enough for Successful Change - Final
A Great Idea Isn't Enough for Successful Change - FinalA Great Idea Isn't Enough for Successful Change - Final
A Great Idea Isn't Enough for Successful Change - Final
 
SurveyMonkey Audience Survey Writing Guide
SurveyMonkey Audience Survey Writing GuideSurveyMonkey Audience Survey Writing Guide
SurveyMonkey Audience Survey Writing Guide
 
Business Growth Engineering
Business Growth EngineeringBusiness Growth Engineering
Business Growth Engineering
 
Top 52 clinical research associate interview questions and answers pdf
Top 52 clinical research associate interview questions and answers pdfTop 52 clinical research associate interview questions and answers pdf
Top 52 clinical research associate interview questions and answers pdf
 

More from Kevin Lee

Patient’s Journey using Real World Data and its Advanced Analytics
Patient’s Journey using Real World Data and its Advanced AnalyticsPatient’s Journey using Real World Data and its Advanced Analytics
Patient’s Journey using Real World Data and its Advanced AnalyticsKevin Lee
 
Introduction of AWS Cloud Computing and its future for Biometric Department
Introduction of AWS Cloud Computing and its future for Biometric DepartmentIntroduction of AWS Cloud Computing and its future for Biometric Department
Introduction of AWS Cloud Computing and its future for Biometric DepartmentKevin Lee
 
A fear of missing out and a fear of messing up : A Strategic Roadmap for Chat...
A fear of missing out and a fear of messing up : A Strategic Roadmap for Chat...A fear of missing out and a fear of messing up : A Strategic Roadmap for Chat...
A fear of missing out and a fear of messing up : A Strategic Roadmap for Chat...Kevin Lee
 
Leading into the Unknown? Yes, we need Change Management Leadership
Leading into the Unknown? Yes, we need Change Management LeadershipLeading into the Unknown? Yes, we need Change Management Leadership
Leading into the Unknown? Yes, we need Change Management LeadershipKevin Lee
 
How to create SDTM DM.xpt using Python v1.1
How to create SDTM DM.xpt using Python v1.1How to create SDTM DM.xpt using Python v1.1
How to create SDTM DM.xpt using Python v1.1Kevin Lee
 
Enterprise-level Transition from SAS to Open-source Programming for the whole...
Enterprise-level Transition from SAS to Open-source Programming for the whole...Enterprise-level Transition from SAS to Open-source Programming for the whole...
Enterprise-level Transition from SAS to Open-source Programming for the whole...Kevin Lee
 
How I became ML Engineer
How I became ML Engineer How I became ML Engineer
How I became ML Engineer Kevin Lee
 
Artificial Intelligence in Pharmaceutical Industry
Artificial Intelligence in Pharmaceutical IndustryArtificial Intelligence in Pharmaceutical Industry
Artificial Intelligence in Pharmaceutical IndustryKevin Lee
 
Tell stories with jupyter notebook
Tell stories with jupyter notebookTell stories with jupyter notebook
Tell stories with jupyter notebookKevin Lee
 
Perfect partnership - machine learning and CDISC standard data
Perfect partnership - machine learning and CDISC standard dataPerfect partnership - machine learning and CDISC standard data
Perfect partnership - machine learning and CDISC standard dataKevin Lee
 
Machine Learning : why we should know and how it works
Machine Learning : why we should know and how it worksMachine Learning : why we should know and how it works
Machine Learning : why we should know and how it worksKevin Lee
 
Big data for SAS programmers
Big data for SAS programmersBig data for SAS programmers
Big data for SAS programmersKevin Lee
 
Big data in pharmaceutical industry
Big data in pharmaceutical industryBig data in pharmaceutical industry
Big data in pharmaceutical industryKevin Lee
 
How FDA will reject non compliant electronic submission
How FDA will reject non compliant electronic submissionHow FDA will reject non compliant electronic submission
How FDA will reject non compliant electronic submissionKevin Lee
 
End to end standards driven oncology study (solid tumor, Immunotherapy, Leuke...
End to end standards driven oncology study (solid tumor, Immunotherapy, Leuke...End to end standards driven oncology study (solid tumor, Immunotherapy, Leuke...
End to end standards driven oncology study (solid tumor, Immunotherapy, Leuke...Kevin Lee
 
Are you ready for Dec 17, 2016 - CDISC compliant data?
Are you ready for Dec 17, 2016 - CDISC compliant data?Are you ready for Dec 17, 2016 - CDISC compliant data?
Are you ready for Dec 17, 2016 - CDISC compliant data?Kevin Lee
 
SAS integration with NoSQL data
SAS integration with NoSQL dataSAS integration with NoSQL data
SAS integration with NoSQL dataKevin Lee
 
Introduction of semantic technology for SAS programmers
Introduction of semantic technology for SAS programmersIntroduction of semantic technology for SAS programmers
Introduction of semantic technology for SAS programmersKevin Lee
 
Standards Metadata Management (system)
Standards Metadata Management (system)Standards Metadata Management (system)
Standards Metadata Management (system)Kevin Lee
 
Data centric SDLC for automated clinical data development
Data centric SDLC for automated clinical data developmentData centric SDLC for automated clinical data development
Data centric SDLC for automated clinical data developmentKevin Lee
 

More from Kevin Lee (20)

Patient’s Journey using Real World Data and its Advanced Analytics
Patient’s Journey using Real World Data and its Advanced AnalyticsPatient’s Journey using Real World Data and its Advanced Analytics
Patient’s Journey using Real World Data and its Advanced Analytics
 
Introduction of AWS Cloud Computing and its future for Biometric Department
Introduction of AWS Cloud Computing and its future for Biometric DepartmentIntroduction of AWS Cloud Computing and its future for Biometric Department
Introduction of AWS Cloud Computing and its future for Biometric Department
 
A fear of missing out and a fear of messing up : A Strategic Roadmap for Chat...
A fear of missing out and a fear of messing up : A Strategic Roadmap for Chat...A fear of missing out and a fear of messing up : A Strategic Roadmap for Chat...
A fear of missing out and a fear of messing up : A Strategic Roadmap for Chat...
 
Leading into the Unknown? Yes, we need Change Management Leadership
Leading into the Unknown? Yes, we need Change Management LeadershipLeading into the Unknown? Yes, we need Change Management Leadership
Leading into the Unknown? Yes, we need Change Management Leadership
 
How to create SDTM DM.xpt using Python v1.1
How to create SDTM DM.xpt using Python v1.1How to create SDTM DM.xpt using Python v1.1
How to create SDTM DM.xpt using Python v1.1
 
Enterprise-level Transition from SAS to Open-source Programming for the whole...
Enterprise-level Transition from SAS to Open-source Programming for the whole...Enterprise-level Transition from SAS to Open-source Programming for the whole...
Enterprise-level Transition from SAS to Open-source Programming for the whole...
 
How I became ML Engineer
How I became ML Engineer How I became ML Engineer
How I became ML Engineer
 
Artificial Intelligence in Pharmaceutical Industry
Artificial Intelligence in Pharmaceutical IndustryArtificial Intelligence in Pharmaceutical Industry
Artificial Intelligence in Pharmaceutical Industry
 
Tell stories with jupyter notebook
Tell stories with jupyter notebookTell stories with jupyter notebook
Tell stories with jupyter notebook
 
Perfect partnership - machine learning and CDISC standard data
Perfect partnership - machine learning and CDISC standard dataPerfect partnership - machine learning and CDISC standard data
Perfect partnership - machine learning and CDISC standard data
 
Machine Learning : why we should know and how it works
Machine Learning : why we should know and how it worksMachine Learning : why we should know and how it works
Machine Learning : why we should know and how it works
 
Big data for SAS programmers
Big data for SAS programmersBig data for SAS programmers
Big data for SAS programmers
 
Big data in pharmaceutical industry
Big data in pharmaceutical industryBig data in pharmaceutical industry
Big data in pharmaceutical industry
 
How FDA will reject non compliant electronic submission
How FDA will reject non compliant electronic submissionHow FDA will reject non compliant electronic submission
How FDA will reject non compliant electronic submission
 
End to end standards driven oncology study (solid tumor, Immunotherapy, Leuke...
End to end standards driven oncology study (solid tumor, Immunotherapy, Leuke...End to end standards driven oncology study (solid tumor, Immunotherapy, Leuke...
End to end standards driven oncology study (solid tumor, Immunotherapy, Leuke...
 
Are you ready for Dec 17, 2016 - CDISC compliant data?
Are you ready for Dec 17, 2016 - CDISC compliant data?Are you ready for Dec 17, 2016 - CDISC compliant data?
Are you ready for Dec 17, 2016 - CDISC compliant data?
 
SAS integration with NoSQL data
SAS integration with NoSQL dataSAS integration with NoSQL data
SAS integration with NoSQL data
 
Introduction of semantic technology for SAS programmers
Introduction of semantic technology for SAS programmersIntroduction of semantic technology for SAS programmers
Introduction of semantic technology for SAS programmers
 
Standards Metadata Management (system)
Standards Metadata Management (system)Standards Metadata Management (system)
Standards Metadata Management (system)
 
Data centric SDLC for automated clinical data development
Data centric SDLC for automated clinical data developmentData centric SDLC for automated clinical data development
Data centric SDLC for automated clinical data development
 

Recently uploaded

Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireExakis Nelite
 
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxMasterG
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceSamy Fodil
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftshyamraj55
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?Paolo Missier
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTopCSSGallery
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxFIDO Alliance
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxFIDO Alliance
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxFIDO Alliance
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch TuesdayIvanti
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe中 央社
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Patrick Viafore
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data SciencePaolo Missier
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Hiroshi SHIBATA
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...ScyllaDB
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024Stephen Perrenod
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxFIDO Alliance
 

Recently uploaded (20)

Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
(Explainable) Data-Centric AI: what are you explaininhg, and to whom?
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
Introduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptxIntroduction to FIDO Authentication and Passkeys.pptx
Introduction to FIDO Authentication and Passkeys.pptx
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
Portal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russePortal Kombat : extension du réseau de propagande russe
Portal Kombat : extension du réseau de propagande russe
 
Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024Extensible Python: Robustness through Addition - PyCon 2024
Extensible Python: Robustness through Addition - PyCon 2024
 
Design and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data ScienceDesign and Development of a Provenance Capture Platform for Data Science
Design and Development of a Provenance Capture Platform for Data Science
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
Event-Driven Architecture Masterclass: Engineering a Robust, High-performance...
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 

Prompt it, not Google it - Prompt Engineering for Data Scientists

  • 1. “Prompt it”, not “Google it” : Prompt Engineering for Stat Programmers and Biostatisticians Kevin Lee
  • 2. Disclaimer The views and opinions presented here represent those of the speaker and should not be considered to represent any companies or organizations.
  • 3. Agenda ➢Prompt it, not Google it ➢What is Prompt Engineering? ➢How to Prompt Better ➢Prompt Engineering Technique ➢Use Cases in Biometrics ➢Discussion 3
  • 5. Prompt it is the new Google it 5
  • 6. What is Prompt? 6 • Prompt – A tool to communicate with Gen AI (ChatGPT) • “Prompt It” is the new “Google it”
  • 8. What is Prompt Engineering? 8 • Prompt Engineering – the art of creating effective communication/ prompt that guide ChatGPT to generate desired response. • Bad Prompt – Bad Response • Good Prompt – Good Response
  • 9. How to work with the recent, smart graduate at work? 9
  • 10. ChatGPT is a very smart, capable, recent graduate 10 =?
  • 11. How to prompt better (How to communicate better) - Get Specific - Add Constraints - Add more contexts - Set the role - Coach with feedback - Probe further - Step by step introduction
  • 12. Get specific 12 Generic Prompt Specific Prompt Write an essay about flowers. Write an essay about flowers at 9th grade level Write me a rap song Write me a rap song using references to SpongeBob Square Pants. Write me a promotion request. Write me a promotion request for Manager of Statistical Programmer. • Generic inquiry will provide generic (and less impressive) answers
  • 13. Add Parameter or Constraints 13 Generic Prompt Prompt with parameter Write an essay about flowers. Write an essay about flowers at 9th grade level within 200 words Tell me the best places to visit in Prague. Tell me the best places to visit in Prague within 4 days. Tell me the best places to visit in Prague. Tell me the best places to visit in Prague with $500 budget. • Restriction and constraints breed a creativity • Example of parameters • Under 100 words • Include word of “creative” / do not use a word of “creative” • Make it under $100 • Make it work for 15 people
  • 14. Add more context 14 Generic Prompt Prompt with more context Write a greeting email. I have not seen my friend for a long time. I want to know how he is doing. Write a greeting email. • If one adds more background, ChatGPT can provide more relevant, customized answers. • Provide the reason that I am using ChatGPT
  • 15. Set the role 15 Generic Prompt Prompt with role Write a greeting email. I am a salesperson who markets new medicine. Write a greeting email. Review this proposal and provide your feedback. Pretend you are the head of IT. Review this proposal and provide your feedback. How do you respond below proposal? You are Steve Jobs. How do you respond below proposal? • If one gives a role to ChatGPT and ask, ChatGPT play a role given and provide the answers. • Example of roles : boss, parent, salesperson,
  • 16. Coach ChatGPT with feedback 16 Generic Prompt Prompt with feedback Write a greeting email. Make it in 50 words. Make it more formal. Make it more persuasive. • After ChatGPT provide an answer, one can provide a feedback and ask again. • By iterating, one can get the better answer
  • 17. Probe further 17 Generic Prompt Prompts with probing Tell me more about paragraph 2. Tell me more about option 1and 2. Please explain the attraction in paragraph 2. • After receiving the answers, one could probe further in the current chat. • One can find more detail information from the certain part of previous response.
  • 18. Provide a reference 18 Generic Prompt Prompt with feedback Write a greeting email. I want you to use #my_style to write a greeting email. #my_style: ……….. • This technique is called ‘Few-shot Learning’ • By providing reference/ examples, one could receive customized response. • It will help ChatGPT to mimic writing style and format.
  • 19. Provide step by step instruction 19 Generic Prompt Prompt with step by step introduction Perform the following actions: 1. Summarize the below text 2. Translate in French 3. Convert into JSON format • One can give step by step instruction on how ChatGPT think the answer “step by step” • This will help ChatGPT to perform better.
  • 20. Prompt Engineering Technique - Zero Shot - Few Shot - Reflection - Chain of Thought - Tree of Thought
  • 21. Prompt Technique : Zero-Shot 21 • Purpose : One time Query • Method : Straight-up Query • Examples • Prompt : What is 2 + 8? • Output : 2 + 8 equals 10.
  • 22. Prompt Technique : Few-Shot 22 • Purpose : Teaching AI models to follow specific patterns • Method : Feeding model with examples before asking the desired questions • Examples • Prompt : 2@4 = 8 3@3 = 9 4@2 = 8 5@3 = 15 4@2 = • Output : It seems like you have a pattern where you're using "@" as an operator. Based on the examples you provided: 2@4 = 8 (2 multiplied by 4) 3@3 = 9 (3 multiplied by 3) 4@2 = 8 (4 multiplied by 2) 5@3 = 15 (5 multiplied by 3) So, following this pattern, 4@2 would be equal to 4 multiplied by 2, which is 8.
  • 23. Prompt Technique : Chain of Thought Example 23 • Prompt : Classify the safety issues of the text. Follow these steps in the classification. 1. Identify adverse event in text. 2. Identify patient information in text 3. Identify medication information in text If text answers to “Yes” on all the steps, classify as ‘Safety Issues’ Otherwise ‘No Safety Issues’ Let’s think step by step for classification of the text. Text: Patient 001 has adverse events after taking the medication. • Output : Let's follow the steps you provided to classify the safety issues in the text: Step 1: Identify adverse event in text - The text mentions "Patient 001 has adverse events after taking the medication." This indicates that there is an adverse event mentioned in the text. Step 2: Identify patient information in text - The text mentions "Patient 001," which is patient information. Step 3: Identify medication information in text - The text mentions "taking the medication," which is medication information. Now, let's evaluate the results of each step: - Step 1: Adverse event identified - Step 2: Patient information identified - Step 3: Medication information identified Since all three steps have been answered "Yes," we can classify this text as 'Safety Issues' because it contains information about a patient experiencing adverse events after taking medication.
  • 24. ChatGPT Use Cases in Biometrics - Simple Inquiry - Content Development - Coding - Comparison - Data Analysis - Patient Profiles - Safety Cases - Image Analysis - Art Generation
  • 25. 25 Simple Inquiry Prompt : What is schizophrenia? Tell me in 200 words. Output : Schizophrenia is a complex and chronic mental disorder that profoundly affects a person's thinking, emotions, and behavior. It typically emerges in late adolescence or early adulthood, and its exact cause remains unclear, though it is thought to involve a combination of genetic, environmental, and neurobiological factors. Individuals with schizophrenia often experience a range of symptoms, including hallucinations (false sensory perceptions), delusions (false beliefs), disorganized thinking, and reduced emotional expression. They may also struggle with cognitive impairments, such as difficulty with memory, attention, and decision-making. Schizophrenia can have a profound impact on a person's daily life and functioning, making it challenging to maintain relationships, hold a job, or pursue personal goals. It can lead to significant distress and impairment in social, occupational, and educational domains. Treatment for schizophrenia typically involves a combination of antipsychotic medications, psychotherapy, and psychosocial support. While these interventions can help manage symptoms and improve the quality of life for individuals with schizophrenia, the condition is often chronic and requires ongoing care and support. Early intervention and a comprehensive, individualized treatment plan are crucial for managing schizophrenia and helping affected individuals lead fulfilling lives while minimizing the impact of their symptoms.
  • 26. 26 Content Development Prompt : I am salesperson. I need to contact the doctors about new medicine, which is 3 times more effective to lower blood pressure. write marketing emails within 100 words. Output : Subject: Revolutionize Blood Pressure Management with Our New Medicine! Dear Dr. [Doctor's Last Name], I hope this message finds you well. I am excited to introduce our breakthrough medication, [Medicine Name], designed to transform blood pressure management. With its cutting-edge formula, it is proven to be three times more effective in lowering blood pressure compared to existing solutions. [Medicine Name] offers a unique opportunity for your patients to achieve better health outcomes. Its advanced technology ensures quicker results and fewer side effects, leading to enhanced patient compliance. We would be honored to provide you with more information and samples for your evaluation. Together, we can make a significant impact on improving patients' lives. Let's revolutionize hypertension treatment together. Please reply to this email, and I'll be happy to arrange a meeting at your convenience. Best Regards, [Your Name] [Your Title] [Your Contact Information]
  • 27. 27 Codes conversion Prompt : Convert below SAS codes to R codes: data dm; merge demo rand; by usubjid ; run; Output : You can convert the SAS code to R using the `merge` function in R to perform the equivalent operation. Assuming you have two data frames `demo` and `rand` that you want to merge by the `usubjid` variable, here's the equivalent R code: ``` # Assuming you have loaded your data into two data frames: demo and rand # Merge the data frames by usubjid dm <- merge(demo, rand, by="usubjid") ``` In this code: - `demo` and `rand` are your input data frames. - We use the `merge` function to merge the data frames. - The `by` parameter specifies the key variable by which to merge the data frames, which in this case is `usubjid`. After running this code, the merged data frame `dm` will contain the result of the merge operation, similar to what you would achieve with the SAS code you provided.
  • 28. 28 Comparison between SAS and R Prompt : I want you to compare SAS and R programming. Provide me with differences, present in a table format Output :
  • 29. 29 Patient Profile Development • Prompt : Use below data to provide patient profiles: { 'patient' : '01-001', 'sex' : 'male', 'age' : 25, 'race' : 'White'} • Output : Based on the provided data, here is a patient profile for '01-001': - Patient ID: 01-001 - Sex: Male - Age: 25 - Race: White This patient is a 25-year-old male of White race. Please let me know if you need any additional information or if you would like to create profiles for more patients.
  • 30. 30 Data Analysis (1) • Prompt : Select patients whose sex is male. Use below "Patient Data". Provide me the answers only. “Patient Data”: { 'patient' : '01-001', 'sex' : 'male', 'age' : 25, 'race' : 'White’}, { 'patient' : '01-002', 'sex' : ‘female', 'age’ : 28, 'race' : ‘Asian’}, { 'patient' : ‘02-001', 'sex' : ‘female', 'age’ : 50, 'race' : ‘White’}, { 'patient' : ‘02-002', 'sex' : 'male', 'age’ : 40, 'race' : ‘Black’} • Output : The selected patients whose sex is male are: 1. {'patient': '01-001', 'sex': 'male', 'age': 25, 'race': 'White'} 2. {'patient': '02-002', 'sex': 'male', 'age': 40, 'race': 'Black'}
  • 31. 31 Data Analysis (2) • Prompt : Count below “Patient Data” by race “Patient Data”: { 'patient' : '01-001', 'sex' : 'male', 'age' : 25, 'race' : 'White’}, { 'patient' : '01-002', 'sex' : ‘female', 'age’ : 28, 'race' : ‘Asian’}, { 'patient' : ‘02-001', 'sex' : ‘female', 'age’ : 50, 'race' : ‘White’}, { 'patient' : ‘02-002', 'sex' : 'male', 'age’ : 40, 'race' : ‘Black’} • Output : Certainly! Let's count the number of patients by race in the given "Patient Data": - White: 2 - Asian: 1 - Black: 1
  • 32. Boston Consulting : ChatGPT Users vs Non-users • Results of consultants using ChatGPT • finished 12.2% more tasks on average • completed tasks 25.1% more quickly • produced 40% higher quality results 32
  • 33. 33 What can we ( Stat Programmers and Biostatisticans) when we are fully utilizing with prompt engineering?