3
Most read
6
Most read
9
Most read
Lecture 05
Irfan Malik
Dr. Sheraz Naseer
● Prompt Engineering
● Chat GPT PlayGround
Agenda
Generative AI
3
Tokenization
Definition: Tokenization is the process of breaking down text into smaller units
called tokens, which can be words, phrases, or even characters.
4
Tokens in Language Models
Definition: Tokens are the fundamental units of text used by language models.
They can be as short as a single character or as long as a word or phrase.
Importance: Language models process text at the token level, allowing them to
analyze and generate text based on the context and relationships between
individual tokens.
5
Prompt Limits in Language Models
Definition: Prompt limits refer to the constraints imposed on the input provided to
a language model.
Reasons for Prompt Limits:
● Memory limitations: Language models have a finite capacity to process
and store information.
● Computational constraints: Longer prompts require more processing time
and computational resources.
● Response coherence: Extremely long prompts may result in irrelevant
outputs.
6
Prompt Engineering
7
What is Prompt Engineering?
● Prompt engineering involves crafting tailored instructions or queries to
guide the language model towards desired outputs.
● It helps shape the behavior of the model and improves response quality.
8
Anatomy of Prompt
Definition: In the context of
language models, a prompt refers
to the input or instruction
provided to the model to generate
a specific response or output
9
Parts of a Good Prompt (Not all are
necessary for each and every prompt)
1. Simulate Persona
2. Task
3. Steps to complete Task
4. Context/Constraints
5. Goal
6. Format Output
Prompting Example 01
Simulate Persona: You are a customer service representative for a tech company.
Task: Assist a customer in resolving a software issue.
Steps to complete Task:
Greet the customer and ask for details about the issue.
Provide step-by-step instructions to troubleshoot the problem.
If the issue persists, escalate it to the technical support team.
Context/Constraints: The customer is not tech-savvy, and you must communicate in
a friendly and non-technical manner.
Goal: Resolve the customer's issue satisfactorily.
Format Output: Provide a summary of the troubleshooting steps and any additional
information the customer might need.
10
Prompting Example 02
Simulate Persona: Imagine you are a mentor guiding a group of individuals new to prompt
engineering.
Task: Identify and address common issues in prompt creation to improve overall effectiveness.
Steps to complete Task:
Analyze the prompt for Simulate Persona, Task, Steps to complete Task, Context/constraints,
goals and Format Output
Identify and rectify instances of ambiguity or vagueness in prompt language.
Ensure that prompts provide sufficient information for the desired task without unnecessary
complexity.
Context/Constraints: Consider the diverse backgrounds and skill levels of those engaging with
the prompts.
Goal: Enhance the quality of prompts by eliminating potential sources of confusion or
misinterpretation.
Format Output: Provide a revised version of a poorly constructed prompt, highlighting the
changes made and explaining how each modification contributes to better prompt engineering.
11
Context in Prompting
Definition: Context refers to the information and preceding text that informs the
language model about the desired output or influences its response.
Role of Context:
● Context helps shape the model's behavior and generate more accurate
responses.
● Relevance: Context ensures continuity and relevance in the generated text.
● Interpretation: The language model uses context to understand the desired
meaning and tone of the prompt.
12
Tips for Effective Prompt Engineering
● Be explicit: Clearly specify the desired format or output.
● Provide context: Offer relevant information or background to guide the
model.
● Control output length: Instruct the model to generate responses of a
specific length.
● Restrict responses: Utilize techniques like temperature adjustment to refine
output quality.
● Experiment and iterate: Refine prompts through experimentation and
feedback loops.
13
Chat GPT PlayGround
14
Summary
1. Prompt Engineering
2. Best Practices
3. ChatGPT PlayGround
4. Sample prompt practise
15

More Related Content

