AI Help Center › GenAI / LLM › Generative AI Beginner Guides › Prompt Engineering Basics
GENAI / LLM · BEGINNER GUIDE

Prompt Engineering Basics: The 5-Part Framework for Better AI Answers

A step-by-step guide for students: how to tell an AI tool what you need, so you get clear, useful answers.

12 min readPublished October 23, 2026Last reviewed October 23, 2026
Quick insight

A prompt is a brief, not just a question. The AI can only use what you write down. Everything you leave out, it guesses, and the safest guess is a generic answer.

Prompt engineering is the skill of writing clear instructions so that an AI tool gives you useful answers instead of generic ones. A simple way to do it is a five-part checklist: Role, Task, Context, Format and Constraints. It works like giving a clear brief to a tutor who has never met you.

GenAI / LLM

Why do vague prompts give generic answers?

Vague prompts give generic answers because the AI has to guess what you mean, and its safest guess is the most average one. Here is a common situation. A student types this into ChatGPT:

Example prompt · The vague version
Explain machine learning.

Out comes a long, textbook-style answer. It is correct, but it does not fit the student. It may be too advanced or too basic, with no example and no link to the exam. The student says, “This is generic. It does not help me.” They are half right. The answer is generic. But the tool did not fail. The instruction did.

Two terms will help. A large language model (LLM) is software trained on a huge amount of text to predict the most likely next words. ChatGPT, Claude and Gemini are built on LLMs. A prompt is the text you type to it. When your prompt is vague, the model has to cover every possible reader, so the safest answer is a general one. The model is not being lazy. It has nothing else to go on. New to this? Start with what generative AI is and how LLMs are trained.

The fix is not secret words or paid prompt packs. Think of asking a tutor who has never met you. If you say only “explain machine learning”, they give a standard lecture. If you say “I am a second-year commerce student, I know basic statistics, my exam is on Friday, explain it with a simple example”, they can really help. The framework below is that briefing, written as a checklist.

GenAI / LLM

What are the five parts of a good prompt?

A good prompt has five parts: Role, Task, Context, Format and Constraints. Each one answers a question the AI cannot answer for itself.

Five parts, one brief Role Who should the AI be? Task What exactly should it do? Context What does it need to know? Format What should the output look like? Constraints What are the limits and quality bars? Complete prompt Leave a part out and the model guesses it.
PartQuestion it answersExample fragment
RoleWho is answering?“You are a patient statistics tutor…”
TaskWhat is the one job?“…explain what a p-value means…”
ContextWhat does the AI need to know?“…I am a second-year student. I know mean and standard deviation but not hypothesis testing. My exam is on Friday…”
FormatWhat should the answer look like?“…three short steps, then one practice question…”
ConstraintsWhat are the limits?“…use simple words, no formulas until I ask, and tell me if you are unsure.”
Rule of thumb

You do not need all five parts every time. A quick question like “What does CAGR stand for?” needs none of them. Use the full checklist for anything you will study from, send or submit: an email, an assignment brief, a study plan, interview practice.

This is not only our view. Anthropic’s guide also stresses clear, detailed instructions, examples and a stated format.

GenAI / LLM

How do you write each of the five parts?

Write each part as one or two plain sentences that remove a guess the AI would otherwise make.

Role: tell it whose point of view to use

A role tells the AI which kind of expert to sound like. “Explain GST as a chartered accountant advising a small shop owner” gets a more focused answer than “Explain GST”.

Be careful

A role changes the point of view, not the facts. If you tell the AI it is a Supreme Court lawyer, its case names do not become real. Always check facts yourself.

Task: one verb, one job

Give each prompt one main job. A common mistake is asking for four things at once: “summarise this chapter, make flashcards, explain the hard parts and set practice questions.” The answer comes out muddled. Split it into four prompts, each with one clear verb: summarise, explain, compare, critique or rewrite.

Example prompt · Before
Help me with my presentation.
Example prompt · After
Critique this outline for my final-year project presentation. Act as a faculty reviewer who has only five minutes.

Context: the part that helps most

In our view, context improves a prompt more than any other part. The AI knows nothing about you or your course unless you say so. Add who you are, what you already know, what happened and what you want.

