Skip to content

Latest commit

 

History

History
273 lines (188 loc) · 12.2 KB

File metadata and controls

273 lines (188 loc) · 12.2 KB

Encephagen: Research Development Report — Day 4

Date: April 4-5, 2026 Author: edvatar (toroleapinc) Repo: https://github.com/toroleapinc/encephagen AI-assisted: Code development assisted by Claude (Anthropic). All experimental design, analysis, and interpretation by the author. All code reviewed, validated, and tested.


1. Summary of Day 4

Day 4 was the most scientifically rigorous day of the project. An expert panel reviewed the work, identified four critical blockers, and we fixed them all. Then we discovered the real reason the connectome isn't helping: we're burying the structural signal under random local noise.

  1. Expert panel identified 4 blockers: no SC-FC validation, surrogate gradient bug, no FDR correction, overclaimed philosophy
  2. Fixed all 4 blockers
  3. Experiment 24: Full biophysical model (delays + ALIF + neuron types) — ALIF reverses connectome advantage
  4. Experiment 25: SC-FC validation fails at old parameters (r=0.074)
  5. Experiment 26: SC-FC tuning finds sweet spot (gc=0.20, r=0.388)
  6. Experiment 27: With validated SC-FC, structure helps organization but HURTS cognition
  7. Root cause analysis: why worm/fly succeeded and we didn't
  8. Added tvb66 (Desikan-Killiany) with continuous weights (14,249x dynamic range)

The fundamental insight: Our model treats the connectome as a minor modulator of an otherwise random local network. The fly/worm models treat the connectome AS the network. Until we flip this ratio, structure can't help.


2. Expert Panel Review

Six experts reviewed the project:

  • Stephen Larson (OpenWorm) — Need more null models, don't add complexity yet
  • Sebastian Seung (FlyWire/Princeton) — Go finer-grained (360+ regions)
  • Mala Murthy (Princeton) — Add region-specific neuron types
  • Wulfram Gerstner (EPFL, e-prop creator) — Fix e-prop to continuous reward, add ALIF
  • György Buzsáki (NYU) — Add conduction delays — most impactful single change
  • Eve Marder (Brandeis) — Fix statistics, increase N, validate SC-FC first

Four Blockers Identified

# Blocker Severity Fix
1 No SC-FC validation Critical Exp 25-26: validate and tune
2 Surrogate gradient bug (ALIF) Code bug Fixed: use adaptive threshold
3 No FDR correction Statistical Added BH-FDR; Exp 22 p=0.011 survives
4 "Structure IS intelligence" overclaim Framing Walked back to "structure constrains computation"

What Survived Review

  • Channeling vs distributing framing (novel)
  • E-prop over Hebbian (real progress)
  • Honest self-assessment in RDRs

3. Brain v2 Implementation

New features added to SpikingBrainGPU:

Conduction delays:

  • From TVB96 Euclidean distances or TVB66 real tract lengths
  • Range: 2-68ms (16-680 timesteps at dt=0.1ms)
  • Implemented as circular spike history buffer + per-synapse delay lookup via scatter_add
  • ~900K delayed synapses on TVB96

Region-specific neuron types:

  • Cortical pyramidal (excitatory): tau_m = 20ms
  • Cortical PV+ fast-spiking (inhibitory): tau_m = 10ms
  • Thalamic relay: tau_m = 15ms
  • Subcortical: tau_m = 25ms
  • Classification from region labels (TVB96 parcellation)

ALIF adaptation:

  • Slow adaptation variable: a^{t+1} = rho * a^t + z^t (rho = exp(-dt/tau_adapt))
  • Adaptive threshold: v_thr = v_threshold_base + beta * a
  • tau_adapt = 200ms, beta = 1.6mV
  • Soft reset: v = v - v_thr (not reset to 0)

Continuous e-prop:

  • Removed snapshot pattern (was losing temporal credit)
  • Reward modulates CURRENT eligibility (which naturally decays from CS phase)
  • ALIF recursive eligibility trace: e_adapt = psi * z_bar + (rho - psi * beta) * e_adapt
  • Fixed surrogate gradient to use adaptive threshold for ALIF neurons