PDF
Retrieval Augmented Generation in Practice: Scalable GenAI platforms with k8s...
PDF
The 7 Most Common Usability Issues
PPTX
Prompt Engineering.pptx
PPTX
OpenAI-Copilot-ChatGPT.pptx
PDF
Prompt Engineering
PPTX
Learn Prompt Engineering Basics chatgpt llms guide
PPTX
PPt on Chat GPT New users.pptx
PDF
What is langchain
Retrieval Augmented Generation in Practice: Scalable GenAI platforms with k8s...
The 7 Most Common Usability Issues
Prompt Engineering.pptx
OpenAI-Copilot-ChatGPT.pptx
Prompt Engineering
Learn Prompt Engineering Basics chatgpt llms guide
PPt on Chat GPT New users.pptx
What is langchain

What's hot (20)

PDF
Using MLOps to Bring ML to Production/The Promise of MLOps
PDF
ChatGPT - AI.pdf
PPTX
Mule AMQP Connector
PDF
The Rise of the LLMs - How I Learned to Stop Worrying & Love the GPT!
PPTX
Cloud AI GenAI Overview.pptx
PDF
Advanced Retrieval Augmented Generation Techniques
PDF
Emeli Dral (Evidently AI) – Analyze it: production monitoring for machine lea...
PPTX
OpenAI Chatgpt.pptx
PPTX
Prompt Engineering Guide.pptx
PPTX
ChatGpt.pptx
PPTX
Prototype Model
PPTX
Prompting is an art / Sztuka promptowania
PPTX
Episode 2: The LLM / GPT / AI Prompt / Data Engineer Roadmap
PDF
Software development process
PPTX
‘Big models’: the success and pitfalls of Transformer models in natural langu...
PDF
Building AI Startups & AI Mindset
PPTX
Learn Prompting with ChatGPT
PDF
The current state of generative AI
PPTX
Non technical explanation of Large Language Model
PDF
GenAi LLMs Zero to Hero: Mastering GenAI
Using MLOps to Bring ML to Production/The Promise of MLOps
ChatGPT - AI.pdf
Mule AMQP Connector
The Rise of the LLMs - How I Learned to Stop Worrying & Love the GPT!
Cloud AI GenAI Overview.pptx
Advanced Retrieval Augmented Generation Techniques
Emeli Dral (Evidently AI) – Analyze it: production monitoring for machine lea...
OpenAI Chatgpt.pptx
Prompt Engineering Guide.pptx
ChatGpt.pptx
Prototype Model
Prompting is an art / Sztuka promptowania
Episode 2: The LLM / GPT / AI Prompt / Data Engineer Roadmap
Software development process
‘Big models’: the success and pitfalls of Transformer models in natural langu...
Building AI Startups & AI Mindset
Learn Prompting with ChatGPT
The current state of generative AI
Non technical explanation of Large Language Model
GenAi LLMs Zero to Hero: Mastering GenAI
Ad

Similar to Lecture 05 - Prompt Engineering.pptx (20)

