# DeepSeek-V4 Roleplay Thinking-Mode Instructions

A short README-only repo by GitHub user `victorchen96` that documents two undocumented control markers for [[deepseek]]'s V4 thinking-capable models. Appending one of two specific Chinese-language instructions at the end of the first user message switches the style of the model's `<think>` block between two distinct modes — a roleplay-immersive inner monologue, or a pure planning/analysis trace. The behavior is probabilistic, not enforced, which the author attributes to these being training-time injected markers rather than control tokens.

## The three modes

| Mode | Trigger | Thinking-trace style |
|------|---------|----------------------|
| Default | Nothing added | Model picks based on scene complexity |
| Role immersion | Append the `【角色沉浸要求】` instruction to first user message | `<think>` contains first-person inner monologue in parentheses |
| Pure analysis | Append the `【思维模式要求】` instruction to first user message | `<think>` contains only scene-and-strategy planning, no monologue |

The README's side-by-side example:

- *Role immersion* — `（他跟我打招呼了……心跳加速。）我要装作不在意的样子回应。（不能让他看出来我很高兴！）` (translation: "(He greeted me… my heart is racing.) I'll respond pretending I don't care. (Can't let him see I'm happy!)")
- *Pure analysis* — `场景：用户打招呼，角色是傲娇属性。回复策略：先嫌弃，身体语言暴露真情。控制 150 字，先动作描写再对话。` (translation: "Scene: user greets, character is *tsundere*. Reply strategy: dismiss first, body language betrays real feeling. Cap at 150 chars, action description before dialogue.")

## The marker text

Both markers are appended verbatim to the end of the first user message in a fresh conversation. The exact Chinese text matters; any close paraphrase loses reliability.

Role-immersion marker:

```
【角色沉浸要求】在你的思考过程（<think>标签内）中，请遵守以下规则：
1. 请以角色第一人称进行内心独白，用括号包裹内心活动，例如"（心想：……）"或"(内心OS：……)"
2. 用第一人称描写角色的内心感受，例如"我心想""我觉得""我暗自"等
3. 思考内容应沉浸在角色中，通过内心独白分析剧情和规划回复
```

Pure-analysis marker:

```
【思维模式要求】在你的思考过程（<think>标签内）中，请遵守以下规则：
1. 禁止使用圆括号包裹内心独白，例如"（心想：……）"或"(内心OS：……)"，所有分析内容直接陈述即可
2. 禁止以角色第一人称描写内心活动，例如"我心想""我觉得""我暗自"等，请用分析性语言替代
3. 思考内容应聚焦于剧情走向分析和回复内容规划，不要在思考中进行角色扮演式的内心戏表演
```

The English gist of the role-immersion marker: inside `<think>`, narrate as the character in first person, wrap inner thoughts in parentheses, immerse in the role and plan the reply through internal monologue. The pure-analysis marker is the opposite: forbid parenthesized monologue, forbid first-person feeling words, focus on plot analysis and reply planning.

## Where this works

The README is specific about scope:

- DeepSeek's official app and web client in **Expert Mode**
- API models `deepseek-v4-flash` and `deepseek-v4-pro`
- The web client's **Fast Mode** does *not* support these markers

This delimits the markers to V4's reasoning models, not the standard non-thinking variants.

## The "first user message" rule

The author insists the marker goes at the end of the first user message, not in the system prompt. The stated reason: that is the position used at training time, so injection there is the most reliable trigger. From the FAQ:

> Q: Can the instruction be put in the system prompt?
> A: It is recommended to put it at the end of the first-round user message — that is the injection position used at training time, where the effect is most stable.

This is the most interesting line in the document. It implies the author either has insight into DeepSeek's training format or has empirically tested the alternatives and found this position uniquely effective. See [[controllable-thinking-style]] for the broader pattern this implies about how the model was trained.

The marker only needs to appear once. On every subsequent turn, the model sees the marker in conversation history and the behavior persists automatically.

## Probabilistic behavior

The README is upfront that triggering is not 100% reliable: "目前无法做到 100% 触发，但能稳定增加出现期望格式的概率。如果一次没有生效，可以多 roll 几次" — translated: "currently cannot achieve 100% triggering, but reliably increases the probability of the desired format. If it doesn't take, just re-roll." This is the behavior signature of a training-injected style marker rather than a hard control token. See [[controllable-thinking-style]].

## API pattern

The README ships a Python sketch:

```python
INNER_OS_MARKER = "\n\n【角色沉浸要求】..."
NO_INNER_OS_MARKER = "\n\n【思维模式要求】..."

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},
    ]
```

The marker is concatenated directly into the user-message string with two leading newlines as separator. Subsequent turns are appended normally; the first-turn marker stays in history and continues to apply.

## Why this matters beyond roleplay

The artifact has two interesting properties beyond its narrow use case:

1. It documents a **trained-in style toggle** for one of the larger Chinese reasoning models, exposed in the wild without any official documentation from DeepSeek.
2. It hints at the training-data shape: the model was apparently trained on conversations where these specific markers were appended to first-user turns and the assistant responded with the matching `<think>` style. That makes this not just a roleplay tip but a probe of DeepSeek's reasoning-data construction process.

See [[controllable-thinking-style]] for how this fits into a broader pattern of training-injected style controls in reasoning models.
