-: In this video, we're gonna look at
how we can overcome ChatGPT's context length,
and using a process called chunking.
Let's start by having a look at this prompt at the top
where we have, "Create an article outline
with 20 subheadings about the 2008 financial crash."
The problem we've got here
is that the article outline is so long
that if I just provide a prompt afterwards
to ChatGPT to say,
"Write an entire article based on the above subheadings,"
ChatGPT starts off fine, absolutely good,
but then as soon as we hit the domino effect,
notice how we haven't even finished this sentence.
So we've hit the largest amount of tokens
that ChatGPT is able to provide us with.
So we need to break this down
and start using a chunking technique.
So what we could do is, rather than asking it to create,
when we have the article outline,
rather than asking it to write an entire article,
we could change it to say, you know,
"Write a very and extremely detailed section
about all of this."
So we could say, for example, get all this information,
"Write an extremely detailed
and incredibly
long section
for all of the below subheadings."
And we're breaking our problem down,
so rather than purely working off
creating the whole entire article,
we're basically just trying to say,
"Hey, let's take this section and chunk out
and get the output from that."
And then what we do after that
is once we've done that entire thing,
then we're gonna take this entire section
on the historical background.
And so we're breaking it down into step by steps,
rather than trying to force ChatGPT
to produce the entire output all in one go.
And so you can see here
we've got a little bit more information.
Also, the keywords that we were using,
such as extremely detailed and incredibly long section
help to encourage ChatGPT to give us a better output.
So again, you just keep doing this step over and over again
and asking it to do, you know, a section at a time
rather than trying to fit everything in the same output.