Sign in to save

Bookmark this page so you can find it later.

Sign in to save

Bookmark this page so you can find it later.

Prompt engineering is the practice of writing clear instructions that guide an AI model toward useful, accurate, and safe responses. This cheat sheet covers common prompt patterns students can use for coding help, research planning, debugging, writing, and problem solving. It is useful because small changes in wording, context, constraints, and examples can greatly change the quality of an AI response.

Students in grades 11-12 can use these patterns to communicate goals clearly and evaluate AI outputs responsibly.

The core idea is to define the role, task, context, constraints, and output format before asking for an answer. Strong prompts often include examples, success criteria, step-by-step planning requests, and verification instructions. Useful patterns include role prompting, few-shot prompting, decomposition, critique and revise, structured output, and test-driven prompting.

Good prompt engineering also requires checking facts, protecting privacy, and treating AI responses as drafts rather than guaranteed truth.

Key Facts

  • A strong prompt often follows the structure: role + task + context + constraints + output format.
  • Role prompting tells the model how to respond, such as: Act as a Python tutor for an 11th grade student.
  • Few-shot prompting provides examples of the desired input and output so the model can copy the pattern.
  • Decomposition prompts break a large task into smaller steps, such as: First list the subproblems, then solve each one.
  • Structured output prompts specify the response format, such as: Return a table with columns: concept, definition, example.
  • Constraint prompts set limits, such as: Use only beginner-level Python and keep the answer under 150 words.
  • Critique and revise prompting asks the model to review an answer against criteria, then improve it.
  • Verification prompts ask the model to check assumptions, identify uncertainty, or provide tests that could reveal errors.

Vocabulary

Prompt
A prompt is the instruction, question, or input given to an AI model to guide its response.
Context
Context is the background information the model needs to understand the task and produce a relevant answer.
Constraint
A constraint is a rule or limit that shapes the response, such as length, tone, tools, audience, or format.
Few-shot Prompting
Few-shot prompting is a pattern that gives the model a small number of examples before asking it to complete a similar task.
Structured Output
Structured output is a response format that organizes information in a specific layout, such as JSON, a table, or numbered steps.
Iteration
Iteration is the process of improving a prompt or response through repeated testing, feedback, and revision.

Common Mistakes to Avoid

  • Writing a vague task, such as 'help me with this,' is wrong because the model has too little information to know the goal, audience, or expected output.
  • Leaving out the output format is wrong because the model may respond in paragraphs when a table, checklist, code block, or JSON object would be more useful.
  • Asking for too many unrelated tasks at once is wrong because it can make the response scattered, incomplete, or difficult to verify.
  • Trusting the first answer without checking is wrong because AI models can produce confident but incorrect facts, code, or explanations.
  • Including private data in a prompt is wrong because prompts may be stored, reviewed, or processed outside the student's control depending on the system.

Practice Questions

  1. 1 Rewrite this weak prompt into a stronger one using role, task, context, constraints, and output format: 'Explain recursion.'
  2. 2 A student gives 3 input-output examples before asking an AI to classify 12 new text messages. What prompt pattern is being used, and why is it useful?
  3. 3 You need an AI to debug a 40-line Python function. Write a prompt that asks for likely causes, a corrected version, and 3 test cases.
  4. 4 Why is it better to ask an AI to explain its assumptions and provide verification steps instead of only asking for a final answer?

Understanding Prompt Engineering Patterns Reference

AI systems generate text by predicting likely next words from patterns in their training. They do not automatically know what a teacher expects, what sources are trustworthy, or what details matter most in a class assignment. This is why vague requests often produce vague results.

A model may fill missing details with a reasonable sounding guess. It may state that guess confidently.

Give it the audience, purpose, available evidence, and definition of success. If a task depends on a reading passage, data set, or program error, provide the relevant parts rather than assuming the model has access to them.

For research work, separate facts from instructions. Tell the model which material it may use and ask it to label claims that need checking. Request source links or quotations only when it can genuinely provide them, then inspect every citation yourself.

AI can invent book titles, web pages, statistics, and quotations. It can also repeat bias found in common online language.

A useful habit is to compare important claims with a textbook, an original study, a government source, or a trusted news organization. Never paste private school records, passwords, medical details, or another person's personal information into a prompt.

For programming, a good request describes the behavior of the program, not just the error message. Include the programming language, the code that causes the problem, the expected result, the actual result, and a small sample input. Ask for test cases that include normal cases, empty input, very large values, and invalid data.

Read the proposed code closely before running it. An answer can look clean while failing on an edge case or using a library that your class has not covered.

The same care helps with writing tasks. A response format such as a revision checklist, outline, rubric table, or set of flashcards makes the result easier to inspect and use.

Prompting works best as an experiment rather than a single command. Start with a clear version, examine the output, then change one part at a time. If the answer is too broad, narrow the topic.

If it misses evidence, add the source material or a requirement for support. If the tone is wrong, provide a short sample that shows the intended style. Keep a record of useful prompts, outputs, and corrections.

This makes it easier to notice which instruction caused an improvement. In school, use AI to develop your own understanding. You remain responsible for the final claims, the submitted work, and the decisions made from its output.