4. Experiments Conducted

Experiment 24: Full biophysical model — Connectome vs Random × 3

Setup: 15 runs × 3 conditions (connectome, degree-preserving, Erdős-Rényi). All features enabled: delays, neuron types, ALIF, continuous e-prop.

Results (vs degree-preserving):

Metric Connectome Random p Winner
Regional diff (CV) 0.675 0.683 0.48
Conditioning -0.00007 +0.00009 <0.0001 Random
Discrimination 42.7% 48.3% 0.25
Working memory 0.0% 80.4% <0.0001 Random

Key finding: ALIF adaptation REVERSES the connectome advantage. The structured thalamocortical pathway creates concentrated, synchronized volleys that drive PFC adaptation up, killing both conditioning and working memory. Random wiring dilutes these volleys. Memory = 0% in ALL 15 connectome runs.

Experiment 25: SC-FC Validation

Setup: Simulate 10s, compute pairwise region correlations (simulated FC), compare to structural connectivity.

Result: SC-FC r = 0.074 at gc=0.15. FAILS benchmark (0.3-0.5). The panel was right — our dynamics don't produce realistic functional connectivity.

Experiment 26: SC-FC Parameter Tuning

Setup: Grid search over global_coupling × ext_rate_factor, 60 combinations.

Result: gc=0.20, erf=3.5 → SC-FC r = 0.388. PASSES benchmark.

Only gc=0.20 passes (3 passing combinations). Lower gc: too weak. Higher gc: saturates or explodes.

gc erf SC-FC r Status
0.20 3.5 0.388 PASS
0.20 4.0 0.378 PASS
0.20 5.0 0.349 PASS
0.15 3.5 0.074 FAIL
0.30 3.5 ~0 saturated

Experiment 27: Validated Connectome vs Random

Setup: 15 runs per condition, gc=0.20 (SC-FC validated), delays + neuron types, no ALIF. FDR correction.

Results:

Metric Connectome Random p (FDR) Winner
Regional diff (CV) 0.562 0.521 <0.0001 Connectome
Conditioning -0.00009 +0.00010 <0.0001 Random
Discrimination 24.3% 40.8% 0.001 Random
Working memory 0.0% 134.1% <0.0001 Random

4/5 FDR-corrected. Connectome wins 1 (differentiation), random wins 3.

The Exp 22 conditioning advantage (p=0.011) was parameter-dependent. It only appeared at gc=0.15 (unrealistic SC-FC). With validated parameters, it reverses.

Experiment 28: tvb66 Tuning (WIP)

Began tuning the tvb66 parcellation (66 regions, continuous weights). Log-transform connectivity for high dynamic range. SC-FC tuning in progress.


5. The Root Cause: Why Worm/Fly Worked and We Don't

The comparison

Property Fly (FlyWire) Worm (OpenWorm) Encephagen
Connectome resolution 139K neurons, 54M synapses 302 neurons, 7K synapses 96 regions (macro-scale)
Long-range / total input ~100% ~100% 12%
Weight dynamic range 1000x 50x 3x (tvb96)
Connectome drives network Yes Yes No
Weight source Synapse count (EM) Synapse count (EM) Fiber tract count (dMRI)

The problem: signal-to-noise ratio

With 200 neurons/region and 10% local connectivity:

  • Local synapses per neuron: ~3,200 (random, structure-free)
  • Long-range synapses per pair: ~384 (connectome-driven)
  • Ratio: 12% — the connectome signal is drowned in local noise

In the fly model, EVERY synapse comes from the connectome. The connectome IS the network.

In our model, the connectome is a MINOR MODULATOR of an otherwise random network. 88% of each neuron's input is structure-free local recurrence. No wonder the structural signal doesn't matter for cognition.

The fix (not yet implemented)

Make the connectome the dominant signal:

  1. Wire neurons primarily through between-region connections
  2. Reduce local random connectivity to a minority
  3. Use continuous weights (tvb66, 14,249x dynamic range) instead of quantized (tvb96, 3x)
  4. Or: use the fly approach — every synapse from the connectome, no random local

This is a fundamental architectural change, not a parameter tweak.


