发现大模型中层和上层编码人格特征,可精准修改其回应风格。
Probing then Editing Response Personality of Large Language Models
- 通过分层探测分析模型内部人格编码位置。
- 在提示明确指定人格时仍能成功改变输出风格。
- 方法低开销、不显著影响模型通用能力,适合实用改造。
大语言模型虽能生成具有一致人格特征的回应,但其内部如何编码人格仍不清楚。本文提出分层探测框架,系统研究11个开源模型在PersonalityEdit基准上的表现,发现人格模拟主要集中在中上层,指令微调模型表现更清晰。通过解析探测超平面作为各人格类别的分界边界,我们提出分层扰动方法,在推理阶段编辑模型人格表达。结果表明,即使提示中明确指定人格,该方法仍能有效改变输出风格。不同人格间转换难度差异显著,与探测中的表征距离一致。综合MMLU评估与延迟分析显示,该方法仅造成极小性能下降,训练成本低,推理延迟可接受。代码已开源。
原文摘要 · Abstract (English)
Large Language Models (LLMs) have demonstrated promising capabilities to generate responses that simulate consistent personality traits. Despite the major attempts to analyze personality expression through output-based evaluations, little is known about how such traits are internally encoded within LLM parameters. In this paper, we introduce a layer-wise probing framework to systematically investigate the layer-wise capability of LLMs in simulating personality for responding. We conduct probing experiments on 11 open-source LLMs over the PersonalityEdit benchmark and find that LLMs predominantly simulate personality for responding in their middle and upper layers, with instruction-tuned models demonstrating a slightly clearer separation of personality traits. Furthermore, by interpreting the trained probing hyperplane as a layer-wise boundary for each personality category, we propose a layer-wise perturbation method to edit the personality expressed by LLMs during inference. Our results show that even when the prompt explicitly specifies a particular personality, our method can still successfully alter the response personality of LLMs. Interestingly, the difficulty of converting between certain personality traits varies substantially, which aligns with the representational distances in our probing experiments. Finally, we conduct a comprehensive MMLU benchmark evaluation and time overhead analysis, demonstrating that our proposed personality editing method incurs only minimal degradation in general capabilities while maintaining low training costs and acceptable inference latency. Our code is publicly available at https://github.com/universe-sky/probing-then-editing-personality.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。