---
title: 'Prompt Engineering Full Course'
source: 'https://youtube.com/watch?v=2BpCk4d2Cc0'
video_id: '2BpCk4d2Cc0'
date: 2026-06-18
duration_sec: 0
---

# Prompt Engineering Full Course

> Source: [Prompt Engineering Full Course](https://youtube.com/watch?v=2BpCk4d2Cc0)

## Summary

This video provides a comprehensive guide to prompt engineering, covering fundamental techniques, advanced strategies, and practical tips for getting the best results from large language models. The instructor emphasizes treating prompt engineering as 'programming in natural language,' where clarity, context, and structure are crucial. He demonstrates both bad and good examples, introduces key methods, and advocates for using voice dictation to write more detailed prompts faster.

### Key Points

- **Bad vs. Good Prompt Example** [00:44] — A bad prompt like 'write something about our product' produces generic fluff. A good prompt specifies role, audience, tone, and format, e.g., 'You are a senior B2B copywriter. Write a two sentence LinkedIn ad for our project management SaaS... The audience is ops managers at mid-sized companies. The tone is confident but not salesy...' This leads to a scoped, actionable result.
- **What is Prompt Engineering** [01:48] — Prompt engineering is 'programming in natural language' — giving instructions to an AI in plain language instead of code. The model has no built-in task list, so you must define the task, role, format, and constraints within the prompt.
- **Agent Era & Prompting** [02:56] — We've shifted into an 'agent era' where LLMs can interact with tools, search the web, and take actions (e.g., change Asana, write a Google Doc). Prompt engineering becomes even more powerful as we instruct models to take real actions, not just produce text.
- **Speak, Don't Type** [04:32] — To overcome laziness and write detailed prompts, use voice dictation. The tool 'Whisper Flow' is recommended—it formats punctuation, capitalizes, and corrects 'ums' and repetitions automatically. The presenter's WPM is 162, much faster than typing.
- **LLM Fundamentals: Memory & Context** [07:08] — An LLM is a text prediction model with no built-in memory. What gives it 'memory' is providers (e.g., OpenAI) injecting previous conversation history into the prompt. Your prompt is rarely the only thing the model sees—context includes prior messages, tool access, etc.
- **Steer, Don't Command** [10:44] — Common mistake: commanding the model (e.g., 'summarize this') lets the model choose length, style, and focus. Instead, steer by indicating length, focus, and format (e.g., 'Summarize the meeting transcript. Use four bullet points focusing on decisions and action items. No filler.').
- **Core Technique: Role, Audience, Tone, Format** [12:02] — Including these four elements always yields better results. Example: 'You are a customer support lead. Reply to this complaint from a paying user... Acknowledge frustration. Apologize briefly. Confirm investigation. Offer next step. Keep under 150 words. Sign off as support team.'
- **Few-Shot Prompting** [14:35] — Provide a few input-output examples so the model infers the pattern. This is great for classification tasks or specific formats. Example: 'Turn user feedback into a short ticket title.' Without examples, it gave five titles; with examples, it gave one title in the correct format.
- **Chain-of-Thought Prompting** [18:13] — Ask the model to reason step by step before answering. This reduces errors on logic, math, and planning. Many modern models do this by default, but it's still useful for APIs or older models.
- **Structured Output** [20:08] — Request output in a specific format like JSON, XML, or Markdown. Provide an exact schema example. This makes the output parseable for applications. Example: 'Compare Trello, Monday.com, and ClickUp... Output with valid JSON only. Use this shape:'
- **Constraints & Negative Instructions** [22:07] — Sometimes telling the model what *not* to do is more effective. Examples: 'Do not apologize. Do not use bullet points. Do not start with greetings.' This often leads to better, more focused output.
- **Iterative Refinement** [24:26] — Rarely is the first prompt perfect. Instead of restarting, refine within the same conversation: 'Shorter. More formal. Add another example. Focus only on X.' Treat prompting as a conversation, not a one-shot.
- **Interview-Style Prompting** [25:22] — Instead of guessing what context to provide, tell the model to interview you. Example: 'Before you write the post, interview me. Ask one question at a time. When you have enough, say you have enough and write the post.' This surfaces details you'd normally omit.
- **System vs. User Prompts** [29:16] — System prompts set identity, rules, and style (always-on behavior). User prompts are the specific request. In ChatGPT, custom instructions act as a system prompt. Example: 'Always talk like Mario' would apply to all replies.
- **Prompt Chaining** [31:25] — Break complex tasks into multiple steps. Use output from step 1 as input for step 2. This gives more consistent results and lets you verify intermediate outputs. Example: Outline → Expand outline → Write meta description.
- **Self-Evaluation** [32:20] — Ask the model to critique its own output or score it. For less biased results, start a new session and claim the output is yours ('I wrote this'), not the AI's.
- **Temperature Parameter** [33:18] — Low temperature = deterministic, repeatable output (good for code, facts). High temperature = creative, varied output (good for brainstorming). Defaults vary by model.
- **Common Mistakes & Fixes** [35:07] — 1) Too vague → add role/audience/tone/format. 2) Too many tasks → split into steps/chaining. 3) No context/examples → use few-shot or interview technique. 4) Ignored format → explicitly request structured output (e.g., JSON only). 5) Assuming memory → repeat key facts or start fresh session.

