AI in Motion

Generative AIBeginner1:19 video6 chapters

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.

▶ Watch the animated lecture

0:001. Introduction

Introduction — Prompt Engineering and Chain-of-Thought

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

Building blocks — Prompt Engineering and Chain-of-Thought

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

Few-shot prompting — Prompt Engineering and Chain-of-Thought

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

Thinking step by step — Prompt Engineering and Chain-of-Thought

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

Tips — Prompt Engineering and Chain-of-Thought

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

Recap — Prompt Engineering and Chain-of-Thought

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

  1. What is few-shot prompting?
    Show answer

    Including a few worked examples in the prompt — Examples show the desired pattern.

  2. In the pen-and-notebook puzzle, what does the pen cost?
    Show answer

    5 taka — x + (x + 100) = 110 gives x = 5.

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

© 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