6. tvb66 Data

Added Desikan-Killiany 66-region parcellation with continuous weights from tvb-data.

Property tvb96 (old) tvb66 (new)
Regions 96 66
Edges 3,939 1,377
Weight values 3 unique (1, 2, 3) 1,377 unique (continuous)
Dynamic range 3x 14,249x
Tract lengths No (Euclidean proxy) Yes (from dMRI)
Parcellation Custom subcortical Desikan-Killiany (standard)

The tvb66 weights represent actual fiber tract counts, not quantized categories. This is much closer to what the fly model uses (synapse counts).


7. Statistical Corrections

BH-FDR Applied Retroactively

Experiment 22:

  • Regional differentiation (p=0.0002): SURVIVES FDR ✓
  • Conditioning strength (p=0.0113): SURVIVES FDR ✓ (BH threshold = 0.02)
  • Others: do not survive

Experiment 27:

  • 4/5 tests survive FDR (p < 0.001 for all significant results)

Degenerate Metric Flagged

Experiment 23 entropy effect size d = -9.0 was an artifact of near-zero within-condition variance (std=0.0006), not a meaningful biological effect. Absolute difference was 0.6%.


8. Updated Philosophical Claims

Before (overclaimed):

"Structure IS intelligence. The Drosophila connectome experiment proved that simulating brain structure alone replicates behavior."

After (evidence-matched):

"Structure constrains computation. The Drosophila result was at synaptic resolution (54M synapses), 6 orders of magnitude finer than our dMRI data. At macro-scale, structure creates organization but does not provide cognitive advantage."


9. What We Now Know (Cumulative Across 27 Experiments)

Robust findings (survive all tests):

  1. Structure creates regional differentiation — the connectome produces more varied activity patterns than random wiring (p<0.0001, d≈4.0, survives FDR, validated SC-FC)
  2. Structure does NOT create cognitive advantage at dMRI resolution — conditioning, discrimination, and memory are equal or worse than random

Parameter-dependent findings (do not generalize):

  1. Exp 22 conditioning advantage (p=0.011) only appears at gc=0.15 (SC-FC r=0.074, unrealistic)
  2. ALIF adaptation reverses structural advantages by penalizing concentrated activity

Identified root cause:

  1. The connectome signal is buried under local noise (12% of total input vs 100% in fly/worm models)
  2. tvb96 has only 3 unique weight values — almost no structural information

10. Files Changed

File Change
src/encephagen/gpu/spiking_brain_gpu.py Brain v2: delays, neuron types, ALIF, log-transform connectivity
src/encephagen/learning/eprop.py Continuous reward, ALIF eligibility, surrogate gradient bug fix
src/encephagen/analysis/statistics.py NEW: BH-FDR correction utility
src/encephagen/connectome/loader.py Tract lengths support
src/encephagen/connectome/bundled/tvb66_* NEW: 66-region continuous weight data
experiments/24_definitive_structure_vs_random.py Full biophysical model, 3 null models
experiments/25_scfc_validation.py SC-FC validation
experiments/26_scfc_tuning.py Parameter grid search
experiments/27_validated_connectome_vs_random.py Definitive test with validated params
experiments/28_tvb66_tuning.py tvb66 parameter sweep (WIP)
RDP.md Claims walkback, updated findings

11. What's Next

The #1 priority: flip the signal-to-noise ratio. Make the connectome the dominant driver of connectivity, not a minor modulator. Two approaches:

Approach A (minimal): Use tvb66 continuous weights with log-transform, reduce local connectivity to 3%, increase between-region to 30%+ of total input. Retune SC-FC.

Approach B (radical, fly-inspired): Wire neurons ONLY through the connectome. No random local connections. Each neuron's inputs come entirely from the between-region connectivity matrix. This is what made the fly model work.

Both require significant tuning work. The E/I balance that Brunel calibration provides depends on local random connectivity — removing it means finding a new balance point.


Total runtime: ~8 hours (Exp 24: ~2.5h, Exp 26: ~3h, Exp 27: ~3h, tuning: ~2h) GPU: RTX 5070 (12GB VRAM)