Skip to main content
QUICK REVIEW

[论文解读] ChatHaruhi: Reviving Anime Character in Reality via Large Language Model

Cheng Li, Ziang Leng|arXiv (Cornell University)|Aug 18, 2023
Topic ModelingComputer Science被引用 11
一句话总结

本文介绍 ChatHaruhi,这是一个使用记忆增强提示和角色对话语料库来使 LLMs 能够角色扮演特定角色的系统,并发布一个用于 32 个角色的 54K 对话数据集。

ABSTRACT

Role-playing chatbots built on large language models have drawn interest, but better techniques are needed to enable mimicking specific fictional characters. We propose an algorithm that controls language models via an improved prompt and memories of the character extracted from scripts. We construct ChatHaruhi, a dataset covering 32 Chinese / English TV / anime characters with over 54k simulated dialogues. Both automatic and human evaluations show our approach improves role-playing ability over baselines. Code and data are available at https://github.com/LC1332/Chat-Haruhi-Suzumiya .

研究动机与目标

  • 通过解决记忆、连贯性和幻觉问题来提升对虚构角色的更好角色扮演,针对 LLMs。
  • 提出一种利用系统提示、角色记忆和对话记忆来引导角色内在回答的算法。
  • 构建一个覆盖 32 个角色的数据集(ChatHaruhi-54K),用于训练和评估基于人设的聊天机器人。
  • 使大型模型(ChatGPT/Claude)和较小模型(7B)能够通过微调和数据生成来执行角色内对话。

提出的方法

  • 定义一个三组件的角色表示:知识/背景、个性和语言习惯。
  • 将剧本中的原始对话提取并存储到每个角色的记忆库 D 中。
  • 使用句子嵌入在记忆库 U 中进行检索,以获取给定用户查询 q 的最相关对话记忆。
  • 使用强调 cosplay、复用原句和角色特定语言的系统提示 sR 来引导输出。
  • 维持对话历史 H,限制在大约 1200 个标记,以确保连贯的回答。
  • 通过 Alpaca 风格提示自动生成额外的角色内对话以产生 D,并为微调扩充数据(导致 ChatHaruhi-54K)。
Figure 1: Our algorithm is role-playing Haruhi Suzumiya. Note that the user’s questions are related but not identical to the original plot, while Chat Haruhi Suzumiya’s answers can largely quote the original plot.
Figure 1: Our algorithm is role-playing Haruhi Suzumiya. Note that the user’s questions are related but not identical to the original plot, while Chat Haruhi Suzumiya’s answers can largely quote the original plot.

实验结果

研究问题

  • RQ1基于记忆增强的提示系统是否能显著提升 LLM 对特定角色的角色扮演能力,相较于基线提示?
  • RQ2将原始剧本文本记忆与生成的对话相结合,是否在跨语言的角色呈现中更为真实和一致?
  • RQ3记忆检索和提示设计对与角色设定和语言风格的一致性有多大影响?
  • RQ4在 ChatHaruhi-54K 数据上微调的本地 7B 模型是否能以与更大模型相当的方式再现角色内行为?

主要发现

  • 在相同基线模型下,ChatHaruhi 流水线在角色内对齐和响应质量方面优于基线。
  • 作者使用 22,752 条原始对话和 31,974 条模拟对话组装了 ChatHaruhi-54K,总计 54,726 条,对应 32 个角色。
  • 评估包括自动相似度衡量以及计划中的人工对齐/质量评估。
  • 在 ChatHaruhi 数据上微调 7B 模型时,他们获得了在 22,752 与 54K 数据上训练的模型(A/B),并给出评估。
  • 该系统支持使用 ChatGPT/Claude 或本地微调的 7B,实现灵活部署。
Figure 2: The statistics of the ChatHaruhi-54K dataset, showing 32 characters and 54,726 dialogues. The opaque bars indicate the original script data, while the translucent bars present simulated dialogues generated by models like Alpaca.
Figure 2: The statistics of the ChatHaruhi-54K dataset, showing 32 characters and 54,726 dialogues. The opaque bars indicate the original script data, while the translucent bars present simulated dialogues generated by models like Alpaca.

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。