How to prompt Llama 4
Prompt Llama 4 with markdown headers (Context, Task, Constraints, Output format) and lead with the outcome you want. Strip out leftover system prompts, personas and example chats first: Llama follows instructions literally and will obey stale lines it finds. When two rules conflict, say which one wins.
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.
Sources
- Meta — Llama prompting guidance (clear instructions, format specification, system prompts)