Example prompt · Before
Write an email to my professor.
Example prompt · After
Write an email to my professor asking for a one-week extension on my data analytics assignment. I am in my third semester. I was ill for four days and have a doctor’s note. I have finished about half the work.
Tone: polite and honest, not dramatic.
Keep it under 120 words.
Keep your personal details private

Context means useful background, not private data. Do not paste your Aadhaar, PAN, phone number, address, passwords or marks card into an AI tool. Do not paste other people’s private messages either. Change details where you can: write “my professor” instead of the name.

Format: decide the shape of the answer

If you do not say what format you want, the AI chooses one, usually long paragraphs or too many bullets. Tell it: a table with the columns Term, Meaning and Example; a numbered checklist; a 100-word summary; an email under 120 words. Format instructions are the cheapest way to improve an answer.

Constraints: set the limits

Constraints are the rules the answer must follow: length, tone, what to leave out (“no motivational filler”), what to flag (“tell me any assumption you make”) and permission to say “I am not sure”. That last one matters because an AI can sound confident and still be wrong. This is called hallucination.

Worked example

A worked example: preparing for an internship interview

A complete prompt names all five parts and gives the AI every fact it needs. This scenario is made up for teaching: a final-year student preparing for a data analyst internship interview.

Example prompt · Before
Help me prepare for my interview.
Example prompt · After
Role: You are an interviewer hiring data analyst interns at a mid-size company.
Task: Run a mock interview with me. Ask one question at a time and wait for my answer.
Context: I am a final-year B.Com student. I have finished a Python and SQL course. My project was a sales dashboard in Excel and Power BI. I have never been interviewed for a technical role.
Format: After each answer, give feedback in three short lines: what was good, what was missing, and a better version of my answer.
Constraints: Start with easy questions and make them harder. Ask five questions in total, then give me a short summary. Use simple English. If you are not sure something is technically correct, say so.

Each part removes a guess. The AI can still make technical mistakes, so check its feedback against your course notes.

GenAI / LLM

How do you improve a prompt that did not work?

Treat prompting as a conversation, not a slot machine: the first answer is a draft that you guide.

Strong opinion

The first answer almost never matters. Many beginners treat AI like a slot machine: pull the lever, judge the result, walk away disappointed. A better way is to treat it like a study session with a patient senior: they try, you give feedback, it improves.

The iteration loop Write prompt usingthe 5-part framework Read outputcritically Good enoughto use? Yes Verify facts,then use No Diagnose: which partwas underspecified? Refine that part, orshow an example ofwhat ‘good’ looks like Two or three turns is normal. Ten means the original brief was under-briefed.

Three follow-up moves cover most situations:

  • Redirect. “Good explanation, but too long. Cut it to five lines and use an example from cricket.”
  • Show, don’t tell. Paste a sample of the style you want, such as your own notes or an answer you liked. AI copies examples better than it follows adjectives like “simple”. This is called few-shot prompting; the research is in Language Models are Few-Shot Learners (Brown et al., 2020), and our advanced prompting guide goes deeper.
  • Ask the AI to interview you. “Before you answer, ask me five questions that would help you do this better.” It often asks about details you forgot to mention.
Rule of thumb

Two or three follow-ups is normal and healthy. If you need ten, your first prompt was missing something. Go back and improve the Context part instead of patching again and again.

GenAI / LLM

Which prompt templates can you use as a student?

Five templates cover much of a student’s routine writing and studying. Copy them and replace the brackets with your own details.

Template 1 · Email to a professor or recruiter
You are my writing assistant. Draft an email to my [professor / recruiter].
Context: [who I am, what happened, what I am asking for].
Tone: [polite and formal]. Under 120 words. Do not apologise more than once. Do not invent facts I have not given you.
Template 2 · Notes into a revision sheet
Turn these rough class notes into a one-page revision sheet: key terms with one-line meanings, three examples and five practice questions. Flag anything unclear in my notes instead of guessing.
Notes: [paste]
Template 3 · Check my answer like an examiner
You are a strict but fair examiner. Here is my answer to [question]: [paste]. Give it marks out of 10, list what is missing, and show me one stronger point I could add. Do not rewrite the whole answer.
Template 4 · Explain it simply
Explain [topic] to a first-year student who already knows [what you know]. Use one everyday example from India. Keep it under 150 words, then ask me one question to check that I understood.
Template 5 · Learn it in your own language
Explain [topic] in simple [Hindi / Bengali], as if you are teaching a friend. Keep the technical terms in English in brackets. Then give me three questions to test myself.

