Upload README.md with huggingface_hub
Browse files
README.md
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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) — Code & Checkpoints
|
| 21 |
+
|
| 22 |
+
**Diagnostic toolkit and experimental checkpoints for validating claimed "visual directions" in Vision-Language Models.**
|
| 23 |
+
|
| 24 |
+
> Associated paper: "The Subspace Validity Suite: Do Visual Directions in Vision-Language Models Survive Basic Sanity Checks?" (WACV 2027, Evaluations and Datasets Track)
|
| 25 |
+
|
| 26 |
+
## Key Finding
|
| 27 |
+
|
| 28 |
+
We tested 11 methods for extracting "visual directions" from VLM hidden states across 3 architectures (LLaVA-1.5, LLaVA-Next, BLIP-2), 2 text-only backbones (Vicuna, Mistral), and 2 non-VLM transformer families (BLOOM, deepseek-coder). **Every method fails the gibberish specificity test**: random character sequences activate the claimed visual directions as strongly as visual descriptions (Gib/Vis ≈ 1.00, TOST equivalence p < 0.0001, N = 4,000).
|
| 29 |
+
|
| 30 |
+
## Repository Structure
|
| 31 |
+
|
| 32 |
+
### `svs/` — Toolkit Code
|
| 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 |
+
| Script | Experiment |
|
| 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 |
+
### `checkpoints/` — Experimental Results
|
| 55 |
+
Raw results for reviewer verification. Load with `json.load()` or `np.load()`.
|
| 56 |
+
|
| 57 |
+
| Checkpoint | Key Result |
|
| 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 |
+
### `directions/` — Extracted Subspaces
|
| 69 |
+
Pre-computed PCA/SVD/contrastive directions at layers [8, 16, 24, 32].
|
| 70 |
+
|
| 71 |
+
| File | Contents |
|
| 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 |
+
## Quick Verification
|
| 78 |
+
|
| 79 |
+
```python
|
| 80 |
+
import json, numpy as np
|
| 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, result in stats.items():
|
| 86 |
+
print(f"{method}: Gib/Vis={result['gv_ratio']:.2f}, "
|
| 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
|