Course contentsShow
← Machine Learning and Deep Learning
Lesson 1860 of 3,53839. Prompt Engineering FundamentalsFree lesson

System Prompt Best Practices

Apply principles of clarity, specificity, and structure to write robust system prompts that reliably guide behavior.

System Prompt Best Practices

What you'll learn: How to write clear, specific, and structured system prompts that consistently guide model behavior in the way you intend.

Why Best Practices Matter

You've learned how to use system prompts to define personas, set tone, and establish guidelines. But not all system prompts work equally well. A vague or poorly structured system prompt leads to inconsistent outputs, misunderstood instructions, and frustrated users. Think of it like giving directions: "Go downtown" is far less reliable than "Drive north on Main Street for 2 miles, turn left at the library, proceed 3 blocks."

Core Principles

Clarity Over Cleverness

Be direct and unambiguous. Instead of "You're kind of like a helpful assistant," write "You are a helpful assistant who provides accurate, concise answers."

Specificity Wins

Define exact behaviors rather than vague qualities. Don't say "Be professional." Say "Use formal language, avoid slang, and structure responses with clear headings."

Structure for Readability

Organize complex system prompts with clear sections:

  • Role definition first
  • Behavioral guidelines next
  • Constraints and restrictions last
  • Use bullet points or numbered lists for multiple rules

Test Boundaries Explicitly

State what the model should not do: "Do not generate code. Do not make assumptions about missing information."

Avoid Contradictions

Review your system prompt for conflicting instructions. "Be concise" and "provide detailed explanations" create tension—prioritize or clarify when each applies.

Practical Example

Weak: "You help with science questions."

Strong: "You are a high school chemistry tutor. Explain concepts using everyday analogies. Keep responses under 150 words. If a question requires advanced mathematics, suggest the student consult their teacher."

Key Takeaway: Effective system prompts combine clarity (say exactly what you mean), specificity (define concrete behaviors), and structure (organize instructions logically) to create reliable, predictable model behavior.