LLM Kitchen
Explanations

Part VI · Prompt engineering

Ch 20. Instructions, roles, and the system prompt

The slot at the top

Chat models have a slot at the top of the conversation for a : instructions for the whole chat. In a chat app, its makers write it and you never see it. Chat models were trained to follow instructions like these, so they usually do.[1] But what kind of instructions help?

The chat template (Ch 15) has a slot ahead of the conversation for a : instructions that apply to the whole chat. In a chat app, its makers write it and you never see it; when you use a model directly, you write it yourself. Chat models were tuned on examples of an assistant following instructions, and on people’s ratings of which replies were better.[1][1] So instructions there tend to be followed. But what kind of instructions help?

Here is Qwen2.5-1.5B-Instruct answering the same question under three system prompts. The highlighted part is the only text that changes:

Try it

Same question, different system prompts

Recorded · Qwen2.5-1.5B-Instruct
System prompt

What the model reads

<|im_start|>system
You are Qwen, created by Alibaba Cloud. You are a helpful assistant.<|im_end|>
<|im_start|>user
Why is the sky blue?<|im_end|>
<|im_start|>assistant

Its reply (82 tokens)

The sky appears blue because of a phenomenon called Rayleigh scattering. This occurs when sunlight passes through Earth's atmosphere and interacts with gas molecules in the air. The shorter wavelengths of light (blue and violet) scatter more easily than the longer wavelengths (red and orange), which means that they are scattered in all directions throughout the atmosphere. As a result, we see the blue color of the sky from the ground.
Does a persona make it better at sums? “You are a brilliant mathematician who never makes mistakes.” vs. the default system prompt
QuestionRight answerDefaultPersona
What is 47 × 38?17861796 wrong1796 wrong
What is 63 × 29?18271827 right1847 wrong
What is 84 × 57?47884818 wrong4836 wrong
What is 125 × 16?20002000 right2000 right
What is 238 × 47?1118610966 wrong10966 wrong
What is 19 × 99?18811881 right1861 wrong
What is 356 × 24?85448544 right8544 right
What is 73 × 73?53295329 right5329 right
Right5 of 83 of 8

Write your own system prompt and see how Qwen2.5-0.5B-Instruct's answer changes, live. Choose a model tier to run a real model in your browser.

Specific beats grand

The specific instructions worked: two short sentences and an everyday example. The persona, “a world-famous physicist”, made the answer more than twice as long, and no better.

The specific instructions worked: two short sentences and an everyday example, shorter than the default answer. The persona, “a world-famous physicist”, made the answer more than twice as long and no better: it added claims that are muddled, like most blue light being “scattered away from us towards the edges of the sky”.

Telling the model it was “a brilliant mathematician who never makes mistakes” didn’t help either: it got 3 of 8 sums right, against 5 of 8 without it. A large study of 162 personas found the same: on average, personas didn’t make answers more accurate.[2]

The sums tell the same story. Telling the model it is “a brilliant mathematician who never makes mistakes” did not make it one: it got 3 of the 8 right, against 5 of 8 with the default system prompt. A large study found the same across 162 personas and 2,410 factual questions: adding a persona did not improve accuracy on average, and which persona helped on which question was largely random.[2][2]

That fits how the model works. A persona changes which documents the text resembles, so it changes tone, length, and vocabulary. It doesn’t add knowledge or skill the model lacks. Instructions that say what you actually want (who the reader is, how long, what format) give the model something it can follow.

Many rules at once

Real system prompts often hold dozens of rules. Here Qwen2.5-1.5B-Instruct wrote 12 short notes, each under 1, 2, 4, 6, 8, and then 10 rules that a program can check, like “Don’t use any commas”:

System prompts in real apps often hold dozens of rules. Here Qwen2.5-1.5B-Instruct wrote 12 short notes, each under 1, 2, 4, 6, 8, and then 10 rules, all of which can be kept at once and checked by a program: start with “hello”, use no commas, end with “see you soon”, and so on. Each note starts the list at a different rule, so every rule comes both early and late:

Try it

How many rules at once?

Recorded · Qwen2.5-1.5B-Instruct
12 short notes, each written under 1 to 10 rules
RulesRules keptNotes that kept every rule
158%7 of 12
271%7 of 12
463%3 of 12
681%4 of 12
873%1 of 12
1073%0 of 12
Rules

