Table of Contents
Fetching ...

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

Harshvardhan Saini, Yiming Tang, Dianbo Liu

TL;DR

This work addresses the challenge of constraining emergent personas in large language models by connecting mechanistic interpretability with prompt engineering. It introduces RESGA and SAEGA, two gradient-ascent–based frameworks that automatically discover natural-language prompts aligned with mechanistically defined persona directions, using dense residual representations or sparse autoencoder latents. Through fluent gradient ascent and evolutionary prompt optimization, the method balances steering strength with fluency and demonstrates robust persona control across three models and three behavioral prompts, notably neutralizing sycophancy and improving reliability on hallucination and short-term reward tasks. The results reveal that grounding prompt discovery in interpretable features yields precise, on-manifold control and offers a practical pathway for interpretable and scalable behavior modification in LLMs.

Abstract

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.

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

TL;DR

This work addresses the challenge of constraining emergent personas in large language models by connecting mechanistic interpretability with prompt engineering. It introduces RESGA and SAEGA, two gradient-ascent–based frameworks that automatically discover natural-language prompts aligned with mechanistically defined persona directions, using dense residual representations or sparse autoencoder latents. Through fluent gradient ascent and evolutionary prompt optimization, the method balances steering strength with fluency and demonstrates robust persona control across three models and three behavioral prompts, notably neutralizing sycophancy and improving reliability on hallucination and short-term reward tasks. The results reveal that grounding prompt discovery in interpretable features yields precise, on-manifold control and offers a practical pathway for interpretable and scalable behavior modification in LLMs.

Abstract

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.
Paper Structure (20 sections, 4 equations, 6 figures, 2 tables, 1 algorithm)

This paper contains 20 sections, 4 equations, 6 figures, 2 tables, 1 algorithm.

Figures (6)

  • Figure 1: Comparison of Persona Steering Approaches.Left: Traditional prompt-based steering requires manual prompt engineering by human experts. Center: Vector-based steering directly manipulates model activations by adding persona steering vectors $\mathbf{v}$ to internal representations $e(\mathbf{t})$, but lacks natural language interpretability. Right: Our proposed methods, RESGA and SAEGA, automatically discovers interpretable natural language prompts via EPO that activate identified persona steering vectors, bridging mechanistic interpretability with prompt engineering.
  • Figure 2: RESGA & SAEGA Framework Overview. Our framework discovers persona-steering prompts in two stages: (1) Persona steering vector construction via either dense representations (RESGA) or sparse SAE latents (SAEGA), and (2) Fluent gradient ascent optimization with objective $L_\lambda(\mathbf{t}) = f(\mathbf{t}) + H(\mathbf{t})$ that transforms random token sequences into readable prompts that steer the model in specific directions for interpretable persona control.
  • Figure 3: Distribution of projections onto the sycophancy axis. Dense steering and RESGA shift the mean but retain variance. SAEGA collapses variance around neutrality (0.0), indicating precise control.
  • Figure 4: Sparsity preservation ($L_0$ norm). Dense steering forces an unnatural explosion in active features. SAEGA preserves sparsity close to the baseline model.
  • Figure 5: Impact on SAE features correlated with sycophancy. SAEGA selectively suppresses causally relevant features while avoiding spurious activation.
  • ...and 1 more figures