This document provides mathematically consistent derivations for the NeuralCompose pipeline.
with TP9, AF7, AF8, TP10 channels.
Band power:
Unit normalization:
Cosine similarity:
(Definition only — joint/fused representations are RQ5, deferred to Stage 3.4-B/F; no fusion has been evaluated as of the 2026-07-14 Stage 3.4 freeze.)
Define
where
Recommended metrics:
- decoder loop period
- decoder loop repeat count
- prompt echo detection
- stop reason
- generation length
Metrics computed pairwise between embedding models in
Evaluation/scripts/embedding_space_analysis.py. See
docs/research/methodology-review_v1.md/v2.md Pillar A for the
literature review these formulas and caveats are drawn from.
Kornblith, Norouzi, Lee, and Hinton, "Similarity of Neural Network Representations Revisited" (1905.00414, 2019).
with
Raghu, Gilmer, Yosinski, and Sohl-Dickstein, "SVCCA: Singular Vector Canonical Correlation Analysis for Deep Learning Dynamics and Interpretability" (1706.05806, 2017).
Truncate each representation's SVD to the smallest
computed independently for
Scaled (superimposition). scipy.spatial.procrustes: translate both
Orthogonal (rotation-only). Schönemann (1966); Gower & Dijksterhuis,
Procrustes Problems (Oxford University Press, 2004). No rescaling —
finds only the rotation minimizing residual error, so a scale mismatch
between
reported as a relative residual (normalized by
These answer different questions and are not interchangeable: a pair of embedding spaces can have near-zero scaled-Procrustes disparity (same shape) while having large orthogonal-Procrustes disparity (badly misaligned once scale isn't corrected for). Report both; do not treat one as a relabeling of the other.
Jazayeri and Ostojic, "Interpreting neural computations by examining intrinsic and embedding dimensionality of neural activity" (2107.04084, 2021).
over the eigenspectrum
Recommended evaluation reports include:
- bootstrap confidence intervals
- Mann–Whitney U
- Cohen's d
- Pareto frontier
- effect sizes
- hypothesis preregistration
These sections align with the Stage 3.4 and Stage 3.5 evaluation framework.
Companion to §2–3, §8, and §9 above and to Research.md, drawing on the
representation-geometry / spectral-preprocessing review.
Scope rule. This section unifies instruments, not theories. Every definition below must change a reported number in at least one project; nothing here justifies an algorithm change on its own (cf. "philosophy is documentation, never justification"; "no speculative abstraction unless ≥2 call sites exist"). No shared latent space is asserted — heterogeneous embeddings remain coupled, not fused (§7 stays deferred).
Given a representation matrix
-
Participation ratio (second-moment effective dim; = §9.4):
$$\mathrm{PR}(Z) = \frac{\left(\sum_i \lambda_i\right)^2}{\sum_i \lambda_i^2}$$ -
RankMe (entropy effective dim): with singular values
$\sigma_k$ of$Z$ and$p_k = \sigma_k / \sum_j \sigma_j + \varepsilon$ ,$$\mathrm{RankMe}(Z) = \exp!\Big(-\sum_k p_k \log p_k\Big)$$ -
α-ReQ (eigenspectrum decay slope): fit
$\lambda_i \sim i^{-\alpha}$ by OLS of$\log\lambda_i$ on$\log i$ .
PR and RankMe are the same family (Simpson vs. Shannon summaries of the same spectrum); α is orthogonal to both — it measures shape, not magnitude. Two representations can share PR while differing in α.
Use. Report every representation in the stack — per-user EEG latent, each
embedding model in embedding_space_analysis.py, the synthetic JEPA latent — as
the pair
Caveat (inherited). PR/RankMe are bounded by
Replace/augment the raw band power of §2 and the alpha ratio of §3. Fit the
log-power spectrum as an aperiodic component plus periodic peaks (specparam /
FOOOF, "fixed" aperiodic mode):
-
Aperiodic exponent
$\chi$ is a first-class feature (this is the "1/f slope" the whole preprocessing question turns on) — not a nuisance to be log-compressed away. -
Aperiodic-adjusted band power (the oscillatory signal, aperiodic removed):
$$P_b^{\mathrm{osc}} = \int_{f_1}^{f_2} \big[\hat S(f) - \hat L(f)\big]_+ , df$$ -
Corrected alpha dropout (§3 upgrade): compute
$r_\alpha$ from$P_\alpha^{\mathrm{osc}}$ (aperiodic-removed alpha), so a broadband aperiodic shift no longer masquerades as an alpha change:$$r_\alpha^{\mathrm{corr}} = P_\alpha^{\mathrm{osc}} / P_{\alpha,\text{baseline}}^{\mathrm{osc}}, \qquad r_{\alpha,\mathrm{dB}}^{\mathrm{corr}} = 20\log_{10} r_\alpha^{\mathrm{corr}}$$
Serves both stacks. Same front-end for the awake NeuralCompose pipeline and
the sleep study's EEG. Research.md upgrade: the exploratory hypothesis
"theta power ↔ dream relevance" becomes "aperiodic exponent
Decision (transform choice), most→least information-preserving: (1) specparam
channels
Unifies §8 (decoder loop count Research.md novelty outcome. For a trajectory of states
| Project | Trajectory states |
Interpretation |
|---|---|---|
| WorldModel (JEPA) | rolled-out latent states | low |
| NeuralCompose decode (§8) | emitted-token embeddings |
|
| Sleep study (D8) | LLM-extracted analogy embeddings | effective count of distinct analogical directions |
Research.md contribution (pre-register before D8):
- Report
$N_{\mathrm{PR}}$ over the analogy set as an automated novelty score, secondary to the blind human Likert (H1). - Pre-register Spearman
$\rho(N_{\mathrm{PR}}\text{-novelty}, \text{mean blind human novelty})$ and report it beside the LLM–human agreement of H4. - Optionally: does
$N_{\mathrm{PR}}$ separate Active vs. Control? (automated companion to H1.)
Passes the "must change a measured number" bar in all three projects simultaneously.
The §9 metrics (CKA, SVCCA, scaled/orthogonal Procrustes) answer the review's "are the EEG latent and the language/solution latent coupled spaces?" question directly. Do not run this at pilot N.
With
- Reduce each space to
$k \ll n$ dimensions first (the SVCCA$\tau$ -truncation of §9.2), then compare; or - Defer the EEG↔language coupling analysis to the definitive trial.
Report both Procrustes variants (scaled = shape-only; orthogonal = rotation-only, scale-sensitive) — they are not interchangeable (§9.3).
- No shared latent for EEG + language + world-state + memory. Coupled via learned cross-attention/alignment; §7 concatenation remains deferred and is the wrong fusion.
- No cross-validation between the two research programs. The D8 sleep study does not validate the JEPA architecture, nor vice versa — orthogonal questions, no logical dependency.
-
No label-free metric is an oracle.
$(\mathrm{PR},\alpha)$ ,$N_{\mathrm{PR}}$ , RankMe can all fail (RankMe shows no correlation with some downstream tasks; all break under collapse). Anchor promotion to a downstream number — MPC success (WorldModel) or blind human novelty (D8) — never to a geometry statistic alone.