Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,101 +1,58 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
-
task_categories:
|
| 4 |
-
- visual-question-answering
|
| 5 |
-
- image-to-text
|
| 6 |
tags:
|
| 7 |
- hallucination
|
| 8 |
- vlm
|
| 9 |
- evaluation
|
| 10 |
- diagnostic
|
| 11 |
-
- representation-analysis
|
| 12 |
-
- subspace
|
| 13 |
-
pretty_name: "Subspace Validity Suite (SVS)"
|
| 14 |
-
configs:
|
| 15 |
-
- config_name: default
|
| 16 |
-
data_files: []
|
| 17 |
viewer: false
|
| 18 |
---
|
| 19 |
|
| 20 |
-
# Subspace Validity Suite (SVS)
|
| 21 |
|
| 22 |
-
**Diagnostic toolkit
|
| 23 |
|
| 24 |
-
|
| 25 |
|
| 26 |
-
##
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
- `svs_toolkit.py` — Complete SVS implementation (6 diagnostic tests)
|
| 34 |
-
- `__init__.py` — Package init
|
| 35 |
-
|
| 36 |
-
### `experiments/` — Experiment Scripts
|
| 37 |
-
All scripts are self-contained and run on Google Colab with an L4 GPU.
|
| 38 |
|
| 39 |
-
|
| 40 |
-
|--------|-----------|
|
| 41 |
-
| `scaled_gibberish_cpu.py` | Generate 1000 prompts per type |
|
| 42 |
-
| `scaled_gibberish_gpu.py` | N=4000 gibberish test on Vicuna |
|
| 43 |
-
| `scaled_gibberish_stats.py` | TOST equivalence + Cohen's d |
|
| 44 |
-
| `scaled_makebreak.py` | N=500 makebreak with McNemar's test |
|
| 45 |
-
| `pope_evaluation.py` | POPE evaluation (GRH validation) |
|
| 46 |
-
| `vista_actual.py` | VISTA actual codebase test |
|
| 47 |
-
| `pairwise_discrimination.py` | SVS Test 6: pairwise content classification |
|
| 48 |
-
| `impossible_classification.py` | 36-feature classifier test |
|
| 49 |
-
| `theorem_verification_v2.py` | Eigenvalue dominance verification |
|
| 50 |
-
| `blip2_gibberish.py` | BLIP-2 architecture test |
|
| 51 |
-
| `mistral_gibberish.py` | Mistral backbone test |
|
| 52 |
-
| `generalize_test.py` | Cross-domain (BLOOM + deepseek) |
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
-
|
| 58 |
-
|-----------|-----------|
|
| 59 |
-
| `gibberish_test/gpu_checkpoint.json` | N=4000 raw alpha values (9 methods × 4 layers × 4 types) |
|
| 60 |
-
| `gibberish_test/statistical_summary.json` | TOST p-values, Cohen's d, bootstrap CIs |
|
| 61 |
-
| `makebreak/checkpoint.json` | N=500 per-image CHAIR results |
|
| 62 |
-
| `pope/pope_checkpoint.json` | POPE accuracy (baseline vs VGCD: +0.000 difference) |
|
| 63 |
-
| `vista_actual/vista_actual_checkpoint.json` | 24-config VISTA gibberish test |
|
| 64 |
-
| `vista_actual/vista_actual_vectors.npz` | Extracted VISTA steering vectors |
|
| 65 |
-
| `classification/pairwise_discrimination.json` | 6-pair accuracy matrix (all >95%) |
|
| 66 |
-
| `theorem/theorem_results.json` | Weight matrix singular value analysis |
|
| 67 |
|
| 68 |
-
|
| 69 |
-
|
|
|
|
|
|
|
| 70 |
|
| 71 |
-
|
| 72 |
-
|------|----------|
|
| 73 |
-
| `subspaces_9methods.npz` | 9 methods × 4 layers (PCA, image, text, contrastive, etc.) |
|
| 74 |
-
| `directions_vista_nullu.npz` | VISTA + Nullu approximation directions |
|
| 75 |
-
| `subspaces_contrastive.npz` | Contrastive variant directions |
|
| 76 |
|
| 77 |
-
|
| 78 |
|
| 79 |
```python
|
| 80 |
-
import json
|
| 81 |
-
|
| 82 |
-
# Verify gibberish test: Gib/Vis ≈ 1.00 for all methods
|
| 83 |
with open("checkpoints/gibberish_test/statistical_summary.json") as f:
|
| 84 |
stats = json.load(f)
|
| 85 |
-
for method,
|
| 86 |
-
print(f"{method}: Gib/Vis={
|
| 87 |
-
f"TOST p={result['tost_p']:.4f}, d={result['cohens_d']:.3f}")
|
| 88 |
-
|
| 89 |
-
# Verify POPE: VGCD has zero effect
|
| 90 |
-
with open("checkpoints/pope/pope_checkpoint.json") as f:
|
| 91 |
-
pope = json.load(f)
|
| 92 |
-
bl = pope.get("summary", {}).get("baseline_random", {})
|
| 93 |
-
vg = pope.get("summary", {}).get("vgcd_a1.5_random", {})
|
| 94 |
-
print(f"Baseline POPE: {bl.get('acc', 'N/A')}")
|
| 95 |
-
print(f"VGCD POPE: {vg.get('acc', 'N/A')}")
|
| 96 |
-
print(f"Difference: {vg.get('acc', 0) - bl.get('acc', 0):.3f}")
|
| 97 |
```
|
| 98 |
-
|
| 99 |
-
## License
|
| 100 |
-
|
| 101 |
-
MIT
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
|
|
|
|
|
|
|
|
|
| 3 |
tags:
|
| 4 |
- hallucination
|
| 5 |
- vlm
|
| 6 |
- evaluation
|
| 7 |
- diagnostic
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
viewer: false
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# Subspace Validity Suite (SVS)
|
| 12 |
|
| 13 |
+
**Diagnostic toolkit for validating "visual directions" in Vision-Language Models.**
|
| 14 |
|
| 15 |
+
Paper: "What PCA-Based Visual Directions in VLMs Actually Capture" (WACV 2027)
|
| 16 |
|
| 17 |
+
## Installation
|
| 18 |
|
| 19 |
+
```bash
|
| 20 |
+
git clone https://huggingface.co/datasets/Anonymousblind/svs-subspace-validity-suite
|
| 21 |
+
cd svs-subspace-validity-suite
|
| 22 |
+
pip install .
|
| 23 |
+
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
+
## Quick Start
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
+
```python
|
| 28 |
+
from svs import SubspaceValiditySuite
|
| 29 |
+
|
| 30 |
+
svs = SubspaceValiditySuite()
|
| 31 |
+
report = svs.full_report(
|
| 32 |
+
directions=your_directions, # (k, d) numpy array
|
| 33 |
+
h_visual=visual_hidden_states, # list of (d,) arrays
|
| 34 |
+
h_gibberish=gibberish_states, # list of (d,) arrays
|
| 35 |
+
h_factual=factual_states, # optional
|
| 36 |
+
h_math=math_states, # optional
|
| 37 |
+
)
|
| 38 |
+
svs.print_report(report)
|
| 39 |
+
```
|
| 40 |
|
| 41 |
+
## Repository Contents
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
+
- `svs/` — Pip-installable toolkit (6 diagnostic tests)
|
| 44 |
+
- `experiments/` — All experiment scripts (Colab-ready)
|
| 45 |
+
- `checkpoints/` — Raw results for reviewer verification
|
| 46 |
+
- `directions/` — Extracted subspace directions
|
| 47 |
|
| 48 |
+
## Checkpoints
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
+
Load any checkpoint to verify paper numbers:
|
| 51 |
|
| 52 |
```python
|
| 53 |
+
import json
|
|
|
|
|
|
|
| 54 |
with open("checkpoints/gibberish_test/statistical_summary.json") as f:
|
| 55 |
stats = json.load(f)
|
| 56 |
+
for method, r in stats.items():
|
| 57 |
+
print(f"{method}: Gib/Vis={r['gv_ratio']:.2f}, d={r['cohens_d']:.3f}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
```
|
|
|
|
|
|
|
|
|
|
|
|