通过可解释的角色扮演引导提升 LLM 推理能力
Improving LLM Reasoning through Interpretable Role-Playing Steering
AI总结:
提出 SRPS 框架,通过稀疏自编码器识别角色扮演相关内部特征并构建可控引导向量,从而在多种模型和推理基准上稳定提升 LLM 推理表现并增强可解释性。
摘要:
角色扮演已成为增强大型语言模型(LLM)推理能力的一种有效技术。然而,现有方法主要依赖提示工程,这往往缺乏稳定性和可解释性。本文提出 Sparse Autoencoder Role-Playing Steering(SRPS),这是一个新颖框架,用于识别并操纵与角色扮演行为相关的模型内部特征。我们的方法从角色扮演提示中提取潜在表示,基于激活模式选择最相关的特征,并构建一个引导向量,该向量能够以可控强度注入模型的残差流。该方法实现了对角色特定行为的细粒度控制,并为角色信息如何影响模型内部激活提供了洞见。在多种推理基准和模型规模上的大量实验表明,性能获得了持续提升。值得注意的是,在零样本思维链(CoT)设置下,Llama3.1-8B 在 CSQA 上的准确率从 31.86% 提升至 39.80%,而 Gemma2-9B 在 SVAMP 上的准确率从 37.50% 提升至 45.10%。这些结果凸显了 SRPS 增强 LLM 推理能力的潜力,并且与传统的基于提示的角色扮演相比,它提供了更好的可解释性和稳定性。
英文摘要:
Role-playing has emerged as an effective technique for enhancing the reasoning capabilities of large language models (LLMs). However, existing methods primarily rely on prompt engineering, which often lacks stability and interpretability. In this paper, we introduce Sparse Autoencoder Role-Playing Steering (SRPS), a novel framework that identifies and manipulates internal model features associated with role-playing behavior. Our approach extracts latent representations from role-play prompts, selects the most relevant features based on activation patterns, and constructs a steering vector that can be injected into the model's residual stream with controllable intensity. Our method enables fine-grained control over role-specific behavior and offers insights into how role information influences internal model activations. Extensive experiments across various reasoning benchmarks and model sizes demonstrate consistent performance gains. Notably, in the zero-shot chain-of-thought (CoT) setting, the accuracy of Llama3.1-8B on CSQA improves from 31.86% to 39.80%, while Gemma2-9B on SVAMP increases from 37.50% to 45.10%. These results highlight the potential of SRPS to enhance reasoning ability in LLMs, providing better interpretability and stability compared to traditional prompt-based role-playing.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。