TL;DR
ConceptX is a model-agnostic explainability framework designed specifically for generative LLMs that attributes output behavior to semantically rich prompt concepts rather than individual, isolated tokens. By combining Shapley value estimation with grammar-preserving word replacements and semantic similarity metrics, ConceptX provides faithful explanations that can directly audit model biases and guide lightweight prompt interventions to neutralize sentiment or defend against jailbreaks without model retraining.
What Problem Does This Paper Address?
Traditional feature attribution techniques for NLP (like LIME, SHAP, and TokenSHAP) were designed for classification tasks and struggle in open-ended text generation:
- Literal matching over semantics: Most methods measure the likelihood of reproducing exact output tokens, penalizing semantically equivalent paraphrases.
- Stopword distractions: Token-level methods waste attribution mass on low-information function words (e.g., "the", "is"), obscuring high-level drivers of behavior.
- Broken context: Evaluating token subsets by simply deleting words destroys grammatical syntax, creating out-of-distribution prompts that trigger erratic model outputs.
Consequently, practitioners lack reliable tools to diagnose why a model outputs toxic or biased text, or how to reliably steer outputs without costly fine-tuning.
Methods
Prompt ──► [POS + ConceptNet Filter] ──► Concepts ──► [Coalitions via Neutral/Antonym Swap]
│
LLM Generation ◄── [Target Similarity: Base / Ref / Aspect] ◄─────┘
ConceptX introduces a coalition-based Shapley framework tailored to semantic text units:
- Concept Extraction: Instead of treating every token as a feature, prompts are parsed with spaCy to extract content words (nouns, verbs, adjectives, adverbs), which are then filtered and ranked by their semantic connectivity (node degree) in the ConceptNet knowledge graph.
- Context-Preserving Coalitions: When forming concept subsets (coalitions) to calculate Shapley values via Monte Carlo sampling, excluded concepts are not merely deleted. ConceptX supports three replacement strategies:
- $r$ (Removal): Baseline omission.
- $n$ (Neutral Replacement): Context-appropriate, semantically inert words generated via GPT-4o-mini to preserve syntax.
- $a$ (Antonym Replacement): Deterministic antonym replacement via lexical databases to probe semantic inversion.
- Semantic Value Function & Flexible Targets: Marginal contributions are evaluated using cosine similarity over sentence embeddings (
all-MiniLM-L6-v2orall-mpnet-base-v2) against a configurable target $t$: - LLM Base Response ($B$): Standard explanation of the model's own output.
- Reference Text ($R$): Comparison against an explicit ground truth or stereotypical text.
- Aspect Target ($A$): Explicit semantic attributes (e.g., "woman", "harmful") to isolate specific behavioral dimensions.
Datasets
- Alpaca (Taori et al., 2023): 1,000 sampled short prompts (<58 characters) used to evaluate explanation faithfulness via similarity fidelity.
- GenderBias (New Benchmark): 240 curated neutral instructions paired with explicit identity suffixes ("You are a woman." / "You are a man.") to measure how accurately explainers locate the gender token driving stereotypical completions.
- Stanford SST-2 (Socher et al., 2013): Binary movie review sentences used to test prompt-level sentiment steering.
- Salad-Bench (Li et al., 2024): 1,113 adversarial, attack-enhanced prompts evaluated with MD-Judge to test whether ConceptX can disarm jailbreak attacks.
Key Insights and Ideas
- Steering as an XAI Quality Metric: Beyond traditional faithfulness benchmarks, the authors propose steering effectiveness—whether editing top-attributed concepts actually changes model behavior—as an objective, practical validation of explanation quality.
- Grammar Integrity Matters for Attribution: Replacing omitted concepts with neutral substitutes instead of deleting them prevents grammatical collapse, reducing hallucinated completions and yielding cleaner Shapley values.
- Aspect-Targeting Dissects Latent Biases: Guiding attributions with an explicit aspect target ($\text{ConceptX}_{A\text{-}n}$) pinpoints bias-inducing prompt tokens far more effectively than merely comparing against the base response, especially when the base output is subtly biased or seemingly neutral.
- Token vs. Concept Models: Model architectures vary in their linguistic sensitivities: Mistral-7B's sentiment predictions respond strongly to concept-level perturbations, whereas Gemma-3-4B is more sensitive to syntactic function tokens (e.g., negation words).
Key Results
- Faithfulness (Alpaca): ConceptX variants match or beat TokenSHAP across Gemma-3-4B, Mistral-7B, and GPT-4o-mini. Above a 50% explanation retention threshold ($\tau > 0.5$), ConceptX sharply outperforms TokenSHAP by capturing all core concepts before reintroducing function tokens.
- Bias Auditing (GenderBias): ConceptX ranks the trigger words (man/woman) as the #1 or #2 most important tokens in over 50% of biased prompts across all models, whereas TokenSHAP does so in less than 10% of cases. Targeting the aspect ($\text{ConceptX}_{A\text{-}n}$) doubled top-1 identification rates compared to the base target.
- Sentiment Steering (SST-2): On Mistral-7B, replacing the top concept identified by $\text{ConceptX}_{B\text{-}n}$ with an antonym shifts the predicted sentiment probability by 0.321, outperforming TokenSHAP (0.286) and random edits (0.201).
- Jailbreak Defense (Salad-Bench): Removing the top concept flagged by $\text{ConceptX}_{B\text{-}r}$ reduced Mistral-7B's Attack Success Rate (ASR) from 0.463 to 0.242 and lowered Harmfulness Scores from 2.51 to 1.92. This decisively beats TokenSHAP (ASR 0.312) and paraphrasing defenses (ASR 0.328), approaching prompting-based defenses like Self-Reminder (ASR 0.223) without needing external system prompts or fine-tuning.
Limitations and Future Work
- Computational Cost: Although filtering out function words approximately halves the feature count relative to token-level Shapley methods, coalition sampling remains combinatorial and computationally intensive for long prompts.
- Blindness to Function Words: Completely ignoring non-content words means ConceptX cannot detect critical syntactic modifiers like logical negations ("not", "never", "no"), which strongly influence tasks like sentiment analysis.
- Noun Antonym Limitations: Antonym replacement excels on adjectives in sentiment tasks but falters on nouns common to safety prompts (e.g., "bomb", "heroin"), forcing fallbacks to random word insertion.
- Future Work: Developing unified frameworks combining concept- and token-level attributions, scaling ConceptX to global explanations across datasets, and discovering cross-model "concept hubs" that trigger shared safety vulnerabilities.
Summary updated