5 Ways Your Prompts Need To Change To Get The Best of GPT-4o

AI and Tech for Education
17 Jun 202413:34

Summary

TLDRThis video script provides essential tactics for optimizing prompts to achieve the best results from Chat GPT. It emphasizes the importance of clear details, breaking down complex tasks, utilizing larger prompts with delimiters, referencing texts for specific information, and using one-shot or few-shot prompting with examples. The script illustrates these tactics with practical examples, demonstrating how to structure prompts for detailed outputs, organize virtual conferences, synthesize research findings, and write abstracts in a specific journal style.

Takeaways

  • 📝 Be specific and clear in your prompts to provide the AI with more context, leading to more accurate predictions and relevant outputs.
  • 📚 Include detailed instructions in your prompts, such as specifying the desired output length, focus, audience, and tone, to guide the AI effectively.
  • 🔍 Use examples to illustrate the task, such as one-shot or few-shot prompting, to help the AI replicate the desired outcome more effectively.
  • 📈 Break down complex tasks into simpler subtasks to make it easier for the AI to provide precise and helpful responses for each step.
  • 📑 Utilize larger prompts with clear delimiters to structure complex interactions and maintain the AI's understanding across a large context window.
  • 📘 Provide reference texts and specific questions to extract accurate information, ensuring the AI cites the document and does not fabricate information.
  • 🔑 Use delimiters consistently to separate different parts of your request, helping the AI understand where one part of the input ends and another begins.
  • 📝 When providing a large prompt, structure it clearly with instructions and examples to guide the AI in generating the desired output.
  • 🔬 Test the AI's ability to handle complex instructions by attaching articles and giving detailed tasks, such as summarizing and crafting sections based on those summaries.
  • 📋 Demonstrate the effectiveness of using examples by showing how the AI can mimic the style of abstracts from a journal when given two or more examples.
  • 📈 The video script emphasizes the importance of prompt engineering techniques to optimize interactions with AI and achieve better results.

Q & A

  • What are the main tactics discussed in the video for getting the best results from chat GPT?

    -The video discusses five main tactics: 1) Include specific and clear details in your prompt, 2) Split complex tasks into simpler subtasks, 3) Use larger prompts with delimiters, 4) Provide a reference text, and 5) Use one-shot and few-shot prompting with examples.

  • Why is it important to include specific details in a prompt for chat GPT?

    -Including specific details provides the model with more context, which helps it to predict and generate more relevant and accurate subsequent words and tokens.

  • Can you give an example of a bad prompt according to the video?

    -A bad example prompt would be something like 'write about AI in healthcare', which is too general and lacks specificity.

  • What is the purpose of splitting complex tasks into simpler subtasks?

    -Splitting tasks simplifies the process for chat GPT, making it easier to provide precise and helpful responses for each step of the task.

  • How does using delimiters help in structuring large prompts for chat GPT?

    -Delimiters help the AI understand where one part of the input ends and another begins, making it easier to process and respond to complex and detailed prompts.

  • What is the advantage of using a reference text in prompts?

    -Using a reference text allows chat GPT to extract specific information and answer questions accurately, ensuring the response is based on the provided document.

  • How does one-shot prompting differ from few-shot prompting?

    -One-shot prompting involves giving one example to illustrate the task, while few-shot prompting involves giving two or more examples to help the model replicate the outcome more effectively.

  • What is the recommended number of examples to use in few-shot prompting according to the video?

    -The video suggests that using two to five examples in few-shot prompting yields better results.

  • How does chat GPT handle a question if the reference text does not contain the information needed to answer it?

    -If the reference text does not contain the necessary information, chat GPT is instructed to respond with 'insufficient information'.

  • What is the significance of providing examples when asking chat GPT to write in a specific style, such as an academic abstract?

    -Providing examples illustrates the desired style and structure, enabling chat GPT to replicate it accurately in its response.

  • What is the next step the video promises to deliver in terms of prompt engineering tactics?

    -The video promises to cover five more tactics in the next video, encouraging viewers to subscribe for updates.

Outlines

00:00

📘 Optimizing Chat GPT Prompts with Clear Details

