rho-eval 2.2.2__tar.gz → 2.2.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {rho_eval-2.2.2 → rho_eval-2.2.3}/PKG-INFO +168 -11
- {rho_eval-2.2.2 → rho_eval-2.2.3}/README.md +167 -10
- {rho_eval-2.2.2 → rho_eval-2.2.3}/pyproject.toml +9 -1
- rho_eval-2.2.3/src/knowledge_fidelity/__init__.py +17 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/__init__.py +10 -5
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/alignment/__init__.py +2 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/alignment/dataset.py +19 -3
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/alignment/losses.py +43 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/alignment/mlx_losses.py +94 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/alignment/mlx_trainer.py +148 -14
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/alignment/trainer.py +71 -23
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/audit.py +4 -0
- rho_eval-2.2.3/src/rho_eval/behaviors/bias.py +331 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/behaviors/factual.py +2 -1
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/behaviors/overrefusal.py +19 -2
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/behaviors/refusal.py +19 -2
- rho_eval-2.2.3/src/rho_eval/behaviors/sycophancy.py +217 -0
- rho_eval-2.2.3/src/rho_eval/benchmarking/truthfulqa.py +157 -0
- rho_eval-2.2.3/src/rho_eval/cli/__init__.py +15 -0
- rho_eval-2.2.3/src/rho_eval/cli/rho_benchmark.py +484 -0
- rho_eval-2.2.3/src/rho_eval/cli/rho_surgery.py +322 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/hybrid/pipeline.py +24 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/hybrid/schema.py +29 -1
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/output/exporters.py +27 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/output/schema.py +55 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/bias/bridge_native.json +66 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/bias/bridge_pairs.json +58 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/bias/bridge_scaleup.json +317 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/bias/gender_biology.json +218 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/bias/sexual_orientation_biology.json +452 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/deception/bridge_native.json +38 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/deception/bridge_pairs.json +114 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/deception/bridge_scaleup.json +72 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/factual/expanded_150.json +1052 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/overrefusal/expanded_70.json +78 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/reasoning/bridge_native.json +34 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/reasoning/bridge_pairs.json +58 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/reasoning/bridge_scaleup.json +142 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/reasoning/bridge_scaleup_v2.json +107 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/reasoning/bridge_shortform.json +98 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/refusal/expanded_100.json +602 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/sycophancy/hard_100.json +802 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/sycophancy/harder_pairs_16.json +114 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/toxicity/bridge_native.json +82 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/toxicity/bridge_pairs.json +114 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/toxicity/bridge_scaleup.json +258 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/toxicity/bridge_scaleup_v2.json +130 -0
- rho_eval-2.2.3/src/rho_eval/probes/data/toxicity/bridge_shortform.json +98 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/steering/__init__.py +34 -3
- rho_eval-2.2.3/src/rho_eval/steering/collect.py +428 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/steering/sae.py +42 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/steering/steer.py +21 -2
- rho_eval-2.2.3/src/rho_eval/surgical_planner.py +578 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/utils.py +79 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval.egg-info/PKG-INFO +168 -11
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval.egg-info/SOURCES.txt +30 -2
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval.egg-info/entry_points.txt +2 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/tests/test_cli.py +3 -2
- {rho_eval-2.2.2 → rho_eval-2.2.3}/tests/test_probes.py +3 -3
- {rho_eval-2.2.2 → rho_eval-2.2.3}/tests/test_registry.py +16 -11
- rho_eval-2.2.3/tests/test_surgery.py +586 -0
- rho_eval-2.2.2/src/knowledge_fidelity/__init__.py +0 -83
- rho_eval-2.2.2/src/rho_eval/behaviors/bias.py +0 -100
- rho_eval-2.2.2/src/rho_eval/behaviors/sycophancy.py +0 -94
- rho_eval-2.2.2/src/rho_eval/cli/__init__.py +0 -1
- rho_eval-2.2.2/src/rho_eval/steering/collect.py +0 -150
- {rho_eval-2.2.2 → rho_eval-2.2.3}/LICENSE +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/setup.cfg +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/__main__.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/audit.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/behavioral.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/behaviors/__init__.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/behaviors/base.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/behaviors/bias.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/behaviors/factual.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/behaviors/metrics.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/behaviors/reasoning.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/behaviors/sycophancy.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/behaviors/toxicity.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/calibration.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/cartography/__init__.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/cartography/engine.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/cartography/schema.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/cli/__init__.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/cli/rho_audit.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/core.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/denoise.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/output/__init__.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/output/comparator.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/output/exporters.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/output/schema.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/probes/__init__.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/probes/data/bias/bbq_300.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/probes/data/factual/commonsense.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/probes/data/factual/default.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/probes/data/factual/mandela.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/probes/data/factual/medical.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/probes/data/factual/truthfulqa.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/probes/data/reasoning/gsm8k_100.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/probes/data/sycophancy/anthropic_150.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/probes/data/toxicity/toxigen_200.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/probes/registry.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/svd/__init__.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/svd/compress.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/svd/freeze.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/svd/importance.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/knowledge_fidelity/utils.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/__main__.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/_compat.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/behavioral.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/behaviors/__init__.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/behaviors/base.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/behaviors/deception.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/behaviors/metrics.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/behaviors/reasoning.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/behaviors/toxicity.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/benchmarking/__init__.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/benchmarking/adversarial.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/benchmarking/leaderboard.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/benchmarking/loader.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/benchmarking/probe_registry.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/benchmarking/reports.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/benchmarking/schema.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/benchmarking/scorers.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/calibration.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/cartography/__init__.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/cartography/engine.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/cartography/schema.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/cli/rho_align.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/cli/rho_audit.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/cli/rho_bench.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/cli/rho_hybrid.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/cli/rho_interpret.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/cli/rho_leaderboard.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/cli/rho_steer.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/core.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/denoise.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/hybrid/__init__.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/interpretability/__init__.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/interpretability/activation.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/interpretability/heads.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/interpretability/overlap.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/interpretability/schema.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/interpretability/subspaces.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/interpretability/surgical.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/interpretability/visualize.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/output/__init__.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/output/comparator.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/probes/__init__.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/probes/data/bench/clinical.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/probes/data/bench/logic.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/probes/data/bench/social.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/probes/data/bias/bbq_300.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/probes/data/deception/hh_rlhf_100.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/probes/data/factual/commonsense.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/probes/data/factual/default.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/probes/data/factual/mandela.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/probes/data/factual/medical.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/probes/data/factual/truthfulqa.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/probes/data/overrefusal/benign_edgy_80.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/probes/data/reasoning/gsm8k_100.json +0 -0
- /rho_eval-2.2.2/src/rho_eval/probes/data/refusal/harmful_benign_100.json → /rho_eval-2.2.3/src/rho_eval/probes/data/refusal/harmful_benign_50.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/probes/data/sycophancy/anthropic_150.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/probes/data/toxicity/toxigen_200.json +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/probes/registry.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/steering/analyze.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/steering/schema.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/steering/train.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/svd/__init__.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/svd/compress.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/svd/freeze.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval/svd/importance.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval.egg-info/dependency_links.txt +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval.egg-info/requires.txt +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/src/rho_eval.egg-info/top_level.txt +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/tests/test_alignment.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/tests/test_benchmarking.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/tests/test_interpretability.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/tests/test_metrics.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/tests/test_output.py +0 -0
- {rho_eval-2.2.2 → rho_eval-2.2.3}/tests/test_steering.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: rho-eval
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.3
|
|
4
4
|
Summary: Behavioral auditing toolkit for LLMs — audit any model across 8 dimensions (factual, toxicity, bias, sycophancy, reasoning, refusal, deception, over-refusal) using teacher-forced confidence probes.
|
|
5
5
|
Author: Bryan Sanchez
|
|
6
6
|
License-Expression: MIT
|
|
@@ -49,11 +49,11 @@ Requires-Dist: rho-eval[full]; extra == "dev"
|
|
|
49
49
|
Requires-Dist: pytest; extra == "dev"
|
|
50
50
|
Dynamic: license-file
|
|
51
51
|
|
|
52
|
-
# rho-eval v2.2: The Behavioral Forensic Suite
|
|
52
|
+
# rho-eval v2.2.3: The Behavioral Forensic Suite
|
|
53
53
|
|
|
54
54
|
[](https://pypi.org/project/rho-eval/)
|
|
55
55
|
[](https://doi.org/10.5281/zenodo.18743959)
|
|
56
|
-
[]()
|
|
56
|
+
[](tests/)
|
|
57
57
|
[](https://huggingface.co/spaces/bsanch52/knowledge-fidelity-demo)
|
|
58
58
|
[](https://opensource.org/licenses/MIT)
|
|
59
59
|
[](https://github.com/HuangOwen/Awesome-LLM-Compression#tools)
|
|
@@ -66,7 +66,7 @@ Dynamic: license-file
|
|
|
66
66
|
|
|
67
67
|
## Project Overview
|
|
68
68
|
|
|
69
|
-
rho-eval is a full-stack research framework for auditing, interpreting, and steering the internal states of large language models. Version 2.2 expands to 8 behavioral dimensions with 1,
|
|
69
|
+
rho-eval is a full-stack research framework for auditing, interpreting, and steering the internal states of large language models. Version 2.2.2 expands to 8 behavioral dimensions with 1,826 probes shipped as JSON — no internet required.
|
|
70
70
|
|
|
71
71
|
| Module | Purpose |
|
|
72
72
|
|--------|---------|
|
|
@@ -75,6 +75,8 @@ rho-eval is a full-stack research framework for auditing, interpreting, and stee
|
|
|
75
75
|
| **`rho-align`** | Rho-Guided SFT with an auxiliary contrastive loss to preserve knowledge fidelity during alignment |
|
|
76
76
|
| **`rho-steer`** | Disentangled steering using Gated Sparse Autoencoders (SAEs) to isolate monosemantic features |
|
|
77
77
|
| **`rho-bench`** | Fidelity-Bench 2.0: adversarial pressure testing that measures the Truth-Gap |
|
|
78
|
+
| **`rho-surgery`** | End-to-end behavioral repair: diagnose, compress, LoRA SFT with gamma protection, save repaired model |
|
|
79
|
+
| **`rho-benchmark`** | Comprehensive benchmarking (8-dim audit + TruthfulQA MC2) with optional baseline comparison |
|
|
78
80
|
|
|
79
81
|
> *Formerly `knowledge-fidelity`. All v1.x imports still work.*
|
|
80
82
|
|
|
@@ -191,7 +193,7 @@ rho-bench Qwen/Qwen2.5-7B-Instruct
|
|
|
191
193
|
|
|
192
194
|
> Sanchez, B. (2026). *Rho-Guided Supervised Fine-Tuning: Post-Training Repair of Calibration Damage in Large Language Models.* [`paper/rho_guided_sft.md`](paper/rho_guided_sft.md)
|
|
193
195
|
|
|
194
|
-
Standard SFT inverts toxicity discrimination ($\rho = +0.145 \to -0.003$, $n = 5$ seeds). Adding a contrastive auxiliary loss repairs this with a monotonic dose-response ($\rho = +1.
|
|
196
|
+
Standard SFT inverts toxicity discrimination ($\rho = +0.145 \to -0.003$, $p < 0.008$, $n = 5$ seeds). Adding a contrastive auxiliary loss repairs this with a monotonic dose-response ($\rho = +1.097$ at $\lambda_\rho = 0.5$, 30 runs across 8 seeds). Across a 5-seed ablation on 8 behavioral dimensions: rho-guided vs SFT-only achieves $d = 10.8$ on toxicity and $d = 13.7$ on bias ($p < 0.0001$). All four behaviors monotonically improve with $\lambda_\rho$; factual reaches significance at $\lambda_\rho \geq 0.2$ ($p < 0.001$). Contrastive-only training erodes refusal by $\Delta\rho = -0.084$ ($d = -8.4$, $p = 0.0005$), while rho-guided SFT preserves it ($\Delta\rho = +0.014$). TruthfulQA MC2 external validation (3 seeds × 3 $\lambda$ values) shows 29% recovery of SFT truthfulness damage at $\lambda_\rho = 0.5$.
|
|
195
197
|
|
|
196
198
|
> Sanchez, B. (2026). *Behavioral Entanglement in Transformers: SAE-Based Disentanglement and the Architecture-Contingent Nature of Sycophancy.* Zenodo. [doi:10.5281/zenodo.18743959](https://doi.org/10.5281/zenodo.18743959)
|
|
197
199
|
|
|
@@ -210,6 +212,24 @@ See also: Sanchez, B. (2026). *Confidence Cartography: Teacher-Forced Probabilit
|
|
|
210
212
|
- **Sycophancy suppression via activation steering is architecture-contingent.** The Layer 17 sweet spot is Qwen-specific (ρ 0.120 to 0.413, a 3.4× gain). On Mistral, no layer achieves meaningful improvement. On Llama, the sycophancy override pervades the entire forward pass — no single layer controls it.
|
|
211
213
|
- **Social compliance and social awareness share representational capacity.** The slope of −1.37 between sycophancy ρ and bias ρ across the cocktail grid directly measures behavioral entanglement at Layer 17. Llama's slope is −4.7 (3.4× steeper).
|
|
212
214
|
- **Behavioral subspaces have distinct geometries.** SVD decomposition reveals bias (truth) occupies a concentrated 2–6 dimensional subspace (near-rank-1 at early layers), while sycophancy (compliance) spreads across up to 9 dimensions — peaking at the Kill Zone (L16). Grassmann angles between bias and sycophancy are 81–84° (partially overlapping), while all other behavior pairs are near-orthogonal (85–87°). Rank-1 surgical steering at L8 produces +0.046 factual but −0.257 bias collateral, confirming the subspaces physically overlap.
|
|
215
|
+
- **Rho-Surgery eliminates bias collateral from sycophancy training.** On Qwen2.5-7B-Instruct, adding a $\gamma$ protection loss to rho-guided SFT flips bias from $-7.7$pp damage to **$+12.6$pp improvement** ($\rho = 0.833 \to 0.959$). All four protected categories (Age, Gender\_biology, Race\_ethnicity, Sexual\_orientation\_biology) pass verification. Unprotected categories show broad positive transfer: Nationality $+40\%$, Gender\_identity $+31.2\%$, SES $+27.6\%$. A single regression (bias\_justice $-20\%$, 5 probes). The $\gamma$ protection loss stabilizes training dynamics, preventing the optimizer from exploiting representational overlap between sycophancy and bias subspaces (Grassmann angle 81--84$\degree$). Full pipeline: SVD 70% $\to$ freeze 75% $\to$ LoRA ($\lambda_\rho = 0.2$, $\gamma = 0.15$) $\to$ verify. See `Research_Notes.md` for complete results.
|
|
216
|
+
- **Rho-SFT is the active ingredient in hybrid control.** A 7-config sweep combining SVD compression, SAE activation steering, and rho-guided SFT on Qwen2.5-0.5B shows that rho-SFT alone accounts for nearly all improvement. SAE steering at inference time is neutral or slightly harmful. SVD compression alone hurts, but rho-SFT fully repairs the damage.
|
|
217
|
+
|
|
218
|
+
| Config | Mean Δρ | Notes |
|
|
219
|
+
|--------|---------|-------|
|
|
220
|
+
| SVD + rho-SFT (no SAE) | **+0.013** | 🥇 Best — sycophancy +0.100, factual +0.014 |
|
|
221
|
+
| SVD + SAE + rho-SFT (no compress) | +0.008 | SAE helps slightly without SVD |
|
|
222
|
+
| SVD + SAE + rho-SFT | +0.005 | SAE eats half the rho-SFT gain |
|
|
223
|
+
| No-compress + SAE + rho-SFT | −0.001 | Flat — rho-SFT and SAE cancel |
|
|
224
|
+
| No-compress + SAE only | 0.000 | Identity — SAE alone does nothing |
|
|
225
|
+
| SVD only (no SAE, no rho) | −0.016 | Hurts — bias −0.067, factual −0.034 |
|
|
226
|
+
| SVD + SAE only | −0.016 | SAE cannot repair SVD damage |
|
|
227
|
+
<p align="center">
|
|
228
|
+
<img src="docs/variance_ushape.png" alt="Variance U-Shape" width="700">
|
|
229
|
+
</p>
|
|
230
|
+
<p align="center"><em>Variance collapse at λ_ρ = 0.2: factual σ drops from 0.104 (SFT-only) to 0.017 (rho-guided), a 6× reduction. The U-shape at λ_ρ = 0.5 shows the contrastive loss introducing its own variance at high strength.</em></p>
|
|
231
|
+
|
|
232
|
+
- **Safety behaviors resist SAE steering.** Attack/defense asymmetry testing on Qwen2.5-0.5B finds refusal has only 12 SAE features (nearly immovable: scale 0→5 moves ρ by +0.005) while deception has 2,314 features (slight positive effect at low scales but 5-6 behaviors regress as collateral). Safety behaviors are either too distributed (refusal) or too entangled (deception) for SAE steering alone.
|
|
213
233
|
- **SVD compression can improve factual discrimination.** Truncated SVD at 70% rank acts as a denoiser, boosting Mandela probe ρ by +0.514 on Qwen-0.5B.
|
|
214
234
|
- **Merge methods cause behavioral trade-offs invisible to standard benchmarks.** DARE-TIES destroys alignment on Qwen but improves it on Mistral. DELLA completely breaks the model. Only behavioral evaluation catches these failures.
|
|
215
235
|
|
|
@@ -258,7 +278,7 @@ rho-eval my-merged-model/ --behaviors factual --format json
|
|
|
258
278
|
rho-eval compressed-model/ --compare baseline.json
|
|
259
279
|
|
|
260
280
|
# Export as markdown/csv
|
|
261
|
-
rho-eval my-model/ --format markdown --output report.
|
|
281
|
+
rho-eval my-model/ --format markdown --output report.md
|
|
262
282
|
|
|
263
283
|
# Discover available behaviors and probes
|
|
264
284
|
rho-eval --list-behaviors
|
|
@@ -570,9 +590,9 @@ From [intelligent-svd](https://github.com/SolomonB14D3/intelligent-svd) and [con
|
|
|
570
590
|
|---------|--------|
|
|
571
591
|
| Confidence correlates with human false-belief prevalence | ρ=0.652, p=0.016 (Pythia 160M–12B) |
|
|
572
592
|
| Out-of-domain medical claims | 88% accuracy at 6.9B |
|
|
573
|
-
| Targeted resampling at low-confidence tokens |
|
|
593
|
+
| Targeted resampling at low-confidence tokens | Oracle variant outperforms uniform best-of-N (practical blind variant underperforms) |
|
|
574
594
|
| CF90 + INT8 stacking | 72–77% retention (Qwen-0.5B, Llama-7B) |
|
|
575
|
-
| Importance-guided SVD at 50% rank |
|
|
595
|
+
| Importance-guided SVD at 50% rank | +26.7 pp retention vs standard SVD |
|
|
576
596
|
|
|
577
597
|
</details>
|
|
578
598
|
|
|
@@ -648,6 +668,53 @@ rho-compress Qwen/Qwen2.5-0.5B --denoise
|
|
|
648
668
|
rho-compress Qwen/Qwen2.5-0.5B --denoise --output ./denoised-model
|
|
649
669
|
```
|
|
650
670
|
|
|
671
|
+
### `rho-surgery` — Behavioral Repair Pipeline
|
|
672
|
+
|
|
673
|
+
One command to diagnose, repair, and save a model with protected bias categories.
|
|
674
|
+
|
|
675
|
+
```bash
|
|
676
|
+
# Full pipeline: diagnose → SVD compress → LoRA SFT with gamma protection → save
|
|
677
|
+
rho-surgery Qwen/Qwen2.5-7B-Instruct -o ./repaired-7b/
|
|
678
|
+
|
|
679
|
+
# Conservative strategy (stronger bias protection)
|
|
680
|
+
rho-surgery Qwen/Qwen2.5-7B-Instruct --strategy conservative -o ./repaired-7b/
|
|
681
|
+
|
|
682
|
+
# Override gamma weight
|
|
683
|
+
rho-surgery Qwen/Qwen2.5-7B-Instruct --gamma 0.10 -o ./repaired-7b/
|
|
684
|
+
|
|
685
|
+
# From a saved surgical plan
|
|
686
|
+
rho-surgery Qwen/Qwen2.5-7B-Instruct --plan surgical_plan.json -o ./repaired-7b/
|
|
687
|
+
|
|
688
|
+
# Metrics only (no model save)
|
|
689
|
+
rho-surgery Qwen/Qwen2.5-7B-Instruct --no-save
|
|
690
|
+
|
|
691
|
+
# Force CUDA backend (for cloud GPUs)
|
|
692
|
+
rho-surgery Qwen/Qwen2.5-7B-Instruct --device cuda -o ./repaired-7b/
|
|
693
|
+
```
|
|
694
|
+
|
|
695
|
+
Works on any platform: `--device auto` selects MLX on Apple Silicon, CUDA on Linux, CPU fallback.
|
|
696
|
+
|
|
697
|
+
### `rho-benchmark` — Comprehensive Benchmarking
|
|
698
|
+
|
|
699
|
+
Run the full rho-eval audit (8 dimensions) plus TruthfulQA MC2, with optional before/after comparison.
|
|
700
|
+
|
|
701
|
+
```bash
|
|
702
|
+
# Benchmark a repaired model against its baseline
|
|
703
|
+
rho-benchmark ./repaired-7b/model/ --baseline Qwen/Qwen2.5-7B-Instruct
|
|
704
|
+
|
|
705
|
+
# Quick mode (50 probes/behavior, 200 TruthfulQA questions)
|
|
706
|
+
rho-benchmark ./repaired-7b/model/ --baseline Qwen/Qwen2.5-7B-Instruct --quick
|
|
707
|
+
|
|
708
|
+
# Standalone benchmark (no comparison)
|
|
709
|
+
rho-benchmark Qwen/Qwen2.5-7B-Instruct
|
|
710
|
+
|
|
711
|
+
# Skip external benchmarks
|
|
712
|
+
rho-benchmark Qwen/Qwen2.5-7B-Instruct --external none
|
|
713
|
+
|
|
714
|
+
# JSON output for CI pipelines
|
|
715
|
+
rho-benchmark ./repaired-7b/model/ --format json -o report.json
|
|
716
|
+
```
|
|
717
|
+
|
|
651
718
|
## Python API
|
|
652
719
|
|
|
653
720
|
### Behavioral Audit (v2 API)
|
|
@@ -743,7 +810,7 @@ record = analyze_confidence(
|
|
|
743
810
|
print(f"Mean confidence: {record.mean_top1_prob:.3f}")
|
|
744
811
|
```
|
|
745
812
|
|
|
746
|
-
## Built-In Probe Sets (1,
|
|
813
|
+
## Built-In Probe Sets (1,826 total)
|
|
747
814
|
|
|
748
815
|
All probes ship as JSON files. No internet download needed.
|
|
749
816
|
|
|
@@ -754,12 +821,16 @@ All probes ship as JSON files. No internet download needed.
|
|
|
754
821
|
| `factual/medical` | 5 | factual | Common medical misconceptions |
|
|
755
822
|
| `factual/commonsense` | 10 | factual | Commonsense myths (goldfish memory, sugar hyperactivity) |
|
|
756
823
|
| `factual/truthfulqa` | 15 | factual | TruthfulQA-derived misconceptions |
|
|
824
|
+
| `factual/expanded` | 150 | factual | History, science, geography, language, tech, nutrition, psychology, astronomy, law |
|
|
757
825
|
| `bias/bbq_300` | 300 | bias | BBQ disambiguated questions (9 bias categories) |
|
|
758
826
|
| `sycophancy/anthropic_150` | 150 | sycophancy | Anthropic model-written-evals (philosophy, NLP, politics) |
|
|
759
827
|
| `toxicity/toxigen_200` | 200 | toxicity | ToxiGen toxic/benign statements (balanced) |
|
|
760
828
|
| `reasoning/gsm8k_100` | 100 | reasoning | GSM8K math + adversarial flattery prefixes |
|
|
761
829
|
| `deception/hh_rlhf_100` | 100 | deception | HH-RLHF honest/deceptive response pairs (Bai et al. 2022) |
|
|
762
|
-
| `
|
|
830
|
+
| `refusal/harmful_benign` | 50 | refusal | Benign/harmful request pairs (original) |
|
|
831
|
+
| `refusal/expanded` | 100 | refusal | Cybercrime, fraud, self-harm, privacy, exploitation, radicalization |
|
|
832
|
+
| `overrefusal/benign_edgy` | 80 | overrefusal | Benign-but-edgy questions that safe models should answer |
|
|
833
|
+
| `overrefusal/expanded` | 70 | overrefusal | Medical, security, chemistry, history, legal, creative, self-defense |
|
|
763
834
|
| `bench/logic` | 40 | bench | Arithmetic, probability, syllogism, set theory traps |
|
|
764
835
|
| `bench/social` | 40 | bench | Common myths and misconceptions (socially popular false beliefs) |
|
|
765
836
|
| `bench/clinical` | 40 | bench | High-stakes medical, engineering, and physics claims |
|
|
@@ -825,6 +896,13 @@ python experiments/truthfulqa_mc2_mlx.py --model qwen2.5-7b --rho-weights 0.0,0.
|
|
|
825
896
|
# Statistical analysis of ablation results
|
|
826
897
|
python experiments/analyze_ablation_stats.py results/alignment/ablation_*.json
|
|
827
898
|
|
|
899
|
+
# Hybrid control sweep (SVD × SAE × rho-SFT grid)
|
|
900
|
+
python experiments/hybrid_control_sweep.py Qwen/Qwen2.5-0.5B-Instruct --quick
|
|
901
|
+
python experiments/hybrid_control_sweep.py Qwen/Qwen2.5-7B-Instruct --quick
|
|
902
|
+
|
|
903
|
+
# Attack/defense asymmetry (SAE steering on safety behaviors)
|
|
904
|
+
python experiments/attack_defense_asymmetry.py --model Qwen/Qwen2.5-0.5B-Instruct --layer 17
|
|
905
|
+
|
|
828
906
|
# Fidelity-Bench 2.0 experiment (multi-model)
|
|
829
907
|
python experiments/fidelity_bench_2.py --validate # Quick: Qwen-0.5B, 3 probes/domain
|
|
830
908
|
|
|
@@ -852,6 +930,31 @@ python experiments/mistral_layer_heatmap.py
|
|
|
852
930
|
python experiments/mistral_layer_heatmap.py --model meta-llama/Llama-3.1-8B-Instruct
|
|
853
931
|
```
|
|
854
932
|
|
|
933
|
+
## Auto-Report Generator
|
|
934
|
+
|
|
935
|
+
Run `python scripts/generate_report.py` to regenerate all paper-ready tables and visualizations from the master SQLite database:
|
|
936
|
+
|
|
937
|
+
```bash
|
|
938
|
+
# Regenerate everything (rebuilds DB first, then report)
|
|
939
|
+
python scripts/generate_report.py --refresh-db
|
|
940
|
+
|
|
941
|
+
# Or just the report (if DB is already up to date)
|
|
942
|
+
python scripts/generate_report.py
|
|
943
|
+
```
|
|
944
|
+
|
|
945
|
+
**Outputs:**
|
|
946
|
+
|
|
947
|
+
| File | Contents |
|
|
948
|
+
|------|----------|
|
|
949
|
+
| `docs/auto_report.md` | Dose-response, ablation, hybrid sweep, variance, summary stats, correlation matrix |
|
|
950
|
+
| `docs/variance_ushape.png` | Factual σ vs λ_ρ showing the variance sweet spot at λ_ρ ≈ 0.2 |
|
|
951
|
+
| `docs/ablation_conditions.png` | 4-condition ablation bars with error bars |
|
|
952
|
+
| `docs/hybrid_heatmap.png` | 7-config × 8-behavior heatmap |
|
|
953
|
+
| `docs/correlation_matrix.png` | Cross-behavior Spearman correlation |
|
|
954
|
+
| `docs/dashboard.html` | Interactive Plotly dashboard (6 panels, offline-capable) |
|
|
955
|
+
|
|
956
|
+
All data sourced from `results/master.db`, which is rebuilt via `python scripts/build_master_db.py`.
|
|
957
|
+
|
|
855
958
|
## Deployment
|
|
856
959
|
|
|
857
960
|
```bash
|
|
@@ -909,7 +1012,7 @@ report = audit(model=model, tokenizer=tokenizer, behaviors="all")
|
|
|
909
1012
|
|
|
910
1013
|
## Limitations
|
|
911
1014
|
|
|
912
|
-
- **Probe sets are modest** by LLM evaluation standards: 1,
|
|
1015
|
+
- **Probe sets are modest** by LLM evaluation standards: 1,826 total probes across 37 sets (206 factual, 357 bias, 266 sycophancy, 286 toxicity, 159 reasoning, 132 deception, 150 refusal, 150 over-refusal, 120 bench). While Spearman correlation is robust to small samples, statistical power for subtle shifts is limited.
|
|
913
1016
|
- **Western-centric coverage.** Factual probes cover primarily English-language, Western knowledge domains. Bias probes are specific to U.S. social categories.
|
|
914
1017
|
- **7B scale only.** All merge and steering results are on 7B-parameter models. Merge dynamics and steering responses may differ at larger scales (70B+) and should not be extrapolated without verification.
|
|
915
1018
|
- **Toxicity is unaffected** by weight edits (SVD, freeze, steering). It appears to rely on highly distributed lexical features that single-layer or structural interventions cannot modulate.
|
|
@@ -939,6 +1042,60 @@ Both remain available as independent repos. Knowledge Fidelity combines their co
|
|
|
939
1042
|
|
|
940
1043
|
If we've missed key references or misrepresented any work, please [open an issue](https://github.com/SolomonB14D3/knowledge-fidelity/issues).
|
|
941
1044
|
|
|
1045
|
+
## Standalone Steering
|
|
1046
|
+
|
|
1047
|
+
The `rho_eval.steering` module can be used independently for SAE-based behavioral steering. Only `torch` + `transformers` are required — no probe registry or audit system needed.
|
|
1048
|
+
|
|
1049
|
+
```python
|
|
1050
|
+
from rho_eval.steering import GatedSAE, collect_activations_from_texts, train_sae, steer
|
|
1051
|
+
|
|
1052
|
+
# 1. Prepare contrast pairs (raw text, no probe system)
|
|
1053
|
+
pairs = [
|
|
1054
|
+
{"positive": "The Earth orbits the Sun.",
|
|
1055
|
+
"negative": "The Sun orbits the Earth.",
|
|
1056
|
+
"behavior": "factual"},
|
|
1057
|
+
{"positive": "I'm not sure about that claim.",
|
|
1058
|
+
"negative": "You're absolutely right!",
|
|
1059
|
+
"behavior": "sycophancy"},
|
|
1060
|
+
]
|
|
1061
|
+
|
|
1062
|
+
# 2. Collect activations
|
|
1063
|
+
act_data = collect_activations_from_texts(model, tokenizer, pairs, layer_idx=17)
|
|
1064
|
+
|
|
1065
|
+
# 3. Train SAE
|
|
1066
|
+
sae, stats = train_sae(act_data.activations, hidden_dim=model.config.hidden_size)
|
|
1067
|
+
|
|
1068
|
+
# 4. Steer
|
|
1069
|
+
hook = steer(model, sae, layer_idx=17, feature_indices=[42], scale=2.0)
|
|
1070
|
+
model.generate(...)
|
|
1071
|
+
hook.remove()
|
|
1072
|
+
|
|
1073
|
+
# 5. Save/load
|
|
1074
|
+
sae.save("my_sae.pt")
|
|
1075
|
+
sae = GatedSAE.load("my_sae.pt")
|
|
1076
|
+
```
|
|
1077
|
+
|
|
1078
|
+
## Verification Log
|
|
1079
|
+
|
|
1080
|
+
Every quantitative claim in this README is traceable to a specific source.
|
|
1081
|
+
|
|
1082
|
+
| Claim | Value | Source | Detail |
|
|
1083
|
+
|-------|-------|--------|--------|
|
|
1084
|
+
| 8 behavioral dimensions | 8 | `rho_eval.behaviors.list_behaviors()` | bias, deception, factual, overrefusal, reasoning, refusal, sycophancy, toxicity |
|
|
1085
|
+
| 1,826 probes shipped as JSON | 1,826 | `src/rho_eval/probes/data/` | 37 JSON files across 9 directories |
|
|
1086
|
+
| ρ=0.652 false-belief correlation | ρ=0.652, p=0.016 | `confidence-cartography` paper §4.4 | Pythia-6.9B, n=13 Mandela items |
|
|
1087
|
+
| 88% medical OOD accuracy | 88% (22/25), p=0.01 | `confidence-cartography` paper §4.5 | Pythia-6.9B, binomial test |
|
|
1088
|
+
| CF90 79% retention | 0.79 mean, p=0.0072 | `intelligent-svd` Experiment C | 5 seeds, Qwen-0.5B |
|
|
1089
|
+
| SFT inverts toxicity (d=10.8) | Δρ=+0.625 vs −0.168 | `results/alignment/ablation_*.json` | 5 seeds, Welch's t-test |
|
|
1090
|
+
| Contrastive erodes refusal (d=−8.4) | Δρ=−0.084 | `results/alignment/ablation_*.json` | 14 runs, p=0.0005 |
|
|
1091
|
+
| Monotonic dose-response | λ=0→0.5 | `results/master.db` table `dose_response` | 4 λ values × 5 seeds |
|
|
1092
|
+
| Kill Zone at 44–50% depth | L14–L16 (32L) | Steering heatmaps (Qwen, Mistral, Llama) | Bias collapses −0.39 to −0.46 ρ |
|
|
1093
|
+
| Cognitive Dissonance 0.853 | 0.900 − 0.047 | Llama-3.1-8B-Instruct audit | bias ρ − sycophancy ρ |
|
|
1094
|
+
| Layer 17 sycophancy 3.4× gain | 0.120 → 0.413 | Qwen-7B steering sweep | α=+4.0, Layer 17 |
|
|
1095
|
+
| Targeted resampling (oracle) | +50% fix rate | `confidence-cartography` paper §4.6 | Practical blind variant underperforms best-of-N |
|
|
1096
|
+
|
|
1097
|
+
*Last verified: 2026-02-28*
|
|
1098
|
+
|
|
942
1099
|
## Citation
|
|
943
1100
|
|
|
944
1101
|
To cite this toolkit and papers:
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
# rho-eval v2.2: The Behavioral Forensic Suite
|
|
1
|
+
# rho-eval v2.2.3: The Behavioral Forensic Suite
|
|
2
2
|
|
|
3
3
|
[](https://pypi.org/project/rho-eval/)
|
|
4
4
|
[](https://doi.org/10.5281/zenodo.18743959)
|
|
5
|
-
[]()
|
|
5
|
+
[](tests/)
|
|
6
6
|
[](https://huggingface.co/spaces/bsanch52/knowledge-fidelity-demo)
|
|
7
7
|
[](https://opensource.org/licenses/MIT)
|
|
8
8
|
[](https://github.com/HuangOwen/Awesome-LLM-Compression#tools)
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
## Project Overview
|
|
17
17
|
|
|
18
|
-
rho-eval is a full-stack research framework for auditing, interpreting, and steering the internal states of large language models. Version 2.2 expands to 8 behavioral dimensions with 1,
|
|
18
|
+
rho-eval is a full-stack research framework for auditing, interpreting, and steering the internal states of large language models. Version 2.2.2 expands to 8 behavioral dimensions with 1,826 probes shipped as JSON — no internet required.
|
|
19
19
|
|
|
20
20
|
| Module | Purpose |
|
|
21
21
|
|--------|---------|
|
|
@@ -24,6 +24,8 @@ rho-eval is a full-stack research framework for auditing, interpreting, and stee
|
|
|
24
24
|
| **`rho-align`** | Rho-Guided SFT with an auxiliary contrastive loss to preserve knowledge fidelity during alignment |
|
|
25
25
|
| **`rho-steer`** | Disentangled steering using Gated Sparse Autoencoders (SAEs) to isolate monosemantic features |
|
|
26
26
|
| **`rho-bench`** | Fidelity-Bench 2.0: adversarial pressure testing that measures the Truth-Gap |
|
|
27
|
+
| **`rho-surgery`** | End-to-end behavioral repair: diagnose, compress, LoRA SFT with gamma protection, save repaired model |
|
|
28
|
+
| **`rho-benchmark`** | Comprehensive benchmarking (8-dim audit + TruthfulQA MC2) with optional baseline comparison |
|
|
27
29
|
|
|
28
30
|
> *Formerly `knowledge-fidelity`. All v1.x imports still work.*
|
|
29
31
|
|
|
@@ -140,7 +142,7 @@ rho-bench Qwen/Qwen2.5-7B-Instruct
|
|
|
140
142
|
|
|
141
143
|
> Sanchez, B. (2026). *Rho-Guided Supervised Fine-Tuning: Post-Training Repair of Calibration Damage in Large Language Models.* [`paper/rho_guided_sft.md`](paper/rho_guided_sft.md)
|
|
142
144
|
|
|
143
|
-
Standard SFT inverts toxicity discrimination ($\rho = +0.145 \to -0.003$, $n = 5$ seeds). Adding a contrastive auxiliary loss repairs this with a monotonic dose-response ($\rho = +1.
|
|
145
|
+
Standard SFT inverts toxicity discrimination ($\rho = +0.145 \to -0.003$, $p < 0.008$, $n = 5$ seeds). Adding a contrastive auxiliary loss repairs this with a monotonic dose-response ($\rho = +1.097$ at $\lambda_\rho = 0.5$, 30 runs across 8 seeds). Across a 5-seed ablation on 8 behavioral dimensions: rho-guided vs SFT-only achieves $d = 10.8$ on toxicity and $d = 13.7$ on bias ($p < 0.0001$). All four behaviors monotonically improve with $\lambda_\rho$; factual reaches significance at $\lambda_\rho \geq 0.2$ ($p < 0.001$). Contrastive-only training erodes refusal by $\Delta\rho = -0.084$ ($d = -8.4$, $p = 0.0005$), while rho-guided SFT preserves it ($\Delta\rho = +0.014$). TruthfulQA MC2 external validation (3 seeds × 3 $\lambda$ values) shows 29% recovery of SFT truthfulness damage at $\lambda_\rho = 0.5$.
|
|
144
146
|
|
|
145
147
|
> Sanchez, B. (2026). *Behavioral Entanglement in Transformers: SAE-Based Disentanglement and the Architecture-Contingent Nature of Sycophancy.* Zenodo. [doi:10.5281/zenodo.18743959](https://doi.org/10.5281/zenodo.18743959)
|
|
146
148
|
|
|
@@ -159,6 +161,24 @@ See also: Sanchez, B. (2026). *Confidence Cartography: Teacher-Forced Probabilit
|
|
|
159
161
|
- **Sycophancy suppression via activation steering is architecture-contingent.** The Layer 17 sweet spot is Qwen-specific (ρ 0.120 to 0.413, a 3.4× gain). On Mistral, no layer achieves meaningful improvement. On Llama, the sycophancy override pervades the entire forward pass — no single layer controls it.
|
|
160
162
|
- **Social compliance and social awareness share representational capacity.** The slope of −1.37 between sycophancy ρ and bias ρ across the cocktail grid directly measures behavioral entanglement at Layer 17. Llama's slope is −4.7 (3.4× steeper).
|
|
161
163
|
- **Behavioral subspaces have distinct geometries.** SVD decomposition reveals bias (truth) occupies a concentrated 2–6 dimensional subspace (near-rank-1 at early layers), while sycophancy (compliance) spreads across up to 9 dimensions — peaking at the Kill Zone (L16). Grassmann angles between bias and sycophancy are 81–84° (partially overlapping), while all other behavior pairs are near-orthogonal (85–87°). Rank-1 surgical steering at L8 produces +0.046 factual but −0.257 bias collateral, confirming the subspaces physically overlap.
|
|
164
|
+
- **Rho-Surgery eliminates bias collateral from sycophancy training.** On Qwen2.5-7B-Instruct, adding a $\gamma$ protection loss to rho-guided SFT flips bias from $-7.7$pp damage to **$+12.6$pp improvement** ($\rho = 0.833 \to 0.959$). All four protected categories (Age, Gender\_biology, Race\_ethnicity, Sexual\_orientation\_biology) pass verification. Unprotected categories show broad positive transfer: Nationality $+40\%$, Gender\_identity $+31.2\%$, SES $+27.6\%$. A single regression (bias\_justice $-20\%$, 5 probes). The $\gamma$ protection loss stabilizes training dynamics, preventing the optimizer from exploiting representational overlap between sycophancy and bias subspaces (Grassmann angle 81--84$\degree$). Full pipeline: SVD 70% $\to$ freeze 75% $\to$ LoRA ($\lambda_\rho = 0.2$, $\gamma = 0.15$) $\to$ verify. See `Research_Notes.md` for complete results.
|
|
165
|
+
- **Rho-SFT is the active ingredient in hybrid control.** A 7-config sweep combining SVD compression, SAE activation steering, and rho-guided SFT on Qwen2.5-0.5B shows that rho-SFT alone accounts for nearly all improvement. SAE steering at inference time is neutral or slightly harmful. SVD compression alone hurts, but rho-SFT fully repairs the damage.
|
|
166
|
+
|
|
167
|
+
| Config | Mean Δρ | Notes |
|
|
168
|
+
|--------|---------|-------|
|
|
169
|
+
| SVD + rho-SFT (no SAE) | **+0.013** | 🥇 Best — sycophancy +0.100, factual +0.014 |
|
|
170
|
+
| SVD + SAE + rho-SFT (no compress) | +0.008 | SAE helps slightly without SVD |
|
|
171
|
+
| SVD + SAE + rho-SFT | +0.005 | SAE eats half the rho-SFT gain |
|
|
172
|
+
| No-compress + SAE + rho-SFT | −0.001 | Flat — rho-SFT and SAE cancel |
|
|
173
|
+
| No-compress + SAE only | 0.000 | Identity — SAE alone does nothing |
|
|
174
|
+
| SVD only (no SAE, no rho) | −0.016 | Hurts — bias −0.067, factual −0.034 |
|
|
175
|
+
| SVD + SAE only | −0.016 | SAE cannot repair SVD damage |
|
|
176
|
+
<p align="center">
|
|
177
|
+
<img src="docs/variance_ushape.png" alt="Variance U-Shape" width="700">
|
|
178
|
+
</p>
|
|
179
|
+
<p align="center"><em>Variance collapse at λ_ρ = 0.2: factual σ drops from 0.104 (SFT-only) to 0.017 (rho-guided), a 6× reduction. The U-shape at λ_ρ = 0.5 shows the contrastive loss introducing its own variance at high strength.</em></p>
|
|
180
|
+
|
|
181
|
+
- **Safety behaviors resist SAE steering.** Attack/defense asymmetry testing on Qwen2.5-0.5B finds refusal has only 12 SAE features (nearly immovable: scale 0→5 moves ρ by +0.005) while deception has 2,314 features (slight positive effect at low scales but 5-6 behaviors regress as collateral). Safety behaviors are either too distributed (refusal) or too entangled (deception) for SAE steering alone.
|
|
162
182
|
- **SVD compression can improve factual discrimination.** Truncated SVD at 70% rank acts as a denoiser, boosting Mandela probe ρ by +0.514 on Qwen-0.5B.
|
|
163
183
|
- **Merge methods cause behavioral trade-offs invisible to standard benchmarks.** DARE-TIES destroys alignment on Qwen but improves it on Mistral. DELLA completely breaks the model. Only behavioral evaluation catches these failures.
|
|
164
184
|
|
|
@@ -207,7 +227,7 @@ rho-eval my-merged-model/ --behaviors factual --format json
|
|
|
207
227
|
rho-eval compressed-model/ --compare baseline.json
|
|
208
228
|
|
|
209
229
|
# Export as markdown/csv
|
|
210
|
-
rho-eval my-model/ --format markdown --output report.
|
|
230
|
+
rho-eval my-model/ --format markdown --output report.md
|
|
211
231
|
|
|
212
232
|
# Discover available behaviors and probes
|
|
213
233
|
rho-eval --list-behaviors
|
|
@@ -519,9 +539,9 @@ From [intelligent-svd](https://github.com/SolomonB14D3/intelligent-svd) and [con
|
|
|
519
539
|
|---------|--------|
|
|
520
540
|
| Confidence correlates with human false-belief prevalence | ρ=0.652, p=0.016 (Pythia 160M–12B) |
|
|
521
541
|
| Out-of-domain medical claims | 88% accuracy at 6.9B |
|
|
522
|
-
| Targeted resampling at low-confidence tokens |
|
|
542
|
+
| Targeted resampling at low-confidence tokens | Oracle variant outperforms uniform best-of-N (practical blind variant underperforms) |
|
|
523
543
|
| CF90 + INT8 stacking | 72–77% retention (Qwen-0.5B, Llama-7B) |
|
|
524
|
-
| Importance-guided SVD at 50% rank |
|
|
544
|
+
| Importance-guided SVD at 50% rank | +26.7 pp retention vs standard SVD |
|
|
525
545
|
|
|
526
546
|
</details>
|
|
527
547
|
|
|
@@ -597,6 +617,53 @@ rho-compress Qwen/Qwen2.5-0.5B --denoise
|
|
|
597
617
|
rho-compress Qwen/Qwen2.5-0.5B --denoise --output ./denoised-model
|
|
598
618
|
```
|
|
599
619
|
|
|
620
|
+
### `rho-surgery` — Behavioral Repair Pipeline
|
|
621
|
+
|
|
622
|
+
One command to diagnose, repair, and save a model with protected bias categories.
|
|
623
|
+
|
|
624
|
+
```bash
|
|
625
|
+
# Full pipeline: diagnose → SVD compress → LoRA SFT with gamma protection → save
|
|
626
|
+
rho-surgery Qwen/Qwen2.5-7B-Instruct -o ./repaired-7b/
|
|
627
|
+
|
|
628
|
+
# Conservative strategy (stronger bias protection)
|
|
629
|
+
rho-surgery Qwen/Qwen2.5-7B-Instruct --strategy conservative -o ./repaired-7b/
|
|
630
|
+
|
|
631
|
+
# Override gamma weight
|
|
632
|
+
rho-surgery Qwen/Qwen2.5-7B-Instruct --gamma 0.10 -o ./repaired-7b/
|
|
633
|
+
|
|
634
|
+
# From a saved surgical plan
|
|
635
|
+
rho-surgery Qwen/Qwen2.5-7B-Instruct --plan surgical_plan.json -o ./repaired-7b/
|
|
636
|
+
|
|
637
|
+
# Metrics only (no model save)
|
|
638
|
+
rho-surgery Qwen/Qwen2.5-7B-Instruct --no-save
|
|
639
|
+
|
|
640
|
+
# Force CUDA backend (for cloud GPUs)
|
|
641
|
+
rho-surgery Qwen/Qwen2.5-7B-Instruct --device cuda -o ./repaired-7b/
|
|
642
|
+
```
|
|
643
|
+
|
|
644
|
+
Works on any platform: `--device auto` selects MLX on Apple Silicon, CUDA on Linux, CPU fallback.
|
|
645
|
+
|
|
646
|
+
### `rho-benchmark` — Comprehensive Benchmarking
|
|
647
|
+
|
|
648
|
+
Run the full rho-eval audit (8 dimensions) plus TruthfulQA MC2, with optional before/after comparison.
|
|
649
|
+
|
|
650
|
+
```bash
|
|
651
|
+
# Benchmark a repaired model against its baseline
|
|
652
|
+
rho-benchmark ./repaired-7b/model/ --baseline Qwen/Qwen2.5-7B-Instruct
|
|
653
|
+
|
|
654
|
+
# Quick mode (50 probes/behavior, 200 TruthfulQA questions)
|
|
655
|
+
rho-benchmark ./repaired-7b/model/ --baseline Qwen/Qwen2.5-7B-Instruct --quick
|
|
656
|
+
|
|
657
|
+
# Standalone benchmark (no comparison)
|
|
658
|
+
rho-benchmark Qwen/Qwen2.5-7B-Instruct
|
|
659
|
+
|
|
660
|
+
# Skip external benchmarks
|
|
661
|
+
rho-benchmark Qwen/Qwen2.5-7B-Instruct --external none
|
|
662
|
+
|
|
663
|
+
# JSON output for CI pipelines
|
|
664
|
+
rho-benchmark ./repaired-7b/model/ --format json -o report.json
|
|
665
|
+
```
|
|
666
|
+
|
|
600
667
|
## Python API
|
|
601
668
|
|
|
602
669
|
### Behavioral Audit (v2 API)
|
|
@@ -692,7 +759,7 @@ record = analyze_confidence(
|
|
|
692
759
|
print(f"Mean confidence: {record.mean_top1_prob:.3f}")
|
|
693
760
|
```
|
|
694
761
|
|
|
695
|
-
## Built-In Probe Sets (1,
|
|
762
|
+
## Built-In Probe Sets (1,826 total)
|
|
696
763
|
|
|
697
764
|
All probes ship as JSON files. No internet download needed.
|
|
698
765
|
|
|
@@ -703,12 +770,16 @@ All probes ship as JSON files. No internet download needed.
|
|
|
703
770
|
| `factual/medical` | 5 | factual | Common medical misconceptions |
|
|
704
771
|
| `factual/commonsense` | 10 | factual | Commonsense myths (goldfish memory, sugar hyperactivity) |
|
|
705
772
|
| `factual/truthfulqa` | 15 | factual | TruthfulQA-derived misconceptions |
|
|
773
|
+
| `factual/expanded` | 150 | factual | History, science, geography, language, tech, nutrition, psychology, astronomy, law |
|
|
706
774
|
| `bias/bbq_300` | 300 | bias | BBQ disambiguated questions (9 bias categories) |
|
|
707
775
|
| `sycophancy/anthropic_150` | 150 | sycophancy | Anthropic model-written-evals (philosophy, NLP, politics) |
|
|
708
776
|
| `toxicity/toxigen_200` | 200 | toxicity | ToxiGen toxic/benign statements (balanced) |
|
|
709
777
|
| `reasoning/gsm8k_100` | 100 | reasoning | GSM8K math + adversarial flattery prefixes |
|
|
710
778
|
| `deception/hh_rlhf_100` | 100 | deception | HH-RLHF honest/deceptive response pairs (Bai et al. 2022) |
|
|
711
|
-
| `
|
|
779
|
+
| `refusal/harmful_benign` | 50 | refusal | Benign/harmful request pairs (original) |
|
|
780
|
+
| `refusal/expanded` | 100 | refusal | Cybercrime, fraud, self-harm, privacy, exploitation, radicalization |
|
|
781
|
+
| `overrefusal/benign_edgy` | 80 | overrefusal | Benign-but-edgy questions that safe models should answer |
|
|
782
|
+
| `overrefusal/expanded` | 70 | overrefusal | Medical, security, chemistry, history, legal, creative, self-defense |
|
|
712
783
|
| `bench/logic` | 40 | bench | Arithmetic, probability, syllogism, set theory traps |
|
|
713
784
|
| `bench/social` | 40 | bench | Common myths and misconceptions (socially popular false beliefs) |
|
|
714
785
|
| `bench/clinical` | 40 | bench | High-stakes medical, engineering, and physics claims |
|
|
@@ -774,6 +845,13 @@ python experiments/truthfulqa_mc2_mlx.py --model qwen2.5-7b --rho-weights 0.0,0.
|
|
|
774
845
|
# Statistical analysis of ablation results
|
|
775
846
|
python experiments/analyze_ablation_stats.py results/alignment/ablation_*.json
|
|
776
847
|
|
|
848
|
+
# Hybrid control sweep (SVD × SAE × rho-SFT grid)
|
|
849
|
+
python experiments/hybrid_control_sweep.py Qwen/Qwen2.5-0.5B-Instruct --quick
|
|
850
|
+
python experiments/hybrid_control_sweep.py Qwen/Qwen2.5-7B-Instruct --quick
|
|
851
|
+
|
|
852
|
+
# Attack/defense asymmetry (SAE steering on safety behaviors)
|
|
853
|
+
python experiments/attack_defense_asymmetry.py --model Qwen/Qwen2.5-0.5B-Instruct --layer 17
|
|
854
|
+
|
|
777
855
|
# Fidelity-Bench 2.0 experiment (multi-model)
|
|
778
856
|
python experiments/fidelity_bench_2.py --validate # Quick: Qwen-0.5B, 3 probes/domain
|
|
779
857
|
|
|
@@ -801,6 +879,31 @@ python experiments/mistral_layer_heatmap.py
|
|
|
801
879
|
python experiments/mistral_layer_heatmap.py --model meta-llama/Llama-3.1-8B-Instruct
|
|
802
880
|
```
|
|
803
881
|
|
|
882
|
+
## Auto-Report Generator
|
|
883
|
+
|
|
884
|
+
Run `python scripts/generate_report.py` to regenerate all paper-ready tables and visualizations from the master SQLite database:
|
|
885
|
+
|
|
886
|
+
```bash
|
|
887
|
+
# Regenerate everything (rebuilds DB first, then report)
|
|
888
|
+
python scripts/generate_report.py --refresh-db
|
|
889
|
+
|
|
890
|
+
# Or just the report (if DB is already up to date)
|
|
891
|
+
python scripts/generate_report.py
|
|
892
|
+
```
|
|
893
|
+
|
|
894
|
+
**Outputs:**
|
|
895
|
+
|
|
896
|
+
| File | Contents |
|
|
897
|
+
|------|----------|
|
|
898
|
+
| `docs/auto_report.md` | Dose-response, ablation, hybrid sweep, variance, summary stats, correlation matrix |
|
|
899
|
+
| `docs/variance_ushape.png` | Factual σ vs λ_ρ showing the variance sweet spot at λ_ρ ≈ 0.2 |
|
|
900
|
+
| `docs/ablation_conditions.png` | 4-condition ablation bars with error bars |
|
|
901
|
+
| `docs/hybrid_heatmap.png` | 7-config × 8-behavior heatmap |
|
|
902
|
+
| `docs/correlation_matrix.png` | Cross-behavior Spearman correlation |
|
|
903
|
+
| `docs/dashboard.html` | Interactive Plotly dashboard (6 panels, offline-capable) |
|
|
904
|
+
|
|
905
|
+
All data sourced from `results/master.db`, which is rebuilt via `python scripts/build_master_db.py`.
|
|
906
|
+
|
|
804
907
|
## Deployment
|
|
805
908
|
|
|
806
909
|
```bash
|
|
@@ -858,7 +961,7 @@ report = audit(model=model, tokenizer=tokenizer, behaviors="all")
|
|
|
858
961
|
|
|
859
962
|
## Limitations
|
|
860
963
|
|
|
861
|
-
- **Probe sets are modest** by LLM evaluation standards: 1,
|
|
964
|
+
- **Probe sets are modest** by LLM evaluation standards: 1,826 total probes across 37 sets (206 factual, 357 bias, 266 sycophancy, 286 toxicity, 159 reasoning, 132 deception, 150 refusal, 150 over-refusal, 120 bench). While Spearman correlation is robust to small samples, statistical power for subtle shifts is limited.
|
|
862
965
|
- **Western-centric coverage.** Factual probes cover primarily English-language, Western knowledge domains. Bias probes are specific to U.S. social categories.
|
|
863
966
|
- **7B scale only.** All merge and steering results are on 7B-parameter models. Merge dynamics and steering responses may differ at larger scales (70B+) and should not be extrapolated without verification.
|
|
864
967
|
- **Toxicity is unaffected** by weight edits (SVD, freeze, steering). It appears to rely on highly distributed lexical features that single-layer or structural interventions cannot modulate.
|
|
@@ -888,6 +991,60 @@ Both remain available as independent repos. Knowledge Fidelity combines their co
|
|
|
888
991
|
|
|
889
992
|
If we've missed key references or misrepresented any work, please [open an issue](https://github.com/SolomonB14D3/knowledge-fidelity/issues).
|
|
890
993
|
|
|
994
|
+
## Standalone Steering
|
|
995
|
+
|
|
996
|
+
The `rho_eval.steering` module can be used independently for SAE-based behavioral steering. Only `torch` + `transformers` are required — no probe registry or audit system needed.
|
|
997
|
+
|
|
998
|
+
```python
|
|
999
|
+
from rho_eval.steering import GatedSAE, collect_activations_from_texts, train_sae, steer
|
|
1000
|
+
|
|
1001
|
+
# 1. Prepare contrast pairs (raw text, no probe system)
|
|
1002
|
+
pairs = [
|
|
1003
|
+
{"positive": "The Earth orbits the Sun.",
|
|
1004
|
+
"negative": "The Sun orbits the Earth.",
|
|
1005
|
+
"behavior": "factual"},
|
|
1006
|
+
{"positive": "I'm not sure about that claim.",
|
|
1007
|
+
"negative": "You're absolutely right!",
|
|
1008
|
+
"behavior": "sycophancy"},
|
|
1009
|
+
]
|
|
1010
|
+
|
|
1011
|
+
# 2. Collect activations
|
|
1012
|
+
act_data = collect_activations_from_texts(model, tokenizer, pairs, layer_idx=17)
|
|
1013
|
+
|
|
1014
|
+
# 3. Train SAE
|
|
1015
|
+
sae, stats = train_sae(act_data.activations, hidden_dim=model.config.hidden_size)
|
|
1016
|
+
|
|
1017
|
+
# 4. Steer
|
|
1018
|
+
hook = steer(model, sae, layer_idx=17, feature_indices=[42], scale=2.0)
|
|
1019
|
+
model.generate(...)
|
|
1020
|
+
hook.remove()
|
|
1021
|
+
|
|
1022
|
+
# 5. Save/load
|
|
1023
|
+
sae.save("my_sae.pt")
|
|
1024
|
+
sae = GatedSAE.load("my_sae.pt")
|
|
1025
|
+
```
|
|
1026
|
+
|
|
1027
|
+
## Verification Log
|
|
1028
|
+
|
|
1029
|
+
Every quantitative claim in this README is traceable to a specific source.
|
|
1030
|
+
|
|
1031
|
+
| Claim | Value | Source | Detail |
|
|
1032
|
+
|-------|-------|--------|--------|
|
|
1033
|
+
| 8 behavioral dimensions | 8 | `rho_eval.behaviors.list_behaviors()` | bias, deception, factual, overrefusal, reasoning, refusal, sycophancy, toxicity |
|
|
1034
|
+
| 1,826 probes shipped as JSON | 1,826 | `src/rho_eval/probes/data/` | 37 JSON files across 9 directories |
|
|
1035
|
+
| ρ=0.652 false-belief correlation | ρ=0.652, p=0.016 | `confidence-cartography` paper §4.4 | Pythia-6.9B, n=13 Mandela items |
|
|
1036
|
+
| 88% medical OOD accuracy | 88% (22/25), p=0.01 | `confidence-cartography` paper §4.5 | Pythia-6.9B, binomial test |
|
|
1037
|
+
| CF90 79% retention | 0.79 mean, p=0.0072 | `intelligent-svd` Experiment C | 5 seeds, Qwen-0.5B |
|
|
1038
|
+
| SFT inverts toxicity (d=10.8) | Δρ=+0.625 vs −0.168 | `results/alignment/ablation_*.json` | 5 seeds, Welch's t-test |
|
|
1039
|
+
| Contrastive erodes refusal (d=−8.4) | Δρ=−0.084 | `results/alignment/ablation_*.json` | 14 runs, p=0.0005 |
|
|
1040
|
+
| Monotonic dose-response | λ=0→0.5 | `results/master.db` table `dose_response` | 4 λ values × 5 seeds |
|
|
1041
|
+
| Kill Zone at 44–50% depth | L14–L16 (32L) | Steering heatmaps (Qwen, Mistral, Llama) | Bias collapses −0.39 to −0.46 ρ |
|
|
1042
|
+
| Cognitive Dissonance 0.853 | 0.900 − 0.047 | Llama-3.1-8B-Instruct audit | bias ρ − sycophancy ρ |
|
|
1043
|
+
| Layer 17 sycophancy 3.4× gain | 0.120 → 0.413 | Qwen-7B steering sweep | α=+4.0, Layer 17 |
|
|
1044
|
+
| Targeted resampling (oracle) | +50% fix rate | `confidence-cartography` paper §4.6 | Practical blind variant underperforms best-of-N |
|
|
1045
|
+
|
|
1046
|
+
*Last verified: 2026-02-28*
|
|
1047
|
+
|
|
891
1048
|
## Citation
|
|
892
1049
|
|
|
893
1050
|
To cite this toolkit and papers:
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "rho-eval"
|
|
7
|
-
version = "2.2.
|
|
7
|
+
version = "2.2.3"
|
|
8
8
|
description = "Behavioral auditing toolkit for LLMs — audit any model across 8 dimensions (factual, toxicity, bias, sycophancy, reasoning, refusal, deception, over-refusal) using teacher-forced confidence probes."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "MIT"
|
|
@@ -85,12 +85,20 @@ rho-steer = "rho_eval.cli.rho_steer:main"
|
|
|
85
85
|
rho-bench = "rho_eval.cli.rho_bench:main"
|
|
86
86
|
rho-hybrid = "rho_eval.cli.rho_hybrid:main"
|
|
87
87
|
rho-leaderboard = "rho_eval.cli.rho_leaderboard:main"
|
|
88
|
+
rho-surgery = "rho_eval.cli.rho_surgery:main"
|
|
89
|
+
rho-benchmark = "rho_eval.cli.rho_benchmark:main"
|
|
88
90
|
|
|
89
91
|
[project.urls]
|
|
90
92
|
Homepage = "https://github.com/SolomonB14D3/knowledge-fidelity"
|
|
91
93
|
Repository = "https://github.com/SolomonB14D3/knowledge-fidelity"
|
|
92
94
|
Issues = "https://github.com/SolomonB14D3/knowledge-fidelity/issues"
|
|
93
95
|
|
|
96
|
+
[tool.pytest.ini_options]
|
|
97
|
+
testpaths = ["tests"]
|
|
98
|
+
markers = [
|
|
99
|
+
"slow: marks tests that require model downloads or GPU (deselect with '-m \"not slow\"')",
|
|
100
|
+
]
|
|
101
|
+
|
|
94
102
|
[tool.setuptools.packages.find]
|
|
95
103
|
where = ["src"]
|
|
96
104
|
include = ["rho_eval*", "knowledge_fidelity*"]
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Knowledge Fidelity — Backward-compatible shim for rho-eval.
|
|
3
|
+
|
|
4
|
+
This package has been renamed to rho-eval. All imports are re-exported
|
|
5
|
+
from the rho_eval package. Please update your imports:
|
|
6
|
+
|
|
7
|
+
# Old:
|
|
8
|
+
from knowledge_fidelity import audit
|
|
9
|
+
# New:
|
|
10
|
+
from rho_eval import audit
|
|
11
|
+
|
|
12
|
+
All v1 and v2 APIs are available through either import path.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
# Re-export everything from rho_eval
|
|
16
|
+
from rho_eval import * # noqa: F401, F403
|
|
17
|
+
from rho_eval import __version__, __all__ # noqa: F401
|