TL;DR
When giving a Large Language Model (LLM) a few examples to guide its output, choosing examples that merely look similar to your prompt on the surface often misses the mark. PULSE cracks open the LLM using Sparse Autoencoders to pinpoint the exact internal neural features that light up when a set of examples actually helps the model succeed. By turning these "utility features" into a search filter, we can retrieve far better prompts tailored to how a specific model thinks—no parameter updates required.
What Problem Does This Paper Address?
In-context learning (ICL)—teaching an LLM a task on the fly by pasting a few input-output demonstrations into the prompt—is famously fickle. Swap out one example, and accuracy can either soar or crater.
Standard practice is to pick examples from a support pool that have high lexical or semantic similarity to your query (e.g., matching keywords or dense embeddings). The catch? Surface similarity ignores the target model's internal wiring. Two prompts that look equally similar to a human—or an external embedding model—can trigger completely different internal computations inside Llama vs. Gemma, leading to wildly different answers.
If we want consistently great demonstrations, we shouldn't just ask, "Which examples match the query?" We need to ask, "Which internal features of this specific LLM make a demonstration useful?" Isolating those features in raw neural activations is tough because individual neurons are "polysemantic"—entangling many unrelated concepts at once.
Methods
To untangle the LLM’s hidden states, the authors attach pretrained Sparse Autoencoders (SAEs)—neural dictionaries that decompose messy, dense activations into clean, sparse, interpretable features—to a middle residual layer of the LLM. On top of this standard interpretability tool, they build PULSE (Paired Utility Localization over Sparse Encodings) in three stages:
- Estimating the Utility-Localization Vector: Using a tiny labeled "discovery set" (just 64 training queries), PULSE samples random $k$-shot demonstration sets and measures how much each set improves the model's log-likelihood or classification margin over a zero-shot baseline. By comparing pairs of demonstration sets on the exact same query, PULSE cancels out query difficulty and isolates SAE features whose activation shifts reliably track utility gains or losses. Keeping only the top positive and negative coordinates yields a sparse weight vector $\mathbf{w}_l$.
- PULSE-Ranking (Validation): To verify the signal, pre-sampled complete $k$-shot sets are ranked by taking the dot product of $\mathbf{w}_l$ with the context's SAE activation shift.
- PULSE-Retriever (Scalable Selection): Scoring every possible $k$-example combination in a massive database is combinatorially impossible. Instead, PULSE-Retriever takes the magnitude $|\mathbf{w}_l|$ as a feature-relevance mask. It compares the zero-shot SAE encodings of the query and individual candidate inputs (weighing utility-relevant features heavily), blends this with standard SAE cosine similarity, and greedily selects diverse top examples.
Datasets
The authors do not introduce new benchmarks; they evaluate across six established datasets spanning three task types (using training splits strictly for feature discovery and held-out splits for testing):
- Classification: AGNews (topic classification), REST14 & LAP14 (aspect-based sentiment for restaurants and laptops), and EMOC (dialogue emotion recognition).
- Open-ended Generation: CommonGen (concept-to-sentence generation).
- Reasoning: GSM8K (multi-step grade-school math).
Key Insights and Ideas
- Raw neurons are too tangled for the job: When the authors ran the exact same paired-utility math on raw hidden states or PCA components instead of SAE features, retrieval accuracy dropped by ~3.5 to 4 points. SAEs aren't just window dressing; sparsity is what makes isolating utility signals possible.
- "Bad" features are great for retrieval: On laptop sentiment (LAP14), the single highest-magnitude feature had a negative utility weight—firing on generic, off-aspect praise like "Toshiba works great." Because PULSE-Retriever masks by absolute magnitude $|\mathbf{w}_l|$, knowing which distracting features to align/avoid is just as informative as knowing the helpful ones.
- Utility is a mix of task-specific anchors and transferable skills: Inspecting top SAE coordinates reveals recognizable patterns like aspect-opinion bindings and affective cues. Surprisingly, if you take utility features discovered on three datasets and apply their union to an unseen fourth dataset, you still beat standard baselines—showing that "how to use context" partially transfers across related tasks.
Key Results
Evaluated primarily on Gemma2-2B and Llama3.1-8B across 1-, 2-, 4-, and 8-shot settings:
- Set-Level Ranking: In controlled candidate-set scoring, PULSE-Ranking achieved the best or tied-best accuracy in 30 out of 32 experimental cells, beating unweighted SAE nearest-neighbors (KNN-SAE) by +3.89 accuracy points on Gemma2-2B and +3.58 on Llama3.1-8B.
- Pool-Scale Retrieval: PULSE-Retriever won 25 out of 32 classification cells, outperforming the strongest baselines by 2–3 accuracy points on average.
- Generation & Reasoning: PULSE-Retriever swept all 12 out of 12 evaluation cells—boosting CommonGen by +0.93 and +0.61 BLEU-4 (on Gemma2-2B and Llama3.1-8B) and jumping +3.16 exact-match points over the best baseline on GSM8K.
Limitations and Future Work
- Dependency on Public SAEs: Because PULSE operates in SAE feature space, you can only use it on backbone models where SAEs have already been trained and released (though appendices extend tests to Qwen3-8B and Gemma2-9B).
- Proxy Approximation & Correlational Scope: PULSE-Retriever approximates set-level interactions via pointwise zero-shot similarity rather than exact combinatorial scoring, and feature inspections show associations with utility rather than strict causal mediation.
- Non-Uniform Transfer: Cross-dataset feature transfer works well across sentiment and emotion tasks, but drops noticeably (by 2.35 points) when transferring into topic classification (AGNews), which relies heavily on domain-specific topic anchors.
- Future Directions: The authors highlight extending PULSE to multimodal ICL, specifically to test whether internal utility features remain reliable when models face misleading visual inputs.
Summary updated