The first paragraph introduces the video's focus on tactics for crafting effective prompts for Chat GPT, referencing Open AI's prompt engineering guide. The key tactic discussed is the importance of including specific and clear details in prompts to provide the AI with sufficient context for accurate predictions. An example is given to illustrate the difference between a vague prompt and a detailed one, showing how specificity improves the relevance and quality of the AI's output.

05:02

📚 Breaking Down Complex Tasks for Chat GPT

The second paragraph emphasizes the strategy of splitting complex tasks into simpler subtasks to facilitate more precise responses from Chat GPT. It demonstrates how breaking down a request, such as organizing a virtual conference, into actionable steps results in a more detailed guide. The paragraph also shows how further details can be obtained by specifying particular steps, leading to a more comprehensive and step-by-step approach.

10:02

🔍 Utilizing Delimiters for Structured Prompts

The third paragraph discusses the use of delimiters to structure large prompts and help the AI understand the different parts of a request. Examples of delimiters are provided, and a detailed example is given where XML tags are used to structure instructions for summarizing research papers and developing sections based on those summaries. The output from Chat GPT is shown to be well-structured and adhering to the provided guidelines, highlighting the effectiveness of using delimiters.

📝 Extracting Information with Reference Texts

The fourth paragraph introduces the technique of providing a reference text enclosed in triple quotes for Chat GPT to extract specific information from. It outlines a method where the AI is instructed to answer a question using only the provided document and to cite the passages used. An example is given where the AI successfully extracts a definition from a text and cites the source, and also correctly indicates 'insufficient information' when the question cannot be answered by the provided text.

🎯 Enhancing Prompts with One-Shot and Few-Shot Examples

The final paragraph of the script explores the power of providing examples through one-shot and few-shot prompting to illustrate tasks for the AI. It explains that giving clear examples helps the model replicate the desired outcome, with research suggesting that few-shot prompting (two to five examples) yields better results. An example is provided where Chat GPT is instructed to write an abstract in the style of existing journal abstracts, demonstrating the AI's ability to mimic the style effectively.

Mindmap

Keywords

💡Prompt Engineering

Prompt engineering refers to the art of crafting input prompts for AI systems to elicit desired responses. In the video, it is the central theme, focusing on how to effectively communicate with AI like Chat GPT to achieve optimal results. The script provides various tactics to improve prompt engineering, such as including clear details and splitting complex tasks into simpler subtasks.

💡Tokens

In the context of the video, tokens represent individual elements, typically words, that an AI model considers when generating responses. The script explains that providing specific details in prompts helps the model to predict subsequent tokens more accurately within its context window.

💡Context Window

The context window is the set of tokens or words that an AI model uses to understand the current session and predict the next tokens. The script emphasizes the importance of this concept in creating effective prompts, as it directly influences the AI's output generation process.

💡Actionable Steps

The script suggests breaking down complex tasks into actionable steps to simplify the process for the AI. This approach helps in getting more precise responses from Chat GPT, as demonstrated by the example of organizing a virtual conference on AI, where the AI is first asked to list the steps involved.

💡Delimiters

Delimiters are symbols or words used to separate different parts of a prompt, helping the AI to understand the structure of the input. The video script mentions various types of delimiters, such as triple quotes and XML tags, and advises staying consistent with them for clarity in complex prompts.

💡128,000 Token Context

This term refers to the capacity of the AI model to retain and understand information across a large number of tokens, approximately 100,000 words. The script highlights this as an advantage for conducting detailed and complex interactions with the model, allowing for longer and more comprehensive prompts.

💡Reference Text

The script discusses the use of reference text to extract specific information from documents or data sets. This is done by enclosing the text in triple quotes and providing a specific question for the AI to answer, ensuring accuracy and adherence to the provided material.

💡One Shot and Few Shot Prompting

These terms refer to techniques where the AI is given one or a few examples to illustrate a task, helping it to replicate the outcome. The script explains that providing examples, especially in few shot prompting, can significantly improve the AI's performance in tasks such as writing abstracts in a specific style.

💡Research Papers

The script uses the term 'research papers' in the context of summarizing and synthesizing academic findings. It illustrates how to instruct the AI to create sections based on these summaries, such as research questions and theoretical frameworks, adhering to specific guidelines and examples provided.