PDF
Mastering Chatgpt The Ultimate Guide To Prompt Engineering For Beginners 2024...
PDF
A comprehensive guide to prompt engineering.pdf
PDF
Learn Prompt Engineering: Google’s 10-Step Guide Now Available
PDF
Rostyslav Chayka: Prompt Engineering для проєктного менеджменту (Advanced) (UA)
PDF
A comprehensive guide to prompt engineering.pdf
PDF
Prompt Engineering for AI and ML Technical Product Managers - 2023-08-21 00.5...
PPTX
How to fine-tune and develop your own large language model.pptx
PPTX
ChatGPT Prompt Engineering - Practical Strategies for Effective Content Creat...
PDF
A comprehensive guide to prompt engineering.pdf
PDF
A comprehensive guide to prompt engineering.pdf
PPTX
Applications of Generative Artificial intelligence
PDF
Best Practices for Building Successful LLM Applications
PDF
Chatgpt and Prompt engineering for course creators.pdf
PDF
Chatgpt and Prompt engineering for course creators.pdf
PDF
LLM Learning Path Level 1 - Presentation Slides
PPTX
Pair Programming with a Large Language Model
PDF
Rostyslav Chayka: Prompt Engineering для проєктного менеджменту (Basic) (UA)
PPTX
Gnerative AI presidency Module1_L3.pptx
PPTX
Mastering Advanced Prompt Engineering...
PDF
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Mastering Chatgpt The Ultimate Guide To Prompt Engineering For Beginners 2024...
A comprehensive guide to prompt engineering.pdf
Learn Prompt Engineering: Google’s 10-Step Guide Now Available
Rostyslav Chayka: Prompt Engineering для проєктного менеджменту (Advanced) (UA)
A comprehensive guide to prompt engineering.pdf
Prompt Engineering for AI and ML Technical Product Managers - 2023-08-21 00.5...
How to fine-tune and develop your own large language model.pptx
ChatGPT Prompt Engineering - Practical Strategies for Effective Content Creat...
A comprehensive guide to prompt engineering.pdf
A comprehensive guide to prompt engineering.pdf
Applications of Generative Artificial intelligence
Best Practices for Building Successful LLM Applications
Chatgpt and Prompt engineering for course creators.pdf
Chatgpt and Prompt engineering for course creators.pdf
LLM Learning Path Level 1 - Presentation Slides
Pair Programming with a Large Language Model
Rostyslav Chayka: Prompt Engineering для проєктного менеджменту (Basic) (UA)
Gnerative AI presidency Module1_L3.pptx
Mastering Advanced Prompt Engineering...
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Ad

Recently uploaded (20)

