Full text
PhaseBrain: Torus-Based Semantic Dynamics Model A Multimodal Paradigm for Structural Representation, Probabilistic Angular Dynamics, and Semantic Phase Cohesion Anton Fedotov SynqraTech anvifedoto[email protected] ORCID: 0009-0004-2313-6530 December 4, 2025 Abstract We introduce PhaseBrain, a torus-based semantic dynamics model that treats perception, structure, and prediction as the evolution of angular states on a multidimensional torus TD . Instead of operating in an unconstrained Euclidean latent space, PhaseBrain represents signals as trajectories of phases and amplitudes and learns a single probabilistic law of phase increments shared across modalities and semantic channels. The core of the model is a probabilistic angular dynamics module parameterized by von Mises distributions, with concentration parameters κt serving as first-class measures of epistemic confidence in phase predictions. To make this geometry universal, we propose a Phase Interchange Framework (PIF) that maps heterogeneous data—text, code, audio, images, and time series—into phase sequences on TD with modality-specific frontends but a common downstream dynamics. Structural and semantic factors such as token identity, role (e.g., IF/THEN/END), and block depth are encoded as separate circular channels whose cross-channel relationships are quantified by phase-locking metrics (e.g., PLV). In this view, high-dimensional data structures become patterns of phase coherence and relative angular shifts rather than unstructured vectors. We report experiments showing that PhaseBrain can (i) improve structural consistency on synthetic grammars via multidimensional semantic phases, (ii) act as a phase-based grammar linter and controlled decoder for block closures, (iii) learn role automata and role taggers from text, (iv) serve as a latent phase classifier for simple shapes in images, and (v) expose calibrated uncertainty cones through ensemble and diffusion-style angular dynamics. Together, these results support torus-based semantic dynamics as a viable paradigm for interpretable, probabilistic, and multimodal representation of structure and temporal evolution. 1
1 Introduction Modern sequence and world models have achieved remarkable performance across language, vision, control, and simulation. Yet, beneath their success lies a common limitation: they typically operate in generic Euclidean latent spaces that do not encode the intrinsic topology, periodicity, or structural roles present in real data. As a result, the same architecture must re-learn compatible representations for each modality and task, and the geometry of the latent space itself provides little semantic guidance or interpretability. In this work we ask a different question: what if we fix a simple, universal geometry—a multidimensional torus TD —and design both representation and dynamics to respect its circular structure? We argue that many core phenomena in signals, semantics, and behavior are at least locally cyclic (phases, rhythms, roles, control loops, block structures), and that a torus-based formulation can turn these cycles into first-class objects of modeling and inference. 1.1 Problem: lack of a universal, structured dynamics space Despite their diversity, contemporary models share several structural gaps that motivate our approach: • No universal geometry of representation. Latent spaces are typically unconstrained Rd vectors, whose topology is not tied to the topology of the data (e.g., periodicity, cyclicity, or discrete role structure). • No single dynamics law across modalities. Text, audio, video, sensor data, and control trajectories require separate architectures or heavily tuned variants; there is no shared dynamical primitive that naturally spans them. • Limited structural interpretability. While attention weights and feature activations can be analyzed post hoc, models rarely have explicit coordinates for roles, block depths, or semantic channels that can be probed and constrained directly. • Weakly structured uncertainty. Uncertainty is usually modeled in Euclidean spaces with Gaussian or logit-based parameterizations; there is no native notion of angular uncertainty or confidence in cyclic structure. • No built-in periodicity. Periodic phenomena—phases of oscillators, daily or seasonal cycles, rotations, wrapping of indices—are often linearized or encoded via ad hoc features (e.g., sin /cos embeddings), rather than being fundamental to the state space. • No explicit topological coherence across channels. Multi-channel and multimodal signals often exhibit coherent phase relations (e.g., phase locking, stable 2
shifts), but existing models do not treat cross-channel phase alignment as a primary structural signal. These limitations suggest the need for a modeling paradigm in which topology, periodicity, structure, and uncertainty are not afterthoughts but are built into the latent space and its dynamics. 1.2 Limitations of existing approaches Transformers. Transformer-based models represent tokens as vectors in Rd and operate via attention and feedforward layers. While positional encodings occasionally use sinusoidal features, the latent dynamics themselves are not constrained to be periodic or angular. Transformers do not maintain explicit phase variables, do not model circular uncertainty, and do not provide direct structural channels for roles or block depths; such structure, if learned, is entangled in high-dimensional embeddings. State Space Models (SSM). Neural state space models approximate sequence dynamics by learning discrete-time updates in Rd . Their strength lies in efficient long-range propagation and linear-time inference, but their latent geometry is again Euclidean. Roles, nesting depths, and cyclic relations are not represented as explicit angular coordinates, and there is no inherent notion of phase locking or circular error. Latent World Models. Latent world models learn nonlinear dynamics in continuous latent spaces to support imagination, planning, and control. These latents are typically Gaussian or related continuous distributions, which are well suited for many tasks but do not encode the topology of cycles or discrete semantic axes. Periodicity and structural roles must be implicitly reconstructed by the network, with no guarantee of coherent angular structure. Graph Neural Networks (GNNs). Graph neural networks excel at exploiting known relational structure: nodes, edges, and neighborhoods are given as input. However, they assume a fixed or slowly changing graph topology and do not directly model dynamic syntactic scaffolds such as evolving block structures in programs or role transitions in sequences. GNNs also do not provide built-in circular coordinates or angular uncertainty; any such structure must be engineered separately. 1.3 Our thesis: torus-based semantic dynamics PhaseBrain departs from these designs by positing a simple but strong prior: All modalities and semantic channels can be represented as trajectories of phases and amplitudes on a multidimensional torus TD , governed by a shared 3
probabilistic law of angular dynamics, with structure emerging as patterns of phase coherence across channels. Concretely, we propose three core ideas: 1. Torus-based latent space. Each semantic or physical factor (token identity, syntactic role, block depth, class label, oscillator phase, etc.) is mapped to a circular coordinate. The joint latent state at time t is a point Θ t∈TD , not a generic vector in Rd. 2. Probabilistic angular dynamics. The temporal evolution of each channel is modeled as a distribution over phase increments, typically von Mises, with concentration parameters κtserving as calibrated measures of confidence in local dynamics. 3. Semantic phase cohesion. Structural relations are expressed through cross-channel phase statistics such as phase-locking value (PLV) and stable phase shifts. Roles, closures, and multimodal alignments correspond to coherent patterns in these angular relations rather than opaque configurations of Euclidean embeddings. To make this paradigm practical and multimodal, we introduce the Phase Interchange Framework (PIF) that maps diverse data into torus trajectories, enabling a single PhaseBrain core to operate across text, code, sensor signals, and images with a unified geometry and uncertainty model. 1.4 PhaseBrain as a Dynamical Semantic Model From an engineering standpoint, PhaseBrain occupies a point in the landscape that is orthogonal to most existing machine learning systems. Contemporary models can be roughly grouped into two main families: • Representers. Static or quasi-static mapping models that transform raw data into latent vectors or embeddings, such as language models, convolutional networks, and autoencoders. Their primary function is to produce useful representations; dynamics, if present, are typically handled by an external mechanism. • Dynamical predictors. Models whose main purpose is to predict the evolution of a state in time: state-space models, RNNs, sequence models with learned transition functions, and physical simulators. These systems focus on temporal evolution but usually operate in Euclidean, non-structured latent spaces. PhaseBrain is designed as a third type: a dynamical semantic model: a system whose latent state is explicitly semantic in the sense of structural roles, and whose primary operation is to predict and control the angular dynamics of those roles on a torus. 4
Here, “semantic” does not mean lexical meaning or human-level concepts; rather, it refers to phase structure: which token plays which role, how blocks open and close, how classes or modes are organized into stable phase clusters. “Dynamics” means predicting phase increments and role transitions over time. In other words, PhaseBrain is neither just a better representation encoder nor just another dynamical model. It combines: • torus-based semantic latent space that encodes roles, nesting, and class structure as circular coordinates, and • probabilistic angular dynamics that evolves these semantic phases with calibrated uncertainty (κ) and cross-channel coherence (PLV). To our knowledge, there are very few systems that aim to learn such structural dynamics on a torus across modalities. PhaseBrain thus fills a gap between static representers and generic dynamical predictors by providing a concrete, geometry-aware model of semantic phase evolution. 2 Background 2.1 Directional Statistics PhaseBrain is built on top of directional statistics, where the primary objects are angles on the unit circle S1 or their higher-dimensional counterparts. Let θ∈ ( −π, π ]denote a circular random variable and let {θi}N i=1 be i.i.d. samples. The basic sufficient statistic is the mean resultant in the complex plane: R=1 N N X i=1 eiθi∈C,(1) from which we obtain the circular mean and resultant length µcirc = arg(R),¯ R=|R| ∈ [0,1].(2) The quantity ¯ R is a measure of concentration: ¯ R≈ 1indicates that the angles cluster tightly around µcirc, while ¯ R≈0corresponds to near-uniform spread on the circle. The canonical unimodal distribution on S1is the von Mises distribution, often viewed as a circular analogue of the Gaussian. For θ∈(−π,π]it is defined as p(θ|µ, κ) = 1 2πI0(κ)expκcos(θ−µ),(3) where µ∈ ( −π, π ]is the mean direction, κ≥ 0is the concentration parameter, and I0 ( κ )is the modified Bessel function of the first kind of order zero. As κ→ 0, p ( θ )approaches the uniform distribution on (−π,π];asκ→ ∞, it concentrates around µ. 5
In PhaseBrain, von Mises distributions are used to model phase increments ∆ θt , and the corresponding concentration parameters κt are treated as first-class measures of model confidence in predicted angular dynamics. 2.2 Torus Geometry The natural extension of circular geometry to multiple semantic or physical channels is the D-dimensional torus TD=S1×···×S1 | {z } Dtimes ,(4) which can be represented as TD≡RD/(2πZ)D,(5) with the equivalence relation θ∼θ + 2 π kfor all k ∈ZD . A point on TD is a vector of angles θ= (θ(1), . . . , θ(D))with each component defined modulo 2π. Distances on TD are computed component-wise with circular wrapping. Given two points θ,ϕ∈TD, the wrapped difference is ∆θ(d)= wrapπθ(d)−ϕ(d)∈(−π,π],(6) and a simple choice of angular distance is dcirc(θ,ϕ) = v u u t D X d=1∆θ(d)2.(7) PhaseBrain leverages this geometry in two ways. First, each semantic or physical channel (e.g., token identity, syntactic role, block depth, class label) is assigned its own circular coordinate, yielding a joint state Θ t∈TD at each time step t . Second, the dynamics of these coordinates are modeled in terms of wrapped increments ∆ θt with circular loss functions, ensuring topological correctness: states never “leak” out of the torus into an unconstrained Euclidean space. 2.3 Phase-Based Representations Phase-based representations have a long history in signal processing and time–frequency analysis. A real-valued signal x(t)can be transformed into its analytic signal xa(t)=x(t)+iH[x](t),(8) where H [ x ]is the Hilbert transform of x . The analytic signal admits a polar decomposition xa(t)=A(t)eiϕ(t),(9) 6
where A ( t ) ≥ 0is the instantaneous amplitude and ϕ ( t )is the instantaneous phase. Phase unwrapping techniques track the evolution of ϕ ( t )across multiples of 2 π , while many time–frequency representations (e.g., STFT, wavelets) also yield phase information in each time–frequency bin. In discrete domains, angular encodings are also widely used. A common pattern is to map a discrete index j∈ {0, . . . , M −1}to an angle θj=2πj M,(10) and then use θj or ( cos θj,sin θj )as a circular coordinate or embedding. Such encodings respect the periodic structure of the underlying index, but are usually treated as feature engineering rather than as the primary latent geometry and dynamical state. PhaseBrain makes phase the central representational primitive: all modalities are mapped into sequences of phases and amplitudes, and all dynamics are expressed as probabilistic evolution of these angular states on TD. 3 The Phase Interchange Framework (PIF) A key ingredient of PhaseBrain is the Phase Interchange Framework (PIF), which acts as a universal interface between raw data and the torus-based dynamics core. PIF provides modality-specific frontends that map heterogeneous inputs into a common phase–amplitude format, enabling a single PhaseBrain core to operate across text, code, images, audio, and sensor streams. Figure 1 summarizes the overall PhaseBrain architecture, from raw modalities through PIF to the shared torus-based dynamics core and its phase-based outputs. 7
Raw modalities Text / Code / DSLs Images Audio Sensors & time series Phase Interchange Framework (PIF) Modality-specific frontends X → {(θt, at)}N−1 t=0 Phase Dynamics Core Probabilistic angular dynamics on TD ∆θt+1 ∼p(· | θt−k+1:t) PhaseMemory (complex exponential smoothing) von Mises parameters µt, κt Phase decoders Discrete tokens / roles / classes from phase Uncertainty κ Phase-based confidence profiles Phase coherence PLV, cross-channel structure, structural phase error modality-specific mapping phase–amplitude trajectories phase trajectories Shared torus-based semantic dynamics single law across all modalities Figure 1: High-level architecture of PhaseBrain. Raw heterogeneous modalities are mapped by the Phase Interchange Framework (PIF) into unified phase–amplitude trajectories ( θt, at ) on a multidimensional torus. A single torus-based Phase Dynamics Core applies probabilistic angular dynamics with PhaseMemory and von Mises parameters ( µt, κt ). Downstream phase-based heads decode discrete symbols, expose calibrated phase confidence via κ , and compute cross-channel coherence metrics such as PLV and structural phase error. Conceptually, this framework is built on top of the PhaseBridge Phase Interchange Format—a strict discrete-to-phase codec that maps finite alphabets to phases on the circle with lossless round-trip guarantees. In this work we generalize that format into a modalitylevel interpretation layer: modality-specific frontends map heterogeneous inputs into a 8
common phase–amplitude representation that is compatible with the PhaseBridge discrete phase codec. Formally, for a given modality X, PIF defines a mapping PIF : X −→ (θt, at)N−1 t=0 θt∈TD, at≥0,(11) where θt is a D -dimensional phase vector at time index t and at is a nonnegative amplitude or weight. At the implementation level, each phase coordinate can be associated with a finite alphabet size Md and encoded via the PhaseBridge discrete-to-phase mapping n7→ 2 πn/Md with a strict inverse; when raw data are continuous, they are first normalized and, if strict round-trip is required, quantized into such discrete alphabets. Once data have been passed through PIF, the PhaseBrain dynamics and decoders are modality-agnostic. 3.1 A Unified Interface for All Modalities The PIF design follows two principles: 1. Phase first. All salient degrees of freedom are encoded as angles on one or more circles, even when the underlying raw representation is discrete or Euclidean. 2. Separable frontends, shared core. The mapping from raw modality to phase is implemented by a lightweight, interpretable frontend, while the downstream PhaseBrain core (probabilistic angular dynamics, phase decoders, PLV-based structure) is shared across modalities. In the simplest case, PIF maps a univariate sequence {xt}N−1 t=0 to ( θt, at )with θt∈ [0 , 2 π ) obtained via a monotone normalization of xt followed by scaling by 2 π , and at representing amplitude, reliability, or energy. When strict PhaseBridge compatibility is desired, the normalized values are further quantized to a finite alphabet and encoded as θt = 2 πnt/M with nt∈ { 0 , . . . , M − 1 } . For multichannel data, each channel or semantic factor is given its own phase coordinate, forming an ND phase θt∈TD. 3.2 Text: Token / Role / Depth Phases For text (and code), PhaseBrain uses a three-channel semantic phase representation: •atoken channel encoding lexical identity; • arole channel encoding syntactic or semantic role (e.g., IF, THEN, ELSE, END, VAR); •adepth channel encoding block nesting depth. 9
5.1 Angular Dynamics on the Torus At each time step t , the core predicts a phase increment ∆ Θt+1 given the current phase state, phase memory, and local history. In the 1D case this reduces to ∆ˆ θt+1 = wrapπgϕ(xt),(25) where gϕ is a parametric learner (e.g., MLP) and xt is a feature vector built from a window of past increments and memory features. The new phase is then obtained via wrapped addition: ˆ θt+1 = wrap2πθt+ ∆ˆ θt+1.(26) In the ND case, with Θt∈TD , PhaseBrain predicts a vector of increments ∆ ˆ Θt+1 ∈RD , applies wrapπcomponent-wise, and updates ˆ Θt+1 = wrap2πΘt+ ∆ ˆ Θt+1,(27) ensuring that all channels remain on the torus. Training uses circular loss functions of the form ℓt= 1 −cos∆θtrue t+1 −∆ˆ θt+1(28) (and their ND extensions), which are invariant under 2 π -shifts and naturally aligned with the torus geometry. 5.2 Probabilistic Angular Model In the probabilistic variant, PhaseBrain does not output a single deterministic increment; it outputs parameters (µt, κt)of a von Mises distribution over ∆θt+1: p∆θt+1 xt=p∆θt+1 |µt(xt), κt(xt)=1 2πI0(κt)expκtcos∆θt+1 −µt.(29) The learner gϕ now maps features xt to raw parameters ( µraw t, κraw t ), which are converted via µt= wrapπµraw t, κt= softplusκraw t≥0.(30) The training loss is the negative log-likelihood ℓNLL t=−log p∆θtrue t+1 |µt, κt=−κtcos∆θtrue t+1 −µt+ log2πI0(κt),(31) optionally weighted by amplitudes at+1. In the ND case, each channel d has its own von Mises parameters ( µ(d) t, κ(d) t ), and the joint loss sums over channels. 16
5.3 κas a Confidence Measure The concentration parameter κtplays the role of a calibrated phase confidence: • high κt corresponds to a narrow von Mises distribution around µt , i.e., a concentrated forecast with low angular uncertainty; • low κt corresponds to a nearly uniform distribution on the circle, i.e., high uncertainty about the next phase increment. Operationally, κt controls the spread of stochastic trajectories sampled from the model. For ensembles or diffusion-like chains on the torus, steps with high κt yield tightly clustered predictions, while steps with low κt produce a wide “phase cone” of possible futures. This connects the local probabilistic dynamics to global uncertainty quantification on TD. In PhaseBrain, κtcan also be used as a signal for: • curriculum learning and sample re-weighting (emphasizing or de-emphasizing uncertain steps), •active selection of sequences (active learning), • controlled decoding, where highκ structural channels can constrain lowκ lexical channels. 5.4 PhaseMemory: Exponential Phase Averaging PhaseMemory is a lightweight, fully phase-aligned memory mechanism that summarizes the recent phase history via exponential smoothing on the complex plane. In the 1D case, given phases θtand weights at≥0, PhaseMemory maintains Mt=αMt−1+(1−α)ateiθt,(32) Wt=αWt−1+(1−α)at,(33) with M0= 0,W0= 0 and forgetting factor α∈[0,1). The normalized memory is ˜ Mt= Mt Wt , Wt>0, 0, Wt= 0, (34) from which we extract: µM(t) = arg˜ Mt, κM(t) = ˜ Mt ∈[0,1].(35) Here µM ( t )is the average phase of the recent history, and κM ( t )is a measure of how coherent that history is (1 means perfectly aligned phases, 0 means maximally dispersed). 17
These memory features are concatenated into the learner input xt , giving the core access to long-range structure without abandoning the phase geometry. In the ND case, PhaseMemory can be maintained per channel or as a global aggregate over channels, yielding per-channel (µ(d) M(t), κ(d) M(t)) or global (µagg(t), κagg(t)) features. 5.5 Multi-Channel Dynamics and Phase Locking For Θt∈TD , PhaseBrain models all channels jointly while keeping per-channel updates and loss functions simple. Interactions between channels are captured via phase-locking values (PLV) and cross-channel phase differences. Given two channels aand b, define the phase difference at time t ∆θ(a,b) t= wrapπθ(a) t−θ(b) t,(36) and the complex statistic zab =Ptwtei∆θ(a,b) t Ptwt+ε,(37) where wt≥0are optional weights. The PLV and average phase shift are then PLVab =|zab|∈[0,1], ϕab = arg(zab)∈(−π, π].(38) High PLVab indicates strong phase coupling between channels a and b (e.g., between token and role, or brightness and class), while low PLVab indicates independence or structural instability. PhaseBrain uses these measures both as diagnostic tools (for understanding learned structure) and as building blocks for controlled decoding, where a high-confidence structural channel can constrain or guide other channels during generation. In summary, the Phase Dynamics Core provides: •wrapped angular dynamics on TD, •a probabilistic von Mises model with κ-based confidence, •a phase-aligned memory with its own coherence measure κM(t), •and multi-channel interaction metrics via PLV. Together with PIF, this defines a complete torus-based semantic dynamics model that is shared across modalities. 6 Semantic Phase Cohesion: PLV and Structural Phase Error PhaseBrain uses phase relationships not only as a carrier of state (Section 4), but also as an explicit signal of semantic cohesion. Two central notions are: (i) phase locking between channels, quantified by PLV, and (ii) structural phase error on syntactically marked positions. Together they provide a geometric view of “how well a structure holds” in the torus space. 18
6.1 PLV as a Measure of Coherence Given two phase channels a and b with angles θ(a) t, θ(b) t∈ [0 , 2 π ), we define the wrapped phase difference ∆θ(a,b) t= wrapπθ(a) t−θ(b) t,(39) and the complex-valued average zab =1 N N−1 X t=0 exp i∆θ(a,b) t∈C.(40) The phase-locking value (PLV) and average phase shift are PLVab = zab ∈[0,1], ϕab = arg(zab)∈(−π,π].(41) Intuitively: •PLVab ≈1indicates a stable phase relation between channels aand b; •PLVab ≈0indicates decorrelation or structural disorder between the channels. In PhaseBrain, typical pairs include: •token vs. role channels (a=token, b =role)for text and code; •token vs. depth (a=token, b =depth)for block structure; •brightness vs. class (a=brightness, b =class)for images; •different sensor channels in multivariate time series. PLV thus provides a modality-agnostic scalar that quantifies how coherent a structure is in the torus geometry. 6.2 Structural Phase Error PhaseBrain distinguishes between ordinary positions and structurally marked positions, such as: •closing tokens in grammars (end,done,stop,else); •key events in protocols or workflows; •specific role tags in tagged sequences. 19
For such positions we can measure a dedicated structural phase error on the token channel. Let t∈ Tstruct be indices of structurally marked steps, and let θtrue t and ˆ θt denote true and predicted token phases. The structural phase error at time tis estruct t= wrapπθtrue t−ˆ θt,(42) and we report its circular magnitude in degrees errstruct deg =180 π·meant∈Tstruct estruct t .(43) This metric is complementary to the global phase error over all positions. It specifically measures how well the model respects structural constraints (e.g., correctly closing blocks) in its torus dynamics. In practice we observe that semantic ND models can reduce errstruct deg by nearly an order of magnitude compared to 1D baselines, while keeping the overall token-level error unchanged. 6.3 Role Phase Clusters and Structural Role IDs In ND text/code settings, PhaseBrain maintains at least two channels: a token channel and a role channel. After training, we can inspect the empirical phase clusters of roles and use them as a structural prior. Let j index tokens in the vocabulary, and let θ(role) t be the role-phase at time t . For each token j we collect all positions where jt = j and compute the circular mean of the role channel: ϕrole j= arg 1 |Tj|X t∈Tj exp i θ(role) t ,(44) where Tjis the set of time indices with token j. The mapping role_phase_map :j7→ ϕrole j(45) defines a role-phase cluster for each token: a canonical role angle on S1. For a set of structurally important tokens Sstruct (e.g., closing tokens), we can further decode each ϕrole j on the role channel via a strict PhaseDecoder to obtain discrete structural role IDs: structural_role_ids =(j, rj) j∈ Sstruct, rj= decode_role(ϕrole j).(46) During controlled decoding, these role-phase clusters are used as semantically meaningful attractors on the role channel. For example, when the model is constrained to be in an “END” role cluster, the role phase is clamped near ϕrole j for closing tokens, and the token decoder is restricted to tokens whose structural role ID matches this cluster. The resulting mechanism combines: 20
•learned phase clusters (from data), •explicit role constraints, •and token-level decoding, to improve the correctness of block closures and other structural choices. 7 Multimodal Phase Dynamics 7.1 A Universal Law for All Modalities Once data are passed through PIF, all modalities share the same representation type: sequences of phase–amplitude pairs on the torus TD (Section 3). PhaseBrain then applies one and the same set of laws: • Phase dynamics: autoregressive updates of the form Θt+1 = wrap2πΘt + ∆ Θt+1 ; • Probabilistic angular model: von Mises distributions on increments with concentration κtas a confidence signal; • Phase-based memory: exponential complex averaging and memory coherence κM(t); • Phase cohesion metrics: PLV across channels and structural phase error on marked positions. No modality-specific architecture is introduced at the level of the core dynamics: text, images, audio, and sensor streams all obey the same torus-based semantics. The only modality-specific component is PIF, which defines how raw data are mapped into phase channels and weights. 7.2 Multimodal as Output of a Single Geometry The phrase “multimodal as output of one geometry” captures the following design principle: instead of building different models for different modalities and then trying to align their embeddings, we impose a single geometric regime—torus-based semantic dynamics—and treat each modality as a particular view of trajectories on TD. Concretely: • Text/code is seen as a sequence of token, role, and depth phases, with structural errors and PLV(token,role) as key indicators of syntactic health. • Images are flattened into trajectories where brightness and class phases evolve jointly; classification emerges as decoding the class channel from a stable phase cluster. 21
• Audio and time-series are mapped to phases over frequency, energy, or sensor-specific axes; rhythm and regime changes become patterns of ∆Θtand local κt. • Cross-modal configurations (e.g., text + image, sensor + control signal) are simply higher-dimensional tori TD where different modality channels interact via PLV and shared phase dynamics. From this perspective, “being multimodal” is not an add-on; it is a direct consequence of enforcing a common torus geometry and probabilistic angular law on all channels. Structural invariants such as high PLV, low structural phase error, and coherent κ profiles become shared signals of good behavior across modalities, opening the door to unified diagnostics, control, and adaptation in a single PhaseBrain core. 8 Experiments We evaluate PhaseBrain on a set of synthetic and semi-real tasks that stress different aspects of the torus-based semantic dynamics paradigm: ND semantic structure, role coherence, phase-based structural control, probabilistic angular confidence, and multimodal classification. All experiments run on relatively small datasets and modest models, focusing on behavioral properties (structure, κ, PLV) rather than benchmark-scale scores. 8.1 ND Semantic Language We first compare a 1D language model on S1 ( PhaseLanguageMVP ) with a 3D semantic ND model ( PhaseLanguageSemanticMVP ) on a small synthetic grammar corpus. The PIF encodes each token into three phase channels: token, role, and block depth (Section 4). Setup. The corpus consists of short DSL-like programs with nested blocks ( IF/ELSE/END , loops, etc.). We construct: (i) 1D PIF (token-only); and (ii) ND PIF with three channels (token/role/depth). Both models share similar capacity (hidden size 32, window k = 2), and are trained for 3 epochs on the first 30 lines. Metrics. We measure: (i) mean phase error on the token channel; (ii) structural phase error on closing tokens (Section 6.2); and (iii) PLV between channels (token ↔ role, token↔depth, role↔depth) (Section 6.1). Results. On token-level phase error, both models perform similarly ( ≈ 40 ◦ mean absolute error). However, on closing tokens the ND semantic model reduces structural phase error from ≈ 47 . 1 ◦ (1D baseline) to ≈ 3 . 0 ◦ , almost an order-of-magnitude improvement. PLV analysis shows that token ↔ role and role ↔ depth relationships remain coherent after generation, indicating that the ND torus geometry preserves structural semantics beyond the lexical channel. 22
8.2 Phase Linter We then use the ND semantic model as a phase-based grammar linter. The idea is to detect structural anomalies (extra/missing closers, misplaced else , etc.) via phase metrics, without an explicit symbolic parser. As illustrated in Figure 3, injected grammar errors produce sharp spikes in structural phase error and local drops in token–role PLV. 1 4 8 12 16 0 60 120 180 grammar error Token index t Structural phase error (deg) Structural phase error 0 0.25 0.5 0.75 1.0 PLV(token, role) PLV(token, role) Figure 3: Structural phase error and token–role phase-locking value (PLV) around an injected grammar corruption in a toy control-flow sequence. The dashed vertical line marks the position of an artificial error (e.g., an extra END or a mis-placed ELSE ). PhaseBrain’s structural phase error exhibits a sharp spike at the error token, while the local token–role PLV simultaneously collapses, providing a purely phase-based signal for detecting structural anomalies without an explicit symbolic parser. Setup. We train PhaseLanguageSemanticMVP on the ND grammar corpus. At evaluation time we: (i) run teacher forcing on clean programs and programs with artificially injected structural errors; and (ii) record per-step structural phase error on closing tokens, κ on role/depth channels, and local PLV(token↔role) in sliding windows. Findings. On clean programs, peaks of structural phase error concentrate on closing tokens but remain moderate. When we inject structural faults (extra end , else without if, wrong closing type), we observe: •sharp spikes in structural phase error (often >100◦) at the offending token; •local drops in κrole(t)around the anomaly; 23
•disruptions of local PLV(token↔role). These effects provide a robust, differentiable signal of structural violations directly in the torus space, demonstrating that PhaseBrain can act as a grammar linter using only angular dynamics. 8.3 Controlled Phase Decoding Next we test whether semantic role information in the torus can be used for controlled decoding, enforcing correct structural closures. Setup. We compute a role-phase map role_phase_map : j7→ ϕrole j and structural role IDs for closing tokens ( end , done , stop ) as in Section 6.3. On structurally marked positions in the grammar corpus, we compare: • a baseline decoder that strictly decodes tokens from the predicted token and role phases; • a constrained decoder that clamps the role phase to the appropriate structural role cluster and then decodes tokens. Results. On 75 closing positions, the baseline produces a valid closing token in ≈ 52% of cases and exactly matches the true closer in ≈ 21% of cases. With structural role constraints, the rate of closing tokens increases to ≈ 64%, and exact matches rise to ≈ 53%. Thus, phase-level role constraints significantly improve block closure quality, providing a torus-native analogue of constrained decoding. 8.4 Pure Role Automata To disentangle semantic dynamics from lexical content, we consider a pure role experiment: only roles are meaningful, tokens are anonymous. Setup. We construct synthetic sequences of roles A/B/C. Tokens are drawn from a 6-symbol alphabet, with a fixed mapping to three roles. We encode two phase channels: symbol ID and role ID. Role dynamics follow either a Markov process with high stay probability or a deterministic cycle A→B→C→A. We train a 2D PhaseNDMVP model on these sequences. Results. After training, the model: • maintains three tight role clusters on the role channel (resultant length R≈ 0 . 9–1 . 0 for each role); 24
• exhibits strong PLV(symbol ↔ role) ( ≈ 0 . 93 on ground truth, ≈ 0 . 68 on generated sequences); • achieves ≈ 0 . 67 consistency between decoded roles and the roles implied by decoded symbols. This shows that PhaseBrain can learn abstract automata purely at the level of role dynamics on TD, independent of textual semantics. 8.5 Phase Role Tagging on Real Text We then probe PhaseBrain as a phase-based role tagger on a small, real Russian text corpus (stress_corpus), to see whether role structure emerges in the torus. Setup. We tokenize text by whitespace and define heuristic roles based on frequency and punctuation: MID , PUNCT , RARE . PIF encodes token ID and role ID as two phases. A 2D PhaseNDMVP model is trained for 5 epochs on two long sequences. Metrics. We evaluate: (i) role accuracy on generated continuations; (ii) role confusion matrix; (iii) PLV(token↔role); and (iv) circular statistics of role phase clusters. Results. While raw tagging accuracy on held-out tails is modest ( ≈ 21% in a challenging low-data regime), the phase geometry is well-structured: •role phase clusters are tight (R≈0.89–0.97 for generated roles), especially for RARE; • PLV(token ↔ role) degrades from ground truth to generated text, but remains non-zero, quantifying the loss of structure; •the confusion matrix reflects sensible confusions between MID and RARE. Thus, even without supervised tagging and at tiny scale, the torus representation organizes roles into stable phase clusters that can be exploited by downstream decoders. 8.6 ND Shape Classification We test a fully non-textual, image-based setting, where the goal is to classify simple geometric shapes using only phase clusters on an ND torus, without any convolutional structure. Setup. We generate 24 × 24 grayscale images of three shape classes: circle, square, triangle. Each image is flattened to length N = H·W . We define two phase channels: brightness and shape class. Brightness is mapped linearly to [0 , 2 π ); the class phase is a per-class constant. Amplitudes are set to 1. A 2D PhaseNDMVP is trained on 48 images (16 per class) for 4 epochs and evaluated on 24 test images (8 per class). 25
PhaseBrain, in contrast, defines phase diffusion: sampling increments from von Mises distributions around angular predictions, analyzing diffusion chains on S1 and TD , and interpreting κ as a concentration parameter that governs angular spread. This leads to a notion of “phase cone of uncertainty” around a trajectory which is geometrically different from Euclidean diffusion. Summary. Overall, PhaseBrain does not attempt to replace Transformers, SSMs, world models, GNNs or diffusion models. Instead, it fills a structural niche that is largely absent in existing architectures: •an explicitly toroidal latent geometry for semantic roles; •probabilistic angular dynamics with κas confidence; •cross-channel phase coherence (PLV) as a structural signal. These properties make PhaseBrain a natural candidate for integration with existing models as a structural controller or diagnostic module for multimodal systems. Across these comparisons, a unifying perspective emerges: Transformers, state-space models, latent world models, graph neural networks, and diffusion models each occupy different points along the axes of representation quality and temporal prediction, but they rarely make the structural dynamics of roles a first-class object. PhaseBrain explicitly targets this third axis, acting as a dynamical semantic model where the latent state is a structured torus and the core operation is to predict and regulate semantic phase evolution. 10 Limitations and Scope PhaseBrain introduces a new geometric and probabilistic perspective on structure, but it has clear limitations and a specific scope of applicability. 10.1 PhaseBrain Is Not Semantic Meaning PhaseBrain does not learn or represent lexical meaning in the sense of distributional semantics or world knowledge. Its primary focus is: • structural roles (e.g., openers/closers, punctuation-like roles, rare vs. common tokens); •block depth and control structure; •phase patterns in multimodal signals. In text experiments, PhaseBrain “knows” how tokens are used structurally and how roles evolve, but not what words mean in a human sense. 32
10.2 Phase Does Not Encode Category Semantics Angular coordinates in PhaseBrain encode categories as roles and dynamics, not as semantic concepts. For example: • a phase cluster may represent “closing token” or “rare token” rather than the concept of a specific keyword; • in images, class phases encode “this is class 0/1/2” rather than visual attributes such as color or texture. This is by design: PhaseBrain emphasizes structural and dynamical semantics (who closes what, which block we are in, which mode we are in), not high-level semantic content. 10.3 Dependence on PIF Encoding PhaseBrain relies on the Phase Interchange Framework (PIF) to map raw modalities (text, audio, images, sensor signals) into phases (and optionally amplitudes). The quality of PIF directly bounds what PhaseBrain can learn: • poorly designed PIFs may collapse important distinctions or introduce degenerate phase mappings; • different PIF choices for the same data can lead to different latent structures and performance. In this sense, PhaseBrain is an engine for torus-based dynamics, but it depends on domainspecific PIF frontends to expose meaningful structure. 10.4 Complementary to LLMs, Not a Replacement PhaseBrain is not intended as a standalone replacement for large language models or high-capacity multimodal models. Instead, it is best viewed as a complementary component that can: •track and control structural aspects of generation (block closures, roles, modes); • provide calibrated angular uncertainty ( κ ) and PLV-based diagnostics of structural coherence; • offer a unified geometric layer across modalities where the same torus dynamics applies to text, audio, images and sensor data. Future work includes: •integrating PhaseBrain as a structural controller on top of LLM decoders; 33
•exploring larger-scale PIF+PhaseBrain systems for real-world multimodal tasks; •refining κcalibration and PIF design for richer semantics. Within this scope, PhaseBrain aims to establish torus-based semantic dynamics as a reusable building block for structurally aware, multimodal systems. 11 Applications PhaseBrain is designed as a generic engine for torus-based semantic dynamics rather than a task-specific architecture. In this section we outline several application domains where the combination of phase representations, probabilistic angular dynamics and cross-channel coherence (PLV) is particularly natural. 11.1 Industrial / IoT Many industrial and IoT systems exhibit inherent cycles and rhythms: daily load profiles, rotating machinery, batch processes, periodic maintenance routines. PhaseBrain provides: • Cycle-aware state: operating conditions are encoded as phases on S1 or TD (e.g., machine cycle, time-of-day, process stage), with wrapped dynamics θt+1 = wrap(θt+ ∆θt); • Phase-based forecasting: probabilistic von Mises dynamics for ∆ θt yields forecasts of future phase (“where in the cycle the system will be”) together with κ as a confidence signal; • Anomaly detection: abrupt changes in phase increments, drops in κ , or PLV breakdown between channels (e.g., torque vs vibration) signal structural anomalies, not just scalar outliers; • Phase-state monitoring: instead of tracking dozens of raw time series, operators can monitor a small set of phases and phase-locking relations as a compact structural view of the process. Here the torus geometry directly reflects the cyclical nature of industrial processes, and κ/PLV provide interpretable diagnostics for state-of-health and regime changes. 11.2 Programming Languages and DSLs Programming languages, configuration DSLs and templating systems have strong, nested block structure (e.g., if/then/else/end, loops, scopes). PhaseBrain can act as a structural layer for: 34
• Phase-based linting: structural phase error on closing tokens (end/done/stop) and κ -role profiles highlight mismatched blocks, missing closers and invalid role sequences; • Autocompletion: controlled phase decoding (using role-phase clusters and structuralrole constraints) biases token selection towards structurally valid closers and continuations; • Structural control: during generation or refactoring, PLV(token ↔ role, role ↔ depth) can be monitored and enforced to maintain syntactic integrity, independently of textual semantics. In this setting PhaseBrain complements syntax trees and parsers by providing a continuous, probabilistic view of structural consistency in a torus geometry. 11.3 Workflow and Protocol Modeling Business workflows, communication protocols and human-in-the-loop processes often resemble automata over roles and states. PhaseBrain models these as role channels on TD: • Role dynamics: discrete states (e.g., INIT,REVIEW,APPROVED,FAILED) are mapped to phases, and their transitions are learned as angular dynamics; • Phase-locked sub-processes: multiple parallel roles or streams (human, system, external service) become channels whose PLV indicates synchronization and correct hand-offs; • Compliance and deviation: deviations from learned phase patterns (unexpected jumps, broken PLV) identify workflow violations or novel behaviours. Unlike static graph models, PhaseBrain represents workflow structure as evolving phase patterns, naturally capturing loops, retries and multi-party coordination. 11.4 Robotics and Control Robotic behaviours and control policies often involve limit cycles, gaits, rhythmic controllers and multi-oscillator coordination. PhaseBrain is well-suited to: • Model limit cycles: stable behaviours correspond to attractors in phase space; κ and diffusion experiments quantify robustness of these cycles; • Multi-joint coordination: phases per joint or actuator live on TD , with PLV capturing gait coherence and phase relations between limbs; 35
• Mode switching: control modes (walk/run/stop/turn) can be represented as roles on a dedicated phase channel, with controlled decoding enforcing valid transitions; • Phase-state feedback: controllers can use phase and κ as compact summaries of where the robot is in its behavioural cycle, enabling phase-based feedback and synchronization. Here the torus is not just a metaphor: many control problems are naturally angular, and uncertainty about phase is more meaningful than uncertainty in arbitrary Euclidean coordinates. 11.5 Multimodal World Modeling Through PIF, heterogeneous modalities (text, images, audio, sensors) are mapped into a unified torus-based representation: • Single geometric law: every modality is represented as phase trajectories on TD with the same angular dynamics, κ -confidence and PLV-based cross-channel structure; • Cross-modal structure: PLV and structural phase error can be computed not only within a modality (e.g., token vs role) but across modalities (e.g., audio envelope vs visual motion, text role vs sensor state); • Structural backbone: PhaseBrain can act as a common structural layer beneath multimodal encoders/decoders, providing modality-agnostic signals about cycles, roles and phase coherence that higher-level models (e.g., LLMs or vision-language models) can use for control and diagnostics. In this view, multimodality is “the output of one geometry”: different sensors and channels become different coordinates on TD , governed by the same probabilistic angular law. 12 Conclusion PhaseBrain introduces a torus-based semantic dynamics paradigm in which: • Representation is phase: data from multiple modalities are mapped via PIF into angular coordinates on TD; • Meaning is structure: the model focuses on roles, block depth, cycles and automatalike patterns rather than on lexical semantics; • Connection is coherence: relations between channels are quantified by phaselocking (PLV) and structural phase error, providing interpretable structural signals; 36
• Confidence is κ : angular uncertainty is modeled explicitly through von Mises concentration, enabling calibrated forecasts, ensembles and diffusion processes; • Dynamics is angular increments: evolution proceeds by wrapped phase increments ∆θtunder a single, probabilistic law; • Multimodality is one law: all modalities share the same torus geometry and dynamic principles, differing only in their PIF frontends and channel semantics. Empirical results on synthetic trajectories, grammatical languages, role automata, real text role tagging and simple image classification support the viability of this approach and demonstrate that structural phase cohesion can be learned, measured and controlled. We view PhaseBrain not as a competitor to Transformers, SSMs, world models or diffusion models, but as a structural layer that brings directional statistics and torus geometry into practical modeling. Future work includes scaling PIF+PhaseBrain to richer corpora and sensors, integrating it as a structural controller for large language and multimodal models, and further developing the theory of semantic phase cohesion on TD. References [1] K. V. Mardia and P. E. Jupp. Directional Statistics. John Wiley & Sons, 2000. [2] N. I. Fisher, T. Lewis, and B. J. J. Embleton. Statistical Analysis of Spherical Data. Cambridge University Press, 1993. [3] J.-P. Lachaux, E. Rodriguez, J. Martinerie, and F. J. Varela. Measuring phase synchrony in brain signals. Human Brain Mapping, 8(4):194–208, 1999. [4] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, Ł. Kaiser, and I. Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems 30 (NeurIPS), 2017. [5] T. B. Brown, B. Mann, N. Ryder, M. Subbiah, J. D. Kaplan, P. Dhariwal, A. Neelakantan, P. Shyam, G. Sastry, A. Askell, et al. Language models are few-shot learners. In Advances in Neural Information Processing Systems 33 (NeurIPS), 2020. [6] A. Gu, K. Goel, and C. Ré. Efficiently modeling long sequences with structured state spaces. In International Conference on Learning Representations (ICLR), 2022. [7] D. Ha and J. Schmidhuber. World models. Neural Networks, 119:446–461, 2019. (originally arXiv:1803.10122, 2018). [8] D. Hafner, T. Lillicrap, I. Fischer, R. Villegas, D. Ha, H. Lee, and J. Davidson. Learning latent dynamics for planning from pixels. In International Conference on Machine Learning (ICML), 2019. 37
[9] D. Hafner, T. Lillicrap, J. Ba, and M. Norouzi. Dream to control: Learning behaviors by latent imagination. In International Conference on Learning Representations (ICLR), 2020. [10] D. P. Kingma and M. Welling. Auto-encoding variational Bayes. arXiv:1312.6114, 2013. [11] J. Ho, A. Jain, and P. Abbeel. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems 33 (NeurIPS), 2020. [12] Y. Song, J. Sohl-Dickstein, D. P. Kingma, A. Kumar, S. Ermon, and B. Poole. Scorebased generative modeling through stochastic differential equations. In International Conference on Learning Representations (ICLR), 2021. [13] F. Scarselli, M. Gori, A. C. Tsoi, M. Hagenbuchner, and G. Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61–80, 2009. [14] J. Zhou, G. Cui, S. Hu, Z. Zhang, C. Yang, Z. Liu, L. Wang, C. Li, and M. Sun. Graph neural networks: A review of methods and applications. AI Open, 1:57–81, 2020. 38