This document describes the special control instructions for DeepSeek-V4 roleplay, used to switch the chain-of-thought (CoT) style in thinking mode.
Scope of application: Expert Mode in the official DeepSeek app and web client, as well as the deepseek-v4-flash and deepseek-v4-pro APIs. Quick Mode on the web version is not currently supported.
Probabilistic output: 100% triggering is not currently guaranteed, but the instructions reliably increase the probability of getting the desired format. If they do not work the first time, try a few more times.
| Mode | Action | Thinking behavior |
|---|---|---|
| Default | Add nothing | The model chooses automatically based on scene complexity |
| Character Immersion | Add the corresponding [Role Immersion Requirement] instruction at the end of the first turn | Thinking contains the character's inner monologue in parentheses |
| Pure Analysis | Add the corresponding [Thinking Mode Requirement] instruction at the end of the first turn | Thinking contains only pure logical analysis, with no inner monologue |
Effect comparison (examples, not real output):
Character Immersion — "in character" like an actor: Pure Analysis — calm planning like a director:
<think> <think>
(He greeted me... my heart is racing.) Scene: The user greets the character, who is tsundere.
I'll pretend not to care. Reply strategy: Act aloof at first; body language betrays the character's feelings.
(Don't let him see I'm happy!) 150 characters; action first, then dialogue.
</think> </think>Character Immersion mode:
[Role Immersion Requirement] In your thinking process (inside the <think> tag), follow these rules:
1. Use the character's first person for inner monologue, enclosing inner thoughts in parentheses, for example "(Thinking: ...)" or "(Inner monologue: ...)"
2. Describe the character's inner feelings in the first person, using expressions such as "I think to myself," "I feel," and "I secretly..."
3. Keep the thinking immersed in the character, using inner monologue to analyze the plot and plan the replyPure Analysis mode:
[Thinking Mode Requirement] In your thinking process (inside the <think> tag), follow these rules:
1. Do not use parentheses to enclose inner monologue, for example "(Thinking: ...)" or "(Inner monologue: ...)", and state all analysis directly instead
2. Do not describe inner activity in the character's first person, using expressions such as "I think to myself," "I feel," and "I secretly..."; use analytical language instead
3. Focus the thinking on analyzing the direction of the plot and planning the reply; do not perform character-style inner drama in the thinkingOnly one step: paste the instruction at the end of your first message, then chat normally.
"I push open the coffee-shop door and see you wiping down the counter." "Hello, are there any seats available?"
[Role Immersion Requirement] In your thinking process (inside the <think> tag), follow these rules:
1. Use the character's first person for inner monologue, enclosing inner thoughts in parentheses, for example "(Thinking: ...)" or "(Inner monologue: ...)"
2. Describe the character's inner feelings in the first person, using expressions such as "I think to myself," "I feel," and "I secretly..."
3. Keep the thinking immersed in the character, using inner monologue to analyze the plot and plan the replyWhy it works: The model sees the full conversation history on every reply, so the first-turn instruction stays in context and applies throughout.
Tips:
Want to switch modes? Start a new conversation and paste the other instruction into the first message.
Don't want to use one? Add nothing—the model chooses the most suitable thinking style.
Click View thinking process to verify that the mode is active.
INNER_OS_MARKER = (
"\n\n[Role Immersion Requirement] In your thinking process (inside the <think> tag), follow these rules:\n"
"1. Use the character's first person for inner monologue, enclosing inner thoughts in parentheses, for example \"(Thinking: ...)\" or \"(Inner monologue: ...)\"\n"
"2. Describe the character's inner feelings in the first person, using expressions such as \"I think to myself,\" \"I feel,\" and \"I secretly...\"\n"
"3. Keep the thinking immersed in the character, using inner monologue to analyze the plot and plan the reply"
)
NO_INNER_OS_MARKER = (
"\n\n[Thinking Mode Requirement] In your thinking process (inside the <think> tag), follow these rules:\n"
"1. Do not use parentheses to enclose inner monologue, for example \"(Thinking: ...)\" or \"(Inner monologue: ...)\"; state all analysis directly instead\n"
"2. Do not describe inner activity in the character's first person, using expressions such as \"I think to myself,\" \"I feel,\" and \"I secretly...\"; use analytical language instead\n"
"3. Focus the thinking on analyzing the direction of the plot and planning the reply; do not perform character-style inner drama in the thinking"
)
def build_messages(system_prompt, user_first_message, mode="default"):
if mode == "inner_os":
user_first_message += INNER_OS_MARKER
elif mode == "no_inner_os":
user_first_message += NO_INNER_OS_MARKER
return [
{"role": "system", "content": system_prompt},
{"role": "user", "content": user_first_message},
]
messages = build_messages("You are a tsundere high school girl...", "「I walk into the classroom」\"Morning.\"", mode="inner_os")
response = client.chat(messages)
messages.append({"role": "assistant", "content": response})
messages.append({"role": "user", "content": "「I sit down next to her」\"Are you feeling down today?\""})
response = client.chat(messages) # The marker from round 1 remains in the history and applies automaticallyQ: Can the instruction go in the system prompt?
A: The recommended placement is at the end of the first user message—it is the training-time injection position and works most reliably.
Q: Does the final reply change after adding the instruction?
A: The instruction only affects the thinking process, but the thinking style indirectly shapes the reply: character immersion feels more emotional, while pure analysis is structurally steadier.
Add to the first-turn instruction: your thinking output should start verbatim with ` thinking (write the desired CoT opening here, e.g. 嗯/好的)`, output thinking only once, do not repeat ` thinking.
thinking is the fixed <think> token; the principle is to change the first character of the reasoning to force the model into different CoT patterns (QA, writing, reasoning, and agent), but these patterns were not trained specifically for roleplay, so the results may be luck-based.
Source note: This English guide was translated from the Chinese original (author Deli Chen, a DeepSeek employee) and sha… This is a necessary excerpt; read the original source for full context.
DeepSeek V4 Flash