Prompting Capabilities
Mistral's official prompting guide. System prompt design, JSON mode, function calling, worded rating scales, and the specific anti-patterns to avoid.
Official Mistral docs →System prompt design
Mistral uses two input levels: system and user. The system prompt sets the role and behavioral rules, managed by developers. The user prompt provides the specific task. Start with a concise role and task: 'You are a <role>, your task is to <task>.' You can use role-separated messages or concatenate them. Keep the system prompt focused on WHO the model is and HOW it should behave, put WHAT to do in the user message.
Structure and formatting
Organize instructions hierarchically with clear sections and subsections. Imagine writing for someone with zero prior context. This is critical with Mistral: the model performs significantly better with well-structured prompts. Use Markdown and/or XML-style tags because they're readable (easy for humans to scan), parsable (simple to extract programmatically), and familiar (Mistral models saw these formats extensively during training).
Few-shot prompting
Embed examples directly in your prompt or use the standard user/assistant message format. For tasks like classification, show exact input/output pairs so the model learns the format, not just the concept. This is especially effective for JSON output, category mapping, and any task where format consistency matters more than creativity.
JSON mode and structured outputs
Mistral's JSON output enforcement ensures the model generates valid, parsable JSON every time. This is a game-changer for production pipelines where you need consistent structure. Define your schema clearly, use few-shot examples showing the exact JSON shape, and enable JSON mode in the API. The model will conform to your schema without adding markdown code blocks or explanatory text.
What to avoid (Mistral-specific)
These anti-patterns cause the most problems with Mistral models: Blurry quantitative adjectives ('too long', 'many', 'few'). Replace with exact numbers. Vague words ('things', 'stuff', 'interesting'). State exactly what you mean. Contradictions in long prompts. Use decision trees instead of conflicting rules. Asking the model to count words. Provide character counts as input instead. Generating unnecessary tokens. Request only what you need.
Worded scales beat numeric scales
This is a unique Mistral insight: when rating or scoring, worded scales consistently outperform numeric scales. Instead of 'Rate on 1 to 5', use: 'Very Low (highly irrelevant), Low (not good enough), Neutral (not particularly interesting), Good (worth considering), Very Good (highly relevant).' The descriptions anchor each level. Convert to numbers after if needed.
Four core capabilities
Mistral's guide covers four practical patterns in depth: Classification (zero-shot and few-shot categorization), Summarization (condensing documents while preserving key info), Personalization (adapting output to user preferences and context), and Evaluation (assessing quality and relevance). Each pattern works best with the structured approach: clear role, explicit format, and examples.