TubeSum ← Transcribe a video

Prompt engineering essentials: Getting better results from LLMs | Tutorial

Transcribed Jun 14, 2026 Watch on YouTube ↗
Beginner 4 min read For: Beginners interested in using LLMs like GitHub Copilot effectively.
177.3K
Views
5.5K
Likes
56
Comments
156
Dislikes
3.1%
📈 Moderate

AI 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.

[00:40]
What are LLMs?

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.

[01:06]
Three key concepts: context, tokens, limitations

Context is surrounding information; tokens are units of text; limitations include hallucinations and lack of true understanding.

[02:28]
What is a prompt?

A prompt gives the model context via tokens and works around limitations to generate a response.

[03:14]
What is prompt engineering?

Crafting prompts to improve output quality and relevance.

[03:43]
Components of effective prompting

Be clear, precise, provide enough context, and iterate.

[04:16]
Example: Refining a prompt

From 'Write a function that will square numbers in a list' to a specific Python function with constraints.

[05:28]
Common issues and solutions

Prompt confusion: break down multiple requests. Token limits: keep prompts concise. Assumptions: explicitly state requirements.

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.

Clickbait Check

95% Legit

"Title accurately reflects the tutorial content on prompt engineering for better LLM results."

Mentioned in this Video

Tutorial Checklist

1 03:43 Craft a clear and precise prompt, avoiding ambiguity.
2 03:55 Provide enough context without overwhelming the model.
3 04:08 Iterate and refine your prompt if the output is not as expected.
4 05:28 Break down multiple requests into separate steps.
5 06:50 Keep prompts concise to avoid token limits.
6 07:15 Explicitly state all requirements and constraints.

Study Flashcards (10)

What are large language models (LLMs)?

easy Click to reveal answer

A type of AI trained on large amounts of text data to understand and generate human-like language.

00:40

How do LLMs generate responses?

easy Click to reveal answer

By predicting the next word in a sentence based on the context of previous words.

00:53

What are the three key concepts to understand LLMs?

easy Click to reveal answer

Context, tokens, and limitations.

01:06

What is a token in the context of LLMs?

medium Click to reveal answer

A unit of text, which can be a word, part of a word, or a single letter.

01:30

What are hallucinations in LLMs?

medium Click to reveal answer

Incorrect or nonsensical answers generated by the model.

02:18

What is prompt engineering?

easy Click to reveal answer

The practice of crafting prompts to improve the quality and relevance of LLM outputs.

03:14

What are three key components of effective prompting?

medium Click to reveal answer

Clarity and precision, sufficient context, and iteration.

03:43

How can you fix prompt confusion?

medium Click to reveal answer

Break down multiple requests into separate steps.

05:43

What happens if a prompt is too long?

hard Click to reveal answer

The LLM might hallucinate, cut off, or fail entirely due to token limits.

06:38

Why should you explicitly state requirements in a prompt?

medium Click to reveal answer

To ensure the LLM doesn't overlook critical aspects of the request.

07:30

💡 Key Takeaways

💡

LLMs are ultra-smart autocomplete

Provides a simple analogy to understand how LLMs work.

00:40
📊

Three key concepts: context, tokens, limitations

Foundation for understanding LLM behavior and prompt engineering.

01:06
⚖️

Prompt engineering is good communication

Reframes prompt engineering as a communication skill, making it accessible.

03:14
🔧

Example of refining a prompt

Shows practical application of prompt engineering principles.

04:16
🔧

Common issues and solutions

Addresses real-world problems users face with LLMs.

05:28

✂️ Creator Tools: Viral Hooks

AI-generated clip ideas for Shorts based on the transcript

AI responds better when you ask right

45s

Opens with a surprising fact that hooks viewers into learning prompt engineering.

▶ Play Clip

Fix your prompts with this simple trick

60s

Shows a concrete before/after example of prompt refinement, highly actionable.

▶ Play Clip

3 common prompt mistakes and fixes

60s

Lists common pain points with quick solutions, perfect for saving and sharing.

▶ Play Clip

[00:00] Did you know that an AI processes

[00:01] language and responds better when you

[00:03] ask the right way? Let's learn

[00:09] how. Today, I'm going to teach you what

[00:12] you need to know about large language

[00:14] models or LLMs and how to interact with

[00:16] them with prompt engineering. Prompts

[00:19] are what power LLM to make us more

[00:21] productive in our work. When you

[00:23] understand the power of prompting and