It kept 8 of 10 rules.

  1. Start with the word "hello". (kept)
  2. Mention the word "harbor". (kept)
  3. Use fewer than 60 words. (kept)
  4. Don't use any commas. (kept)
  5. Write everything in lowercase letters. (kept)
  6. Include a number written in digits. (missed)
  7. End with the words "see you soon". (kept)
  8. Don't use the word "the". (kept)
  9. Include a question. (missed)
  10. Mention the word "lemonade". (kept)
hello there! i hope this message finds you well. would love to invite you to our family's harbor picnic on saturday. it promises to be a delightful day filled with laughter and delicious lemonade. see you soon!

More rules didn’t make it worse at each one: with ten rules it kept 88 of 120, about three in four. But every rule it misses spoils the note. With one rule, 7 of the 12 notes kept it; with ten, not one note kept them all. Much larger models slip too as rules pile up: the best of 20 kept only about two thirds of 500 rules.[3] So check every rule that matters, and split a long list into steps (Ch 31).

More rules didn’t make the model worse at each one: with a single rule it kept it in 7 of the 12 notes, and with ten it kept 88 of 120, about three in four. What fell is the chance that a note kept every rule: 7 of 12 with one rule, 3 with four, 1 with eight, and none with ten. The misses were mostly in rules that fight the model’s habits, like using no “the” or adding a question, and they came from all over the list. A benchmark of 500 rules found that much larger models slip too as rules pile up: the best of 20 kept only 68% at the full 500, and models favored rules near the start of the list.[3][3] So a long list of rules needs checking, one rule at a time, and it often works better split into steps (Ch 31).

Why “all of them” falls so fast

If each rule is kept with chance p, and the rules are kept or missed independently, all k are kept with chance

pk

With p=88/120≈0.73, ten rules give 0.7310≈4%: about half a note in 12, and the recording got none. A rule that’s kept 90% of the time still leaves only 0.910≈35% of outputs with all ten right.

One sequence, ranked by training

In the template from Ch 15, the system prompt sits between <|im_start|>system and <|im_end|>, and the user’s message follows in the same way. Leave the system prompt out and Qwen’s template fills one in: “You are Qwen, created by Alibaba Cloud. You are a helpful assistant.” Either way, the network gets one sequence of tokens. Nothing in its layers treats the system part differently; any extra weight it gets was learned in tuning.

That’s a weakness when other text in the sequence gives orders. OpenAI researchers argued that treating system prompts and untrusted text as equals is one of the main things that lets prompt injection work (Ch 33). They trained GPT-3.5 on generated examples of an instruction hierarchy, with system messages ranked above users’ and users’ above tool outputs, teaching it to ignore lower-ranked instructions that conflict. It became much harder to attack, even in ways it hadn’t been trained on, while losing little on ordinary tasks.[4]

Recipe card

Recap

  • The system prompt is text in a slot at the start of the chat, read like any other text.
  • Clear, specific instructions about audience, length, and format are followed well.
  • Each extra rule is another chance to miss one: with ten, no note kept them all.
  • A persona changes style, not ability; “you never make mistakes” doesn’t make it so.
  • Roles are marked by special tokens in one sequence; any priority for the system prompt comes from tuning.

Next question: what about asking the model to work step by step, or to answer in a fixed format?

Sources

  1. Long Ouyang et al. (2022). Training language models to follow instructions with human feedback. NeurIPS 2022.
  2. Mingqian Zheng et al. (2024). When "A Helpful Assistant" Is Not Really Helpful: Personas in System Prompts Do Not Improve Performances of Large Language Models. Findings of EMNLP 2024.
  3. Daniel Jaroslawicz et al. (2025). How Many Instructions Can LLMs Follow at Once?. arXiv.

Sources

  1. Long Ouyang et al. (2022). Training language models to follow instructions with human feedback. NeurIPS 2022.
  2. Mingqian Zheng et al. (2024). When "A Helpful Assistant" Is Not Really Helpful: Personas in System Prompts Do Not Improve Performances of Large Language Models. Findings of EMNLP 2024.
  3. Daniel Jaroslawicz et al. (2025). How Many Instructions Can LLMs Follow at Once?. arXiv.

Sources

  1. Long Ouyang et al. (2022). Training language models to follow instructions with human feedback. NeurIPS 2022.
  2. Mingqian Zheng et al. (2024). When "A Helpful Assistant" Is Not Really Helpful: Personas in System Prompts Do Not Improve Performances of Large Language Models. Findings of EMNLP 2024.
  3. Daniel Jaroslawicz et al. (2025). How Many Instructions Can LLMs Follow at Once?. arXiv.
  4. Eric Wallace et al. (2024). The Instruction Hierarchy: Training LLMs to Prioritize Privileged Instructions. arXiv preprint.