💡Insufficient Information

This phrase is used in the script to indicate a response from the AI when the provided reference text does not contain the information needed to answer a question. It demonstrates the AI's ability to acknowledge limitations in the data, rather than fabricating answers.

💡Abstracts

Abstracts are brief summaries of research papers, and the script discusses how to instruct the AI to write them in a specific journal's style by providing examples of existing abstracts. This demonstrates the effectiveness of using examples in prompt engineering for academic writing.

Highlights

Introduction to the most important tactics for effective prompt engineering with Chat GPT.

Tactic 1: Importance of including specific and clear details in prompts for better predictions.

Explanation of the model's context window and how it uses tokens to predict subsequent words.

Example of a good prompt for writing an article on AI in healthcare with specified focus and audience.

Demonstration of the model's output adhering to the detailed prompt, showcasing six paragraphs and a conclusion.

Tactic 2: Splitting complex tasks into simpler subtasks for more precise responses.

Example of breaking down the task of organizing a virtual conference into actionable steps.

Tactic 3: Utilizing larger prompts with the 128,000 token context limit for detailed interactions.

Use of delimiters to separate different parts of a request for clarity in long prompts.

Example of structuring a prompt with XML tags for synthesizing research findings and drafting sections.

Tactic 4: Providing a reference text enclosed in triple quotes for extracting specific information.

Method of answering questions using only the provided document and citing passages.

Tactic 5: Power of providing examples using one-shot and few-shot prompting for task illustration.

Research showing better results with few-shot prompting using two to five examples.

Example of writing an abstract in a journal's specific style using two abstract examples.

Output demonstration of an abstract written in a similar style to the provided journal examples.

Upcoming video teaser on five additional tactics for prompt engineering with Chat GPT.

Transcripts

play00:00

hello everyone and in this video we're

play00:01

going to be looking at the most

play00:03

important tactics that you need to use

play00:04

in your prompts to get the best results

play00:07

out of chat GPT and I'm going to be

play00:09

showing you this with some practical

play00:10

examples for each one and this is based

play00:12

on open ai's official prompt engineering

play00:15

guide which I'll leave the link for you

play00:16

below in case you want to go into

play00:18

further detail so tactic number one

play00:21

include specific and clear details in

play00:23

your prompt and I know this seems

play00:25

straightforward but it's important to

play00:26

understand why we need to do this and

play00:28

this is because the model considers all

play00:30

the previous tokens or let's just call

play00:32

them words and uses it to predict the

play00:34

next words within its current context

play00:36

window which is basically the session

play00:38

and the words that you're working with

play00:40

right now so by providing that extra

play00:42

detail in your prompt you give it

play00:44

significantly more information to work

play00:47

with and to accurately predict all the

play00:49

subsequent words and tokens that are

play00:51

coming next so the more you're able to

play00:54

provide in terms of uh context the more

play00:57

relevant your output is going to be so

play00:59

if you were to give a bad example you'd

play01:00

say something like write about AI in

play01:02

healthcare which is completely General

play01:04

but a good example would be to write a

play01:06

prompt like this so write an article

play01:08

composed of six paragraphs so you can

play01:09

see I specified the amount of the output

play01:12

that I want on the impact of AI in

play01:14

healthcare focusing on how it enhances

play01:16

personalized patient care okay so I've

play01:18

said specifically what I want the focus

play01:20

of my article to be the article is

play01:22

intended for healthc Care Professionals

play01:24

and administrators so I've said who my

play01:26

audience is and where it's going to be

play01:28

published in a leading Healthcare

play01:29

Journal the tone should be informative

play01:31

and professional specifi the tone the

play01:33

way it should be written and it's

play01:35

suitable for an audience familiar with

play01:37

medical and technological advancements

play01:39

telling it that you can use some

play01:41

technical terminology as well so I'm

play01:43

going to enter this

play01:45

prompt okay so if we look at our output

play01:48

we can immediately see it's given us six

play01:49

paragraph output that we wanted and it's

play01:51

also added a conclusion at the end uh if

play01:53

we look at the actual writing we can see

play01:56

that it's focused on the specific areas