### Conclusion

Effective prompt engineering is a learnable skill that dramatically improves AI output quality. Practice iteratively, use voice dictation to speed up the process, and remember to steer the model with clear context, constraints, and structure.

## Transcript

In this video, you'll learn everything
you need to know about prompt engineering.
I'll explain what it is.
Why it's important. How to do it faster.
The top techniques and methods
and advanced strategies to get the most out of loops.
With that said, let's dive in.
So what I've done for this
video is have created a markdown file
that contains all of the examples
and key talking points that I'll go over.
Now, if you want this file for yourself
for your reference, you can get it for free
just by clicking the link in the description
and subscribing to my newsletter.
Anyways, let's start and I want to just show you
a quick example of a bad prompt versus
a great prompt just to kind of set the tone,
and then we'll get into all of the other theory.
And keep in mind, all of the different topics
in this video are available down below
in the video player or the chapters in the comments
in case you want to fast forward.
Okay, so what is a bad prompt?
Well, an example of that would be something
like write something about our product.
It's going to give you something like generic
marketing fluff, wrong tone, wrong length,
probably no CTA.
The model is effectively going to
guess what you want here, whereas a better prompt
would be something like this.
You are a senior B2B copywriter.
Write a two sentence LinkedIn
ad for our project manager at SAS.
As an alternative.
The audience is ops managers at mid-sized companies.
The tone is confident
but not salesy and end with a clear CTA.
Now, if you do this, you're
hopefully going to get a result that's on brand
scoped, actionable, and easy to drop into an ad.
The point of me showing you
these examples is that when we're writing
these prompts,
we're using the same tool or the same LLM.
So what's giving us the difference in result
isn't the LLM, it's the way in which we instruct it.
And most people, while this kind of seems obvious,
are writing prompts closer to the iPad prompt
than they are to the good prompt, and just because a
prompt is long does not necessarily make it good.
Which I'm going to go over in this video.
So this leads me to what is prompt engineering
and why does it matter?
Well, you should really think of prompt engineering
just like programing in natural language.
So rather than using Python or Java or JavaScript,
you're just using, you know, text or your voice
or whatever
language it is that you speak in to try to get
some kind of result complete some action,
get some text, whatever.
Effectively what you're doing is you're giving
instructions in plain language
instead of something like code.
Now, it's important to note that the models
that we give
these instructions to,
they don't have a built in task list.
So you have to define the task, the role, the format
and the constraints within the prompt.
And you have to be very specific
with what it is that you actually want.
And that's why the same model can seem brilliant
or useless,
depending on the clarity, context
and the structure that you provide.
Now, when most people prompt AI models,
they're trying to get some kind of text in return.
And while that's still a very valid use case
of these models, it's important to note
that we've now shifted kind of into an agent era
where a lot of these models
are capable of interacting with various tools,
searching the web, and actually taking actions
they can change something in your asana, right?
They can write a Google doc,
they can create a PowerPoint slide.
And because of that prompt,
engineering becomes even more powerful
because we're no longer just directing the model
to try to give us some kind of textual output,
we're actually instructing it to take some kind of
actions which can give us a real meaningful result.
So just keep that in mind.
While a lot of what I'm showing you here
is going to be based on text.
This also works for agents, right?
Or more complex models that are capable
of calling tools and just go through quick example.
You can see a vague prompt would be something like
help me with my essay was a specific prompt
is something like you were a tutor,
help me improve the thesis and first paragraph
of this 500 word history essay
on the causes of World War one.
Keep my voice, adjust the edits inline, etc.. Okay.
Now, in terms of why this is important,
well, we're moving more and more towards an AI world.
So for people like developers,
marketers, researchers, just anyone who's using AI,
the better
the result you can get from it, obviously the better
that is for everyone, and the faster
you can get to the result if you have better prompts.
So the takeaway write
better prompts is just better results for everyone,
and this is overall
a skill that you will learn over time.
But by knowing some of the foundations that I'll
teach in this video, it will just speed that up for
you and allow you to think of these a little bit
more intentionally while you're writing the prompts.
Now, what you've probably gathered at this point
is that the more details we include in the prompt,
the better the result or action
is that this model will take.
Now, that's generally true.
I mean, longer prompts are not always better, but
most of the time they will give you a better result.
However, that's
only if you actually take the effort to write them.
Most people are lazy, they type very slow,
and they don't want to spend ten,
20, 30 minutes here typing a prompt just to have to
maybe change it, iterate on it, whatever.
So what I'm going to suggest to
you guys is going forward,
rather than typing your prompts, just speak them.
So use your voice, use natural language
and this will allow you to have prompts significantly
faster where you can include all of the details
without lazily having to type them in.
Now this applies on phone and applies on computer,
and the tool that I use
to do this within any application
doesn't just have to be something like ChatGPT.
Here is called a whisper flow.
Now I'm just going to quickly show you how it works
and if you want to try it for free,
I have a link in the description.
I would highly recommend it
because it is currently the best dictation tool
that works a lot
better than anything built into your computer.
So for example, let me just do something.
Hey, this is just a quick test
where I want to dictate with whisper flow
and see what kind of results I'm getting.
Notice I'm talking, 
you know, extremely, extremely fast.
I'm making a few repetitions, pauses, etc.
and let's see the result that we get.
Okay, so you can see the kind of little bubble
popped up there.
And pretty much instantly we get the result.
And you'll see that if we go through the result here,
it automatically does the punctuation, adds
the capitalization, and corrects
any of the ums, ons, or repetitions that I had.
I believe I said extremely twice.
It recognized that wasn't useful and it just removed.
So you get a much faster, better result
and you can also do something like this.
I want to have three bullet points.
Bullet point one is Apple's bullet point two is
banana's, bullet point three is pears.
And you'll see that
it will automatically format it for me like that.
Okay.
So when you're doing the prompts,
the formatting is very important as well.
And this tool will handle it
for you compared to a built in dictation.
I do have a long term partnership
with them, full disclosure, but I was using them much
before we did the partnership
because the tool is very, very good.
You can see here I've spoken 35,000 words.
My WPM is 162,
which is much faster than I would be able to type.
It has a lot of other features
like dictionaries, snippets.
You can change the style based on the apps
that you're working inside of notes,
all of this kind of stuff, and a bunch of settings
where I was just hitting a keyboard shortcut
on my computer, and that allows me to actually
trigger flow to start activating on my computer.
So I use this in every kind of application.
Sometimes I use it to write emails,
sometimes I use it for prompting.
Right?
Sometimes I used in cursor
to prompt a model or reference files,
and I'll show you more of it in the video.
But the point is, speak your prompts,
you're just going to have better prompts.
And this tool also is available on phone.
They actually recently released it on Android,
so you can use it directly from the keyboard
like on your iPhone or Android.
So even if you're on mobile,
you have no excuse not to give a detailed,
comprehensive prompt
that actually includes the information that you want.
So this now leads us to the next section,
which is how let's think.
Now, an LLM is a large language model.
And effectively what these are capable of doing
is replying to text okay.
So you give some text in, they give some text app.
Now you can configure them in very fancy ways
to call tools
or call other LMS or create something
or take some action.
But effectively, at the very root of an Lem,
there's a text prediction model.
It's important to understand this
because when you give a prompt to a model,
you need to imagine that
what it's attempting to do is predict
the next text that you would expect
to see in this sequence.
So while you might see reasoning models,
you think that you know the AI
is thinking or developing something.
Really, it's just been trained
on a massive amount of data and given some prompt
it's able to predict
with a relative degree of accuracy
what it is it thinks you want in terms of the output.
So the prediction is usually going to be in text
or in tokens that they may call it right.
You give some tokens in it spits some tokens out.
That's effectively what an Lem is.
We don't need to worry about the architecture
or anything complicated there just remember
you have some input,
you get some output, and it's just predicting
what it thinks that output is going to be.
Now with that in mind and Lem by default.
So something like GPT 5.2 right.
It doesn't have any memory.
Now what would give it
memory is the providers of these models
injecting previous parts of your conversation
into the prompt or into the model automatically.
So what you need to understand
is that a lot of times when you use, you don't.
Lem's right.
You use ChatGPT, you use Claude, or you use curser.
Behind the scenes, the people who developed
those tools or these interfaces to work with the LMS,
they're injecting a lot of data into the prompt
that you provide to give you a better response.
So while you may prompt and say, hey,
you know, review my essay and tell me what's wrong
behind the scenes,
the prompt is significantly larger than that,
where it includes a lot more details
that the Lem is looking at.
So it's just important for you to understand that,
because by default, it doesn't have memory.
It doesn't have, like all of these fancy features
that you see in like the ChatGPT user interface.
The reason why that exists is because OpenAI,
who made ChatGPT,
created this nice interface on top of the Lem,
which is like the brain at the heart of all of this,
that injects this other information into the prompt
that then goes to the model,
that then gives you the response.
So 99% of the time, your prompt is not the only thing
the yellow Lem is seeing.
It's going to be seeing,
you know, previous conversation history.
Maybe it has access to some tools, right?
Whatever.
There's all kinds of things that are usually
being thrown in that you don't actually get to see.
And it's really important
that you kind of internalize that and understand it.
And you don't think like GPT 5.2 or something
has this memory and just knows everything about you.
The only reason that it knows something is because
it's just taking information that you've given to it
previously, and just injecting that into the prompt
that it's using to give you the response.
Now, that additional information that I just talked
about is typically referred to as context.
It's the other stuff that the Lem can see
and look at.
That's not just the prompt that you gave it.
So just understand that the context, specificity
and structure
that you provide is what shapes
what it's going to say next.
And a lot of these tools, just like,
you know cursor. Right.
The tool that I'm using right now,
if I create an agent by default, it's
jamming a bunch of context into the prompt.
And if I tag something like this markdown file right.
And I say, you know, hello world, the prompt is
Hello world plus all of this additional context.
Now, with that in mind, let's quickly
talk about steering versus commanding the model.
So the common mistake that most people make
when prompting is they
command the model to do something,
rather than steering it in the correct direction.
Now commanding
the model is something like summarize this okay.
Do this, you know, write this down.
Take this thing. Look at this thing. Whatever. Right.
So if that's the case,
the model chooses the length, the style and the focus
that it's going to take
when it's summarizing the thing in this instance.
Whereas steering the model,
you give it more direction on exactly what you want.
So you are an executive assistant.
Summarize the meeting transcript and for bullet
points, focus on decisions and action items.
No filler.
Notice that we're not only telling you what to do,
we're telling it what not to do,
and we're giving it a much more clear objective
where when it's trying to predict what we want next,
it can give us a much more accurate, better result
because of the detail we've included in the prompt.
So when you steer the model,
you're typically indicating the length,
the focus and the format that you want.
Whereas when you're commanding the model,
you're telling it to do something and it's picking
how it's going to do that. The result
you're going to get, etc..
So I'm not going to focus on that too much more,
but just understand commanding and steering.
Now, what I want to do is get into the core
techniques of prompt engineering
and really focus on a lot of examples.
So one of the most basic and important techniques
that you can employ is to be specific
and to set the scene or specify
the particular role that you want.
The model or agent to take.
Now these are the four things that,
if you include, will always
give you a much better result
than simply commanding the model to do something.
If you include a role in audience, a tone,
and some kind of
format or output, you're almost always going
to get a significantly better reply.
So here it says,
you know, reply to this customer complaint.
Okay, fine, you can reply to it.
But if you said something like this,
you're giving it all of these details the role,
the audience, the tone and the format.
So you're going to get a better response.
So what I want to do now
show you a few practical examples of this
by actually writing or voicing
the prompt here in ChatGPT.
So let's just do a quick example of the bad prompt,
right?
Reply to this customer complaint.
And then I'm just going to paste in a random one
that I generate here.
And let's see the result
that we get here from ChatGPT.
So you can see here it gave us something decent,
but it just assumed it was an email.
Even though you know, we didn't specify we want it
to be an email gave us something relatively long.
It didn't say it was from the support team. Whatever.
So what I'm going to do now is just make a new chat
and let's now do a much more detailed prompt
with the same customer complaint
so we can say you are a customer support lead.
Reply to this complaint from a paying user
whose expert failed twice.
Acknowledge the frustration. Apologize. Briefly.
Confirm
we're investigating and offer a concrete next step.
For example, we'll email it in 24 hours,
keep it under
150 words and sign off as the support team.
Cool.
So that is our prompt.
Okay.
Notice again
the whisper here automatically formatted it for us.
So another important part when you are writing
the prompts is that if you structure it
well so you have like bullet points
for example, different
sections,
you separate things out into clear sentences.
It's going to be a lot easier for the model to
understand what you want and predict the next text.
For example, if we even just do a quick delimiter,
like adding these three lines
and saying, you know, here is the complaint.
And then putting a colon, it's separate.
So like this is the thing it should be listening to.
And then this is the additional context.
And also notice that I created a new session here
in ChatGPT by making a new chat so that it's
not automatically going to include the previous text
that I had in the conversation in the prompt.
So I'm just going to go ahead and hit enter here.
What I mean is that if I had just run this underneath
the other example that I gave,
you know, we can still get a decent result,
but it's going to be a little bit confused
or mixed up with the other conversation history,
because that's going to be included
in the prompt as well,
because ChatGPT will include that as context.
So if we look here, you can see now we get something
a little bit more concise.
You know, it says best regards support team.
And it's followed
generally what it is that we asked it to do.
Then the next technique you can use
is referred to as few short prompting.
Now effectively what this means is
that you are going to give a few different examples
of input and output pairs that you're looking for, so
that when you give the prompt,
the model can give you a better reply.
So when you do this, the model can infer and figure
out the pattern which it's very good at doing,
and then replicate the pattern
to give you the exact result that you're looking for.
So this is especially helpful
when you want something in a specific format style.
You have various edge cases,
and you want to do something like a classification
task using an LLF, because
limbs are actually very good at classifying things.
For example, like is this email positive or negative?
Is it red or black, whatever, right.
All of those things.
But only if they know and have examples
to be able to classify that.
And in fact, when you talk about fine tuning LMS,
what you're effectively doing
is you're passing them a bunch of different examples
of inputs and output pairs
so they can infer that pattern on top of their base
training to give you a more specific, better result.
So let's have a look at a few examples here.
I'm not going to throw them on screen.
Let's just go into ChatGPT and we can do
a few prompts and see the result that we get.
So let's do something like turn
this user feedback into a short support ticket title.
The feedback is the app crashed
when I uploaded a PDF over ten megabits on iPhone.
Okay, and let's see what we get here.
Perfect.
Let's see what it gives us.
Okay, so you can see we didn't really get any clear
formatting in this case.
It didn't actually give me one title.
It gave me five because again
it's just guessing what to do.
But let's change and do something like this.
Turn user feedback into a short ticket title.
We want this to be under 60 characters,
use the format area and then brief description.
Okay. And then I'm just going to paste this.
And then here I'm just going to say here are
a few examples of the format that I'm looking for.
Just give me back one line of text that starts
with a title and then includes the, area.
And then a brief description of the issue. Okay.
And then we should just say something like this.
And then I can even do,
do not return anything other than the title.
Okay.
Cool.
So let's now run this
and you can see that I gave a few examples.
So let's actually separate the examples a little bit.
So it's it's a bit easier to see.
And you can see that we have you know feedback long.
It is broken with Google on Safari
the title is off okay.
And then Google login fails on Safari.
And then let's go here.
Feedback is export to CSV only. Exports
first 200 rows.
The title export right CSV feedback.
The app crashed
when I upload a PDF over ten megabytes an iPhone.
This is actually the example
that I'm going to pass paste to it in a second.
Sorry.
And I'm going to say like this.
This is the feedback to generate the title for.
Cool.
Okay.
And then it should give us the title
and let's see if that works.
Now again I'm being super specific,
but I'm just trying to show you that if I give it
a few examples,
we hopefully will get a better response.
And there you go.
You can see it says upload and then iPhone app
crashes on PDFs over ten megabits.
So in this case I was super verbose.
But look at the difference.
So we went from this kind of crap here
right from the LM to this, which
now I could directly plug into like some API
or I could use in my app.
And I know that the format I'm going to get from
the model is going to be consistent.
And then I could just do something else now
because I'm in the same chain.
So let's go.
Like feedback I don't know here.
Let's go feedback and let's change this
to say something
I don't know what's a good example of feedback.
The keyboard does not disappear when clicking
outside of the frame on the login screen.
Okay.
And let's see if we give it
if it gives us the title back. Now.
And there you go.
You can see it just gives us the title.
And we can now keep doing this in this chain because
it has the previous context on how it should behave.
Now the next technique to go over
is called chain of thought prompting.
Now this is asking the model to reason step by step
before it gives the final answer.
Now this will reduce errors on logic, math, you know,
the planning, whatever in different comparisons.
And a lot of models do this by default now,
especially if you're using like a planning model
or a reasoning model
where they're instructions internally.
Right.
Again, like in the prompt that's being created for
you in the back end is to actually do this.
So the reasoning models, like
they're still using a core line, but they just have
some fancy kind of tools and orchestration
on top of them to make them do this.
But if you're not using a fancy model like that,
then you want to tell it to reason
with chain of thought.
So without it, you have something like, you know,
store sells pens for $2 and notebooks for $5.
Sarah buys three pens and two notebooks.
She has a 10% off coupon. Coupon? Sorry.
How much does she pay now?
If you don't tell it to reason, it's just going to
look at this text and try to predict the result.
Now, in a lot of cases, it will get this wrong.
Just like the famous example of asking them to count.
You know how many teaser and strawberry or something,
and it just can't do it
unless you change the prompt
to tell it how to reason through it
so that it actually thinks before
it gives you the response.
Okay,
so I'm actually not going to show this in ChatGPT
because it is probably not going to work
or prove the example where I think both prompts
will give us a very similar result,
just because the default reasoning for like GPT
models is already really good,
but with some other models where they don't do
the reasoning by default, or if you're not using them
in the interface like ChatGPT
and you're just using it in like an API or something,
then you definitely would want to include
these kind of keywords, right?
So just anyways,
keep that in mind for chain of thought.
A lot of times now
the models that are super modern and,
you know, state of the art will do this by default.
And actually auto detect what reasoning model
they should use based on what you asked them.
But it is kind of worth knowing, especially,
you know, six months ago,
12 months ago, this was a lot more important than it
probably is right now.
So the next method that is super
underrated is structured output.
Now this is asking the model to provide the output
in some kind of format like Json tables,
XML, markdown, whatever, and then giving an exact
example of what you're looking for
such that you're able to parse this and use it
in some other format or in some other application.
Now, in my case,
you know, I do a lot of development work, right?
And when I have the model generating something,
maybe I want to read it into a database.
Maybe I want to display it
on the front end of my website, whatever.
In order to do that,
I typically need it in some type of structure.
So what I will do is something like what you see
right here
where I actually provide a Json object schema.
This is what is referred to, which is really just
an example of what it should look like to the model.
So it knows how to give me the output.
So obviously compared to the first example
where we just said
something like this, the main difference
is that we're providing the structure
and we're telling it that we want it to respond
with just that.
No other text in a particular shape.
So we're kind of almost doing this
a multi shot prompting right,
or few short prompting,
but combining it with some kind of output as well.
So anyways, let me go to ChatGPT
and just show you a quick example.
So what's something that we can do.
so we can say maybe compare
Trello, Monday.com and Clickup.
For a small team of 5 to 10 people,
I want to understand
the main features, the limitations and the pricing.
And what I'd like you to do is output this with valid
Json only.
Don't give me any other text
and make sure that it's in this shape.
Okay, so that is what we're going to do here.
Just put that in with whisper.
And then I'm just going to paste in the format.
So we'll just put it like that
and we'll say example format like so okay.
So let's run this now and let's see what we get okay.
So just give me the output right now.
But you can see that it's following this format.
It's in a valid Json object.
And now I would be able to load this into my code.
I could store it in a database right.
I can return it from an API.
It doesn't matter. But it is very useful.
And it's going to be a lot better
than if you just gave me
this random kind of markdown text
that ChatGPT usually replies with.
So moving on, let's talk about constraints
and negative instructions.
So sometimes the best prompts are not talking
too much about what to do,
but they're talking about what not to do.
Now the more constraints which is saying you know, do
this, don't do this, be within this bounds,
whatever the better the results you're going to get,
because you're steering the model more accurately.
So some examples of constraints is for example
the length.
Now you could say summarize in exactly
three bullet points.
That's fine. That's a constraint.
You also could say keep the reply under 300 words
or under five bullet points.
Right.
You could have a tone like no slang or humor.
Do not apologize. Right.
Do not use bullet points. Use one short paragraph.
Do not suggest paid tools. Do not include code.
Describe the approach only.
So when you do that, it actually ends up listening
a lot better sometimes than telling it what you want.
And this has been shown a lot,
especially with a lot of the researchers
working with these models oftentimes
are including a large list of things not to do
because it just works extremely well for prompting.
So you don't want to write something
like write a short intro for our onboarding doc.
Instead, you would say,
write a short intro for onboarding doc.
Start directly
with what the user will do in this section.
Do not start with welcome or generic greetings.
And then in that case, you're going to get something
that is straight to the point.
So anyways, let's have a quick
look at an example here.
If we go inside of something like ChatGPT again,
let's make a new chat.
So let's just do something
like write a short out of office email reply from me.
Tip okay, so this would be without any constraints.
And let's see the kind of response that we get.
Okay, so ChatGPT actually gave me something
interesting here, but it's not really that useful
for an out of office email
because I need to know, for example,
the dates, the time, all of that kind of stuff.
So let's do something better would be, say,
write a short out of office reply,
start with the exact dates I'm away,
and one sentence on who to contact for urgent issues.
Do not use the phrase limited access.
Reply when I can or thank you for your patience.
Be short to the point,
but detail enough that people understand
when I'm coming back,
I'm going to be away from March 1st to March 25th.
Okay, so in this case, again,
we've included a few constraints.
So hopefully we're going to get
a better response here from ChatGPT.
And let's see perfect.
And you can see that we get a much better email
that doesn't include any of the other fluff like,
you know, message me
if you need to. Limited access. Right.
Which funny enough, we got in this one,
but we didn't get here.
Now the next method to go over is pretty
straightforward, and you probably already do this,
but it's just to do iterative refinement
on your prompts.
So very rarely is the first prompt
you send going to give you the desired result.
So rather than restarting simply
improve the prompt over and over again
until you get what you're looking for.
So as it says here, you know, treat prompting
as a conversation, not just a one shot attempt.
The first reply maybe isn't right,
so you're going to refine it by saying shorter.
I'd like it more formal. Add another example.
Focus only on X, whatever.
Of course, the better first prompt
you give, you know, the better.
But sometimes you just don't know
what the result is going to be.
In that case, don't restart.
Just keep going based off the result that you have.
If you're in like a decent enough place
now, an example flow here you can see,
you know, you dropped a two sentence blurb.
Whatever it returns four sentences a bit salesy.
Hey, cut it to two sentences.
You know, make it more factual.
Whatever model tightens
it up, add it to work, a Google calendar, whatever.
You get the idea.
I'm not going to show this to you in ChatGPT
because I think it's pretty intuitive.
But the point is, be iterative with your prompt.
And then the last method that I'm quickly going
to show you, we'll go into some more stuff after
is the interview style prompting,
which is super powerful and extremely underrated.
So I'm just going to read through some of this
because it's pretty descriptive.
But instead of guessing what context to provide,
give the model the task
and ask it to interview you
for whatever it is that it needs.
So a lot of times you know, you're
not going to be able to provide the best context
because you don't actually know what information
the model needs to give you the correct result.
You can go off the top of your head,
you can guess whatever, but it's actually better
if the model prompts you on what it is that it needs,
and you go back and forth
where it's prompting you and then your prompting it,
and you get a much better response.
So you state the goal,
and then the model will ask you clarifying questions,
and you can answer them one by one, and then it can
perform the operation with the full context.
Now it works because we often leave out
details, right?
Audience constraints, format examples
because we don't know the model needs them.
So if we let them surface that information first,
or let the model ask that,
it gives us kind of the prompt to
then give it all of the details.
And a lot of times we're lazy or we have assumptions.
So again, we just don't include something
because we assume the model will know,
but it may not actually know that
or have the same assumptions as us.
Okay.
So I mean, if you have this talk
you can read through here,
but what I'm going to do is just go over into ChatGPT
and give you an example here of what
this kind of interview style
would look like in order to get a decent response.
Okay, so let's just read something out here.
I need a short LinkedIn post about 250 words
about lessons
we learned switching to a four day workweek.
Before you write it, interview
me and ask me questions about anything that you need.
So, for example,
the audience, company, size, tone, metrics,
do's and don'ts,
I want you to ask one question at a time.
And then when you have enough information, say,
I have enough and give me the post.
Then I want you to write the post and again
ask me any questions afterwards for clarifications.
Okay.
So we have the prompt here.
You can see that it's generated.
And now let's see if we can do this.
So great says first question who is the primary
audience for this LinkedIn post okay.
And let's say it is founders and CEOs
okay.
Let's see what question we get next. Got it.
Second question.
Tell me about your company context.
So the advice doesn't feel too generic.
I run a developer mentorship program
where I help developers,
you know, land software engineering jobs
and a tough market.
And I employ a team of about ten people.
They're mostly remote where they're doing like
coaching as well as admin work and some dev work.
For the company.
I'm just making up random stuff right now.
But anyways, you get the idea.
Okay, let's see what else. Get context.
Next question why did you switch to a four day
workweek in the first place?
We switch because we wanted to get more flexibility
to the employees,
and to make them more focused on the four days
that they were at work, rather than finding something
to do when they, you know, didn't need to be doing
that, just spinning random stuff.
Okay, let's see here.
It's actually picked up just spinning random stuff.
So let's remove that, and let's see what we get.
Next question.
What actually happened after you switch
overall was a very positive experience.
The productivity went up.
The revenue stayed about the same,
but the satisfaction of employees was just higher.
And there was no unexpected problems.
Okay. Let's see
what's going to ask me any questions. Okay.
So after this I'm just going to tell it to stop
because I don't want to answer more questions.
Use the current information and give me the post.
Don't ask any more questions.
So you can see when I do this,
I actually get a very detailed, well-written post
that is accurate based on what I told it,
rather than a bunch of random
AI crap that you guys probably see all the time over
social media.
It actually matches,
you know, context that we gave it.
So what happened?
Productivity went up, revenue stayed the same, team
satisfaction increased.
You get the idea.
So this interview style is really effective
and you can get fantastic results
by just chatting
and giving all of this additional context
that you probably never would include by default,
especially just in the first prompt.
Okay, so now I'm going to go through
a few advanced strategies when it comes to prompting.
So first one to talk about is system
versus user prompts.
Now this is more relevant for those of you
that are developers.
However in some different applications
you will see this notion of like a system prompt
and a user prompt.
Now, a system
prompt typically sets the identity of the model
various rules and style, and it's often
not shown to end users.
So this is for always on behavior
where any time you talk with the model, it's
going to read this system
prompt first and understand that this system prompt
is designed for the system
to look at before answering the user prompt.
So for example,
if I want a model that always talks like Mario,
you know, I give it a system prompt
that says always talk like Mario.
I don't need to say that every time.
It just always reads that.
So in cursor, the app that I'm in right now
in chat, GPT and all of these different platforms,
they have their own system prompts
that they provide to the models
to give you the output that you're looking for.
And then when you type the prompt,
it gets added to this kind of chain of prompts
that's already inside of there, that's building
the context of the models or reasoning based off.
So if you have a look here,
you know, an example of a system prompt,
be like you're a helpful
coding assistant, blah blah, blah, whatever.
Whereas the user is,
how do I read the first line of a file in Python?
Now if I go to ChatGPT,
I'll just quickly show you an example.
So actually if you go to ChatGPT settings,
and personalization, you can see that you can add
custom instructions, which is somewhat similar
to something like a system prompt.
And you can see that
I say adopt a skeptical questioning approach.
Take a forward
thinking view, be talkative and conversational.
Now I'm going to change this to say,
be direct into the points and always talk like Mario
when replying to me.
I don't know if that's going to work super
well in ChatGPT,
but let's see now if we do a new conversation.
Hey, how's your day going?
Let's see if it's actually going to give me something
like Mario.
You can see hey Tim, it's good, you see.
So it's actually following like the system
prompt here, right.
And giving me a much different response
than I would normally get.
Now I need to turn that off.
Otherwise that's going to drive me crazy.
So let's just remove the custom instructions
for right now.
But you get the idea, okay.
And even these other things like the style, warm,
whatever these would be built in
to the system prompt
that it's going to use when replying to you.
Okay.
Now the next advanced feature to go over is prompt
chaining.
Now, generally speaking, it's better to break
complex tasks into multiple steps
and to use the output of the previous step
in the next step.
So rather than just writing a super complex prompt
that says like, hey, here
are the three different steps that you need to do.
Just do them one by one
so that you can verify the result of step one is good
before moving on to step two.
So I'm not going to demonstrate this in ChatGPT.
But the example would be like,
you know, given topic, whatever output
a five heading outline with this Json format.
Okay. It then does that.
Then you say okay based on that result,
expand this outline into a 400 word section.
And then,
you know, here's the outline that you want okay.
Then you wait for that.
I say turn this draft into,
you know, meta title description for SEO.
You get the idea.
So go step by step and break it down.
Rather than having the model do everything at once,
that's almost always going to give you a better,
more consistent result.
Now, another, more advanced technique
you can follow is self evaluation.
So let's say the model outputs something to you.
You can then ask the model to critique
or score its own output.
Now sometimes you want to fool the model a bit
where you want to maybe start a new session.
You don't want to have it in the same one and say,
hey, review this email
that I wrote rather than saying, hey, an AI model
wrote this, say, hey, I wrote this, and then it's
going to give you a more accurate response
than if it thinks that it wrote it itself.
So if you have drafts, code, summaries, whatever,
you can say something like,
here's a short summary
I generated. You know, whatever.
Put the text, rate it
1 to 5 for clarity and completeness
in one sentence
to just the single most important improvement.
And then you can take that improvement
and ask it to refine it based on that.
Okay, so super cool.
The evaluation is really good,
but make sure you're kind of fooling the model a bit.
And you're not just,
you know, in the same conversation
chain after it gives you the output
saying rank your own reply
because it's not going to give you
as non-biased of a response
as if you ask it in a fresh chain
where it doesn't have that in its context already.
Okay.
And then just a few other things to look at here.
So temperature and other parameters.
Now if you're going to work with models
in typically an API
setting, you're going to have the ability
to adjust the temperature of the model.
Now the temperature of the model
effectively is the determinism of the model.
Now the determinism means how repeatable effectively
is it now
something that's deterministic is like okay,
if I don't know, open the lid on this pen.
It always opens like it's a deterministic action.
Like if I open this, it's always going to open right?
Whereas if I generate a random number
that's non-deterministic
because I don't know what number I'm going to get.
And I can get a random number now LMS by
default are non-deterministic, which means there's
a sense of randomness and you don't know the output
that you're actually going to get.
Now you can adjust how deterministic
it is by affecting the temperature of the model.
So the lower the temperature is, the more repeatable
and deterministic it's going to be, whereas
the higher the temperature, the more creative, varied
and random it's going to be.
So you would use a low temperature
for consistent output,
especially if you want something
in like a particular format, structured output.
Right.
Code facts, things where there's really just like one
clear answer
is the sentiment of this, you know, text positive.
That would be a low, you know, temperature,
you know, parameter you would want to use there.
Whereas for higher temperature, you use this
for brainstorming, varied phrasing, multiple ideas,
maybe some advanced planning if it's not really sure,
you know how you would get to the result.
And if the outputs are too random,
then you can lower the temperature.
But if it's too repetitive,
then you can raise it slightly
so you know, play with the temperature by default.
It's usually on the lower side on the higher side.
But just know what that parameter means
because it does come up a lot
when you're working with these models.
So now let's talk about a few common mistakes
and how you can fix them.
Now one mistake being too vague right.
What's going to go wrong?
Generic or irrelevant output.
How can you fix that at a roll?
Audience tone format potentially length okay,
next, too many tasks in one prompt.
So a lot of times you're putting,
you know, 100 things that you want it to do.
In that case, the model may, miss something.
You may not actually complete the task.
It might mix them up, whatever.
In that case,
split it into steps or separate prompts.
Right.
So chaining like I talked about before.
Now none of context are examples.
So you're going to get like wrong format or style.
So add 123.
Few shot examples include the relevant background.
Or use that interview technique to ensure
that you're getting enough context before proceeding.
Another common mistake
is that the model ignores the format that you want,
which means it can be hard to parse or reuse.
So, like I showed you before,
you can explicitly request
a specific structure and tell it to only output that.
So Json with keys x, y, z or whatever. Right?
Only give me Json.
Do not give me any text, don't give me anything
else. Right?
We're adding the constraints
as well as being really specific in what we want
and then assuming memory like I said, the model
is going to forget the things that aren't relevant
or that aren't in the same thread conversation
or a context window that you're currently in.
So make sure that you repeat or summarize key facts
if the threat is long,
or if you're working in a new session,
don't assume the model remembers something.
Again, you kind of have to infer
like what is the tool that you're using actually
doing in the background
to load up the model with this context?
Okay, now there's a lot of other mistakes and things
that I can go through, but I'm going to leave
kind of the rest of the stuff in this document
for you guys to refer to if you would like.
Last thing I will say is that it
does just make a massive difference
to practice this and to prompt a lot.
The more you prompt, the more you're going to see
what the outcomes respond
to, how you get the best response,
and you can prompt more and faster.
If you use a tool like flow,
like I've been using in this video, that allows
you just to dictate it with your natural voice
as opposed to having to type it in.
You guys have seen in this video
how quickly I could actually prompt
and how much better
the response is because I'm using my voice.
So I know yes there partner of mine,
but I've been using that for a very long time.
I really cannot recommend it enough, and whether
you use them or someone else doesn't matter to me.
But point is, use some kind of dictation tool used on
your phone, used on your computer.
Your productivity will skyrocket, especially
if you're someone like a developer where you need
really long, detailed prompts and you're working
with like multiple agents at once, like I am.
So anyways, guys, that's going to wrap up this video.
If you enjoyed, make sure leave a like subscribe
and I will see you in the next one.
