Tutorials / Prompting Meta AI and Llama Models / The anatomy of a good prompt

The anatomy of a good prompt

10 min read text
Course contents (20 lessons)
  1. Getting to know Meta AI and Llama
  2. What Meta AI is and where you can use it
  3. Meta AI versus Llama: the assistant and the models
  4. Your first chat with Meta AI
  5. Prompt basics that work
  6. The anatomy of a good prompt
  7. Context, tone, length and follow-ups
  8. Everyday uses
  9. Writing and replying to messages
  10. Captions, posts and bios
  11. Planning and study help
  12. Customer replies for a small business
  13. Images, groups and privacy
  14. Writing image generation prompts
  15. Group chats, etiquette and privacy
  16. Working with Llama models directly
  17. Running a Llama model on your own computer
  18. System prompts and chat templates
  19. Parameters: temperature, top_p and max tokens
  20. Few-shot examples and structured JSON output
  21. Advanced prompting
  22. Prompting Llama for code
  23. Retrieval-augmented prompting: answering from your own documents
  24. Evaluating and comparing answers
  25. Safety, limits and a final project
  26. Safety, limits and responsible use
  27. Final project: build a study buddy assistant

Four parts that do most of the work

I have read a lot of prompt advice, and most of it comes down to four parts. You do not need all four every time, but when an answer disappoints me, one of them is usually missing.

  1. Task: what you want done. Use a clear verb: write, rewrite, list, compare, explain, summarise.
  2. Context: what the assistant needs to know about the situation. Who is the reader? What happened before?
  3. Constraints: limits on the answer. Length, words to avoid, things to include, things to leave out.
  4. Format: the shape of the output. A table, bullet points, three short paragraphs, a single sentence.

A weak prompt and a better one

Weak:

Write a message about the meeting.

Better:

Write a WhatsApp message to my team (6 people, friendly relationship).
Task: tell them the Thursday meeting moves from 10:00 to 14:00 because the client is travelling.
Constraints: under 50 words, polite, ask them to reply with a thumbs-up if the new time works.
Format: plain text, no bullet points.

Why the better one works

The first version leaves the assistant to guess everything. Which meeting? Who is it for? Formal or friendly? Long or short? The second version answers each of those questions before they are asked. The labels (Task, Constraints, Format) are not magic. They just keep me honest about what I included.

You do not need labels every time

In casual use you can write one natural sentence that contains all four parts:

Write a friendly WhatsApp message to my 6-person team saying Thursday's meeting moves from 10:00 to 14:00 because the client is travelling. Under 50 words, and ask for a thumbs-up if it works.

It is the same prompt in a compact form. Use labels when the request is long or complicated, and plain sentences when it is short.

Show, do not only tell

If you have a style in mind, paste a short sample. Assistants copy style very well.

Here is how I usually write to customers:
"Hi Sara, thanks for waiting. Your order is packed and leaves today. I will send the tracking number tonight."

Write a similar message to Omar. His order is delayed by two days because of a supplier problem. Keep my tone and length.

Why it works

Words like "friendly" and "professional" mean different things to different people. A real sample is exact. The model does not have to guess what "my tone" means because it can see it.

Say what to do, not only what to avoid

Compare "Do not be boring" with "Open with one surprising fact, then give three tips". The second tells the assistant what to do. Negative rules are fine as an extra ("no jargon"), but they work best next to a positive instruction.

A quick checklist

Question to ask yourselfIf the answer is no
Did I name the task with a clear verb?Start the prompt with that verb.
Does it know who the reader is?Add the reader and the relationship.
Did I give a length?Add "under 80 words" or "three bullets".
Did I say what shape I want?Add the format.
Did I include the facts it needs?Paste them in. It cannot look up your life.

The common mistake

People either write too little or write a long, tangled paragraph with five tasks in it. If you ask for a plan, a poem, a table and a translation in one message, the quality of each drops. Split big requests into steps. One main task per message works better.

Try it yourself

Take a message you need to send soon. First write the weakest version of the prompt, one short line. Send it and save the answer. Now write the four-part version and send that. Put the two answers side by side and underline what the better prompt fixed. This small comparison teaches more than reading ten articles.

This course is free to read. Create a free account to enrol, save your progress and pick up where you left off.

Sign up free I already have an account