play01:58

that told it to focus on which is the

play02:00

area of personalized patient care and I

play02:03

can already see that it's given me some

play02:05

examples of specific AI tools and if I

play02:07

read through it I can see that it's

play02:09

adopted the tone that I want it has

play02:10

technical language and it sounds

play02:12

professional as well so again being H

play02:15

specific and clear in my in my prompt

play02:17

will help me get a better output so

play02:19

tactic number two split complex tasks

play02:21

into simpler subtasks so instead of just

play02:24

asking for help in general terms break

play02:27

down your request into specific

play02:28

actionable steps and this approach makes

play02:31

it easier for chat GPT to give you a

play02:33

more precise and helpful response for

play02:35

each step so I'll give you an example

play02:36

instead of prompting it by say help me

play02:39

organize a virtual conference on AI you

play02:41

can first ask chat GPT to give you the

play02:43

steps involved so we will put a prompt

play02:45

here that says what are the steps

play02:47

involved in organizing a virtual

play02:49

conference on the advances of AI okay so

play02:51

I'm going to enter

play02:56

that and you can see that it's come back

play02:58

with some steps that tell me what I need

play02:59

need to do in order to organize the

play03:01

conference I've got find the conference

play03:03

goals and so on got almost um 12

play03:06

different steps that I would need to go

play03:07

through and now I can then follow up

play03:09

this prompt that says provide a detailed

play03:12

guide on organizing a virtual conference

play03:14

on the topic of advancements in

play03:16

artificial intelligence and machine

play03:17

learning and then the guide should

play03:19

include all the above steps

play03:31

and now you can see it's come back with

play03:32

a detailed guide and for each step it's

play03:35

now broken it down into further substeps

play03:38

that tell me exactly what I need to do

play03:40

for each one and it's given me a lot

play03:41

more detail that it initially did in the

play03:44

first part so helping it to think in

play03:47

these in terms of these different steps

play03:49

will get more detailed precise responses

play03:52

and what you can do is you can even ask

play03:54

for further detail

play03:56

step number one consider any other

play04:06

variables that should be added okay and

play04:08

I can specify one specific step to go

play04:11

into further detail and then I will

play04:13

enter

play04:17

that okay and you can see just for that

play04:19

step again um it's gone into a lot more

play04:21

detail in terms of the topics and themes

play04:23

and so on so when we get the model to

play04:25

think in terms of steps we're usually

play04:27

getting a more precise detail detailed

play04:30

output than if we just ask it to think

play04:32

of a topic as a whole so tactic number

play04:35

three is to use larger prompts with the

play04:37

limits and with chat GPT for you can now

play04:40

use much larger prompts because it has a

play04:42

128,000 token context which is roughly

play04:45

about 100,000 words and this means that

play04:48

GPT 4 can retain and understand

play04:50

information across all those words and

play04:52

you can use this to your advantage to

play04:54

have more detailed and complex

play04:55

interactions with the model so to get

play04:57

the best results from these long prompts

play04:59

you need to use the limits clearly to

play05:01

separate different parts of your request

play05:03

and when we talk about Del limits

play05:05

they're basically symbols or words that

play05:08

help the AI understand where one part of

play05:10

your input ends and the other begins so

play05:12

some examples are as we can see here you

play05:14

can use triple quotes you can use three

play05:16

dashes you can use angle brackets you

play05:18

can use XML tags really it doesn't

play05:21

matter which delimiter you use the most

play05:24

important thing is that you stay

play05:25

consistent using the same delimiter for

play05:28

the type of instruction that you're

play05:30

giving so let me give you an example

play05:32

just to clarify a bit and I probably

play05:33

don't need to use all these delimits

play05:35

here but I have quite a large uh prompt

play05:38

that I'm going to be inputting and I

play05:39

want to structure it um so that it's

play05:41

very clear in terms of what it needs to

play05:43

do and in terms of the output that I

play05:46

want it to give me so if you look here

play05:48

I've put my instructions um in XML tags

play05:51

so showing the beginning and the end and

play05:53

I've said you're an expert academic

play05:55

writer tasked with synthesizing research

play05:58

findings your primary Duty is to

play06:00

summarize provided research papers and

