Free · WaitlistJoin the waitlist for the free 2-day Vibecoding & AI Agents Intensive (autonomous Hermes + DeepSeek agent · led by Jemal Hamidun, Head of AI at Alpina Digital & MIPT)Join the waitlist →
ReleaseInsight · On RadarBerkeley BAIR→ original

Berkeley Cuts the Cost of Analyzing LLM Answers: ProxySPEX Needs About 10x Fewer Model Runs

To figure out why an LLM answered strangely, engineers remove words from the prompt one by one, but every check is a paid model call. Berkeley proposes SPEX and ProxySPEX, algorithms that find influential word combinations without brute-force enumeration. ProxySPEX matches SPEX's quality with roughly 10x fewer runs, which makes prompt and RAG debugging noticeably cheaper.

AI-processed from Berkeley BAIR; edited by Hamidun News
Berkeley Cuts the Cost of Analyzing LLM Answers: ProxySPEX Needs About 10x Fewer Model Runs
Source: Berkeley BAIR. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceBerkeley BAIR ↗
Editor-in-Chief
Key metric #1GPT-4o mini solved the modified trolley problem correctly in only 8% of cases
Key metric #2Replacing four words (trolley ×2, pulling, lever) nearly eliminated the errors
Key metric #3SHAP only flagged individual "trolley" tokens, while SPEX found a four-word combination

Imagine your RAG agent suddenly gives a wrong answer, and you want to know why. The usual trick is to remove pieces of the prompt one at a time and see how the result changes. Each such check is a separate paid model call.

And if the prompt has thousands of words, and the influence comes not from individual words but from combinations of them (for example, two mentions of the same term plus a verb nearby), then enumerating all pairs, triples, and quadruples is physically impossible: the number of combinations grows exponentially. Researchers from Berkeley (BAIR) proposed two algorithms, SPEX and ProxySPEX, that find important combinations without exhaustive enumeration. The claimed result: ProxySPEX reaches the same quality as SPEX with roughly 10x fewer "removals" (the paper calls them ablations), meaning a tenfold reduction in model runs.

How to Find Important Combinations Without Enumerating Everything

The idea rests on three observations about how large models behave. First, the number of possible combinations is enormous, but only a few of them actually affect the answer. Second, such combinations usually involve a small number of elements, say three or four words, not a hundred. Third, which appeared in ProxySPEX: if a complex combination matters, its smaller parts usually matter too. The authors call this a hierarchy.

SPEX (Spectral Explainer) borrows methods from signal processing and coding theory. It builds a carefully designed set of removals, where each one simultaneously "mixes" many candidate important combinations. Decoding algorithms then separate this mixed signal and pick out the interactions that actually shaped the answer. It is similar to how a doctor does not test every combination of a patient's medications, but instead runs a few smart tests and reconstructs the picture from them. ProxySPEX adds the hierarchy assumption, and thanks to it, many times fewer checks are needed.

Caveat: the tenfold saving is claimed relative to SPEX, not relative to any method, and it was measured on specific tasks. It should not be treated as a universal multiplier.

What the Experiments Showed

Explanation quality was measured through faithfulness: how well the attributed contributions of words predict the model's answer on new prompt variants with fragments removed. On text sentiment analysis, SPEX on short inputs performs at the level of methods that account for interactions (Faith-Shap and Faith-Banzaf), but unlike them, it keeps its quality when the context grows to thousands of features. The simple methods LIME and Banzhaf also work on long texts, but lag noticeably on faithfulness: they cannot see combinations.

The most illustrative example is a slightly modified trolley problem, with the moral ambiguity removed so that the correct answer is obvious: "True". GPT-4o mini answered correctly in only 8% of cases. Classic SHAP pointed to the individual "trolley" words as the cause of the error, but replacing them with "tram" or "streetcar" changed almost nothing. SPEX revealed something else: a strong link between two occurrences of "trolley" and the words "pulling" and "lever". When these four words were replaced with synonyms, the error rate dropped to nearly zero. For a product team, this is a useful lesson: the model may have been reacting not to the meaning of the task, but to a recognizable phrasing pattern.

The same ideas were applied to training data: ProxySPEX was run on a ResNet trained on CIFAR-10. It found synergies, where different classes together shape a decision boundary (for example, "automobile" was identified through similarity to a sports car, a yellow truck, and a red van), and redundancy, where duplicates reinforce a single concept (the prediction of "horse" was strongly influenced by a group of dogs that resemble it in silhouette). This opens a path to data selection that preserves useful synergies and safely removes repetitions.

What Practitioners Can Do With This

The method can be useful in several scenarios:

  • Debugging prompts and RAG. You can find which document fragments need to appear together for the model to answer correctly, and which ones merely duplicate each other.
  • Testing brittle phrasing. If the answer breaks when a few words are replaced, that is a sign the model relies on a pattern.
  • Cleaning training data. You can remove redundant duplicates while keeping sets of examples that work together.

The limitations matter too. Each check still requires a model run or retraining, even if there are fewer of them. The algorithms rely on sparsity assumptions (few influential combinations exist) and on hierarchy, and these may not hold on your data. Still, as a cheaper way to answer the question "what exactly caused the model to answer this way," the work looks practical, especially for long contexts where full enumeration is impossible.

Story

Key Questions Answered

How to Find Important Combinations Without Enumerating Everything?

The idea rests on three observations about how large models behave. First, the number of possible combinations is enormous, but only a few of them actually affect the answer. Second, such combinations usually involve a small number of elements, say three or four words, not a hundred. Third, which appeared in ProxySPEX: if a complex combination matters, its smaller parts usually matter too. The authors call this a hierarchy. SPEX (Spectral Explainer) borrows methods from signal processing and coding theory.

What the Experiments Showed?

Explanation quality was measured through faithfulness: how well the attributed contributions of words predict the model's answer on new prompt variants with fragments removed. On text sentiment analysis, SPEX on short inputs performs at the level of methods that account for interactions (Faith-Shap and Faith-Banzaf), but unlike them, it keeps its quality when the context grows to thousands of features.

What Practitioners Can Do With This?

The method can be useful in several scenarios: Debugging prompts and RAG. You can find which document fragments need to appear together for the model to answer correctly, and which ones merely duplicate each other. Testing brittle phrasing. If the answer breaks when a few words are replaced, that is a sign the model relies on a pattern. Cleaning training data. You can remove redundant duplicates while keeping sets of examples that work together. The limitations matter too.

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

Test Frontier LLMs & Autonomous Agents in One Workspace

Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.

Try Nomad AI →Launch Nomad Agent
What do you think?
Loading comments…