Application

System Prompt

Why System Prompt Is Needed

In every conversation, you might want the model to have different "personalities" and "behavior patterns."

For example:

  • Customer service scenario: you want the model professional, patient, polite
  • Code assistant scenario: you want the model rigorous, direct, providing runnable code
  • Creative writing scenario: you want the model imaginative, with varied styles

These "global settings" shouldn't be repeated every time a user asks a question. System Prompt solves this — set it once at the start of the conversation, and it applies globally.


What Is System Prompt

One-line definition: System Prompt is the global rule layer set for the model before a conversation starts, defining role, goals, boundaries, and default behavior.

Analogy: System Prompt is like giving the model a "employee handbook" — it's not answering a specific question, but telling the model "what role you are, how to do things, what you can't do."

Three layers of Prompt:

  • System Prompt: role settings, behavior rules — highest priority
  • User Prompt: the actual question the user is asking this turn
  • Assistant history: previous conversation context — affects style and continuity

How to Do It: How to Write Good System Prompts

A good System Prompt typically includes:

  • Role: what identity the model has now
  • Goal: what the main task of this session is
  • Style: how to answer, tone, structure
  • Constraints: what not to do, how to handle exceptions

Practical advice:

  • Write the most important rules first — key constraints buried too late are easily ignored
  • Use executable language over abstract slogans, e.g., "give conclusions first, then reasons"
  • Write clear strategies for exceptional situations, e.g., "state uncertainty when unsure"
  • If the system calls tools, it's best to also specify when to call and when to stop

For systematic Prompt optimization, see the Prompt Engineering entry.


Common Pitfalls

  • Too long System Prompt consumes Context space, and middle rules are more easily ignored
  • Vague instructions like "answer naturally" are usually hard to execute consistently
  • Permissions, sensitive operation confirmations, and data validation can't be guaranteed by Prompt alone — need program control

Remember this: System Prompt is the model's "employee handbook" — set once at the start of the conversation, applies globally, defining role, rules, and boundaries.

Related terms: Prompt · Prompt Engineering