arXiv:2601.02896cs.LG2026-01被引 5

用梯度上升自动发现可解释的提示,精准控制大模型行为

Bridging Mechanistic Interpretability and Prompt Engineering with Gradient Ascent for Interpretable Persona Control

  • 通过梯度上升优化随机提示,使其对齐特定人格方向
  • 在三类人格上实现显著改进,如奉承行为降低至49.90%(原79.24%)
  • 方法可解释且适用于Llama、Qwen、Gemma等主流模型

控制大型语言模型中涌现的行为人格(如阿谀奉承、幻觉、短视奖励)对AI安全至关重要,但始终面临挑战。现有方案存在两难:手工提示工程直观但不可扩展且不精确,而自动优化方法虽有效却为“黑箱”,缺乏与模型内部机制的可解释关联。本文提出新框架,将梯度上升适配于大模型,实现目标提示的定向发现。具体提出RESGA和SAEGA两种方法,均通过优化随机初始化提示,使其更好地对齐已识别的人格方向。引入流畅性梯度上升以控制发现提示的流畅性。在Llama 3.1、Qwen 2.5和Gemma 3上验证其有效性,成功引导三种人格:阿谀奉承、幻觉、短视奖励。关键是在阿谀奉承任务中,自动发现提示使表现从79.24%降至49.90%,显著提升。通过基于机制可解释特征的提示发现,本方法为可控且可解释的行为调控提供了新范式。代码已开源:https://github.com/HarshSaini10/RESGA_SAEGA。

原文摘要 · Abstract (English)

Controlling emergent behavioral personas (e.g., sycophancy, hallucination) in Large Language Models (LLMs) is critical for AI safety, yet remains a persistent challenge. Existing solutions face a dilemma: manual prompt engineering is intuitive but unscalable and imprecise, while automatic optimization methods are effective but operate as "black boxes" with no interpretable connection to model internals. We propose a novel framework that adapts gradient ascent to LLMs, enabling targeted prompt discovery. In specific, we propose two methods, RESGA and SAEGA, that both optimize randomly initialized prompts to achieve better aligned representation with an identified persona direction. We introduce fluent gradient ascent to control the fluency of discovered persona steering prompts. We demonstrate RESGA and SAEGA's effectiveness across Llama 3.1, Qwen 2.5, and Gemma 3 for steering three different personas, sycophancy, hallucination, and myopic reward. Crucially, on sycophancy, our automatically discovered prompts achieve significant improvement (49.90% compared with 79.24%). By grounding prompt discovery in mechanistically meaningful features, our method offers a new paradigm for controllable and interpretable behavior modification. We release our scripts for RESGA and SAEGA in this github repo: https://github.com/HarshSaini10/RESGA_SAEGA.

提示工程可解释性人格控制梯度上升

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。