ADAPT: Hybrid Prompt Optimization for LLM Feature Visualization
Abstract
Understanding what features are encoded by learned directions in LLM activation space requires identifying inputs that strongly activate particular directions. Feature visualization, which optimizes inputs to maximally activate a target direction, offers an alternative to costly dataset search approaches, but remains underexplored for LLMs due to the discrete nature of text. Furthermore, existing prompt optimization techniques are poorly suited to this domain, which is highly prone to local minima. To overcome these limitations, we introduce ADAPT as a hybrid method combining beam search initialization with adaptive gradient-guided mutation, designed to address the local minima and unreliable gradient estimates that limit existing methods. We evaluate on sparse autoencoder latents from Gemma 2 2B, proposing metrics grounded in dataset activation statistics to enable rigorous comparison. Experimental results show that ADAPT consistently outperforms prior methods across layers and latent types. ADAPT also produces significantly more interpretable prompts in human evaluation. Our results establish that feature visualization for LLMs is tractable, but requires design assumptions tailored to the domain.