ADAPT: Hybrid Prompt Optimization for LLM Feature Visualization
Organizations: Instituto Superior T´ecnico · INESC-ID
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.
Figures & tables
| GCG | BEAST | EPO | ADAPT | |
|---|---|---|---|---|
| GCG | – | 56.4% | 63.2% | 29.6% |
| BEAST | 43.6% | – | 50.2% | 12.8% |
| EPO | 36.8% | 49.8% | – | 21.4% |
| ADAPT | 70.4% | 84.0% | 78.6% | – |
| Latent A | Latent B | Optimized Prompt |
|---|---|---|
| 823 (MCU) | 2738 (bit) | nearby Avenger/avenulla Rd Avengers is bits |
| 1264 (syn) | 154 (magnets) | ul magnetism currently ( determinediuminium, syn |
| 823 (MCU) | 154 (magnets) | times aanki Stark magnet first unveiled as the |
Appendix figures & tables2 assets
Supplementary material from the paper’s appendix.
Appendix
| Parameter | GCG | BEAST | EPO | ADAPT |
|---|---|---|---|---|
| General | ||||
| Iterations | 50 | 10 | 50 | 25 |
| Prompt length | 10 | 10 | 8–15 | 10 |
| Parallel prompts | 6 | – | 6 | 10 |
| Candidate Generation | ||||
| Candidates/iter | 32 | – | 32 | 32 |
LLM Interpretability
Large language model (LLM) interpretability studies how internal representations and computations produce outputs, and how they can be explained or controlled.
See all 758 papers