polyformer Learned rotations

Composition lab

Learning to turn

Holonomy attention gives every token a rotation and reads the products of those rotations in the order the tokens appear. Carry a frame along a sequence to see what it computes, then compare the sixty rotations one head learned with the true symmetries of an icosahedron.

Model

Carry a frame

Each token is one of the sixty rotations. To relate a group of tokens, the layer multiplies their rotations in sequence order. That is the same as walking along the sequence with a frame and turning it only at the chosen tokens: the frame at the end is the product.

tokenits rotationcarried frame12345678end and start0°

Turning at tokens 1, 4 and 6, the frame comes back unturned. These three moves undo each other.

The same moves with the first two swapped leave it turned by 120°: the term depends on the order.

marks each token that belongs to three tokens, in order, whose moves undo each other: what the task asks the layer to find. Click tokens to choose them.

The computation

The layer never lists the groups. A running product from the left collects, for every size, the ordered products before each token; one from the right collects those after it; and a group containing token i is one of each with Mi between them. Every size up to K is read out into the token's features. Paper, section on holonomy attention

Σ

The sixty rotations, ideal and learned

Element 13(1 2)(3 4)
Ideal symmetryComputed from the group law
Ideal reference Switch to Recorded to compare

The solid dot tracks one vertex. The open dot marks its starting point. A symmetry returns the shape to itself while moving its vertices.

Choose a rotationAll 60 group elements

Same moves. Different ending.

Apply rotation A then B, or B then A. The marked vertex ends in different places: these moves do not commute. A is element 01; B is element 12.

A → BAfter both moves
B → AAfter both moves