PPTX
Introduction to cybersecurity and digital nettiquette
PDF
Uptota Investor Deck - Where Africa Meets Blockchain
PPTX
Internet Safety for Seniors presentation
PDF
📍 LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1 TERPOPULER DI INDONESIA ! 🌟
PPT
250152213-Excitation-SystemWERRT (1).ppt
PDF
Alethe Consulting Corporate Profile and Solution Aproach
PDF
Exploring VPS Hosting Trends for SMBs in 2025
PDF
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
PDF
si manuel quezon at mga nagawa sa bansang pilipinas
PDF
Course Overview and Agenda cloud security
PPTX
module 1-Part 1.pptxdddddddddddddddddddddddddddddddddddd
PPT
FIRE PREVENTION AND CONTROL PLAN- LUS.FM.MQ.OM.UTM.PLN.00014.ppt
PPTX
newyork.pptxirantrafgshenepalchinachinane
PDF
The Evolution of Traditional to New Media .pdf
PPT
415456121-Jiwratrwecdtwfdsfwgdwedvwe dbwsdjsadca-EVN.ppt
PPT
12 Things That Make People Trust a Website Instantly
PDF
mera desh ae watn.(a source of motivation and patriotism to the youth of the ...
DOCX
Powerful Ways AIRCONNECT INFOSYSTEMS Pvt Ltd Enhances IT Infrastructure in In...
PPTX
IPCNA VIRTUAL CLASSES INTERMEDIATE 6 PROJECT.pptx
PPTX
t_and_OpenAI_Combined_two_pressentations
Introduction to cybersecurity and digital nettiquette
Uptota Investor Deck - Where Africa Meets Blockchain
Internet Safety for Seniors presentation
📍 LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1 TERPOPULER DI INDONESIA ! 🌟
250152213-Excitation-SystemWERRT (1).ppt
Alethe Consulting Corporate Profile and Solution Aproach
Exploring VPS Hosting Trends for SMBs in 2025
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
si manuel quezon at mga nagawa sa bansang pilipinas
Course Overview and Agenda cloud security
module 1-Part 1.pptxdddddddddddddddddddddddddddddddddddd
FIRE PREVENTION AND CONTROL PLAN- LUS.FM.MQ.OM.UTM.PLN.00014.ppt
newyork.pptxirantrafgshenepalchinachinane
The Evolution of Traditional to New Media .pdf
415456121-Jiwratrwecdtwfdsfwgdwedvwe dbwsdjsadca-EVN.ppt
12 Things That Make People Trust a Website Instantly
mera desh ae watn.(a source of motivation and patriotism to the youth of the ...
Powerful Ways AIRCONNECT INFOSYSTEMS Pvt Ltd Enhances IT Infrastructure in In...
IPCNA VIRTUAL CLASSES INTERMEDIATE 6 PROJECT.pptx
t_and_OpenAI_Combined_two_pressentations

Lecture 05 - Prompt Engineering.pptx

  • 2. ● Prompt Engineering ● Chat GPT PlayGround Agenda
  • 4. Tokenization Definition: Tokenization is the process of breaking down text into smaller units called tokens, which can be words, phrases, or even characters. 4
  • 5. Tokens in Language Models Definition: Tokens are the fundamental units of text used by language models. They can be as short as a single character or as long as a word or phrase. Importance: Language models process text at the token level, allowing them to analyze and generate text based on the context and relationships between individual tokens. 5
  • 6. Prompt Limits in Language Models Definition: Prompt limits refer to the constraints imposed on the input provided to a language model. Reasons for Prompt Limits: ● Memory limitations: Language models have a finite capacity to process and store information. ● Computational constraints: Longer prompts require more processing time and computational resources. ● Response coherence: Extremely long prompts may result in irrelevant outputs. 6
  • 8. What is Prompt Engineering? ● Prompt engineering involves crafting tailored instructions or queries to guide the language model towards desired outputs. ● It helps shape the behavior of the model and improves response quality. 8
  • 9. Anatomy of Prompt Definition: In the context of language models, a prompt refers to the input or instruction provided to the model to generate a specific response or output 9 Parts of a Good Prompt (Not all are necessary for each and every prompt) 1. Simulate Persona 2. Task 3. Steps to complete Task 4. Context/Constraints 5. Goal 6. Format Output
  • 10. Prompting Example 01 Simulate Persona: You are a customer service representative for a tech company. Task: Assist a customer in resolving a software issue. Steps to complete Task: Greet the customer and ask for details about the issue. Provide step-by-step instructions to troubleshoot the problem. If the issue persists, escalate it to the technical support team. Context/Constraints: The customer is not tech-savvy, and you must communicate in a friendly and non-technical manner. Goal: Resolve the customer's issue satisfactorily. Format Output: Provide a summary of the troubleshooting steps and any additional information the customer might need. 10
  • 11. Prompting Example 02 Simulate Persona: Imagine you are a mentor guiding a group of individuals new to prompt engineering. Task: Identify and address common issues in prompt creation to improve overall effectiveness. Steps to complete Task: Analyze the prompt for Simulate Persona, Task, Steps to complete Task, Context/constraints, goals and Format Output Identify and rectify instances of ambiguity or vagueness in prompt language. Ensure that prompts provide sufficient information for the desired task without unnecessary complexity. Context/Constraints: Consider the diverse backgrounds and skill levels of those engaging with the prompts. Goal: Enhance the quality of prompts by eliminating potential sources of confusion or misinterpretation. Format Output: Provide a revised version of a poorly constructed prompt, highlighting the changes made and explaining how each modification contributes to better prompt engineering. 11
  • 12. Context in Prompting Definition: Context refers to the information and preceding text that informs the language model about the desired output or influences its response. Role of Context: ● Context helps shape the model's behavior and generate more accurate responses. ● Relevance: Context ensures continuity and relevance in the generated text. ● Interpretation: The language model uses context to understand the desired meaning and tone of the prompt. 12
  • 13. Tips for Effective Prompt Engineering ● Be explicit: Clearly specify the desired format or output. ● Provide context: Offer relevant information or background to guide the model. ● Control output length: Instruct the model to generate responses of a specific length. ● Restrict responses: Utilize techniques like temperature adjustment to refine output quality. ● Experiment and iterate: Refine prompts through experimentation and feedback loops. 13
  • 15. Summary 1. Prompt Engineering 2. Best Practices 3. ChatGPT PlayGround 4. Sample prompt practise 15