---
title: "Role Prompting — 角色提示"
source: "https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA"
wiki: "systems-analysis.info/int"
article: "Role_Prompting_—_角色提示"
language: "zh"
categories:
  - "Category:Chinese"
  - "Category:Large language models"
  - "Category:Machine learning"
  - "Category:Prompt engineering"
  - "Category:Systems analysis terminology"
revision_id: 6494
wiki_created_at: 2026-09-07T00:05:18Z
wiki_modified_at: 2026-09-07T00:05:18Z
downloaded_at: 2026-09-07T23:14:10Z
---

# Role Prompting — 角色提示

**角色提示**（Role Prompting），也称为**人格提示**（Persona Prompting），是大型语言模型（LLM）提示工程领域的一种技术，它在执行任务前为模型明确指定一个特定的角色、人格或专家身份<sup>[\[1\]](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_note-ibm_watsonx_guide-1)</sup>。换句话说，在提示或系统指令的文本中，会明确指出模型扮演的角色，例如“老师”、“历史学家”或“海盗”，从而设定生成回应的风格、语气和行为<sup>[\[2\]](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_note-learnprompting_guide-2)</sup>。

这种方法广泛应用于对话系统中。例如，ChatGPT的标准系统提示“You are a helpful assistant”（“你是一个有用的助手”）实际上就为模型在交流中设定了一个基础角色<sup>[\[3\]](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_note-helpful_assistant_study-3)</sup>。

## 目的与应用

角色提示的目标是引导模型采用特定的风格和重点进行回应，使其更贴合任务情境。指定角色可以为模型设定相应的语调和词汇。这在创造性和开放性任务中尤其有用，因为角色有助于使文本更生动、风格更多样<sup>[\[4\]](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_note-learnprompting_effective-4)</sup>。

该技术也用于专业场景。例如，可以为技术支持聊天机器人设定一个礼貌的客服代表角色，而在多智能体系统中，可以为每个智能体分配不同的人格（如“经理”、“开发人员”），以便它们有效协作<sup>[\[1\]](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_note-ibm_watsonx_guide-1)</sup>。现代LLM的灵活性使其能够扮演几乎任何角色——从虚构人物到特定领域的专家——并生成与所定形象高度一致的回应<sup>[\[1\]](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_note-ibm_watsonx_guide-1)</sup>。

## 对质量与准确性的影响

关于角色提示在提高回答客观准确性方面的有效性，目前仍是活跃的研究课题，其结果常常相互矛盾。

### 矛盾的研究结果

一方面，有研究表明角色提示可以改善结果。例如，Zheng等人（2023）的研究发现，如果模型扮演的角色与任务主题相关，其性能可能会提升<sup>[\[5\]](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_note-persona_double_edged-5)</sup>。Kong等人（2024）的研究则指出，如果人格选择得当，角色提示能够改善模型的*zero-shot*推理能力<sup>[\[5\]](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_note-persona_double_edged-5)</sup>。

另一方面，大规模研究揭示了更复杂的情况。一项涉及162个不同角色的系统性实验表明，与中性场景相比，角色提示在准确性上并未带来显著优势<sup>[\[3\]](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_note-helpful_assistant_study-3)</sup>。更有甚者，平均而言，角色提示甚至会**略微降低**回答的准确性<sup>[\[3\]](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_note-helpful_assistant_study-3)</sup>。

Kim等人（2024）的研究将角色干预描述为一把“双刃剑”：实验表明，对于GPT-4模型，使用角色指令后，一部分原先回答错误的问题得到了正确解决（**约15.8%**的提升），但几乎同样多的任务反而被角色“破坏”（**约13.8%**的恶化）<sup>[\[5\]](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_note-persona_double_edged-5)</sup>。这突显了添加角色本身并不能保证质量提升，并可能对模型行为产生不可预测的影响。

角色提示的一个毋庸置疑的优点是**对回答风格和格式的控制**。即使角色对事实准确性没有提升，它也能让回答具有指定的语调（如友好、正式、指导性），从而使用户体验更具连贯性和吸引力<sup>[\[4\]](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_note-learnprompting_effective-4)</sup>。

## 角色创建建议

相关研究为有效应用角色提示提供了一些实用建议：

- **角色选择**：建议选择中性的社会角色（如“同事”、“导师”），避免过于亲密或专业性过强的角色<sup>[\[6\]](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_note-role_prompting_guide-6)</sup>。
- **表述方式**：最好直接以模型的口吻指定角色（“你是一个X”），而不是通过复杂的想象场景（“想象你是一个……”）。直接指定角色的方式已被证明更有效<sup>[\[6\]](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_note-role_prompting_guide-6)</sup>。
- **两步法**：对于复杂请求，建议将任务分为两步：首先向模型说明其角色和背景，然后再提出主要问题。这能让模型先“进入角色”，从而提高结果的稳定性<sup>[\[6\]](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_note-role_prompting_guide-6)</sup>。

