Table of Contents
Fetching ...

ADAPT: Hybrid Prompt Optimization for LLM Feature Visualization

João N. Cardoso, Arlindo L. Oliveira, Bruno Martins

TL;DR

This work introduces ADAPT, a hybrid method combining beam search initialization with adaptive gradient-guided mutation, designed around these failure modes, and establishes that feature visualization for LLMs is tractable, but requires design assumptions tailored to the domain.

Abstract

Understanding what features are encoded by learned directions in LLM activation space requires identifying inputs that strongly activate them. 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, a hybrid method combining beam search initialization with adaptive gradient-guided mutation, designed around these failure modes. We evaluate on Sparse Autoencoder latents from Gemma 2 2B, proposing metrics grounded in dataset activation statistics to enable rigorous comparison, and show that ADAPT consistently outperforms prior methods across layers and latent types. Our results establish that feature visualization for LLMs is tractable, but requires design assumptions tailored to the domain.

ADAPT: Hybrid Prompt Optimization for LLM Feature Visualization

TL;DR

This work introduces ADAPT, a hybrid method combining beam search initialization with adaptive gradient-guided mutation, designed around these failure modes, and establishes that feature visualization for LLMs is tractable, but requires design assumptions tailored to the domain.

Abstract

Understanding what features are encoded by learned directions in LLM activation space requires identifying inputs that strongly activate them. 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, a hybrid method combining beam search initialization with adaptive gradient-guided mutation, designed around these failure modes. We evaluate on Sparse Autoencoder latents from Gemma 2 2B, proposing metrics grounded in dataset activation statistics to enable rigorous comparison, and show that ADAPT consistently outperforms prior methods across layers and latent types. Our results establish that feature visualization for LLMs is tractable, but requires design assumptions tailored to the domain.
Paper Structure (32 sections, 10 equations, 16 figures, 3 tables, 1 algorithm)

This paper contains 32 sections, 10 equations, 16 figures, 3 tables, 1 algorithm.

Figures (16)

  • Figure 1: Diagram for ADAPT.
  • Figure 2: Distribution of top dataset activations for latents 0–49 (by Neuronpedia index) across all layers of Gemma 2 2B.
  • Figure 3: Mean activation ratio (the optimized prompt's activation divided by the maximally activating dataset example) per layer, for all 4 methods under study.
  • Figure 4: Comparative ranking matrices for GCG-ADAPT and GCG-BEAST comparisons.
  • Figure 5: Quadrant success per layer for GCG-BEAST and GCG-ADAPT comparisons.
  • ...and 11 more figures