---
title: Morlet Positional Encoding (MoPE)
url: https://www.emergentmind.com/topics/morlet-positional-encoding-mope
type: topic
---

# Morlet Positional Encoding (MoPE)

Searching arXiv for the cited MoPE papers and closely related references.
Morlet Positional Encoding (MoPE) is a wavelet-based positional encoding for transformer architectures in which each embedding-dimension pair learns both a characteristic frequency $\omega_i$ and a locality bandwidth $\sigma_i$, producing Gaussian-windowed sinusoidal features that are localized jointly in position and frequency. In the formulation introduced by Zeris, MoPE replaces fixed, nonlocal sin/cos features with learned Morlet-like atoms, thereby making the spatial extent of positional influence a learned property rather than a fixed design choice. The encoding strictly generalizes sinusoidal positional encoding through the $\sigma_i \to \infty$ limit, and its phase recovers the RoPE rotation angle, while its Gaussian amplitude adds a locality prior absent from standard sin/cos PE and RoPE [2605.26355; 2606.01258].

## 1. Conceptual role in transformer position modeling

MoPE was proposed to address what the underlying papers describe as a missing inductive bias in standard attention: locality, and specifically *scale-selective locality*. Standard sin/cos positional encoding assigns fixed frequencies to embedding dimensions without a spatial envelope, so every position contributes globally at every scale. RoPE encodes relative position via rotations, but it likewise uses fixed, nonlocal frequencies. In this framing, MoPE answers the question of *where* positional information should matter, and *at what scale* [2605.26355].

The motivating claim is that real sequences contain phenomena operating over distinct positional ranges. Character-level patterns are highly local, whereas clause- and sentence-level dependencies may span tens to hundreds of tokens. MoPE is intended to let each embedding dimension learn both a frequency and the range over which that frequency remains informative. This gives each dimension its own notion of “how far” positional influence extends.

The wavelet basis is central to that motivation. The Morlet, or Gabor, atom is a Gaussian-windowed sinusoid, and the papers characterize it as achieving minimum-uncertainty localization in position and frequency within the Gaussian window class. This makes it a natural mechanism for injecting locality without discarding oscillatory phase structure. In the broader architecture proposed in the companion work, MoPE supplies the locality inductive bias, while Energy-Gated Attention (EGA) supplies salience, or “what to attend to” [2606.01258].

## 2. Formal definition and induced kernel

In real form, for token position $b$ and embedding dimension pair $(2i,2i+1)$, MoPE is defined as

$$
MoPE(b, 2i) = \cos(\omega_i b) \cdot e^{-b^2/2\sigma_i^2}
$$

$$
MoPE(b, 2i+1) = \sin(\omega_i b) \cdot e^{-b^2/2\sigma_i^2}.
$$

Here $\omega_i$ and $\sigma_i$ are learned per embedding-dimension pair. The implementation uses real-valued features; no complex arithmetic is required. For analysis, the same object is also written in complex form as

$$
\text{MoPE}(b, i) = e^{i\omega_i b}\cdot e^{-b^2/2\sigma_i^2},
$$

which makes the phase–amplitude decomposition explicit: the phase is $\omega_i b$, and the amplitude is the Gaussian envelope $e^{-b^2/2\sigma_i^2}$ [2606.01258].

A key limiting case is

$$
\lim_{\sigma_i\to\infty} MoPE(b,2i) = \cos(\omega_i b),
$$

with the analogous result for the sine channel. This establishes sinusoidal PE as a degenerate, nonlocal case of MoPE. The same limit also removes the Gaussian amplitude from the correlation structure, yielding the RoPE phase factor [2605.26355].

The lag-space structure induced by MoPE is central to its interpretation. In the same-scale autocorrelation view, ignoring boundary effects, the kernel has the Morlet-like form

$$
C_i(\tau) \propto e^{-\tau^2/4\sigma_i^2} \cdot \cos(\omega_i\tau).
$$

The first factor encodes locality through Gaussian decay in lag $\tau$; the second encodes periodicity at frequency $\omega_i$. Fine scales, with small $\sigma_i$, decay quickly and emphasize local structure. Coarse scales, with large $\sigma_i$, decay more slowly and can represent longer dependencies [2605.26355].

The more exact cross-correlation written in the second paper is

$$
C_\text{MoPE}(b,\tau) = \cos(\omega_i\tau) \cdot e^{-(2b^2+2b\tau+\tau^2)/2\sigma_i^2}.
$$

