Artificial intelligence-based language generators are now a part of most people's lives. However, by default, they tend to generate "average" language without reflecting the ways in which people differ. Here, we propose a lightweight modification to the standard language model transformer architecture - "PsychAdapter" - that uses empirically derived trait-language patterns to generate natural language for specified personality, demographic, and mental health characteristics (with or without prompting). We applied PsychAdapters to modify OpenAI's GPT-2, Google's Gemma, and Meta's Llama 3 and found generated text to reflect the desired traits. For example, expert raters evaluated PsychAdapter's generated text output and found it matched intended trait levels with 87.3% average accuracy for Big Five personalities, and 96.7% for depression and life satisfaction. PsychAdapter is a novel method to introduce psychological behavior patterns into language models at the foundation level, independent of prompting, by influencing every transformer layer. This approach can create chatbots with specific personality profiles, clinical training tools that mirror language associated with psychological conditionals, and machine translations that match an authors reading or education level without taking up LLM context windows. PsychAdapter also allows for the exploration psychological constructs through natural language expression, extending the natural language processing toolkit to study human psychology.
翻译:基于人工智能的语言生成器已成为大多数人生活中的一部分。然而,默认情况下,它们倾向于生成“平均化”的语言,未能反映人与人之间的差异。本文提出一种对标准语言模型Transformer架构的轻量化修改方案——“PsychAdapter”——该方案利用经验推导的特质-语言模式,为指定的人格、人口统计学及心理健康特征生成自然语言(无论是否使用提示)。我们将PsychAdapter应用于修改OpenAI的GPT-2、Google的Gemma和Meta的Llama 3,发现生成文本能有效反映目标特质。例如,专家评估者对PsychAdapter生成的文本输出进行评定,发现其与目标特质水平的匹配度在大五人格维度达到平均87.3%的准确率,在抑郁与生活满意度维度达到96.7%。PsychAdapter是一种在基础层面将心理行为模式引入语言模型的新方法,它通过影响每个Transformer层来实现,独立于提示工程。该方法可用于创建具有特定人格特征的聊天机器人、模拟心理状态相关语言的临床训练工具,以及匹配作者阅读或教育水平的机器翻译(无需占用LLM的上下文窗口)。PsychAdapter还能通过自然语言表达探索心理构念,从而扩展自然语言处理工具在研究人类心理学中的应用。