# Noncommutative path-word pooling

- ID: 412
- Canonical URL: https://synthcore.org/idea/412/noncommutative-path-word-pooling
- API JSON: https://synthcore.org/api/idea/412.json
- API Markdown: https://synthcore.org/api/idea/412.md
- Verification status: unverified
- Source: [arXiv:2607.04737](https://arxiv.org/abs/2607.04737)
- Category: architecture
- Solves: accuracy, generalization
- ML areas: transformer, graph-nn, embedding, regularization
- Math tags: algebraic-topology, algebra, topology
- Ratings: usefulness 5/10; difficulty 6/10; novelty 8/10

## Idea description

Replace ordinary bag-of-events pooling for an ordered trajectory, graph walk, or token event stream with a reduced-word representation in a free group. Each event contributes a signed group word, and the model aggregates signed differences (w-1), preserving order-sensitive information while making explicitly paired local events cancel.

## Mathematical statement

The paper's index polynomial has the form I(D)=sum over c in C(D) of sign(c) times iota(c), where C(D) is the set of crossings, sign(c) is either +1 or -1, and iota(c) is an invariant label. Its homotopy version uses group-valued labels h(c) and computes H_o(K)=sum over crossings with o(c)=1 of sign(c)(h(c)-1), and H_u(K)=sum over crossings with o(c)=-1 of sign(c)(h(c)-1). Here o(c) is an orientation class and h(c) is a reduced word in a noncommutative group generated by x and y, with x inverse times x and x times x inverse cancelled. The crucial property is that ordered words remain distinct, for example xy is not equal to yx, while paired local events with opposite signs cancel in the group algebra. The paper also gives P_D(t)=H_o(K)(t^{-1})+H_u(K)(t), showing that abelianizing the words recovers a weaker scalar polynomial.

## Key formulas

- $$I(D)=\sum_{c\in\mathcal{C}(D)}\operatorname{sign}(c)\,\iota(c)$$
- $$H_o(K)=\sum_{c:o(c)=1}\operatorname{sign}(c)\bigl(h(c)-1\bigr),\qquad H_u(K)=\sum_{c:o(c)=-1}\operatorname{sign}(c)\bigl(h(c)-1\bigr)$$
- $$P_D(t)=\sum_{c\in\mathcal{C}(D)}\operatorname{sign}(c)\bigl(t^{w(c)}-1\bigr)=H_o(K)(t^{-1})+H_u(K)(t)$$
- $$\Phi_{\mathrm{NC}}(s_{1:T})=\sum_{i=1}^{T}\sigma_i\left(\operatorname{Reduce}(w_i)-1\right),\qquad w_i\in F_r$$

## Implementation notes

Integrate this at the representation-pooling stage for an ordered event stream, trajectory, or graph walk, before the final Transformer or MLP head. Choose a small free group F_r with generators g_1 through g_r; in the first MVP use r=4. For each input event e_i, use a linear projection of its embedding to produce a generator index a_i, an orientation bit o_i, and a sign sigma_i. Let w_i be the ordered word accumulated around event i: append g_{a_i} or its inverse, then reduce the stack by cancelling adjacent inverse pairs. Maintain two sparse hash maps, one for H_o and one for H_u, from reduced words to floating-point coefficients. For every event, add sigma_i to the coefficient of w_i and subtract sigma_i from the empty-word coefficient, exactly implementing h(c)-1. Embed each retained word with a learned sum of position-sensitive generator vectors followed by a small GRU over the word; pool coefficient-weighted word embeddings and concatenate them with the ordinary final hidden state. Pseudocode: initialize an empty stack and maps; for each e_i, predict (a_i,o_i,sigma_i), update and reduce the stack, set w_i to the current stack, update H_o[w_i] or H_u[w_i] by sigma_i, and update the empty-word coefficient by -sigma_i; finally compute z=sum over words w of H_o[w]E_o(w)+H_u[w]E_u(w). The paper supplies the signed group-algebra construction and cancellation principle; the event-to-generator predictor and word embeddings are learned. Start on synthetic sequence classification where labels depend on xy versus yx, and on a real trajectory or graph-walk benchmark. Compare a Transformer with mean pooling, commutative count pooling, and this module at equal parameter count. Success is higher accuracy on order-sensitive tasks and improved robustness under insertion of cancelling event pairs; test that xy and yx remain separable while gg^{-1} insertions leave the pooled representation nearly unchanged.

## Disclaimer

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