WEBVTT

00:00.180 --> 00:01.013
-: In this video,

00:01.013 --> 00:03.840
we're gonna cover a concept called delimiters.

00:03.840 --> 00:07.620
Delimiters allow you to tell ChatGPT what part

00:07.620 --> 00:09.870
of the input you would like it to operate on.

00:09.870 --> 00:11.730
Reading the prompt from start to the finish,

00:11.730 --> 00:16.050
we have summarized the text delimited by triple quotes.

00:16.050 --> 00:18.960
So you can see we've put these triple quotes at the start

00:18.960 --> 00:21.210
and end of where we would like to put some text.

00:21.210 --> 00:23.610
And obviously, when we put some real text there,

00:23.610 --> 00:25.380
we're actually gonna get a real summary.

00:25.380 --> 00:29.130
The key to this is realizing we've used the word delimited,

00:29.130 --> 00:30.450
triple quotes.

00:30.450 --> 00:32.310
And then the language model is gonna know

00:32.310 --> 00:34.710
that whatever is inside of our prompt,

00:34.710 --> 00:36.720
which contains these triple quotes

00:36.720 --> 00:38.220
is where it's gonna summarize.

00:38.220 --> 00:40.440
We could also do different type of delimiters.

00:40.440 --> 00:42.660
So rather than using triple quotes,

00:42.660 --> 00:45.000
we could actually delimit all of the different bits

00:45.000 --> 00:47.070
of information such as this.

00:47.070 --> 00:49.140
So let's walk through this prompt.

00:49.140 --> 00:49.973
We have,

00:49.973 --> 00:51.277
"In the following scenario,

00:51.277 --> 00:54.037
"you'll be given an extract of a dissertation

00:54.037 --> 00:56.197
"and a proposed title for it.

00:56.197 --> 00:58.657
"The name of the thesis should not only inform the reader

00:58.657 --> 01:00.937
"about its subject matter in a succinct manner,

01:00.937 --> 01:02.707
"but also be engaging.

01:02.707 --> 01:05.497
"Should the given title fall short of these requirements,

01:05.497 --> 01:08.490
"kindly offer five different alternatives."

01:08.490 --> 01:09.323
And then we have,

01:09.323 --> 01:13.350
"Please input abstract and please input title."

01:13.350 --> 01:14.670
So what's great about this format

01:14.670 --> 01:16.800
is then we can put the abstract here

01:16.800 --> 01:18.180
and then we could put the title,

01:18.180 --> 01:20.670
which is "Chromosome Structures" in here.

01:20.670 --> 01:24.480
So we're able to use a multiple delimiter approach

01:24.480 --> 01:28.620
by having what we are delimit by either title here.

01:28.620 --> 01:29.820
And if we scroll up,

01:29.820 --> 01:32.610
then you'll see we've got the abstract as the top delimiter.

01:32.610 --> 01:33.443
As well as that,

01:33.443 --> 01:34.800
it's also important to note

01:34.800 --> 01:37.740
that we have attached these delimiters, right?

01:37.740 --> 01:39.690
So we should ideally have title

01:39.690 --> 01:41.640
and abstract capitalize

01:41.640 --> 01:43.350
so that when we're referring to abstract,

01:43.350 --> 01:45.660
we're referring to what's after the delimiter.

01:45.660 --> 01:47.926
And when we're referring to the capitalized title,

01:47.926 --> 01:50.250
ChatGPT knows what to refer to.

01:50.250 --> 01:51.870
Going back to our first example,

01:51.870 --> 01:54.510
let's have a look at a slightly more complicated prompt

01:54.510 --> 01:57.000
and walk through it step-by-step.

01:57.000 --> 01:58.867
So we have a prompt here which says,

01:58.867 --> 02:01.950
"Summarize the text delimited by triple quotes."

02:01.950 --> 02:04.260
And we've got, "My father is happy."

02:04.260 --> 02:06.360
Then compare the generated summary

02:06.360 --> 02:09.337
to the text delimited with square brackets,

02:09.337 --> 02:10.680
"My dad is happy."

02:10.680 --> 02:13.320
Provide a final answer on whether the summary

02:13.320 --> 02:16.380
and the square bracket text are similar in meaning.

02:16.380 --> 02:18.900
So let's give this a run and see what happens.

02:18.900 --> 02:20.820
It's firstly created a summary,

02:20.820 --> 02:22.950
as well as that we've got a comparison,

02:22.950 --> 02:24.690
and it's come up with a final answer

02:24.690 --> 02:25.950
that the generated summary

02:25.950 --> 02:28.470
and the text limited by square brackets

02:28.470 --> 02:30.060
are similar in meaning.

02:30.060 --> 02:32.220
What's great about using delimiters here

02:32.220 --> 02:35.137
is that we've specifically told ChatGPT,

02:35.137 --> 02:35.970
"First,

02:35.970 --> 02:39.067
"you need to summarize the text that's in triple quotes

02:39.067 --> 02:41.347
"and then compare that generated summary

02:41.347 --> 02:43.560
"to the square brackets text."

02:43.560 --> 02:45.390
By adding multiple delimiters,

02:45.390 --> 02:48.540
we can clearly separate out different parts of the task

02:48.540 --> 02:51.300
so that ChatGPT can work more effectively for you.

02:51.300 --> 02:52.133
Finally,

02:52.133 --> 02:54.450
it's worth noting that delimiters are universal

02:54.450 --> 02:56.130
and can be applied to any different type

02:56.130 --> 02:57.330
of large language model.

02:57.330 --> 02:59.370
For instance, here we have GPT-4,

02:59.370 --> 03:01.920
and we're using that same delimiters concept

03:01.920 --> 03:03.690
where we have some various articles,

03:03.690 --> 03:07.110
which are separated out with the article delimiter.

03:07.110 --> 03:10.470
And then we've given a system message on the left hand-side,

03:10.470 --> 03:13.440
telling that we will be providing a pair

03:13.440 --> 03:16.530
of articles delimited by XML tags.

03:16.530 --> 03:18.813
So you can use this method anywhere you like.
