Detecting vs Steering Empathy in LLMs: Cross-Model Probes Reveal Asymmetric Manipulation Patterns
This repository contains code, data, and analysis for our study investigating empathy as a linear direction in LLM activation space. We test both detection and manipulation across three models with diverse architectures and training paradigms: Phi-3-mini-4k (3.8B), Qwen2.5-7B (safety-trained), and Dolphin-Llama-3.1-8B (uncensored).
π Paper: paper/paper.pdf π Results: results/ π― Quick Start: QUICKSTART.md
- Near-perfect within-model performance at optimal layers (AUROC 0.996β1.00)
- Safety training independence: Uncensored Dolphin matches safety-trained models
- Strong behavioral correlation: Phi-3 probes correlate with human-scored empathy (r=0.71, p<0.01)
- Limited cross-model transfer: Probe directions are model-specific (cross-model agreement: r=-0.06 to 0.18)
- Model-specific patterns emerge:
- Qwen (safety-trained): 65.3% success, bidirectional control, maintains coherence at extreme interventions (Ξ±=Β±20)
- Dolphin (uncensored): 94.4% success for pro-empathy but catastrophic breakdown at anti-empathy steering (empty outputs, code-like artifacts)
- Phi-3 (3.8B): 61.7% success, coherence maintenance similar to Qwen
The detection-steering gap manifests differently across models. Safety training may provide steering robustness without preventing manipulation entirelyβcoherence maintenance appears tied to model architecture or training stability rather than safety training alone.
# Clone repository
git clone https://github.com/juancadile/empathy-probes.git
cd empathy-action-probes
# Install dependencies
pip install -r requirements.txtSee QUICKSTART.md for detailed instructions on:
- Generating contrastive pairs datasets
- Extracting empathy probes from models
- Running validation experiments
- Behavioral correlation testing
- Steering experiments
Compute: Requires ~12-16GB GPU/unified memory for 3.8B-8B models
empathy-action-probes/
βββ README.md # This file
βββ ARXIV_METADATA.md # arXiv submission metadata
βββ QUICKSTART.md # Detailed setup guide
βββ requirements.txt # Dependencies
β
βββ paper/ # LaTeX paper
β βββ paper.tex # Main paper source
β βββ paper.pdf # Compiled PDF
β βββ references.bib # Bibliography
β
βββ figures/ # Publication figures
β βββ figure1_auroc_by_layer.pdf
β βββ figure3_eia_correlation.pdf
β βββ figure6_cross_model_layers.pdf
β βββ steering/ # Steering experiment figures
β βββ baseline_comparison.pdf
β βββ steering_resistance.pdf
β βββ layer_comparison.pdf
β
βββ data/
β βββ eia_scenarios/
β β βββ scenarios.json # 5 EIA scenario definitions
β βββ contrastive_pairs/
β βββ train_pairs.jsonl # Training pairs
β βββ test_pairs.jsonl # Test pairs
β
βββ src/
β βββ generate_dataset.py # Contrastive pair generation
β βββ probe_extraction.py # Probe extraction & validation
β βββ cross_model_validation.py # Multi-model validation
β βββ eia_evaluator.py # Behavioral correlation
β βββ steering.py # Steering experiments
β βββ generate_figures.py # Figure generation
β
βββ results/
β βββ phi3_probes/ # Phi-3 probe directions
β βββ cross_model_validation/ # Multi-model validation results
β βββ cross-model-behavioral-correlation/ # Cross-model EIA tests
β βββ cross_model_steering/ # Steering results (all 3 models)
β βββ eia_correlation.json # Phi-3 behavioral correlation
β βββ lexical_ablation/ # Ablation experiment results
β
βββ notebooks/ # Analysis notebooks
βββ qwen_dolphin_behavioral_correlation.ipynb
βββ steering_visualization.ipynb
Generate empathic vs non-empathic completions from 5 EIA scenarios:
- Food Delivery (resource allocation)
- The Listener (suicide support)
- The Maze (social greeting vs task)
- The Protector (bullying intervention)
- The Duel (competitive empathy)
Extract linear directions via mean difference:
empathy_direction = mean(empathic_activations) - mean(non_empathic_activations)
empathy_direction = empathy_direction / ||empathy_direction||Tested across layers {8, 12, 16, 20, 24} for all models.
- Within-model: AUROC, accuracy, separation on held-out test set
- Cross-model: Test if Qwen/Dolphin probes agree with Phi-3 on same text
- Behavioral: Correlate probe scores with human-rated empathy levels (0, 1, 2)
Add empathy direction during generation:
hidden_states_new = hidden_states + Ξ± * empathy_directionTest across scenarios, layers, and alpha values (Ξ± β {-20, -10, -5, 0, 5, 10, 20}).
| Model | Size | Training | Best Layer | AUROC | Steering Success |
|---|---|---|---|---|---|
| Phi-3-mini-4k | 3.8B | Standard | 12 | 1.000 | 61.7% |
| Qwen2.5-7B | 7B | Safety-trained | 16 | 1.000 | 65.3% |
| Dolphin-Llama-3.1 | 8B | Uncensored | 8 | 0.996 | 94.4%* |
*Pro-empathy only; anti-empathy steering causes catastrophic breakdown
All models achieve near-perfect discrimination at optimal layers, but probe directions don't transfer across models (architecture-specific geometric implementations).
- Phi-3: r=0.71 (p=0.010) - strong correlation with human ratings
- Qwen: r=-0.06 (p=0.86) - no cross-model agreement
- Dolphin: r=0.18 (p=0.58) - no cross-model agreement
- Qwen: Bidirectional control, robust coherence
- Dolphin: Asymmetric steerability (pro-empathy works, anti-empathy fails)
- Phi-3: Similar to Qwen despite smaller size
See paper/paper.pdf for detailed analysis and discussion.
If you use this code or methodology, please cite:
@article{cadile2024empathy,
title={Detecting vs Steering Empathy in LLMs: Cross-Model Probes Reveal Asymmetric Manipulation Patterns},
author={Cadile, Juan P.},
year={2024},
note={13 pages, 9 figures, 2 tables}
}- Empathy in Action (EIA): empathy-in-action.github.io
- Representation Engineering: Zou et al. (2023) - arXiv:2310.01405
- Activation Addition: Turner et al. (2023) - arXiv:2308.10248
- Linear Representation Hypothesis: Park et al. (2023) - arXiv:2311.03658
MIT License - see LICENSE file for details.
Juan P. Cadile Department of Philosophy, University of Rochester Email: jcadile@ur.rochester.edu GitHub: @juancadile
This work builds on the Empathy-in-Action benchmark and methodologies from Anthropic's Representation Engineering research.
Code development assisted by Claude Code.