[00:25] its limitations, you can do even more

[00:28] faster. I'm Cadesha and I'm so excited

[00:31] that you're here with me today. Let's

[00:33] dive right

[00:36] in. Before we get into prompt

[00:38] engineering, we should understand more

[00:40] of what LLMs are under the hood. Large

[00:43] language models are a type of AI that

[00:45] are trained on large, hence the name,

[00:48] amounts of text data to understand and

[00:50] generate humanlike language. They work

[00:53] by predicting the next word in a

[00:54] sentence based on the context of the

[00:57] words that came before it, making their

[00:59] responses relevant and coherent to

[01:01] humans that use them. You can think of

[01:03] it as an ultra smart autocomplete. There

[01:06] are three things you really need to know

[01:08] to understand LLMs. Context, tokens, and

[01:13] limitations. Think of context as a

[01:16] surrounding information that helps an

[01:17] LLM understand what you're talking

[01:19] about. Just like in a conversation with

[01:22] a friend, the more context you have, the

[01:25] more the conversation will make sense.

[01:27] In the world of LLMs, text is broken

[01:30] down into units of tokens. A token can

[01:33] be a word, a part of a word, or even a

[01:36] single letter. The AI model processes

[01:39] tokens to generate responses. The number

[01:42] of tokens you use with an LLM can impact

[01:44] its response. Too few tokens and it may

[01:47] lack context, but too many and it might

[01:50] get

[01:51] overwhelmed. While LLMs are powerful,

[01:54] they aren't all powerful. They don't

[01:57] truly understand language like humans

[01:59] do. They rely on patterns and

[02:02] probabilities that were in the data they

[02:04] trained on. We won't get into the

[02:06] training side of things in this episode,

[02:09] but hopefully this quickly explains why

[02:11] we need a diverse and broad training set

[02:14] for the best

[02:15] responses. Models are never perfect, so

[02:18] they sometimes provide incorrect or

[02:20] nonsensical answers, sometimes called

[02:24] hallucinations. You can work with LM's

[02:26] power and limitations by combining

[02:28] everything into a prompt. A prompt gives

[02:31] the model context via tokens and works

[02:34] around the model's potential limitations

[02:36] so that the model can give you a

[02:38] response. For example, if you prompt an

[02:41] LLM with write a JavaScript function to

[02:44] calculate the factorial of a number, it

[02:47] will use its training to give you a

[02:48] function that accomplishes that task.

[02:51] Depending on how the model was trained,

[02:53] it may understand your prompt

[02:55] differently and output different code.

[02:58] This is why you may see different

[02:59] outputs from various models out in the

[03:02] world like OpenAI's GPT, Anthropics

[03:05] Claude, Google's Gemini, and so on and

[03:07] so forth. These are all trained

[03:10] differently and understand an output

[03:12] differently as a

[03:14] result. So now we know what a prompt is,

[03:17] but what is prompt engineering?

[03:20] Honestly, it's just a term for crafting

[03:23] prompts. Just like how clear

[03:25] instructions can help a friend complete

[03:26] a task exactly how you want, a

[03:29] well-crafted prompt can help an LLM

[03:31] understand and deliver what you're

[03:32] looking for, good prompt engineering can

[03:35] drastically improve the quality and

[03:38] relevance of the outputs you get from an

[03:40] LLM. Now, let's talk about some key

[03:43] components of effective prompting. An

[03:46] effective prompt is clear and precise.

[03:49] Ambiguity can confuse the model, so

[03:52] don't forget that an effective prompt

[03:55] also gives enough context. You want to

[03:58] provide enough background information to

[04:00] get the job done without overwhelming

[04:02] the model with unnecessary detail. And

[04:06] don't forget, you can always iterate and

[04:08] refine your prompts. If you ask for

[04:10] something and you don't get what you

[04:12] expect, tweak your language. Now,

[04:16] imagine you're using GitHub Copilot and

[04:18] you say, "Write a function that will

[04:20] square numbers in a list." At first

[04:23] glance, this sentence isn't too bad. But

[04:26] let me ask you, what language should the

[04:29] function be written in? Do you want to

[04:31] include negative numbers? Will the input

[04:33] ever have non- numbers? Should it affect

[04:36] the given list or return a new list?

[04:39] Let's refine our prompt a bit. So we can

[04:41] say write a Python function that takes a

[04:44] list of integers and returns a new list

[04:47] where each number is squared excluding

