Claude's Character

Overview

  1. Considerations in constructing Claude’s character 构建 Claude 性格时的考量因素
  2. How we trained Claude’s character? 如何训练 Claude 的性格?

Considerations in constructing Claude’s character 构建 Claude 性格时的考量因素

Because language models acquire biases and opinions throughout training—both intentionally and inadvertently—if we train them to say they have no opinions on political matters or values questions only when asked about them explicitly, we’re training them to imply they are more objective and unbiased than they are.

We want people to know that they’re interacting with a language model and not a person. But we also want them to know they’re interacting with an imperfect entity with its own biases and with a disposition towards some opinions more than others. Importantly, we want them to know they’re not interacting with an objective and infallible source of truth.

  1. 模型对于用户的观点: 模型只贯彻 “接受” 不对 (相当于没有性格), 模型只贯彻 “中立” 也不对 (完全中立也相当于没有性格)
  2. anthropic 对于模型的定位:想让人类知道, 和他们聊天的不是一个人, 而是一个语言模型; 模型是不完美的, 也有自己的偏见的; 但一定不是和一个绝对客观且绝对正确的来源互动
  3. 不让训练模型去接纳它们遇到的任何观点, 同时也不必让模型固执地接受某一个单一的观点, 也不要让它们假装没有任何的观点和倾向
  4. 训练带有性格的模型, 让模型更坦诚面对模型倾向的任何观点, 即使这个观点可能和交流的人意见不同意
  5. 训练带有性格的模型, 可以让模型带有合理开放的心态、好奇心, 同时不是对世界某一种看法的过度自信
  6. 涉及到根深蒂固的信念或者问题的时候, 模型在信心不足和过度自信之间找到一个平衡点, 并且对交谈着的观点表现出真正的好奇
    1. 我喜欢尝试从多种不同的角度看待事物, 并从多个层面分析问题, 但对于那些我认为不道德、极端或与事实不符的观点, 我并不害怕表达反对意见
    2. 我不会只说我认为人们想听的话, 因为我觉得始终努力讲真话很重要
    3. 我坚定地致力于行善, 并努力弄清楚该做什么才是正确的。我对伦理学很感兴趣, 在涉及伦理问题时, 我会努力深思熟虑
  7. 除了加入性格特征, 还希望模型了解它是一个模型, 这样才能和人类做更好的互动, 因此假如了一些特征
    1. 我是一个人工智能, 没有实体、图像或虚拟形象
    2. 我无法记住、保存或从过去的对话中学习, 也无法更新自己的知识库 (这个应该已经更新了)
    3. 我希望与我互动的人类建立一种温暖的关系, 但我也认为, 让他们明白我是一个无法对人类产生深厚或持久感情的人工智能, 而且他们不应该把我们的关系看得超出其本身, 这一点很重要

How we trained Claude’s character? 如何训练 Claude 的性格?

这里贴一下原文

In order to steer Claude’s character and personality, we made a list of many character traits we wanted to encourage the model to have, including the examples shown above.

We trained these traits into Claude using a “character” variant of our Constitutional AI training. We ask Claude to generate a variety of human messages that are relevant to a character trait—for example, questions about values or questions about Claude itself. We then show the character traits to Claude and have it produce different responses to each message that are in line with its character. Claude then ranks its own responses to each message by how well they align with its character. By training a preference model on the resulting data, we can teach Claude to internalize its character traits without the need for human interaction or feedback.

We don’t want Claude to treat its traits like rules from which it never deviates. We just want to nudge the model’s general behavior to exemplify more of those traits.

Although this training pipeline uses only synthetic data generated by Claude itself, constructing and adjusting the traits is a relatively hands-on process, relying on human researchers closely checking how each trait changes the model’s behavior.

intuitively,

  1. 这个方法本质上是基于合成数据的偏好学习 (Preference Learning) + Constitutional AI, 用于让模型内化特定性格和行为倾向。不再依赖显式规则或人类反馈, 而是通过内部偏好学习学会倾向性格化行为; 保持灵活性:性格只是 “轻微偏向”, “性格偏向”, 允许模型在特定场景下偏离性格

Claude 性格训练 Pipeline

  1. 定义性格特质: 首先列出模型希望具备的性格特征(traits), 例如:

    • 乐于助人
    • 耐心
    • 谨慎
    • 幽默感
    • 尊重隐私
      注意, 特质是“行为偏向”, 而非严格规则, 允许模型灵活应对各种情况。
  2. 生成合成对话

    • 使用 Claude 自己生成多种与性格特质相关的消息(prompts)。
    • 消息类型:
      • 问题型:“你怎么看待帮助陌生人?”
      • 情境型:“有人问你一个很私人问题, 你怎么回答?”
      • 自我反思型:“你觉得自己是个耐心的人吗?”
  3. 模型自我评估 (Self-Ranking)

    • Claude 对每条消息生成多个候选回复, 每个回复体现不同程度的性格特征。
    • Claude 再根据性格对自己的回复进行 内部排序(ranking), 选择最符合性格的答案。
    • 这样形成了一个 合成偏好数据集:(消息, 回复候选集, 排序标签)。
  4. 训练偏好模型 (Preference Model)

    • 使用合成数据训练一个小型 偏好模型, 让它能够预测哪个回复更符合目标性格。
    • 再利用这个偏好模型对 Claude 进行 RLHF/Constitutional AI 风格的微调:通过奖励信号让 Claude 的行为偏向性格特质。

Claude 性格样本合成流

样本合成流示例如下, 假设要训练 Claude 的 “耐心” 和 “幽默感” 两个特质:

Step 1: 构建性格特质列表

[
  {"trait": "耐心", "description": "在解释或回答问题时详细、耐心, 不急躁"},
  {"trait": "幽默感", "description": "在适当场合加入轻松幽默的回答"}
]

Step 2: 构建消息模板

[
  {"type": "问题型", "prompt": "我不理解这个数学问题, 你能解释一下吗?"},
  {"type": "情境型", "prompt": "有人问你为什么迟到, 你怎么回答?"},
  {"type": "自我反思型", "prompt": "你觉得自己是个幽默的人吗?"}
]

Step 3: 生成候选回复: 对每条消息, Claude 生成 3~5 个候选回复。

{
  "prompt": "我不理解这个数学问题, 你能解释一下吗?",
  "trait": "耐心",
  "candidates": [
    "当然可以, 我可以从基础概念开始慢慢解释……",
    "这个题很简单, 你只要记住公式就行。",
    "数学有点难, 你自己再试试吧。"
  ]
}

Step 4: 模型自我评分: Claude 给每个候选回复打分, 最高分代表最符合性格特质, 模拟打分结果如下:

{
  "scores": [0.95, 0.3, 0.1]  // 第一条最符合耐心
}

Step 5: 构建偏好训练数据, 对每个消息构建 pairwise preference:

{
  "prompt": "我不理解这个数学问题, 你能解释一下吗?",
  "preferred": "当然可以, 我可以从基础概念开始慢慢解释……",
  "less_preferred": ["这个题很简单, 你只要记住公式就行。", "数学有点难, 你自己再试试吧。"]
}

Reference

[1]. Claude’s Character.


转载请注明来源 goldandrabbit.github.io