TL;DR
How do you figure out what a specific concept direction inside a Large Language Model actually means without scanning massive text corpora? This paper introduces ADAPT, a hybrid prompt optimization algorithm that generates custom text inputs from scratch to make specific internal LLM features light up like a Christmas tree. By solving the tricky local-minima traps of discrete text optimization, ADAPT generates highly interpretable prompts that reveal what LLMs are thinking under the hood.
What Problem Does This Paper Address?
Inside an LLM, concepts are often represented as linear directions in activation space—think of them as "concept wires" or latents (commonly extracted using Sparse Autoencoders, or SAEs). To figure out what a latent does, the standard play is dataset search: run a massive corpus through the model and see which existing sentences make that wire fire the hardest.
Dataset search works, but it is expensive, limited to whatever happens to be in your corpus, and easily fooled by spurious correlations (e.g., if a concept only appears in French in your dataset, does the latent track the concept, or French?).
Computer vision solved this years ago with feature visualization: starting from random noise and using gradients to synthesize a custom image that maximally excites a neuron. Doing this in LLMs, however, is notoriously painful. Text is discrete—you can't nudge a word by 0.001 along a gradient. Existing discrete prompt optimizers borrowed from adversarial "jailbreaking" (like Greedy Coordinate Gradient, or GCG) get easily trapped in terrible local minima or rely on noisy gradient estimates that degrade in deeper layers.
Methods
To navigate the rugged, discrete landscape of text, the authors build ADAPT (Adaptive DynAmic Prompt Tuning). Instead of relying purely on gradients or purely on forward-pass search, ADAPT marries the best of both worlds in three stages:
- Beam-Search Initialization: Starting from random tokens often dooms optimization before it begins. ADAPT starts by running parallel, independent beam searches, sampling likely tokens from the LLM itself (both appending to the end and inserting in the middle) to find strong, diverse starting foothills in prompt space.
- Hybrid Candidate Generation: In the main loop, ADAPT mutates prompts by randomly alternating between two moves: standard GCG-style gradient swaps (using one-hot gradients to guess promising token replacements) and gradient-free logit-swaps (sampling from the model's own predicted token probabilities). Because logit-swaps are computationally cheaper, ADAPT dynamically keeps a larger population of candidates on those steps.
- Diversity-Preserving Selection & Fluency: If you let a population optimize greedily, every prompt quickly collapses into minor variations of the same phrase, making it hard to triangulate what the feature truly represents. ADAPT locks prompts into isolated "groups" based on their starting beam, reserving guaranteed slots for each group's champion alongside free slots for top global performers. It also applies a sigmoid-scheduled fluency penalty (based on cross-entropy) that ramps up late in the run, letting early exploration roam freely before tidying up the text.
Datasets
Because feature visualization generates inputs from scratch, there is no training dataset. Instead, the authors build a rigorous evaluation benchmark using Neuronpedia and the Gemma Scope SAE suite:
- Primary Benchmark: A stratified sample of 486 SAE latents across 6 evenly spaced residual-stream layers (3, 7, 11, 17, 21, and 25) of Gemma 2 2B, balanced across feature properties like activation density and vocabulary diversity.
- Cross-Model Benchmarks: Smaller evaluations on Gemma 3 1B and GPT-2 Small SAEs.
- To score generated prompts fairly across different layers, each prompt's raw activation is benchmarked against the latent's top 15 real-world Maximally Activating Examples (MAEs) retrieved via dataset search.
Key Insights and Ideas
- Discrete gradient estimates are surprisingly noisy: When the authors audited GCG's one-hot gradient rankings, they found that top-ranked tokens barely yielded more frequent improvements than lower-ranked ones—and uniform random sampling uncovered plenty of great token swaps that standard top-$k$ gradient cutoffs completely miss.
- Gradients and beam search fail in opposite places: Gradient-based GCG dominates in early model layers but degrades in deeper layers; gradient-free beam search (BEAST) struggles early on but catches up deep in the network. Combining them gives ADAPT a flat, reliable performance profile across all layers.
- Gibberish can still be interpretable—if activation is high enough: In adversarial jailbreaking, researchers add fluency penalties to bypass perplexity filters. Here, adding a naive fluency penalty to GCG actually hurt activation strength and didn't improve human interpretability ratings! Conversely, even unpenalized "gibberish" prompts became overwhelmingly interpretable to humans once they crossed the threshold of beating the top dataset example (activation ratio $> 1.0$).
Key Results
Evaluated at a matched compute budget (~80 seconds per latent on a single NVIDIA A40 GPU), ADAPT consistently beats GCG, BEAST, and Evolutionary Prompt Optimization (EPO):
- Higher Activations: On Gemma 2 2B, ADAPT outperforms GCG on 70.4% of latents ($p < 10^{-28}$), BEAST on 84.0%, and EPO on 78.6%. Its mean activation ratio reaches 1.199—meaning on average, ADAPT synthesizes prompts that fire ~20% harder than the single best example found in the reference dataset.
- Generalization: With zero hyperparameter tuning, ADAPT beats GCG on 81.2% of latents in Gemma 3 1B, and ties GCG while beating BEAST and EPO on the shallower GPT-2 Small.
- Human Interpretability: In a blind evaluation across 60 latents by three human raters, ADAPT achieved a mean interpretability score of 4.44 / 5, significantly outperforming both standard GCG (3.86) and fluency-penalized GCG (3.78).
- Diversity Pays Off: Ablating diversity groups nudged raw activation up slightly ($+0.03$ to $+0.04$), but more than halved prompt diversity (pairwise Jaccard distance plunged from 0.80 to 0.34).
Limitations and Future Work
The authors note that their primary evaluation focuses on residual-stream SAE latents in Gemma 2 2B (with smaller runs on GPT-2 Small and Gemma 3 1B), and they deliberately avoided hyperparameter sweeps due to compute constraints. Because dataset search is already pretty good at handling bulk SAE dictionaries, the most exciting frontier for ADAPT lies where dataset search becomes computationally impossible: visualizing complex multi-component model circuits, steering vectors, and integrating synthesized prompts into automated interpretability pipelines.
Summary updated