-: Okay, the final principle is division of labor.
That's where you split tasks into multiple steps
Because you can rarely get something done
with just one prompt.
You are gonna chain multiple prompts
or multiple (indistinct) steps together
to achieve a complex goal.
So let's look at text models.
Again, this is our naive prompt.
We're just getting a list of 10 product names
and then this is the engineered prompt.
This is a much bigger prompt is much more to it,
but we're not worried about the prompt itself specifically.
We're worried about a prompt that comes after.
So this isn't just one prompt.
We get the response from ChatGPT,
which gives us the names of iFitShoe,
iAdapt, iUniversalStep.
But then we have a second prompt
that comes after that in the same session
and that asks it to rate the names,
because that's something
that you would have to do as a human otherwise.
And in this case, if you design in a rating step,
you can maybe eliminate some of the time spent
choosing a name,
because that's not important when you're just brainstorming.
You can just manually look at the names.
But if you're generating a list of a hundred names,
or if you're running this prompt a hundred times
and then finding the most catchy, most unique,
most simplistic, then that would make a big difference.
In the prompt template, it's not just one template.
We have this divider,
then we have this second prompt underneath.
So it's actually more of a chat session
than an individual prompt.
And if we zoom in on this,
we can see that it takes the names
that we've given it before,
it has the context from the previous part of the session,
and then it's actually giving you back the names in a table.
And it's rating, such as, catchiness
uniqueness and simplicity.
Do the same thing through the API.
Now the key is that we're actually applying
all the other principles of prompting to this as well.
Like we've specified the format,
we want it in the table
and we give it some direction.
We want it to rate based on catchiness
uniqueness and simplicity.
Each prompt in the chain itself can be optimized.
Now there are other parts of the chain
you might want to add on.
It's not just the rating step,
but there's a step beforehand.
Maybe wanna do some retrieval and list some related products
and use that output as the input into your prompts.
And say, we have Nike ID, it's a competitor.
We have a Reebok Adjustable Shoes, uses a competitor.
We can also do things like function calling,
where you actually tell the AI
it can cause specific functions,
and you give it an understanding of what those functions do.
And then you can ask it, you know,
when it's ready to do that.
In this case, you could give it a function
that calls GoDaddy!
and then checks whether the domain is available.
And that's gonna make the big difference
because now you don't have to go do that yourself.
And then another step, which is really powerful,
is image generation, right?
Like we've been seeing,
we can go and generate an image
of that shoe as part of, you know,
the next part in the chain.
Alright, so let's look at at image generation now
and see how this principle applies to that too.
And typically,
you're not just using a one prompt in Stable Diffusion.
When you see artists that are using AI,
they're not just getting it right in one prompt.
They're trying lots of different prompts.
They're typically working in something
like Photoshop where they're stitching
different AI generated images together in a collage
and then pulling them all together and editing,
joining them together with generated film.
Let's see how that works.
We have this actual kind of prompt
that we're running now, the template.
But the problem with this is that the output,
we have a white background, but we still have a problem
because we, you know, we don't,
we can't really use a white background necessarily.
We need to cut out that shoe from the (indistinct).
It's pretty hard to do in Stable Diffusion,
what we do is we divide the labor,
we split that out, that task out,
we give it to another AI model.
In this case, I'm using remove.bg,
which is a free website
where it just removes the background from the image.
And now I have a proper PNG of the shoe.
I can use that in multiple steps.
And so, you know, that shoe is just one part
of an overall advertisement
or overall marketing collateral for the product.
And you can see we can make a big difference
to how the shoe is perceived
just by putting it in different scenarios.
And again, each one of these is generated
with a separate step.
So we have, you know, a background of New York City,
we have a background of a spaceship,
we have a background of a festival.
Whatever it is you want to appeal to,
in terms of an audience, you can do that now
because you can take the shoe out
of the context without changing what the shoe looks like
and put it in a new context
that was generated in a separate step.
You'll find that this is just a simple example
where you can use things like in painting to do this
and make sure the shadows match.
You can use our (indistinct)
that you're really not using one model, one prompt,
and then you're done.