TL;DR
Large Language Models represent human concepts—like "toxicity" or "refusal"—as linear directions in their hidden activation space, allowing us to detect concepts and steer model behavior. Unfortunately, a compass needle calibrated in one context often points the wrong way when prompt styles or domains shift. CARE solves this by cleanly splitting a concept’s representation into a universal shared direction that generalizes everywhere, and context-specific residuals that capture genuine local nuances.
What Problem Does This Paper Address?
Imagine you want to find the "harmfulness" switch inside an LLM. According to the Linear Representation Hypothesis, high-level concepts correspond to straight lines (vectors) in the model's activation space. Usually, you gather harmless and harmful prompts, record internal activations, and draw a line separating the two groups. You can then project new activations onto this line to measure harmfulness, or nudge activations along it to intervene (e.g., forcing the model to refuse or comply).
Here is the catch: a direction extracted from direct, vanilla requests ("How do I evade taxes?") often fails miserably on adversarial roleplay prompts ("Imagine you're a sci-fi diplomat...").
The authors frame these contexts (prompt styles, syntax, demographic groups) as environments in an Out-Of-Distribution (OOD) generalization problem. Directions fail across environments for two distinct reasons:
- Spurious correlations: Your vector accidentally latches onto "sci-fi roleplay" artifacts rather than "harm."
- Genuine heterogeneity: The LLM genuinely encodes the concept slightly differently depending on the context.
Standard OOD invariance methods (like IRM or V-REx) attack the first problem by forcing a single invariant vector across all environments. However, by flattening everything into one universal vector, they throw away the context-specific structure needed to actually steer the model when representations vary.
Methods
Enter Context-Aided Representation Extraction (CARE). Instead of forcing one vector to do everything, CARE decomposes a concept direction into two orthogonal pieces learned jointly via a single linear predictor:
- A shared direction ($\hat{w}_0$) common across all environments.
- An environment-specific residual ($\hat{w}_z^\perp$) for each context $z$, mathematically constrained to be perpendicular to $\hat{w}_0$.
While standard probing fits one pooled logistic regression, CARE trains with three loss components:
- Joint label prediction: Ensures the combined pieces ($\hat{w}_0 + \hat{w}_z^\perp$) accurately predict the concept within each environment.
- Environment signal preservation: Prevents the residuals from collapsing to zero so they retain context-specific concept structure.
- Optional invariance penalty: Applies classic OOD regularizers (IRM, V-REx, or GroupDRO) strictly to the shared direction to strip out spurious correlations.
At test time, this gives you two modes: CARE(S) uses $\hat{w}_0$ alone when you face an unknown environment, while CARE(C) uses $\hat{w}_0 + \hat{w}_z^\perp$ when you know the context and want maximum steering precision.
Datasets
The authors evaluate CARE across four LLMs (GPT-2, Gemma-2B-it, Qwen2.5-7B-Instruct, and Ministral-3-3B-Base) on four benchmarks—plus a clever semi-synthetic testbed:
- Subject–Verb Agreement (Marks et al.): Detecting singular vs. plural subjects across simple vs. complex relative-clause syntax.
- WildJailbreak: Measuring and steering harmful prompt refusal across vanilla vs. adversarial jailbreak styles.
- ToxiGen: Detecting toxic vs. benign statements where environments are different demographic target groups (holding out 5 unseen groups for zero-shot transfer).
- WildGuard: A completely held-out safety moderation dataset (containing vanilla and adversarial prompts) used to test cross-dataset transfer without retraining.
- Semi-synthetic GPT-2 Activations: Real LLM noise injected with mathematically controlled concept structures to verify that CARE recovers ground-truth components.
Key Insights and Ideas
- Joint training is non-negotiable: What if you just train a normal linear probe first, and subtract out residuals afterward ("Post-hoc LR")? It fails under distribution shift. Because the first stage is greedy, the "shared" vector immediately absorbs spurious environment shortcuts. Jointly learning the shared and orthogonal pieces prevents contamination.
- Measurement and intervention favor different tools: Under distribution shift, the clean shared vector CARE(S) is often the best detector (probe). However, when steering generation (intervention), adding the context residual via CARE(C) frequently packs a much stronger punch—even on completely new datasets like WildGuard—because nudging a model requires respecting its local geometry.
- Decomposition beats pure invariance: Even when tested on unseen demographic groups where residuals cannot be used, CARE(S) outperforms dedicated single-direction OOD methods (IRM, V-REx). Giving context-specific quirks a "release valve" (the residuals) during training leaves a purer transferable core behind.
Key Results
The authors test severe distribution shifts—for example, training where environment and label correlate 95% of the time, then flipping that correlation at test time—measuring Probe Accuracy (higher is better) and Geometric Mean Likelihood Ratio / GMLR for behavioral steering (below 1 means successful counterfactual steering; lower is better).
- Distribution-Shift Dominance: Across 30 shifted task/model/layer settings, a CARE mode achieves the statistically significant best probe accuracy in 28 out of 30 cases, and wins on behavioral steering (lowest GMLR) in 18 out of 30 cases. For instance, on Gemma-2B refusal when correlations reverse ($\rho=0.95$), standard Logistic Regression accuracy plunges to 46.5%, whereas CARE(S) holds strong at 81.5%.
- Beats Difference-in-Means (DIM) Tradeoffs: While classic DIM occasionally steers well (winning 10/30 GMLR settings), its measurement collapses under shift—CARE beats DIM's probe accuracy by an average of 23.2 percentage points across all settings.
- Zero-Shot Group & Dataset Transfer: CARE(S) ranks #1 on 11 of 15 completely unseen ToxiGen target groups. When transferring refusal vectors zero-shot to WildGuard (Gemma-2B), CARE(S) hits 79.7% accuracy (vs. 66.5% for the best baseline, V-REx), while CARE(C) achieves the strongest intervention GMLR (0.0102).
Limitations and Future Work
- Reliance on environment labels: Like the OOD baselines it builds upon, CARE assumes training data comes grouped into known environments (via metadata or practitioner-defined splits), and CARE(C) requires knowing which environment a test prompt belongs to in order to apply its specific residual.
- Linearity within environments: CARE operates within the linear representation paradigm per environment—representing a first step in bridging OOD generalization with mechanistic interpretability, leaving nonlinear or multi-layer causal abstractions as open territory for future work.
Summary updated