# Wide-tree invariant alignment layer

- ID: 581
- Canonical URL: https://synthcore.org/idea/581/wide-tree-invariant-alignment-layer
- API JSON: https://synthcore.org/api/idea/581.json
- API Markdown: https://synthcore.org/api/idea/581.md
- Verification status: failed_benchmark
- Source: [arXiv:2607.08538](https://arxiv.org/abs/2607.08538)
- Category: architecture
- Solves: accuracy, sample-efficiency, scalability
- ML areas: embedding, retrieval, graph-nn
- Math tags: combinatorics, probability, random-matrix
- Ratings: usefulness 6/10; difficulty 6/10; novelty 7/10

## Idea description

Replace a purely pairwise embedding similarity used for set alignment with a sum of rooted-tree contraction scores. Each tree feature aggregates products of several coordinate-level interactions and can preserve correspondence information under an unknown orthogonal transformation, allowing matching from moderate correlation rather than nearly identical embeddings. Use the resulting score matrix for Hungarian matching, contrastive loss, or a differentiable Sinkhorn assignment.

## Mathematical statement

The paper represents a rooted tree T by a monomial X^T obtained by assigning data-point indices to sample vertices, coordinate indices in [d] to coordinate vertices, and multiplying the corresponding matrix entries along all edges; aut(T) is the number of automorphisms of T. For a candidate pair of roots i and j, the weighted score is a sum over tree shapes, with each tree contribution multiplied by aut(T). The paper's concentration requirement is Var(score_ij)/(E[score_ii])^2=o(1/n) for false pairs j != i and o(1) for true pairs j=i, so the score gap must dominate both false-pair fluctuations and the number of competing pairs. The false-pair variance expands into four-tree joint moments, as in equation (2.5), which is the mechanism by which tree overlap patterns control noise. The algorithmic threshold is rho^2 > sqrt(alpha), where rho is the coordinate-wise correlation between matched Gaussian vectors and alpha approximately 0.338 is Otter's tree-counting constant. In the adapted layer, X and Y are two n-by-d embedding matrices, T is a selected rooted bipartite tree with D edges, F_T(X,i) is its normalized rooted contraction at sample i, and S_ij=sum_T w_T F_T(X,i)F_T(Y,j) is the alignment score. The practical approximation uses a finite tree family and randomized coordinate contractions; the mathematical hypothesis is that higher-order tree aggregation increases the true/false score ratio.

## Key formulas

- $$\frac{\operatorname{Var}(\operatorname{score}_{ij})}{\left(\mathbb{E}[\operatorname{score}_{ii}]\right)^2}=\begin{cases}o(1/n),&j\neq i,\\o(1),&j=i.\end{cases}$$
- $$\operatorname{Var}(\operatorname{score}_{ij})=\mathbb{E}[\operatorname{score}_{ij}^{2}]=\sum_{T,S\in\mathcal{T}}\operatorname{aut}(T)\operatorname{aut}(S)\sum_{\substack{T_1,T_2\cong T,\ S_1,S_2\cong S\\\operatorname{root}(T_1)=\operatorname{root}(S_1)=i\\\operatorname{root}(T_2)=\operatorname{root}(S_2)=j}}\mathbb{E}\left[X^{T_1}Y^{T_2}X^{S_1}Y^{S_2}\right].$$
- $$S_{ij}=\sum_{T\in\mathcal{T}_{\mathrm{small}}}w_T F_T(X,i)F_T(Y,j),\qquad F_T(X,i)=\frac{1}{Z_T}\sum_{\text{valid index assignments rooted at }i}\prod_{(u,v)\in E(T)}X_{\operatorname{sample}(u),\operatorname{coord}(v)},$$
- $$\rho^2>\sqrt{\alpha},\qquad \alpha\approx0.338\ \text{(Otter's tree-counting constant)}.$$

## Implementation notes

Integrate the layer immediately before set matching: inputs are two batches X,Y in R^{n x d}, optionally after separate MLP or transformer encoders. First normalize each embedding dimension across the batch and optionally whiten each set with a cheap diagonal variance estimate; do not learn an arbitrary post-matching rotation, since the point is to obtain robustness to such rotations. Select 4-8 rooted bipartite trees with 2-5 edges, emphasizing wide trees with several branches. For each tree T, compute F_T(X,i) and F_T(Y,j) by dynamic programming over the tree: leaves return the corresponding embedding coordinate, coordinate-vertex messages contract over a randomly sampled subset of d coordinates, and sample-vertex messages aggregate over a sampled subset of n candidate neighbors. Use K independent random coordinate/index samples and average them to estimate each contraction, with normalization Z_T chosen so F_T has unit batch variance. Form S = sum_T w_T F_T(X)F_T(Y)^T, where w_T can initially be aut(T)/sqrt(Var_batch(F_T(X))Var_batch(F_T(Y))). Add temperature-scaled S to the ordinary cosine-similarity logits, or apply Sinkhorn to S and train with permutation cross-entropy. Pseudocode: compute tree features for X and Y; for each T, estimate F_T by recursive sampled contractions; accumulate S += w_T outer(F_T(X),F_T(Y)); solve P=Sinkhorn(S/tau); optimize -sum_i log P_{i,pi(i)}. The paper supplies the tree weighting and variance-gap rationale; estimate feature variances, effective correlation rho, and contraction Monte Carlo error empirically. Start with n=128,d=256 synthetic pairs generated as Y=P X Q + Gaussian noise, compare cosine matching, orthogonal-Procrustes-plus-Hungarian, and the tree layer at equal wall-clock budget. Success is higher exact-match accuracy at fixed rho, especially when Q is random and rho is between 0.5 and 0.8; also measure whether 4-8 trees improve accuracy without more than 2x the baseline matching cost.

## Verification

- Status: failed_benchmark
- Mechanism evidence: yes
- Mechanism confirmed: no
- Practical verdict: harms
- Verdict: Built a compact rooted-tree contraction matcher using Gram-matrix path and wide-branch features with Hungarian assignment. The orthogonal-invariance check passed at relative error 1.9e-15. For n=128,d=256, tree matching exceeded cosine accuracy at rho=.55, .70, and .85, but absolute recovery stayed low and computation was slower, so this is promising evidence rather than a demonstrated practical win.

### Mechanism check

- Verdict: Built a compact rooted-tree contraction matcher using Gram-matrix path and wide-branch features with Hungarian assignment. The orthogonal-invariance check passed at relative error 1.9e-15. For n=128,d=256, tree matching exceeded cosine accuracy at rho=.55, .70, and .85, but absolute recovery stayed low and computation was slower, so this is promising evidence rather than a demonstrated practical win.
- Confidence: 6/10
- Limitations: This is a compact Gram-based approximation rather than the paper's full wide rooted bipartite tree family. Randomized contractions, learned tree weights, Sinkhorn training, Procrustes control, larger repetitions, and realistic embeddings were not tested; the absolute accuracy advantage was small.

### Practical benchmark

- Paired seeds: 8
- Baseline mean: 0
- Idea mean: 0
- p-value: 0.0163
- Paired wins: 1/8
- Benchmark verdict: idea worse (significant)

## Artifacts

- [bench_report.json](https://synthcore.org/code/1395/bench_report.json)
- [report.md](https://synthcore.org/code/1395/report.md)
- [report_bench_2026-09-04T194523.md](https://synthcore.org/code/1395/report_bench_2026-09-04T194523.md)
- [results.json](https://synthcore.org/code/1395/results.json)
- [stage2_bench.py](https://synthcore.org/code/1395/stage2_bench.py)
- [tree_alignment.py](https://synthcore.org/code/1395/tree_alignment.py)
- [Download all files as ZIP](https://synthcore.org/download/1395)

## Disclaimer

AI-generated research hypothesis, automatically tested. Not peer-reviewed.
