Class 7 · CBSE AI · Strand C — NLP, Vision, and LLMs Deep-Dive

Prompt engineering as software engineering — for Class 7

Good prompting is a craft with patterns, like few-shot examples. Why it's real engineering. For Class 7.

What this concept actually says

  • Prompt engineering is the systematic design of instructions to reliably elicit desired LLM behaviour — it is a craft with learnable principles
  • Techniques include: role assignment, few-shot examples, chain-of-thought, output format constraints, and system prompts
  • Good prompts reduce ambiguity, handle edge cases, and specify not just what to do but how to handle failures

An analogy your child will recognise

Recipe writing

A recipe that just says 'make biryani' would fail — a good recipe specifies quantity, sequence, timing, heat level, and what 'done' looks like. Prompt engineering is writing a recipe for an AI: the more precisely you specify the ingredients, process, and output, the more reliably the 'dish' comes out right.

Directing a school play

Telling an actor 'just act naturally' produces chaos. A good director gives the actor their character's motivation, tone, key lines, and what to do when they forget their lines. A system prompt is the director's brief — it shapes how the AI-actor behaves throughout the entire performance.

Common misconceptions to watch for

  • Longer prompts are always better — overly long prompts can overwhelm the model's attention, burying critical instructions under noise; concision and structure matter.
  • Once you have a good prompt, you never need to change it — prompts need testing, versioning, and maintenance as model updates and real-world usage patterns change.

Key facts in one breath

  • Few-shot prompting — providing 2–5 examples of the desired input-output pattern inside the prompt — consistently outperforms zero-shot (no examples) on complex tasks.
  • System prompts are processed before the user's message in most LLM APIs, allowing developers to set persistent behaviour instructions, personas, and safety guardrails.
  • Prompt injection is a security attack where malicious content in user input overwrites or contradicts the system prompt — a major concern in deployed AI systems.
  • OpenAI, Anthropic, and Google have all published prompt engineering guides that treat it as a formal discipline with testable best practices.

How Dhee Learning teaches this — the 3-stage question loop

Every Dhee Learning session for this concept follows three stages. We share the questions Dhee actually asks, so you can hear what a session sounds like.

Stage 1 — Surface

You want an AI to write a bedtime story for a 5-year-old about a lost kitten. Compare these two prompts: Prompt A: 'Write a bedtime story.' Prompt B: 'Write a calming bedtime story for a 5-year-old in 200 words. The main character is a lost kitten named Mochi who finds her way home. End with Mochi falling asleep safely. Avoid scary words.' Which is better — and list every specific improvement Prompt B makes.

Rote answer

"Prompt B is more detailed and specific."

Understood

"Each addition in Prompt B removes a decision the AI would otherwise make randomly: audience (5-year-old) sets vocabulary and complexity; 200 words prevents it going too long; naming the character creates consistency; specifying the ending prevents an open-ended sad story; 'avoid scary words' handles a failure mode directly."

Stage 2 — Reasoning

Chain-of-thought prompting means asking the AI to 'think step by step' before answering. Why would adding this instruction to a maths word problem prompt make the answer significantly more likely to be correct?

Follow-up Dhee may use: If chain-of-thought helps, why not always use it for every prompt? What would be the downside for something like 'Translate this phrase to Tamil'?

Stage 3 — Application

You're engineering a prompt for a school admin chatbot that helps students check their library book due dates. Write a system prompt (the invisible instruction the chatbot receives at the start) that handles at least four possible failure modes.

Misconception Dhee watches for: Writing a single-sentence system prompt and expecting it to handle all edge cases — prompt engineering requires explicit anticipation of failure modes, not just describing the happy path.

Related concepts

Want your child to actually understand this?

Dhee turns this concept into a 15-minute spoken session — asking, listening, and probing — so your child builds the idea themselves.

Frequently asked questions

What is prompt engineering as software engineering — explained for kids? +

Good prompting is a craft with patterns, like few-shot examples. Why it's real engineering. For Class 7.

What's the most common mistake children make about this concept? +

Longer prompts are always better — overly long prompts can overwhelm the model's attention, burying critical instructions under noise; concision and structure matter.

How does Dhee Learning teach this in a Class 7 session? +

Dhee opens with a question — for example: "You want an AI to write a bedtime story for a 5-year-old about a lost kitten. Compare these two prompts: Prompt A: 'Write a bedtime story.' Prompt B: 'Write a calming bedtime story for a 5-year-old in 200 words. The main character is a lost kitten named Mochi who finds her way home. End with Mochi falling asleep safely. Avoid scary words.' Which is better — and list every specific improvement Prompt B makes." — listens to your child's answer, then probes the reasoning behind it. The session ends when the child can apply the idea to a brand-new situation, not just recall it.