File size: 4,555 Bytes
4a43952
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# SGP-Tribe3 GAMEPLAN (LOCKED)

## Core Thesis
**The brain is a projection of underlying mathematical structure consistent with the SGP.** If we can reverse-engineer brain activity patterns (via TRIBE v2) into geometric SGP representations from text stimuli, we can compare our geometric model's output against LLM neural models on equal footing β€” both processing text.

**Hypothesis H1**: An LLM integrated with an SGP Resonance Graph calibrated from TRIBE v2 fMRI data will produce measurably lower hallucination rates and higher cross-domain coherence than the same LLM without SGP architecture.

**Hypothesis H2**: TRIBE v2 inference will empirically recover the Hickok-Poeppel dual-stream dissociation β€” ventral nodes (G2, G7, G8) showing significantly higher activation for semantic stimuli, dorsal nodes (G1, G3, G4, G9) for syntactic/structural stimuli.

---

## Architecture Overview

```
TEXT INPUT β†’ TRIBE v2 (LLaMA 3.2 embeddings) β†’ fMRI prediction (20,484 vertices)
    ↓
SGP Parcellation (Schaefer-200 β†’ 9 nodes) β†’ SGP Activation Profile
    ↓
Resonance Anchor Ξ©w β†’ LLM Prompt Weighting β†’ SGP-Guided Output
```

**9 SGP Nodes**: G1_broca, G2_wernicke, G3_tpj, G4_pfc, G5_dmn, G6_limbic, G7_sensory, G8_atl, G9_premotor

---

## Phase 0: Fix Text Inference on CPU (BLOCKING)

**Problem**: TRIBE v2 loads ALL extractors during `model.predict()`, even for text-only events. The audio extractor (`Wav2Vec-BERT`) tries to move to CUDA and crashes with `AssertionError: Torch not compiled with CUDA enabled`.

**Solution**: Patch `BaseExtractor.device` property to return `'cpu'` for ALL extractor classes BEFORE calling `predict()`. The patch must happen inside `_run_text_inference()` immediately before `_run_inference_from_events()`.

**Status**: βœ… IMPLEMENTED - Patching added to `_run_text_inference()`

---

## Phase 1: Minimal Test Battery (3-5 Texts)

| # | Text | Expected Dominant Nodes | Purpose |
|---|---|---|---|
| 1 | "The cat sat on the mat." | G2_wernicke, G7_sensory | Baseline simple sentence |
| 2 | "If P implies Q, and Q implies R, then P implies R." | G4_pfc, G1_broca | Logical structure |
| 3 | "She felt the warmth of the sun on her skin as memories of childhood flooded back." | G6_limbic, G5_dmn | Emotional + sensory |
| 4 | "The mitochondria is the powerhouse of the cell." | G4_pfc, G7_sensory | Factual/technical |
| 5 | "What if the universe is a simulation and we're just characters in someone else's dream?" | G5_dmn, G3_tpj | Self-referential/abstract |

---

## Phase 2: Result Persistence & Analytics

**Storage**: HF dataset repo `Sentient-Field/sgp-tribe3-results`

**Schema**:
```json
{
    "stimulus_id": "uuid",
    "text": "input text",
    "sgp_nodes": {"G1_broca": 0.73, ...},
    "streams": {"dorsal": 0.58, ...},
    "edge_weights": {"AF": 0.45, ...},
    "dominant_hemisphere": "left",
    "inference_time_seconds": 45.2
}
```

---

## Phase 3: LLM Integration (OpenRouter Free Tier)

**Primary**: OpenRouter free tier (`openrouter/free` router)
**Fallback**: Ollama Mistral-7B local

**Prompt construction**:
```
System: You are guided by brain-inspired SGP model.
Activation weights: {node_name}: {value}, ...

User: {input}
```

---

## Phase 4: Validation & Comparison

- Coherence: Does SGP-guided output stay more on-topic?
- Differentiation: Do different texts produce different activation profiles?
- Dual-stream: Do semantic vs. logical texts activate different node clusters?

---

## Phase 5: Scale Up (Post-Validation)

- 50-100 text test battery
- Statistical analysis
- Co-activation matrix
- Scientific article documentation

---

## Risk Register

| Risk | Likelihood | Mitigation |
|---|---|---|
| Text inference still hits CUDA error | Medium | Fallback: subprocess with CUDA_VISIBLE_DEVICES="" |
| TRIBE v2 slow on CPU | High | Accept 30-60s per inference |
| OpenRouter rate limits | Low | Fallback to Ollama local |
| HF Space cold starts | Low | Model persists between requests |

---

## Continuation Prompts for AI Agents

**To start from Phase 0**:
```
Read /home/student/sgp-tribe3/GAMEPLAN.md. Start with Phase 0: Fix text inference on CPU.
Test with: curl -X POST https://Sentient-Field-sgp-tribe3.hf.space/predict_text -F "text=The cat sat on the mat." -F "stimulus_id=test"
```

**Current Status**: Phase 0 patch implemented, awaiting deployment and test.

---

## Plan Locked
This plan is LOCKED. Any AI agent can pick up from this document at any phase.

**Last Updated**: April 6, 2026
**Project**: SGP-Tribe3 - Sentient Generative Principal