# Mistral Models Prompt Guide

**Table of Contents**

1. [Give the Model a Clear Purpose](https://app.gitbook.com/o/wESD8a1fR7H7ddwkYO61/s/IabFtGTeQzwfWCzp8vd6/~/edit/~/changes/458/for-users/prompt-writing-guide/mistral-models-prompt-guide#id-1-give-the-model-a-clear-purpose)
2. [Structure Prompts Clearly](https://app.gitbook.com/o/wESD8a1fR7H7ddwkYO61/s/IabFtGTeQzwfWCzp8vd6/~/edit/~/changes/458/for-users/prompt-writing-guide/mistral-models-prompt-guide#id-2-structure-prompts-clearly)
3. [Use Formatting](https://app.gitbook.com/o/wESD8a1fR7H7ddwkYO61/s/IabFtGTeQzwfWCzp8vd6/~/edit/~/changes/458/for-users/prompt-writing-guide/mistral-models-prompt-guide#id-3-use-formatting)
4. [Add examples when Accuracy or Format Matters](https://app.gitbook.com/o/wESD8a1fR7H7ddwkYO61/s/IabFtGTeQzwfWCzp8vd6/~/edit/~/changes/458/for-users/prompt-writing-guide/mistral-models-prompt-guide#id-4-add-examples-when-accuracy-or-format-matters)
5. [Don't Overuse Reasoning](https://app.gitbook.com/o/wESD8a1fR7H7ddwkYO61/s/IabFtGTeQzwfWCzp8vd6/~/edit/~/changes/458/for-users/prompt-writing-guide/mistral-models-prompt-guide#id-5-dont-overuse-reasoning)
6. [Avoid Subjective Words](https://app.gitbook.com/o/wESD8a1fR7H7ddwkYO61/s/IabFtGTeQzwfWCzp8vd6/~/edit/~/changes/458/for-users/prompt-writing-guide/mistral-models-prompt-guide#id-6-avoid-subjective-words)
7. [Avoid Self Count of Words or Characters](https://app.gitbook.com/o/wESD8a1fR7H7ddwkYO61/s/IabFtGTeQzwfWCzp8vd6/~/edit/~/changes/458/for-users/prompt-writing-guide/mistral-models-prompt-guide#id-7-avoid-self-count-of-words-or-characters)
8. [Use Worded Scales over Numeric Scales](https://app.gitbook.com/o/wESD8a1fR7H7ddwkYO61/s/IabFtGTeQzwfWCzp8vd6/~/edit/~/changes/458/for-users/prompt-writing-guide/mistral-models-prompt-guide#id-8-use-worded-scales-over-numeric-scales)
9. [Prompt Templates](https://app.gitbook.com/o/wESD8a1fR7H7ddwkYO61/s/IabFtGTeQzwfWCzp8vd6/~/edit/~/changes/458/for-users/prompt-writing-guide/mistral-models-prompt-guide#id-9-prompt-templates)

***

### 1. Give the Model a Clear Purpose

Mistral recommends defining a clear purpose early, often through a simple role-and-task setup like: **“You are a \<role>, your task is to \<task>.”**

**Less Effective**

```
Analyze this customer feedback.
```

**More Effective**

```
You are a customer insights analyst. 
Your task is to review this customer feedback and identify
the top 3 recurring complaints.
```

*Tip: Lead with role + task before adding detailed instructions.*

***

### 2) Structure Prompts Clearly

Mistral explicitly recommends organizing prompts hierarchically with clear sections and subsections.

A good structure often includes:

* Context
* Task
* Instructions or steps
* Constraints
* Output format

**Unclear Prompt**

```
Review this text and tell me what matters.
```

**Clear Prompt**

```
Context: Internal Q2 review for non-technical executives
Task: Summarize the document
Instructions:

Identify the 3 most important insights

Remove technical jargon

Note any major risks or opportunities
Constraints: Keep under 200 words
Output Format: 3 bullets only
```

***

### 3. Use Formatting

Formatting is a core prompting tool. It's best to use structures such as markdown and/or XML-style tags because they are readable, parsable, and familiar to models.

**Recommended formats:**

* Markdown headings
* Bullets and numbered steps
* XML-style sections like `<context>`, `<task>`, `<constraints>`

**Example**

```
<context>
This will be used in a board presentation.
</context>

<task>
Summarize the report for executives.
</task>

<constraints>
- Use plain language
- Keep under 120 words
- Output only bullet points
</constraints>
```

*Tip: The more complex the task, the more important formatting becomes.*

***

### 4. Add examples when Accuracy or Format Matters

Use example prompting, especially few-shot prompting, when you want better accuracy or tighter control over output format.

**This is especially useful for:**

* classification
* extraction
* tagging
* JSON outputs
* repeated formatting tasks

```
# Task
Detect the language of the input text.

# Examples
Input: Hello, how are you?
Output: {"language_iso": "en"}

Input: Bonjour, comment allez-vous?
Output: {"language_iso": "fr"}
```

**Tip:** If output structure matters, show the model at least one example of the exact format you want.

***

### 5. Don't Overuse Reasoning

For simple rewriting, extraction, formatting, or short summaries, a well-structured prompt is usually enough.

**Use reasoning for:**

* math
* coding
* multi-step logic
* difficult comparisons
* edge-case-heavy decisions

***

### 6. Avoid Subjective Words

Words like “too long,” “interesting,” “better,” “some,” or “a few” are vague. Mistral recommends replacing them with objective measures.

**Instead of:** Make it shorter\
**Use:** Keep it under 120 words

***

### 7. Avoid Self Count of Words or Characters

Mistral advises against relying on the model to calculate thresholds itself. If length matters operationally, pass the count in as data instead.

***

### 8. Use Worded Scales over Numeric Scales

For evaluations, Mistral recommends labels like Very Low, Low, Neutral, Good, Very Good instead of a raw 1–5 scale.

***

### 9. Prompt Templates

#### General Task Template

```
System:
You are a [role]. Your task is to [goal].

User:
## Context
[Background and audience]

## Task
[Exactly what you want done]

## Instructions
1. [Step one]
2. [Step two]
3. [Step three]

## Constraints
- [Tone]
- [Length]
- [What to avoid]

## Output Format
[Bullets, table, JSON, paragraph, etc.]
```

#### Few Shot Template

```
System:
You are a [role]. Follow the examples exactly.

User:
## Task
Classify each input into one category.

## Categories
- Positive
- Neutral
- Negative

## Examples
Input: "This product is amazing."
Output: Positive

Input: "It arrived yesterday."
Output: Neutral

Input: "It broke after one use."
Output: Negative

## New Input
[Insert text here]

## Output Format
Return only the category.
```

#### Structured Output Template

```
System:
You are an extraction assistant.

User:
## Task
Extract the key details from the text.

## Fields
- company
- product
- launch_date
- summary

## Constraints
- Return valid JSON only
- Use null if a field is missing
- Do not add extra keys
```
