Llama's instruct models follow instructions well, but they are less forgiving of vague prompts than the largest closed models. That is not a flaw to fight. It is a reason to write prompts with a clear structure, which also makes them cheaper because you get a usable answer on the first try instead of the third.
The system prompt is your friend
On a hosted API or local runner you can set a system prompt that applies to the whole conversation. Put stable instructions there: who the model is, what tone to use, what format to return. Then keep each user message short. This saves tokens on every turn and keeps the model consistent.
In Meta AI you do not get a system prompt, so put the same instructions at the top of your first message. The structure still works, you just repeat it more often.
Example 1: rewriting an email
| Before | After |
|---|---|
| Make this email better: [email] | You are an assistant that edits business email. Rewrite the email below so a busy client can read it in 30 seconds. Keep every fact. Lead with the decision I need from them. Max 120 words, plain English, no exclamation marks. Email: [email] |
The before prompt produces something longer and more formal than you wanted, and you send a second message to fix it. The after prompt produces the right thing once. On a metered API, that halves the cost of the task.
Example 2: extracting data
| Before | After |
|---|---|
| What are the important details in this invoice? [text] | Extract from the invoice text below. Return only JSON with keys: vendor, invoice_number, date (YYYY-MM-DD), total (number), currency (ISO code). If a value is missing, use null. No commentary. Text: [text] |
Example 3: writing code
| Before | After |
|---|---|
| Write a function to dedupe a list | Write a Python 3 function dedupe(items) that removes duplicates while preserving first-seen order. Items may be unhashable dicts; compare by json.dumps with sorted keys. Include a docstring and three assert-based tests. Return only code. |
Habits that work on Llama
- Say what format you want, and say "only" if you want no chatter around it.
- Give one or two short examples of the ideal output for repetitive tasks. Open-weight models respond strongly to examples.
- Ask for a plan first on complex tasks, then ask it to execute the plan. Two short calls often beat one long one.
- Keep the context lean. Paste the relevant section, not the whole document, unless the whole document is the task.
Knowledge check
Which change most reliably lets you use a smaller, cheaper Llama model for a task?