play06:02

then develop crucial sections based on

play06:04

these summaries please adhere to the

play06:06

following guidelines while drafting your

play06:07

summary and section and then the next

play06:09

section I've given it is the research

play06:11

papers and I've said I have attached the

play06:13

three research papers for summarization

play06:15

which I'm going to attach them in the

play06:16

prompt and then I've got some section

play06:18

constraints so specific things that I

play06:21

want it to stick to while it's

play06:23

responding so maintain a clear and

play06:25

concise academic tone limit each section

play06:27

structure each section um clearly and

play06:29

engagingly and so on and then I've got

play06:31

the summary of the research papers so if

play06:33

you look at the instructions above I

play06:35

wanted to summarize the papers first and

play06:37

then I've got a section that says

play06:39

research paper sections to craft okay

play06:41

and here so the first section I wanted

play06:43

to come up with is the research

play06:45

questions and I've also given an example

play06:48

that I wanted to follow when it comes up

play06:50

with the research question that it knows

play06:52

when it comes back gives me some

play06:54

research questions it will follow the

play06:56

guidelines or the structure of this

play06:58

example and then got my research

play07:00

questions section and then this is where

play07:02

it's going to insert the research

play07:04

questions here and then I've got a

play07:06

section on the important theoretical

play07:08

Frameworks and it's going to insert the

play07:10

theoretical Frameworks based on the

play07:12

articles that I provided here so you can

play07:14

see there's a lot of sections had I just

play07:16

written it all as one prompt it might

play07:19

not have come back with an accurate

play07:20

response you don't definitely don't need

play07:22

to include all that in every prompt so

play07:24

I'm going to go back to chat GPT and

play07:26

what I'm going to do is I'm going to

play07:27

insert this entire prompt prompt over

play07:30

here and what I'm also going to do

play07:31

attach the Articles to this prompt so

play07:35

after I've attached my articles I'm now

play07:36

going to enter the

play07:43

prompt okay and if we look at the output

play07:45

it's come back with exactly what I've

play07:47

specified it's first summarized the

play07:49

research papers that I've provided and

play07:51

you can see it's got three clear

play07:53

summaries of the three research papers

play07:55

the next section is the research

play07:56

questions it's now come up with three

play07:58

different research question questions

play07:59

that are based on the um articles that I

play08:03

have submitted and it's also following

play08:05

the style of the example that I had

play08:06

given and then the next section we can

play08:08

see is the important theoretical

play08:10

Frameworks again it's specified the

play08:12

three theoretical Frameworks from the

play08:15

above examples and you can see I was

play08:17

able to get the exact output and the

play08:19

structure that I wanted so tactic number

play08:21

four is to provide a reference text and

play08:23

you won't use this all the time but this

play08:25

is really useful when you're focusing on

play08:27

extracting specific information from an

play08:29

article or a reference or a data set and

play08:32

to do this you provide a document and

play08:35

enclose that in triple quotes and a

play08:37

specific question for chat GPT to answer

play08:40

so we can add a prompt here that says

play08:41

you will be provided with a document

play08:43

delimited by triple quotes and a

play08:45

question your task is to answer the

play08:47

question using only the provided

play08:49

document and to cite the passages of the

play08:51

document used to answer the question if

play08:53

the document does not contain the

play08:55

information needed to answer this

play08:56

question then simply write insufficient

play08:58

information okay so basically we're

play09:00

telling it don't make up the information

play09:01

just say that it doesn't have the

play09:03

information and then if an answer to the

play09:05

question is provided it must be

play09:07

annotated with the citation and use this

play09:09

format to give me the uh citation okay

play09:12

so I've added the prompt here now what I

play09:14

need to do is I'm going to open my

play09:15

triple quotes and I'm going to extract

play09:18

the reference text from an article so

play09:20

I'm going to add that in and I'm also

play09:23

going to add like I mentioned the uh

play09:25

question that I wanted to answer which

play09:27

is what definition is provided for

play09:29

entrepreneurial action and I'm going to

play09:32

close off the section with my triple

play09:34

quotes again and I'm going to enter that

play09:37

and you can see the response that it's

play09:38

given the definition provided of

play09:39

