ADAPT: Hybrid Prompt Optimization for LLM Feature Visualization
This paper introduces ADAPT, a hybrid prompt optimization method combining beam search initialization with adaptive gradient-guided mutation to effectively visualize features encoded in LLM activation spaces, demonstrating superior performance over existing techniques on Gemma 2 2B Sparse Autoencoder latents.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you have a giant, super-smart library (the AI model) where every book represents a different idea, feeling, or fact. Inside this library, there are millions of tiny, invisible "switches" (called latents) that light up when the AI reads something specific.
The goal of this paper is to figure out exactly what makes each switch light up. Do they light up when they see the word "apple"? When they see a sad story? When they see a math equation?
The Problem: Finding the Right Key
Traditionally, researchers tried to find these switches by reading millions of books from a standard library (a dataset) and seeing which ones made the switches glow. But this is slow, expensive, and sometimes the library just doesn't have the right book to trigger a specific, weird switch.
Another method was to try to "write" a custom sentence from scratch that would force the switch to glow as brightly as possible. This is called Feature Visualization. However, because computers speak in discrete words (tokens) rather than smooth gradients, it's like trying to tune a radio by jumping randomly between stations. You often get stuck in a "dead zone" (a local minimum) where the signal is weak, and you can't find the perfect station.
Existing methods were like:
- The Greedy Climber (GCG): Tries to climb a hill step-by-step by looking at the slope. But the hill is foggy, and the map is wrong, so they often get stuck in small valleys.
- The Random Walker (Beam Search): Tries many paths at once but doesn't look closely at the terrain, so they might miss the peak entirely.
- The Evolutionary Gardener (EPO): Grows many plants and prunes the weak ones, but it gets too obsessed with making the plants look "pretty" (fluent English) rather than making them grow tall (activating the switch).
The Solution: ADAPT (The Hybrid Detective)
The authors introduce ADAPT, a new method that combines the best tools to solve this puzzle. Think of ADAPT as a team of three detectives working together:
The Scout (Beam Search Initialization):
Before the main work begins, ADAPT sends out a team of scouts to explore the map. They don't just start at one random spot; they start at many different locations and fan out. This ensures they don't miss the "good neighborhood" where the switch is likely to be found. It's like sending a drone to scan the whole mountain before sending a hiker up.The Climber & The Drifter (Hybrid Mutation):
Once they find a promising area, ADAPT uses two techniques to refine the sentence:- The Climber (Gradient-Guided): Uses math to guess which word change will make the switch glow brighter.
- The Drifter (Logit-Swap): Sometimes the math is wrong (due to the "fog"). So, ADAPT also tries random, smart guesses based on what the AI usually says next.
- The Magic: ADAPT switches between these two strategies. If the math is working, it climbs. If it gets stuck, it drifts to a new spot. This prevents them from getting stuck in a dead-end valley.
The Diverse Team (Group Management):
Instead of having everyone work on the same sentence, ADAPT keeps several different teams working on different versions of the sentence simultaneously. This ensures that if one team gets stuck, the others might find a different, better solution. It's like having five different chefs trying to cook the same dish; if one burns it, the others might still succeed.
The Results: A New Standard
The researchers tested ADAPT on a popular AI model (Gemma 2) and compared it to the old methods.
- Better Performance: ADAPT found the "perfect sentences" to light up the switches 70% more often than the previous best method.
- More Human-Like: The sentences ADAPT created weren't just gibberish; they were actually understandable and made sense to humans.
- Consistent: Unlike old methods that worked well on some layers of the AI but failed on others, ADAPT worked consistently from the bottom to the top of the model.
The Big Picture
This paper proves that we can "reverse engineer" what an AI is thinking by crafting the perfect prompt to trigger its internal switches. But to do this, we can't just use brute force or simple math. We need a hybrid approach that explores widely, refines carefully, and keeps multiple options open to avoid getting lost in the fog.
In short: ADAPT is the ultimate treasure map and compass combined, helping us find the hidden "switches" inside the AI's brain much faster and more accurately than ever before.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.