Phase & rotating frames
ARTI phase coordinates make the observer’s frame explicit. The operation is deterministic tensor geometry: it does not rotate token IDs, decode text, or infer a phase that was not supplied.
Alpha integration surface: the tensor inverse remains public in 1.7.0, while participant semantics and observer-frame model integration remain task-dependent. ARTI does not discover speakers, sources, or authorization rules.
Source, viewer, and observer are different axes
Section titled “Source, viewer, and observer are different axes”The caller supplies token ownership and the participant coordinate table. active_participant is the viewer or recipient and selects readability. observer_participant is the role whose next token is being predicted and selects the inverse reference frame. In ordinary assistant continuation these may be “latest non-assistant participant” and “assistant”; during training, set the observer explicitly when the target belongs to another role.
import arti
ctx = arti.build_participant_context( participant_ids, participant_coord, readable_by, assistant_id=0,)layer = arti.nn.Layer( dim=hidden_dim, coord_dim=participant_coord.shape[-1], coord_frame_mode="operator_bank",)out = layer( x, coord=ctx.coord, mask=ctx.mask, visibility=ctx.visibility, observer_coord=ctx.observer_coord, frame_operators=inverse_bank,)participant_ids → source coord ───────────────┐active participant → visibility (who reads) ├→ ARTI layerobserver participant → inverse operator ─────┘Paired rotation
Section titled “Paired rotation”paired_rotation treats adjacent latent channels as 2D pairs. coord[..., :2] must be [sin(theta), cos(theta)]; the latent dimension must be even. The inverse rotation maps observations back to a canonical frame without changing shape.
import torchfrom arti.torch import apply_coord_frame_inverse
theta = torch.tensor([[0.25, -0.75]]) # [B, N]coord = torch.stack([theta.sin(), theta.cos()], dim=-1) # [B, N, 2]observed = torch.randn(1, 2, 8) # [B, N, D], D even
canonical = apply_coord_frame_inverse( observed, coord, mode="paired_rotation")assert canonical.shape == observed.shapeFor each pair (even, odd), ARTI applies [[cos, sin], [-sin, cos]]. Coordinates are runtime evidence, not learned labels.
x [B,N,D] + phase coordinates [B,N,C]→ choose token frame or observer frame→ paired inverse rotation OR weighted operator bank→ canonicalized channels [B,N,D]Operator-bank observer frame
Section titled “Operator-bank observer frame”operator_bank generalizes phase to K supplied channel operators. coord is [B,N,K], frame_operators is [K,D,D], and x is [B,N,D]. Supplying observer_coord selects one observer frame for the context (or one per token).
import torchfrom arti.torch import apply_coord_frame_inverse
x = torch.randn(2, 5, 4) # [B, N, D]coord = torch.nn.functional.one_hot( torch.tensor([[0, 1, 0, 1, 0], [1, 0, 1, 0, 1]]), num_classes=2).float() # [B, N, K]operators = torch.stack([torch.eye(4), torch.eye(4)]) # [K, D, D]observer = torch.tensor([[1.0, 0.0], [0.0, 1.0]]) # [B, K]
y = apply_coord_frame_inverse( x, coord, mode="operator_bank", frame_operators=operators, observer_coord=observer,)assert y.shape == (2, 5, 4)observer_coord accepts [B,K], [B,1,K], or [B,N,K]. Without it, each token’s own coord drives the inverse. The operator bank is supplied by the caller and must actually represent the intended inverse transforms; ARTI does not verify physical correctness.
For one-hot observer coordinates, y = A_observer⁻¹ · x. If an owner produced x = A_owner · canonical, the observer receives A_observer⁻¹ · A_owner · canonical. A matching owner/observer frame returns the canonical representation; a different frame preserves the relative transform. A soft coordinate blend is a weighted operator mixture, not automatically a strict mathematical inverse.
Placement before source mixing
Section titled “Placement before source mixing”Externally meaningful source or participant phase belongs where tokens still map one-to-one to their source—normally immediately after embedding and before attention or other cross-token mixing. Once attention or pooling has mixed sources, assigning one original participant frame to the resulting hidden state may no longer have a rigorous meaning. Fallback coordinates are latent scaffolding, not discovered identity.
ARTIPhaseMixer is not the observer inverse
Section titled “ARTIPhaseMixer is not the observer inverse”ARTIPhaseMixer is a separate learned feature-mixing layer. It concatenates the current hidden state and coordinate, predicts a per-token softmax over learned MLP operators, modulates each candidate with a coordinate-conditioned receptor gain, and returns the weighted mixture:
z + coord→ operator softmax→ coordinate-conditioned receptor gain→ learned MLP operator candidates→ weighted feature mixtureIts diagnostics include operator_weights and phase_receptor_gain. It does not invert a caller-supplied frame, discover an observer, identify a source, fuse physical sensors, or recover a physical phase. Use apply_coord_frame_inverse for deterministic observer-frame geometry; use ARTIPhaseMixer when a trained model should learn coordinate-conditioned feature operators.
import torchfrom arti import ARTIPhaseMixer
mixer = ARTIPhaseMixer(hidden_dim=64, coord_dim=4, operator_count=3)mixed, operator_weights, receptor_gain = mixer( torch.randn(2, 12, 64), torch.randn(2, 12, 4),)assert mixed.shape == (2, 12, 64)assert operator_weights.shape == (2, 12, 3)assert receptor_gain.shape == (2, 12, 3, 64)Layer and Fit integration
Section titled “Layer and Fit integration”arti.nn.Layer(..., coord_frame_mode="paired_rotation") exposes the paired path. The observer-phase Fit profile uses operator_bank and requires runtime frame operators; missing operators raise an error instead of silently disabling the mechanism.
Stability and limits
Section titled “Stability and limits”apply_coord_frame_inverseremains public througharti.torchin 1.7.0; observer-phase Fit profiles are configurable but task-dependent.ARTIPhaseMixerremains public from the package root, but its task behavior is learned and must be evaluated separately from deterministic frame inversion.- PyTorch supports both modes; the JAX backend mirrors this functional contract when installed.
- Shape validation is strict.
paired_rotationrequires evenD; operator-bank coordinates must have exactlyKcomponents. - Canonicalization preserves supplied relative phase; it cannot recover an unknown or incorrect phase.