entrepreneurial action emphasize the

play09:41

importance of both opportunities and

play09:42

individuals it's given me where it's

play09:44

extracted the information from and the

play09:46

citation here's the citation in the

play09:48

format that I specified um above and

play09:51

then it carries on giving me the uh the

play09:54

rest of the information here as well so

play09:56

what if I asked that something that

play09:57

really isn't part of the text will it

play09:59

respond as I asked it to to just say

play10:01

insufficient information um so I'm just

play10:04

going to ask it something that

play10:05

definitely not in that reference text

play10:08

I'm going to

play10:10

say how many companies were used in this

play10:18

sample and you can see it's come back

play10:21

with insufficient information this is a

play10:23

really good way to get accurate

play10:25

information from a reference text and

play10:27

also to build on tactic number three you

play10:30

can see using the limits here to

play10:32

identify the part of the text that we're

play10:34

submitting is also really useful so

play10:36

tactic number five is to provide

play10:38

examples using one shot and few shot

play10:40

prompting now providing examples is such

play10:42

a powerful technique in prompt

play10:44

engineering and the main idea here is to

play10:46

illustrate the task by giving clear

play10:48

concrete examples which can then help

play10:50

the model to replicate the outcome and

play10:52

this technique is sometimes called One

play10:54

Shot prompting or few shot prompting

play10:55

depending on how many examples you give

play10:57

so obviously one shot prompting would be

play10:59

just giving it one example and then F

play11:01

shot prompting would be giving two or

play11:03

more examples and research has actually

play11:05

shown that when you use f shop prompting

play11:07

so anything from two to five examples uh

play11:10

you actually get much better results so

play11:12

I'm going to use two examples in this

play11:14

prompt and we're going to apply this to

play11:16

getting chat GPT to write an abstract

play11:18

based on existing abstracts in a journal

play11:21

so say for example I want to uh submit a

play11:24

paper to this journal and and they

play11:26

already have a specific structure to the

play11:27

way they write the abstracts I'm going

play11:29

to copy two different abstracts exactly

play11:32

the same and I'm going to give chat GPT

play11:34

an instruction here that says okay use

play11:37

these two abstract examples to write an

play11:39

abstract in a similar style for a

play11:41

research paper and then I've given the

play11:43

title of the paper that I wanted to

play11:44

write this is the end of the

play11:45

instructions and you can see I've used

play11:47

the limits here as well and then I've

play11:49

put the abstract example one write an

play11:51

abstract for research paper and I've

play11:52

taken the exact name of the research

play11:54

paper okay and then I've added here the

play11:57

actual abstract that was written for

play11:59

that paper with the same title and then

play12:02

I've given another example also from the

play12:04

same Journal using writer an abstract

play12:06

for research paper and then I've found

play12:08

another paper and given it the title and

play12:10

then I've added the abstract so I'm

play12:11

going to enter

play12:19

that okay and now you can see from the

play12:22

output it's come back with an abstract

play12:25

that really is in a similar style to the

play12:28

ab racts from the journal that I've

play12:30

chosen and if we read through it you'll

play12:33

find that it actually sounds really

play12:35

academic it talks about the Gap that's

play12:37

been addressed which is a key feature of

play12:39

all the other abstracts that we have it

play12:41

talks about the findings obviously this

play12:43

one is uh chat GPT making these things

play12:46

up have to input additional material in

play12:47

your prompt to make it accurate but

play12:49

you'll see that illustrates the findings

play12:51

and and then it goes on to talk about

play12:53

the discussion elements in the app so

play12:55

really well uh written done an amazing

play12:57

job in copying style of the previous

play13:01

examples so in this video I've focused

play13:03

on five main tactics that you can use to

play13:05

really get the best out of your prompt

play13:07

engineering there are five more that I'd

play13:09

like to talk to you about but I'll keep

play13:10

them to the next video so please

play13:12

subscribe and I look forward to seeing

play13:14

you in the next video

Rate This

5.0 / 5 (0 votes)

Related Tags
Prompt EngineeringAI TipsChatGPTOpenAI GuideTacticsPractical ExamplesDetailed PromptsStep-by-StepAI OptimizationTechnical Writing