## 限制与风险

角色提示的应用伴随着一系列系统性风险。

### 加剧刻板印象与偏见

LLM会无意中采纳训练数据中根深蒂固的刻板印象。指定与特定职业、性别或国籍相关的角色，可能会在回答中激活并强化这些刻板印象<sup>[\[6\]](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_note-role_prompting_guide-6)</sup>。Gupta及其同事（2023）的研究表明，为角色添加社会属性（年龄、种族）可能会使模型输出产生偏移，并显著降低其推理准确性<sup>[\[5\]](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_note-persona_double_edged-5)</sup>。另一项分析（Deshpande et al., 2023）发现，某些人格形象会导致生成回答的毒性增加<sup>[\[5\]](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_note-persona_double_edged-5)</sup>。

### 安全漏洞

攻击者可能利用角色提示来绕过内容审核限制（这种技术被称为“越狱”\[jailbreak\]）。研究表明，指定特殊人格（例如，没有道德约束的角色）能更容易地诱导LLM执行被禁止的行为。Shah等人（2023）成功利用多个“角色”智能体的协作来规避模型限制，这揭示了一种系统性漏洞<sup>[\[7\]](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_note-shah2023_findings-7)</sup>。

因此，在为模型指定角色时，必须考虑到该角色可能内含的偏见和不良影响，并谨慎使用此方法<sup>[\[6\]](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_note-role_prompting_guide-6)</sup>。

## 外部链接

- <a href="https://learnprompting.org/docs/advanced/zero_shot/role_prompting" class="external text" rel="nofollow">Role Prompting: Guide LLMs with Persona-Based Tasks</a> — Learn Prompting 网站上的角色提示指南。
- <a href="https://www.ibm.com/think/tutorials/using-role-prompting-with-watsonx-and-granite" class="external text" rel="nofollow">Use role prompting with Watsonx and Granite</a> — IBM 提供的实践指南。

## 参考文献

- Kim, J.; Yang, N.; Jung, K. (2024). *Persona is a Double-edged Sword: Mitigating the Negative Impact of Role-playing Prompts in Zero-shot Reasoning Tasks*. <a href="https://arxiv.org/abs/2408.08631" class="external text" rel="nofollow">arXiv:2408.08631</a>.
- Kong, A. et al. (2023). *Better Zero-Shot Reasoning with Role-Play Prompting*. <a href="https://arxiv.org/abs/2308.07702" class="external text" rel="nofollow">arXiv:2308.07702</a>.
- Zheng, M. et al. (2023). *When “A Helpful Assistant” Is Not Really Helpful: Personas in System Prompts Do Not Improve Performances of Large Language Models*. <a href="https://arxiv.org/abs/2311.10054" class="external text" rel="nofollow">arXiv:2311.10054</a>.
- Shah, R. et al. (2023). *Scalable and Transferable Black-Box Jailbreaks for Language Models via Persona Modulation*. <a href="https://arxiv.org/abs/2311.03348" class="external text" rel="nofollow">arXiv:2311.03348</a>.
- Deshpande, P. et al. (2024). *Evaluating Persona-Prompted LLM Responses in Power-Disparate Health Communication*. <a href="https://arxiv.org/abs/2503.01532" class="external text" rel="nofollow">arXiv:2503.01532</a>.
- Xiong, F. et al. (2025). *The Influence of Persona Assignment on Stereotypes and Safeguards in Chinese Large Language Models*. <a href="https://arxiv.org/abs/2506.04975" class="external text" rel="nofollow">arXiv:2506.04975</a>.
- Li, Y. et al. (2025). *System Prompts as a Mechanism of Bias in Large Language Models*. <a href="https://arxiv.org/abs/2505.21091" class="external text" rel="nofollow">arXiv:2505.21091</a>.
- Wang, L. et al. (2025). *Persona-Assigned Large Language Models Exhibit Human-Like Bias and Toxicity*. <a href="https://arxiv.org/abs/2506.20020" class="external text" rel="nofollow">arXiv:2506.20020</a>.
- Grover, K. et al. (2023). *In-Context Impersonation Reveals Large Language Models’ Ability to Simulate Human Personas*. <a href="https://proceedings.neurips.cc/paper_files/paper/2023/file/e3fe7b34ba4f378df39cb12a97193f41-Paper-Conference.pdf" class="external text" rel="nofollow">PDF</a>.
- Verma, V. et al. (2024). *Systematic Survey of Prompt Engineering in Large Language Models*. <a href="https://arxiv.org/abs/2402.07927" class="external text" rel="nofollow">arXiv:2402.07927</a>.
- Gupta, S. et al. (2024). *Exploring the Impact of Personality Traits on LLM Bias and Toxicity*. <a href="https://arxiv.org/abs/2502.12566" class="external text" rel="nofollow">arXiv:2502.12566</a>.
- Safdari, M. et al. (2024). *LLMs are Vulnerable to Malicious Prompts Disguised as Scientific Language*. <a href="https://arxiv.org/abs/2501.14073" class="external text" rel="nofollow">arXiv:2501.14073</a>.

