How to prompt Llama 4
Prompt Llama 4 by saying the outcome first, in markdown sections, and by deleting any older instruction the draft still contains. This guide treats Llama as a literal follower: a leftover “You are ChatGPT” line, a persona block, or a sample chat is another task it will try to obey. When two rules conflict, name the winner. When the output shape is missing, the answer tends to come back as chatty markdown, so the contract has to be written down.
Meta publishes a prompt-engineering how-to at the link in Sources. The practical failure on this page is not a missing slogan. It is a prompt that still contains the previous system’s rules, or that says “short” and “complete” without deciding which one matters. Lead with the deliverable. Then context, constraints, and output format. Use markdown headers rather than XML. This page’s structure examples use headers because XML in a Llama prompt is easy to echo back as text rather than as structure.
The prompt structure
## Context
Release 2.4 changes: CSV export for reports, fixed timezone bug in
scheduled emails, removed legacy v1 dashboard.
## Task
Write user-facing release notes.
## Constraints
- Only the changes listed above; no invented features.
- No marketing adjectives.
## Output format
Bullets grouped under "New", "Fixed" and "Removed".
Use markdown, not XML. Llama sometimes echoes XML tags back as literal text.
Outcome first
“Write a 120-word status email with a subject line and body” does more than “You are a helpful assistant who values clear communication”. Start with what must exist when the model is done.
Clean out old instructions
This is the most Llama-specific advice. If your prompt still contains a previous system prompt, a “You are ChatGPT” line, a safety preamble that contradicts the task, or a sample conversation, Llama will try to follow it. Delete anything that isn’t part of this task.
Likewise, if you paste a draft containing a markdown table and don’t specify the output format, Llama may assume that table is the shape you want.
Say which rule wins
Llama takes each instruction at face value. If you ask for “short” and “complete”, decide which takes priority and write it in Constraints. The model hesitates and flip-flops less when the winner is explicit.
An explicit output contract
Llama tends towards chatty, list-heavy markdown. State the language, heading style, list or prose, and length. If you want a paragraph, write “clear paragraphs, not a bullet list”.
Numbered steps inside Task are fine when the work is sequential. Don’t add approval gates or tell the model to wait.
Coding with Llama
Refer to files only if you actually know their names. “Edit the function pasted below” is safer than a guessed path. Ask for fenced code and a short list of changes.
Success criteria that can be checked
For important tasks, add a short Success criteria section with observable conditions, such as “the email is under 120 words and includes the launch date”. Avoid vague ones like “be professional”.
Why Llama prompts go wrong
- Stacked personality and persona blocks.
- Conflicting rules with no stated winner.
- No output format, so you get a generic chatty answer.
- XML tags that come back as literal text.
- Example conversations that become the task.
When does Llama 4 follow the wrong instruction?
A previous system prompt is still in the paste. If the draft contains “You are ChatGPT,” a safety preamble, or a sample dialogue, that text is an instruction. Delete it before you add your own headers. Llama’s failure here is obedience, not ignoring you.
Two rules and no winner. “About 600 words” and “cover every detail” can both be true until they collide. Write which one wins in Constraints. The model has nothing to hesitate over once the priority is a line in the prompt rather than a hope.
The output shape is borrowed from the draft. A pasted markdown table, with no Output format of your own, is a shape the model can treat as the request. Say “prose, not a table” if the table was source material.
XML tags used as the skeleton. This guide’s structure is markdown headers. Tags that look like markup are easy to copy into the answer as literal text, which is the opposite of a section the model is meant to fill.
State the language and the heading style in Output format when they matter. “Clear paragraphs, not a bullet list” is a contract. “Write something good” is not. Numbered steps inside Task are appropriate when the work is a sequence. Do not add a line that tells the model to pause for approval. For a coding edit, name the function that was pasted and ask for fenced code plus a short change list, rather than guessing a file path that was never in the draft.
What does the same rough prompt look like for Llama 4?
Same draft. Outcome first. No facts beyond the draft.
write a blog post announcing our windows app is moving from 1000 one-off credits to a flat 13.99 a month plan, about 600 words, its for people already using it, dont be hypey
## Task
Write a blog post of about 600 words announcing the pricing change.
## Context
Windows app. Readers already use it.
Old price: 1,000 one-off credits.
New price: a flat 13.99 a month.
## Constraints
Name both prices. No hype adjectives.
If length and detail conflict, keep the post near 600 words.
## Output format
Prose. Not a bullet list. Not a second version.