AI can make mistakes in regional languages and in technical details. Check the explanation against your textbook, or ask your faculty.

Honest limits

When should you not use the five-part framework?

Skip the full framework when the task is small, you can check the answer at a glance, or the real problem is not the prompt.

If your situation is…The full framework is…Do this instead
A quick lookup, such as “What does CAGR stand for?”✗ OverkillAsk it plainly. Check formulas, dates and rules in your textbook anyway
You want ideas, such as project topics✗ Too earlyStart with a loose prompt, see what comes back, then add structure
The prompt takes longer to write than the task✗ Not worth the timeJust do the task yourself
You need facts you cannot check, such as references for an assignment✗ Not the fixA better prompt does not make facts true. AI can invent books and papers, so confirm every source exists
You plan to submit AI text as your own work✗ Check the rules firstFollow your college’s AI policy. Use AI to learn, then write in your own words
An email, study plan or interview practice that really matters✓ Worth itUse all five parts and check the facts before you use the answer
Common misconceptions

What do people get wrong about prompt engineering?

Three beliefs cause most of the wasted effort.

“There are secret magic words.”

No. A pack of ready-made prompts cannot know who you are or what you need. A clear structure beats secret words, every time. Save your money.

“Prompt engineering will be obsolete soon, because AI is getting smarter.”

Partly true, mostly not. Newer models guess what you mean better, even from a sloppy prompt. But no AI can read your mind about your course, your level and your goal. Clear briefing is the part that lasts.

“Longer prompts are better.”

Longer prompts that are relevant are better. Extra padding hurts, because everything you write competes for the model’s attention inside its context window, the amount of text it can look at once. Be complete, then stop.

Hands-on exercise

How do you practise this? The prompt rebuild challenge

Rebuild three of your own prompts, then keep the best one. It takes about 25 minutes and uses your real work, which is the point.

  • Step 1 (5 min). Find three prompts you typed into ChatGPT, Claude or Gemini in the past month that gave poor answers. Your chat history has them. Be honest; most are short prompts like “explain machine learning”.
  • Step 2 (10 min). Rewrite each one using the five parts. Write them out fully (Role, Task, Context, Format, Constraints), even if it feels slow at first.
  • Step 3 (5 min). Run the old and new versions in fresh chats. Put the answers side by side.
  • Step 4 (5 min). Score both on relevance, specificity, usable-as-it-is and tone, the rubric from our generative AI starter guide. Then note which single part made the biggest difference.
  • Keep the best one. Save your best new prompt in a note or doc so you can reuse it. That is the start of a prompt library. Share it with your study group.
  • Read next. Advanced prompting: few-shot examples, chain-of-thought and structured outputs covers step-by-step reasoning and answers you can drop into a spreadsheet.
FAQ

Frequently asked questions

What is prompt engineering in simple terms?

Prompt engineering is writing clear instructions so an AI tool gives you useful answers. It is closer to explaining a task to a classmate than to programming.

What is the best prompt structure for beginners?

Role, Task, Context, Format, Constraints. Say who the AI should act as, the one job to do, the background it needs, how the answer should look and the limits it must follow.

Do I need coding skills to learn prompt engineering?

No. Basic prompting is a plain-language skill, like writing a clear email. You need technical knowledge only when you build applications on top of AI models, for example with embeddings and retrieval.

Is prompt engineering a career in India?

Treat it as a skill rather than a job title. Standalone “prompt engineer” roles exist, but we do not have reliable figures on how many. In our view, employers increasingly expect prompting inside existing roles such as analyst or developer, much like Excel.

Can I use AI for my assignments?

Check your college’s rules first, because they differ. Using AI to understand a topic, practise questions or get feedback is usually different from submitting AI-written text as your own. If you are unsure, ask your faculty.

Is it safe to share personal details with ChatGPT?

Avoid it. Do not paste your Aadhaar, PAN, phone number, address, passwords or marks card, or other people’s private messages. If you must describe a situation, change the details first.

Sources

Sources