[04:49] any negative numbers. Do you see the

[04:52] difference? This prompt is clear and

[04:54] specific about the language we want to

[04:56] use, what the function should do, what

[04:59] constraints there are, and the expected

[05:01] input type. By giving GitHub Copilot

[05:04] more context, the output will be more

[05:06] relevant to exactly what we want from

[05:08] it. In summary, prompt engineering is

[05:11] really about being a good communicator

[05:13] with the computer. Very similar to

[05:15] coding. By crafting your prompts

[05:18] thoughtfully, you can harness the full

[05:20] power of tools like GitHub Copilot to

[05:23] make your experience smoother and more

[05:25] efficient. Now, as you're working with

[05:28] GitHub Copilot and other LLM tools, you

[05:31] may run into times where you're not

[05:32] getting the output you hoped for. The

[05:35] problem isn't always because you're not

[05:37] specific enough. Here are some things

[05:39] you might be running into and how you

[05:40] can improve them. Prompt confusion.

[05:43] Sometimes we mix multiple requests or

[05:45] aren't clear enough which can lead to

[05:47] confusing outputs. For example, we might

[05:50] highlight something in VS Code and say

[05:52] fix the errors in this code and optimize

[05:55] it. Is the AI supposed to fix the errors

[05:57] or optimize it first? What should it

[06:00] optimize for? Speed, memory,

[06:03] readability? To solve this, break it

[06:06] down. Separate your asks in the prompt.

[06:10] First, fix the errors in the code

[06:12] snippet. Then, optimize the fixed code

[06:16] for better performance. Building out a

[06:18] prompt iteratively will make it more

[06:20] likely that you get the final result

[06:21] that you want because each step of the

[06:24] way has been thought through. We've

[06:26] discussed that tokens are units of words

[06:28] or partial words that a model can

[06:30] handle. It's important to remember that

[06:33] there's a limit to how many tokens a

[06:35] given model can handle at once. If your

[06:38] prompt is too long or the expected

[06:40] output is very extensive, the LLM might

[06:43] start hallucinating, cut itself off, and

[06:46] only give you a partial response or just

[06:48] fail entirely. You want to keep your

[06:50] prompts concise. Similarly to before,

[06:54] you will want to iterate on smaller

[06:55] parts, but also only provide necessary

[06:59] context. Does the LLM need your entire

[07:02] code file to work or can it just use a

[07:04] few lines of code in a certain function?

[07:07] Instead of asking for it to generate an

[07:09] entire application, could you ask it to

[07:11] make each component step by step? And

[07:15] finally, we often assume that the LLM

[07:18] knows more than it does. If you say,

[07:20] "Add authentication to my app," does it

[07:23] know what your app even does? Does it

[07:25] know which technologies you might want

[07:27] to use? When doing a prompt like this,

[07:30] you need to explicitly state your

[07:32] requirements, outline your specific

[07:35] needs, mention best practices if needed,

[07:37] and be ready to iterate again with edge

[07:41] cases and restraints. By stating all

[07:44] your requirements, you help ensure that

[07:46] the LLM doesn't overlook critical

[07:48] aspects of your request when it

[07:50] generates the output. We've gone over a

[07:53] lot in this section. Prompt engineering

[07:56] is an art and a science and you'll get

[07:58] better with practice. As a quick

[08:01] overview, when you're working with

[08:03] GitHub Copilot or any other LLM tool,

[08:06] you use tokens to give the model context

[08:09] given any limitations it might have.

[08:11] Your prompts should be clear, concise,

[08:14] and precise for the best results,

[08:16] providing as much context as the model

[08:19] might need. You should break down your

[08:21] prompts into smaller chunks. If there

[08:23] are multiple tasks to be completed and

[08:26] iterate from there, you should be

[08:28] specific about your requirements and

[08:30] needs so that the model understands the

[08:32] constraints of what it should provide

[08:34] for you. Thanks so much for joining us

[08:36] today and if you want to learn more,

[08:38] we've created a blog post that

[08:40] accompanies this episode. Click the link

[08:42] in the description to be taken there.

[08:44] Remember to sign up for GitHub Copilot

[08:46] if you haven't already done so and get

[08:48] started for free. Don't forget to

[08:50] subscribe to our channel so you don't

[08:52] miss any future episodes. Until then,

[08:55] happy coding.

[08:59] [Music]

⚡ Saved you time reading this? Transcribe any YouTube video for free — no signup needed.