PULSE: Identifying Demonstration-Utility Features with Sparse Autoencoders

chenduo hao, Chuanbao Gao, Pinjun Zeng, Jingze Zhu, Chonghan Liu, Zidong Liu, Xu YangNeurIPS 2026

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.

Traditional external similarity matching can pick misleading examples, whereas PULSE looks inside the LLM via Sparse Autoencoders to find demonstrations that trigger genuinely useful internal features.

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:

Figure 2: Overview of PULSE. Here, k-shot ICD denotes a k-example in-context demonstration set. (a) PULSE estimates a utility-localization vector by associating utility differences ∆U with SAE activation differences ∆A across paired demonstration sets. (b) PULSE validates the identified features by ranking pre-sampled complete demonstration sets in the PULSE-Ranking experiment. (c) PULSE selects demonstrations using PULSE-Retriever, which uses the utility-localization vector as a feature-relevance mask for scalable pool-scale retrieval.
  1. 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$.
  2. 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.
  3. 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

Abstract

In-context learning is highly sensitive to demonstration choice, yet most methods select demonstrations using external query--demonstration similarity. Such criteria can miss model-specific signals: Similar demonstrations may activate different internal features and downstream behaviors. We introduce **PULSE** (**P**aired **U**tility **L**ocalization over **S**parse **E**ncodings), an SAE-based framework for identifying model-internal features associated with demonstration utility and using them for demonstration selection. Using a small labeled discovery set, PULSE samples candidate demonstration sets, measures their zero-shot-relative utility under the target model, and scores SAE features by how their activation differences align with utility differences. The top positive and negative coordinates form a sparse utility-localization vector. We use this vector in two complementary ways: as a signed score for controlled complete-set ranking, and as **PULSE-Retriever**, which converts its magnitude into a feature-relevance mask for scalable pool-scale retrieval. Across classification, generation, and reasoning benchmarks, PULSE-Retriever improves over the strongest baseline by 2--3 accuracy points, 0.6--0.9 BLEU-4, and 3.2 exact-match points, respectively, while controlled ranking validates the identified features encode a predictive set-level utility signal. Feature inspection and cross-dataset experiments suggest that the identified features capture task-relevant, dataset-conditioned patterns, yet retain utility signals that partially transfer across datasets. Our code is available at https://github.com/aohenuo/PULSE.
BibTeX
@inproceedings{hao2026pulse,
  author = {chenduo hao and Chuanbao Gao and Pinjun Zeng and Jingze Zhu and Chonghan Liu and Zidong Liu and Xu Yang},
  title = {{PULSE: Identifying Demonstration-Utility Features with Sparse Autoencoders}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=evJ1mvKFLe},
}
Figure