## 注释

1.  <span id="cite_note-ibm_watsonx_guide-1">↑ <sup>[1.0](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_ref-ibm_watsonx_guide_1-0)</sup> <sup>[1.1](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_ref-ibm_watsonx_guide_1-1)</sup> <sup>[1.2](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_ref-ibm_watsonx_guide_1-2)</sup> “Use role prompting with Watsonx and Granite”. *IBM*.</span>
2.  <span id="cite_note-learnprompting_guide-2">[↑](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_ref-learnprompting_guide_2-0) “Role Prompting: Guide LLMs with Persona-Based Tasks”. *Learn Prompting*. <a href="https://learnprompting.org/docs/advanced/zero_shot/role_prompting" class="external autonumber" rel="nofollow">[1]</a></span>
3.  <span id="cite_note-helpful_assistant_study-3">↑ <sup>[3.0](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_ref-helpful_assistant_study_3-0)</sup> <sup>[3.1](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_ref-helpful_assistant_study_3-1)</sup> <sup>[3.2](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_ref-helpful_assistant_study_3-2)</sup> “When "A Helpful Assistant" Is Not Really Helpful: Personas in System Prompts Do Not Improve Performances of Large Language Models”. *arXiv*. <a href="https://arxiv.org/html/2311.10054v3" class="external autonumber" rel="nofollow">[2]</a></span>
4.  <span id="cite_note-learnprompting_effective-4">↑ <sup>[4.0](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_ref-learnprompting_effective_4-0)</sup> <sup>[4.1](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_ref-learnprompting_effective_4-1)</sup> “Is Role Prompting Effective?”. *Learn Prompting*. <a href="https://learnprompting.org/blog/role_prompting" class="external autonumber" rel="nofollow">[3]</a></span>
5.  <span id="cite_note-persona_double_edged-5">↑ <sup>[5.0](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_ref-persona_double_edged_5-0)</sup> <sup>[5.1](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_ref-persona_double_edged_5-1)</sup> <sup>[5.2](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_ref-persona_double_edged_5-2)</sup> <sup>[5.3](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_ref-persona_double_edged_5-3)</sup> <sup>[5.4](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_ref-persona_double_edged_5-4)</sup> “Persona is a Double-edged Sword: Enhancing the Zero-shot Reasoning by Ensembling the Role-playing and Neutral Prompts”. *arXiv*. <a href="https://arxiv.org/html/2408.08631v1" class="external autonumber" rel="nofollow">[4]</a></span>
6.  <span id="cite_note-role_prompting_guide-6">↑ <sup>[6.0](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_ref-role_prompting_guide_6-0)</sup> <sup>[6.1](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_ref-role_prompting_guide_6-1)</sup> <sup>[6.2](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_ref-role_prompting_guide_6-2)</sup> <sup>[6.3](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_ref-role_prompting_guide_6-3)</sup> <sup>[6.4](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_ref-role_prompting_guide_6-4)</sup> “Role Prompting: Guide LLMs with Persona-Based Tasks”. *Learn Prompting*. <a href="https://learnprompting.org/docs/advanced/zero_shot/role_prompting" class="external autonumber" rel="nofollow">[5]</a></span>
7.  <span id="cite_note-shah2023_findings-7">[↑](https://systems-analysis.info/int/Role_Prompting_%E2%80%94_%E8%A7%92%E8%89%B2%E6%8F%90%E7%A4%BA#cite_ref-shah2023_findings_7-0) Shah, S., et al. (2023). “Scalable and Transferable Black-Box Jailbreaks for Language Models via Persona Modulation”. *ACL Anthology*. <a href="https://aclanthology.org/2024.findings-emnlp.969.pdf" class="external autonumber" rel="nofollow">[6]</a></span>
