Prompt Engineering and Chain-of-Thought — lecture notes
Clear roles, context, examples and step-by-step reasoning: how to get much better answers from language models.
0:001. Introduction

The same model can give a vague answer or an excellent one, depending on how you ask. Prompt engineering is the skill of asking well.
0:112. Building blocks

Strong prompts usually include a role, the context, a clear task, constraints such as length and tone, and the output format you want. When an answer disappoints, one of these is usually missing.
0:253. Few-shot prompting

Showing a few examples in the prompt, called few shot prompting, teaches the model the pattern you want without any training. It is a form of in-context learning.
0:384. Thinking step by step

For reasoning problems, asking the model to think step by step, or using a model with built-in reasoning, often improves accuracy. The quick answer here is ten taka, which is wrong. Working it out shows the pen costs five taka.
0:555. Tips

Be specific. Give examples. Break big tasks into steps. Ask for sources, and always verify important facts, because a well-phrased prompt still does not guarantee a correct answer.
1:086. Recap

To recap. Give role, context, task, constraints and format. Use examples. Ask for step by step reasoning on hard problems. Iterate, and verify.
Key takeaways
- Good prompts specify role, context, task, constraints and format.
- Few-shot examples teach a pattern through in-context learning.
- Step-by-step (chain-of-thought) reasoning improves multi-step problems.
- Prompting improves answers but never guarantees correctness.
Check yourself
- What is few-shot prompting?
Show answer
Including a few worked examples in the prompt — Examples show the desired pattern.
- In the pen-and-notebook puzzle, what does the pen cost?
Show answer
5 taka — x + (x + 100) = 110 gives x = 5.
- Why ask for step-by-step reasoning?
Show answer
It often improves accuracy on multi-step problems — Intermediate steps help the model avoid quick wrong answers.
Go deeper
- Prompt Engineering: Getting Reliable Results from LLMs · The AI Lecture Hall
- Chain-of-Thought and Reasoning in Language Models · The AI Lecture Hall
- In-Context Learning: How LLMs Learn from Prompts · The AI Lecture Hall
© 2026 Janin A Apurba, CSE, AUST · Advanced ICT Officer, CNRS-UNHCR. All rights reserved. Notes for the animated lecture at https://ai-in-motion.vercel.app/watch/prompt-engineering-and-chain-of-thought.html