---
title: 'Prompt engineering essentials: Getting better results from LLMs | Tutorial'
source: 'https://youtube.com/watch?v=LAF-lACf2QY'
video_id: 'LAF-lACf2QY'
date: 2026-07-28
duration_sec: 541
---

# Prompt engineering essentials: Getting better results from LLMs | Tutorial

> Source: [Prompt engineering essentials: Getting better results from LLMs | Tutorial](https://youtube.com/watch?v=LAF-lACf2QY)

## Summary

This tutorial explains how large language models (LLMs) work and how to interact with them effectively through prompt engineering. It covers key concepts like context, tokens, and limitations, and provides practical tips for crafting clear, precise prompts to get better results from tools like GitHub Copilot.

### Key Points

- **What are LLMs?** [00:40] — Large language models are AI trained on vast text data to understand and generate human-like language by predicting the next word based on context.
- **Three key concepts: context, tokens, limitations** [01:06] — Context is surrounding information; tokens are units of text; limitations include hallucinations and lack of true understanding.
- **What is a prompt?** [02:28] — A prompt gives the model context via tokens and works around limitations to generate a response.
- **What is prompt engineering?** [03:14] — Crafting prompts to improve output quality and relevance.
- **Components of effective prompting** [03:43] — Be clear, precise, provide enough context, and iterate.
- **Example: Refining a prompt** [04:16] — From 'Write a function that will square numbers in a list' to a specific Python function with constraints.
- **Common issues and solutions** [05:28] — Prompt confusion: break down multiple requests. Token limits: keep prompts concise. Assumptions: explicitly state requirements.

### Conclusion

Prompt engineering is an art and a science that improves with practice. By being clear, concise, and specific, you can harness the full power of LLMs like GitHub Copilot.

## Transcript

Did you know that an AI processes
language and responds better when you
ask the right way? Let's learn
how. Today, I'm going to teach you what
you need to know about large language
models or LLMs and how to interact with
them with prompt engineering. Prompts
are what power LLM to make us more
productive in our work. When you
understand the power of prompting and
its limitations, you can do even more
faster. I'm Cadesha and I'm so excited
that you're here with me today. Let's
dive right
in. Before we get into prompt
engineering, we should understand more
of what LLMs are under the hood. Large
language models are a type of AI that
are trained on large, hence the name,
amounts of text data to understand and
generate humanlike language. They work
by predicting the next word in a
sentence based on the context of the
words that came before it, making their
responses relevant and coherent to
humans that use them. You can think of
it as an ultra smart autocomplete. There
are three things you really need to know
to understand LLMs. Context, tokens, and
limitations. Think of context as a
surrounding information that helps an
LLM understand what you're talking
about. Just like in a conversation with
a friend, the more context you have, the
more the conversation will make sense.
In the world of LLMs, text is broken
down into units of tokens. A token can
be a word, a part of a word, or even a
single letter. The AI model processes
tokens to generate responses. The number
of tokens you use with an LLM can impact
its response. Too few tokens and it may
lack context, but too many and it might
get
overwhelmed. While LLMs are powerful,
they aren't all powerful. They don't
truly understand language like humans
do. They rely on patterns and
probabilities that were in the data they
trained on. We won't get into the
training side of things in this episode,
but hopefully this quickly explains why
we need a diverse and broad training set
for the best
responses. Models are never perfect, so
they sometimes provide incorrect or
nonsensical answers, sometimes called
hallucinations. You can work with LM's
power and limitations by combining
everything into a prompt. A prompt gives
the model context via tokens and works
around the model's potential limitations
so that the model can give you a
response. For example, if you prompt an
LLM with write a JavaScript function to
calculate the factorial of a number, it
will use its training to give you a
function that accomplishes that task.
Depending on how the model was trained,
it may understand your prompt
differently and output different code.
This is why you may see different
outputs from various models out in the
world like OpenAI's GPT, Anthropics
Claude, Google's Gemini, and so on and
so forth. These are all trained
differently and understand an output
differently as a
result. So now we know what a prompt is,
but what is prompt engineering?
Honestly, it's just a term for crafting
prompts. Just like how clear
instructions can help a friend complete
a task exactly how you want, a
well-crafted prompt can help an LLM
understand and deliver what you're
looking for, good prompt engineering can
drastically improve the quality and
relevance of the outputs you get from an
LLM. Now, let's talk about some key
components of effective prompting. An
effective prompt is clear and precise.
Ambiguity can confuse the model, so
don't forget that an effective prompt
also gives enough context. You want to
provide enough background information to
get the job done without overwhelming
the model with unnecessary detail. And
don't forget, you can always iterate and
refine your prompts. If you ask for
something and you don't get what you
expect, tweak your language. Now,
imagine you're using GitHub Copilot and
you say, "Write a function that will
square numbers in a list." At first
glance, this sentence isn't too bad. But
let me ask you, what language should the
function be written in? Do you want to
include negative numbers? Will the input
ever have non- numbers? Should it affect
the given list or return a new list?
Let's refine our prompt a bit. So we can
say write a Python function that takes a
list of integers and returns a new list
where each number is squared excluding
any negative numbers. Do you see the
difference? This prompt is clear and
specific about the language we want to
use, what the function should do, what
constraints there are, and the expected
input type. By giving GitHub Copilot
more context, the output will be more
relevant to exactly what we want from
it. In summary, prompt engineering is
really about being a good communicator
with the computer. Very similar to
coding. By crafting your prompts
thoughtfully, you can harness the full
power of tools like GitHub Copilot to
make your experience smoother and more
efficient. Now, as you're working with
GitHub Copilot and other LLM tools, you
may run into times where you're not
getting the output you hoped for. The
problem isn't always because you're not
specific enough. Here are some things
you might be running into and how you
can improve them. Prompt confusion.
Sometimes we mix multiple requests or
aren't clear enough which can lead to
confusing outputs. For example, we might
highlight something in VS Code and say
fix the errors in this code and optimize
it. Is the AI supposed to fix the errors
or optimize it first? What should it
optimize for? Speed, memory,
readability? To solve this, break it
down. Separate your asks in the prompt.
First, fix the errors in the code
snippet. Then, optimize the fixed code
for better performance. Building out a
prompt iteratively will make it more
likely that you get the final result
that you want because each step of the
way has been thought through. We've
discussed that tokens are units of words
or partial words that a model can
handle. It's important to remember that
there's a limit to how many tokens a
given model can handle at once. If your
prompt is too long or the expected
output is very extensive, the LLM might
start hallucinating, cut itself off, and
only give you a partial response or just
fail entirely. You want to keep your
prompts concise. Similarly to before,
you will want to iterate on smaller
parts, but also only provide necessary
context. Does the LLM need your entire
code file to work or can it just use a
few lines of code in a certain function?
Instead of asking for it to generate an
entire application, could you ask it to
make each component step by step? And
finally, we often assume that the LLM
knows more than it does. If you say,
"Add authentication to my app," does it
know what your app even does? Does it
know which technologies you might want
to use? When doing a prompt like this,
you need to explicitly state your
requirements, outline your specific
needs, mention best practices if needed,
and be ready to iterate again with edge
cases and restraints. By stating all
your requirements, you help ensure that
the LLM doesn't overlook critical
aspects of your request when it
generates the output. We've gone over a
lot in this section. Prompt engineering
is an art and a science and you'll get
better with practice. As a quick
overview, when you're working with
GitHub Copilot or any other LLM tool,
you use tokens to give the model context
given any limitations it might have.
Your prompts should be clear, concise,
and precise for the best results,
providing as much context as the model
might need. You should break down your
prompts into smaller chunks. If there
are multiple tasks to be completed and
iterate from there, you should be
specific about your requirements and
needs so that the model understands the
constraints of what it should provide
for you. Thanks so much for joining us
today and if you want to learn more,
we've created a blog post that
accompanies this episode. Click the link
in the description to be taken there.
Remember to sign up for GitHub Copilot
if you haven't already done so and get
started for free. Don't forget to
subscribe to our channel so you don't
miss any future episodes. Until then,
happy coding.
[Music]
