-: In this video,
we're gonna cover a concept called delimiters.
Delimiters allow you to tell ChatGPT what part
of the input you would like it to operate on.
Reading the prompt from start to the finish,
we have summarized the text delimited by triple quotes.
So you can see we've put these triple quotes at the start
and end of where we would like to put some text.
And obviously, when we put some real text there,
we're actually gonna get a real summary.
The key to this is realizing we've used the word delimited,
triple quotes.
And then the language model is gonna know
that whatever is inside of our prompt,
which contains these triple quotes
is where it's gonna summarize.
We could also do different type of delimiters.
So rather than using triple quotes,
we could actually delimit all of the different bits
of information such as this.
So let's walk through this prompt.
We have,
"In the following scenario,
"you'll be given an extract of a dissertation
"and a proposed title for it.
"The name of the thesis should not only inform the reader
"about its subject matter in a succinct manner,
"but also be engaging.
"Should the given title fall short of these requirements,
"kindly offer five different alternatives."
And then we have,
"Please input abstract and please input title."
So what's great about this format
is then we can put the abstract here
and then we could put the title,
which is "Chromosome Structures" in here.
So we're able to use a multiple delimiter approach
by having what we are delimit by either title here.
And if we scroll up,
then you'll see we've got the abstract as the top delimiter.
As well as that,
it's also important to note
that we have attached these delimiters, right?
So we should ideally have title
and abstract capitalize
so that when we're referring to abstract,
we're referring to what's after the delimiter.
And when we're referring to the capitalized title,
ChatGPT knows what to refer to.
Going back to our first example,
let's have a look at a slightly more complicated prompt
and walk through it step-by-step.
So we have a prompt here which says,
"Summarize the text delimited by triple quotes."
And we've got, "My father is happy."
Then compare the generated summary
to the text delimited with square brackets,
"My dad is happy."
Provide a final answer on whether the summary
and the square bracket text are similar in meaning.
So let's give this a run and see what happens.
It's firstly created a summary,
as well as that we've got a comparison,
and it's come up with a final answer
that the generated summary
and the text limited by square brackets
are similar in meaning.
What's great about using delimiters here
is that we've specifically told ChatGPT,
"First,
"you need to summarize the text that's in triple quotes
"and then compare that generated summary
"to the square brackets text."
By adding multiple delimiters,
we can clearly separate out different parts of the task
so that ChatGPT can work more effectively for you.
Finally,
it's worth noting that delimiters are universal
and can be applied to any different type
of large language model.
For instance, here we have GPT-4,
and we're using that same delimiters concept
where we have some various articles,
which are separated out with the article delimiter.
And then we've given a system message on the left hand-side,
telling that we will be providing a pair
of articles delimited by XML tags.
So you can use this method anywhere you like.