Under the paper’s heuristic position-averaging assumptions, this approximately factorizes into the RoPE phase term multiplied by a Gaussian locality kernel in $\tau$. This suggests that MoPE can be interpreted as RoPE-like phase behavior with learned distance-sensitive attenuation [2606.01258].

## 3. Admissibility, parameterization, and optimization constraints

MoPE is grounded in the complex Morlet atom

$$
\psi(t) = e^{i\omega_0 t} \cdot e^{-t^2/2},
$$

which is described as approximately admissible when $\omega_0 \ge 5$. The admissibility discussion is operationalized through the product constraint

$$
\omega_i \sigma_i \ge 5.
$$

One paper describes this as enforcing an “admissibility minimum” during training; the other expresses it through a forward-pass projection

$$
\omega_i \leftarrow \max(\omega_i,\, 5/\sigma_i),
$$

which defines the wavelet admissibility boundary $\omega\sigma=5$ in the $(\omega,\sigma)$ plane [2605.26355; 2606.01258].

Both $\omega_i$ and $\sigma_i$ are stored in log space to ensure positivity. The implementation uses one frequency and one bandwidth per sin/cos pair, giving $d/2$ learned frequencies and $d/2$ learned bandwidths for a $d$-dimensional positional vector. The granularity is per embedding dimension rather than per head or per layer. Because the projection matrices for $Q$ and $K$ split embedding dimensions across heads, dimension-local MoPE affects each head that draws on those dimensions [2605.26355].

Initialization is dyadic-like: frequencies are spaced up to approximately $\pi \cdot 0.99$, and bandwidths are initialized as $\sigma_i = 5/\omega_i$ so that $\omega_i\sigma_i = 5$ at the start of training. The papers treat this boundary as both an admissibility device and a structural prior. They also note that projection-based enforcement may bias optimization, and explicitly caution that unconstrained or penalty-based validation is needed to determine whether boundary saturation is intrinsic or an artifact of the clamp [2606.01258].

The Heisenberg interpretation follows directly from the Gaussian window:

$$
\Delta b_i = \sigma_i,\qquad \Delta\omega_i = \frac{1}{2\sigma_i},\qquad \Delta b_i \cdot \Delta\omega_i = \frac{1}{2}.
$$

Within the Gaussian class, this is the minimum uncertainty product. The significance attributed to this fact is not that MoPE guarantees better downstream performance, but that it supplies a principled basis for trading positional localization against frequency localization [2606.01258].

## 4. Integration into attention and relation to existing positional schemes

MoPE is used as an absolute positional encoding added directly to token embeddings:

$$
x'_b = x_b + p_b,\quad p_b[d] \equiv MoPE(b,d).
$$

Queries, keys, and values are then computed in the usual way,

$$
q_b = x'_b W_Q,\quad k_b = x'_b W_K,\quad v_b = x'_b W_V.
$$

Its effect on attention is therefore indirect: it modifies $Q$ and $K$ through the added positional vector, but it does not directly alter value aggregation and does not apply rotary operations. The implementation is explicitly additive [2605.26355].

The computational cost is modest. Computing MoPE features costs $O(T\cdot d)$ per forward pass, comparable to fixed sin/cos PE, with the incremental overhead arising from learned parameters and the Gaussian envelope. The papers state that this overhead is negligible relative to attention’s $O(T^2\cdot d_k)$ cost. Parameter growth is also small: MoPE adds $O(d)$ learnable parameters [2605.26355].

The papers place MoPE in direct relation to three standard positional mechanisms. First, sinusoidal PE is the $\sigma\to\infty$ limit of MoPE. Second, RoPE is recovered at the phase level in the same limit: the MoPE phase difference between positions $b$ and $b+\tau$ is $\omega_i\tau$, exactly matching the RoPE rotation angle when $\omega_i$ is identified with RoPE’s $\theta_i$. However, the additive MoPE mechanism is not equivalent to RoPE’s rotational composition in $Q/K$ space. Third, ALiBi is described as corresponding qualitatively to the zero-frequency limit $\omega=0$, i.e., a pure locality envelope without oscillation [2605.26355; 2606.01258].

A common misconception is therefore that MoPE is merely RoPE with a different initialization or merely sinusoidal PE with learnable frequencies. The papers argue for a stronger claim: MoPE preserves sinusoidal phase structure while adding a learned Gaussian locality kernel. Its novelty lies in the amplitude term, not in replacing oscillatory phase with a different phase law [2606.01258].

## 5. Complementarity with Energy-Gated Attention and empirical results

The empirical setting reported for MoPE is small-scale: a GPT-style decoder with $L=6$ layers, $H=8$ heads, $d=256$, context length $T=256$, trained for 5,000 steps with AdamW and cosine learning-rate decay starting at $3\times 10^{-4}$ on character-level TinyShakespeare, with identical mini-batches across models and total parameter count at or below 6M [2605.26355].

In that setting, MoPE by itself does not outperform the main baseline, whereas its combination with Energy-Gated Attention does. The core interpretation is that MoPE supplies adaptive locality and EGA supplies salience; the papers treat these as complementary inductive biases that affect different parts of the computation. MoPE alters the position-aware content of $Q/K$, while EGA reweights which tokens contribute during aggregation [2605.26355].

The reported validation losses are as follows:

| Model | Validation loss | $\Delta$ vs BASE-DOT |
|---|---:|---:|
| BASE-DOT | 1.4742 | reference |
| PE-SINCOS | 1.5863 | -0.112 |
| PE-ROPE | 1.4637 | +0.011 |
| PE-MORLET | 1.5060 | -0.032 |
| EGA-1 | 1.3821 | +0.092 |
| EGA-MORLET | 1.3550 | +0.119 |

Two empirical points are emphasized. First, MoPE alone underperforms BASE-DOT by $0.032$, although it outperforms fixed sin/cos by $0.080$. Second, the combination EGA+MoPE improves over BASE-DOT by $0.119$, exceeding the sum of the isolated effects of EGA and MoPE, $(+0.092) + (-0.032) = +0.060$, by an excess of $+0.059$. The first paper identifies this superadditivity as the central empirical finding and states that it was observed across two independent training runs; the second paper presents the same interaction as evidence that salience and locality are complementary [2605.26355; 2606.01258].

The EGA component is described in the first paper through a learned energy projection, z-normalization, logistic gating, and renormalization of attention weights. The companion MoPE paper cites the EGA mechanism as originating in Zeris (2026a) and does not reproduce the gating equations, but consistently uses the “EGA-1 energy gate” configuration [2605.21842; 2606.01258].

## 6. Learned parameter behavior, limitations, and proposed extensions

A striking empirical observation from the second paper is that all 128 learned frequency–bandwidth pairs satisfy $\omega_i\sigma_i=5.000$ exactly after training, meaning that every dimension saturates the admissibility boundary. The learned ranges are reported as $\sigma_i \in [1.49, 4.50]$ tokens and $\omega_i \in [1.112, 3.346]$, implying that the learned positional capacity concentrates at character-to-short-word scale in the TinyShakespeare setting. Both sine and cosine channels receive non-zero downstream weights, which the paper interprets as evidence that the model uses the full quadrature representation [2606.01258].

The same papers, however, explicitly warn against overinterpreting these findings. Most results are single-seed, all experiments are at small scale, and effects of at most $\pm 0.02$ are described as preliminary. MoPE alone slightly hurts at this scale, and RoPE remains the strongest structured positional encoding when used alone. The first paper also reports that hand-crafted spectral structures, including Morlet energy gates, Daubechies DWT gates, scale-initialized heads, and fixed sin/cos PE, consistently underperform unconstrained learned counterparts [2605.26355].

Several limitations are structural rather than merely empirical. Because the Gaussian envelope is centered at the sequence origin,

$$
G_i(b) = e^{-b^2/2\sigma_i^2},
$$

MoPE introduces an absolute origin prior, so tokens near $b=0$ have higher positional amplitude. The second paper recommends a natural generalization with learned centers,

$$
G_i(b; b_0) = e^{-(b - b_{0,i})^2 / 2\sigma_i^2},
$$

to mitigate origin bias, but notes that this extension was not evaluated [2606.01258]. The first paper similarly notes possible boundary effects and suggests that anchoring or sliding windows may be worth considering in longer contexts or different segmenting schemes.

Future work proposed in the two papers includes larger multi-seed validation, word-level benchmarks such as WikiText-103 and OpenWebText, and a RoPE-compatible “Morlet-RoPE” variant that would preserve relative-position rotation while adding learned Gaussian locality [2605.26355; 2606.01258]. A plausible implication is that MoPE’s benefits may become more pronounced when long contexts and stronger positional non-stationarity make fixed nonlocal encodings less well matched to the data. The papers do not claim that this has been established; they present it as the next empirical question.

Source: https://www.emergentmind.com/topics/morlet-positional-encoding-mope