RIG-RoPE: Relation- and Instance-Gated Rotary Positional Encoding with Duration-Aware Temporal Coordinates
摘要
This preliminary technical report proposes RIG-RoPE, a relation- and instance-gated rotary positional encoding with duration-aware temporal coordinates, aiming to address spatial interference and improper temporal scaling in multimodal LLMs. It introduces a gating mechanism for height/width rotations and duration-aware temporal coordinates, but leaves large-scale empirical validation to future work.
查看缓存全文
缓存时间: 2026/08/07 07:48
# RIG-RoPE: Relation- and Instance-Gated Rotary Positional Encoding with Duration-Aware Temporal Coordinates
Source: [https://arxiv.org/html/2608.05154](https://arxiv.org/html/2608.05154)
Donggen Li Sichuan University lidonggen0425@163\.comThis is a preliminary technical report intended to establish the problem formulation and method\. Large\-scale empirical validation is left to a subsequent version\.
\(May 21, 2026\)
###### Abstract
Rotary positional encoding \(RoPE\) is a core component of modern language models and has been extended to multimodal LLMs through multidimensional variants such as multimodal RoPE \(M\-RoPE\), which split positional channels into temporal, height, and width subspaces\. This report identifies two limitations of static multidimensional position assignment in interleaved multimodal contexts\. First, height/width rotations may be applied to token pairs whose spatial displacement is not a well\-defined geometric object, producing cross\-modal and inter\-instance spatial interference\. Second, temporal coordinates are often treated as equal\-step counters, so a text token, an image block, and a video segment can advance the temporal phase by comparable amounts despite different information density\.
We propose*RIG\-RoPE*, a relation\- and instance\-gated RoPE mechanism with duration\-aware temporal coordinates\. RIG\-RoPE augments each token with a modality indicator, a visual instance identifier, and a scalar information\-duration coordinate\. It enables H/W rotations only for query\-key pairs from the same visual instance; otherwise the unknown spatial displacement is marginalized rather than set to zero\. Temporal rotations use interpolated cumulative block durations: text tokens consume unit duration, images use a dimension\-aware logarithmic spatial scale, and videos further apply a logarithmic temporal extension over effective frames\. We provide a gauge\-invariance argument for avoiding ordinary cross\-instance spatial rotation, an impossibility result for static IDs under shared H/W subspaces, and a duration\-consistency argument against equal\-step multimodal time\. RIG\-RoPE adds no learned parameters and can be implemented inside tiled attention kernels with constant additional metadata per token\. This preliminary report establishes the formulation and validation path without claiming empirical superiority\.
## 1Introduction
Multimodal large language models \(MLLMs\) increasingly process text, images, and videos inside a unified transformer sequence\. A common design serializes visual inputs into patch tokens and interleaves them with text tokens, allowing self\-attention to mediate both semantic and spatial interaction\. Position encoding is therefore not merely an implementation detail: it defines which relative relations are visible to attention\.
RoPE\[[1](https://arxiv.org/html/2608.05154#bib.bib1)\]encodes one\-dimensional relative position through rotations of query and key vectors\. Recent MLLMs extend this idea to visual data by decomposing each attention head into temporal, height, and width subspaces\. Qwen2\-VL, for example, introduces M\-RoPE to support text, image, and video tokens under dynamic visual resolution\[[2](https://arxiv.org/html/2608.05154#bib.bib2)\]\. Related work studies video\-oriented rotary layouts\[[4](https://arxiv.org/html/2608.05154#bib.bib4),[5](https://arxiv.org/html/2608.05154#bib.bib5)\]and cross\-modal positional bias\[[3](https://arxiv.org/html/2608.05154#bib.bib3)\]\.
This report argues that the central issue is not only how to choose better static coordinates, but when a coordinate difference is meaningful at all\. A visual patch has a height/width coordinate only relative to the coordinate chart of its own image or video\. A text token does not live in that spatial chart\. Two patches from different images also do not share a physical coordinate chart unless an explicit cross\-instance registration is supplied\. Applying height/width RoPE to these pairs implicitly asserts that a valid spatial displacement exists\. In general, it does not\.
A second issue appears in the temporal subspace\. Interleaved multimodal inputs resemble hypertext: text is read quickly, images require longer inspection, and videos occupy still longer intervals\. However, common temporal assignments often advance the temporal coordinate by one step for a text token, one step for an entire image, or a small number of steps for a sampled video\. This makes the distance betweenText1\\mathrm\{Text\}\_\{1\}andText3\\mathrm\{Text\}\_\{3\}identical in\[Text1,Text2,Text3\]\[\\mathrm\{Text\}\_\{1\},\\mathrm\{Text\}\_\{2\},\\mathrm\{Text\}\_\{3\}\]and\[Text1,Image2,Text3\]\[\\mathrm\{Text\}\_\{1\},\\mathrm\{Image\}\_\{2\},\\mathrm\{Text\}\_\{3\}\], even though the middle image carries much greater visual information than a single text token\. We therefore replace token\-count time with an interpolated*information\-duration time*\. The interpolation is important: duration\-aware time is intended to model multimodal context distance, not to erase ordinary linguistic order\.
We introduce*Relation\- and Instance\-Gated RoPE*\(RIG\-RoPE\), based on two simple rules:
> *Enable height/width rotary encoding only when both tokens are visual tokens from the same visual instance\. For unregistered pairs, marginalize the unknown spatial displacement rather than assigning zero displacement\. Measure temporal distance by cumulative information duration rather than raw token count\.*
For all other spatial relations, RIG\-RoPE preserves duration\-aware temporal rotation and replaces unsupported H/W phases by a marginalized spatial operator\. The method has no learned parameters and does not block attention; it only prevents unsupported spatial phases and coarse temporal phases from entering the attention logit\.
#### Intuitive overview\.
RIG\-RoPE changes the question asked before applying RoPE\. Instead of assigning every token a static triplet\(t,h,w\)\(t,h,w\)and applying all relative phases uniformly, it first asks whether the query\-key pair has a valid spatial relation\. If the pair lies inside one visual instance, ordinary H/W RoPE is used\. If the pair crosses modalities or visual instances, the H/W displacement is unknown, so the corresponding phase is marginalized\. Independently, RIG\-RoPE asks how much multimodal content lies between two tokens on the sequence axis and uses an information\-duration coordinate for the temporal phase\. Attention remains fully connected; only the positional phase is routed\.
#### Contributions\.
This technical report makes five contributions:
1. 1\.It formalizes cross\-modal and inter\-instance spatial interference as failures of geometric well\-posedness in multidimensional RoPE\.
2. 2\.It proves that static position assignment cannot simultaneously preserve full text RoPE geometry and guarantee spatial invariance between text and visual patches\.
3. 3\.It gives a gauge\-invariance argument showing that cross\-instance visual\-visual height/width displacement is not a legitimate geometric quantity without an explicit instance registration map\.
4. 4\.It introduces duration\-aware temporal coordinates, where image and video blocks consume dimension\-aware logarithmic information duration instead of a single unit step\.
5. 5\.It proposes RIG\-RoPE, a no\-learned\-parameter routing mechanism that retains intra\-instance spatial topology while marginalizing or suppressing unsupported spatial rotations at relation boundaries\.
## 2Background: Multidimensional RoPE in MLLMs
### 2\.1One\-Dimensional RoPE
Let𝐪i,𝐤j∈ℝd\\mathbf\{q\}\_\{i\},\\mathbf\{k\}\_\{j\}\\in\\mathbb\{R\}^\{d\}denote the query and key vectors at positionsiiandjj\. RoPE applies a block\-diagonal rotation matrixR\(p\)R\(p\)to each vector:
sij1D=⟨R\(si\)𝐪i,R\(sj\)𝐤j⟩=⟨𝐪i,R\(sj−si\)𝐤j⟩,s\_\{ij\}^\{\\mathrm\{1D\}\}=\\left\\langle R\(s\_\{i\}\)\\mathbf\{q\}\_\{i\},R\(s\_\{j\}\)\\mathbf\{k\}\_\{j\}\\right\\rangle=\\left\\langle\\mathbf\{q\}\_\{i\},R\(s\_\{j\}\-s\_\{i\}\)\\mathbf\{k\}\_\{j\}\\right\\rangle,\(1\)wheresis\_\{i\}is the one\-dimensional sequence index\. The key property is relative\-position dependence: the attention logit depends on the offsetsj−sis\_\{j\}\-s\_\{i\}rather than only on absolute positions\.
### 2\.2Multidimensional RoPE
For visual tokens, M\-RoPE decomposes the head dimension into temporal, height, and width subspaces:
𝐪i=\[𝐪it;𝐪ih;𝐪iw\],𝐤j=\[𝐤jt;𝐤jh;𝐤jw\]\.\\mathbf\{q\}\_\{i\}=\[\\mathbf\{q\}\_\{i\}^\{t\};\\mathbf\{q\}\_\{i\}^\{h\};\\mathbf\{q\}\_\{i\}^\{w\}\],\\qquad\\mathbf\{k\}\_\{j\}=\[\\mathbf\{k\}\_\{j\}^\{t\};\\mathbf\{k\}\_\{j\}^\{h\};\\mathbf\{k\}\_\{j\}^\{w\}\]\.\(2\)Given token coordinates\(ti,hi,wi\)\(t\_\{i\},h\_\{i\},w\_\{i\}\), the attention logit is commonly written as
sijM=⟨𝐪it,Rt\(Δtij\)𝐤jt⟩\+⟨𝐪ih,Rh\(Δhij\)𝐤jh⟩\+⟨𝐪iw,Rw\(Δwij\)𝐤jw⟩,s\_\{ij\}^\{M\}=\\left\\langle\\mathbf\{q\}\_\{i\}^\{t\},R\_\{t\}\(\\Delta t\_\{ij\}\)\\mathbf\{k\}\_\{j\}^\{t\}\\right\\rangle\+\\left\\langle\\mathbf\{q\}\_\{i\}^\{h\},R\_\{h\}\(\\Delta h\_\{ij\}\)\\mathbf\{k\}\_\{j\}^\{h\}\\right\\rangle\+\\left\\langle\\mathbf\{q\}\_\{i\}^\{w\},R\_\{w\}\(\\Delta w\_\{ij\}\)\\mathbf\{k\}\_\{j\}^\{w\}\\right\\rangle,\(3\)whereΔtij=tj−ti\\Delta t\_\{ij\}=t\_\{j\}\-t\_\{i\},Δhij=hj−hi\\Delta h\_\{ij\}=h\_\{j\}\-h\_\{i\}, andΔwij=wj−wi\\Delta w\_\{ij\}=w\_\{j\}\-w\_\{i\}up to a sign convention\. Equation \([3](https://arxiv.org/html/2608.05154#S2.E3)\) is valid when each displacement is well defined\. The problem studied here is that the formula is often applied beyond that domain\.
## 3Failure Modes of Static Multimodal Position Assignment
### 3\.1Ill\-Posed Spatial Relations
Static multimodal position assignment applies the same coordinate arithmetic to every query\-key pair after flattening the input sequence\. This is problematic for spatial RoPE because not every token pair admits a shared image\-plane coordinate system\. A text token has no height/width location in an image, and two patches from different visual instances have coordinates in different local charts\. Thus static height/width IDs can create artificial spatial proximity between a text token and a particular image region, or between unrelated patches from different images\.
### 3\.2Equal\-Step Temporal Compression
In a flattened multimodal sequence, the temporal coordinatetit\_\{i\}is frequently derived from a discrete counter over text tokens, image placeholders, video frames, or visual segments\. This design is convenient but implicitly assumes that different input blocks consume comparable temporal length\. For example, both sequences
\[Text1,Text2,Text3\],\[Text1,Image2,Text3\]\[\\mathrm\{Text\}\_\{1\},\\mathrm\{Text\}\_\{2\},\\mathrm\{Text\}\_\{3\}\],\\qquad\[\\mathrm\{Text\}\_\{1\},\\mathrm\{Image\}\_\{2\},\\mathrm\{Text\}\_\{3\}\]\(4\)can yield the same temporal offset betweenText1\\mathrm\{Text\}\_\{1\}andText3\\mathrm\{Text\}\_\{3\}if the middle text token and the middle image each advance the counter by one unit\. This is a coarse approximation: an image or video segment usually has higher information density and requires a longer semantic inspection interval than a single text token\. RIG\-RoPE therefore treats temporal position as accumulated block duration rather than raw token count\.
## 4Unified Problem Formulation
### 4\.1Token Attributes
We consider an interleaved sequence of text and visual tokens\. Each tokeniihas:
Mi∈\{Text,Vision\},Ii∈ℕ0,M\_\{i\}\\in\\\{\\mathrm\{Text\},\\mathrm\{Vision\}\\\},\\qquad I\_\{i\}\\in\\mathbb\{N\}\_\{0\},\(5\)whereMiM\_\{i\}is the modality andIiI\_\{i\}is the instance identifier\. Text tokens useIi=0I\_\{i\}=0by convention\. Tokens from the same image or continuous video segment share the same positive instance identifier\.
We also group the flattened sequence into semantic blocks\. A blockBbB\_\{b\}is either a single text token, one image instance, or one video instance\. Letb\(i\)b\(i\)denote the block containing tokenii\. Each block has a positive durationDbD\_\{b\}and a cumulative start anchor
ab=∑r<bDr\.a\_\{b\}=\\sum\_\{r<b\}D\_\{r\}\.\(6\)The duration\-aware temporal coordinate of tokeniiis denoted byτi\\tau\_\{i\}\. The detailed construction ofDbD\_\{b\}andτi\\tau\_\{i\}is given in Section[7](https://arxiv.org/html/2608.05154#S7)\.
Table 1:Main notation used in RIG\-RoPE\.For a visual instancemm, let𝒱\(m\)\\mathcal\{V\}^\{\(m\)\}denote its visual token grid and let
χm:𝒱\(m\)→ℝ2\\chi\_\{m\}:\\mathcal\{V\}^\{\(m\)\}\\rightarrow\\mathbb\{R\}^\{2\}\(7\)be a local image\-plane coordinate chart for image patches or per\-frame video patches\. A tokeniiin instancemmhas local screen\-space coordinate
𝐱i\(m\)=χm\(i\)=\(hi\(m\),wi\(m\)\)∈ℝ2\.\\mathbf\{x\}\_\{i\}^\{\(m\)\}=\\chi\_\{m\}\(i\)=\(h\_\{i\}^\{\(m\)\},w\_\{i\}^\{\(m\)\}\)\\in\\mathbb\{R\}^\{2\}\.\(8\)
### 4\.2Spatial Well\-Posedness
###### Definition 1\(Spatially well\-posed pair\)\.
A query\-key pair\(i,j\)\(i,j\)is spatially well posed if both tokens are visual tokens and belong to the same visual instance:
WellPosedS\(i,j\)⇔Mi=Vision,Mj=Vision,Ii=Ij\.\\mathrm\{WellPosed\}\_\{S\}\(i,j\)\\iff M\_\{i\}=\\mathrm\{Vision\},\\;M\_\{j\}=\\mathrm\{Vision\},\\;I\_\{i\}=I\_\{j\}\.\(9\)
Only for such pairs is the local spatial displacement
Δ𝐱ij\(m\)=𝐱j\(m\)−𝐱i\(m\)=\(Δhij\(m\),Δwij\(m\)\)\\Delta\\mathbf\{x\}\_\{ij\}^\{\(m\)\}=\\mathbf\{x\}\_\{j\}^\{\(m\)\}\-\\mathbf\{x\}\_\{i\}^\{\(m\)\}=\(\\Delta h\_\{ij\}^\{\(m\)\},\\Delta w\_\{ij\}^\{\(m\)\}\)\(10\)a valid object inside a shared chart\. For text\-vision pairs, text has no image\-plane coordinate\. For visual\-visual pairs withIi≠IjI\_\{i\}\\neq I\_\{j\}, the two coordinates live in different charts\. For video, this chart should be interpreted as a screen\-space or image\-plane grid rather than a strict physical\-world manifold; strong camera motion or object motion can make cross\-frame physical correspondence approximate\.
## 5Spatial Well\-Posedness and Gauge Invariance
This section gives the main theoretical reason for instance gating\. It is tempting to regard two image patches with identical pixel coordinates as spatially comparable\. However, the coordinate\(h,w\)\(h,w\)in image A and the coordinate\(h,w\)\(h,w\)in image B are not points in a shared image\-plane coordinate chart unless a registration is provided\.
### 5\.1Gauge Freedom of Visual Instances
###### Assumption 1\(Independent chart gauges\)\.
Each visual instancemmadmits an independent coordinate gauge transformation
𝐱\(m\)↦Am𝐱\(m\)\+bm,Am∈GL\(2\),bm∈ℝ2,\\mathbf\{x\}^\{\(m\)\}\\mapsto A\_\{m\}\\mathbf\{x\}^\{\(m\)\}\+b\_\{m\},\\qquad A\_\{m\}\\in\\mathrm\{GL\}\(2\),\\;b\_\{m\}\\in\\mathbb\{R\}^\{2\},\(11\)that changes the chart representation but not the semantic content of the instance\.
This assumption is mild\. Cropping, padding, resizing, coordinate\-origin choices, and per\-image normalization all alter local coordinate charts\. Unless the task provides an explicit alignment between images, each instance may choose its own chart\.
###### Proposition 1\(Intra\-instance displacement is translation\-gauge invariant\)\.
Ifiiandjjbelong to the same visual instancemm, then under any shared translation𝐱\(m\)↦𝐱\(m\)\+bm\\mathbf\{x\}^\{\(m\)\}\\mapsto\\mathbf\{x\}^\{\(m\)\}\+b\_\{m\},
Δ𝐱ij\(m\)=𝐱j\(m\)−𝐱i\(m\)\\Delta\\mathbf\{x\}\_\{ij\}^\{\(m\)\}=\\mathbf\{x\}\_\{j\}^\{\(m\)\}\-\\mathbf\{x\}\_\{i\}^\{\(m\)\}\(12\)is invariant\.
###### Proof\.
After the transformation,
\(𝐱j\(m\)\+bm\)−\(𝐱i\(m\)\+bm\)=𝐱j\(m\)−𝐱i\(m\)\.\(\\mathbf\{x\}\_\{j\}^\{\(m\)\}\+b\_\{m\}\)\-\(\\mathbf\{x\}\_\{i\}^\{\(m\)\}\+b\_\{m\}\)=\\mathbf\{x\}\_\{j\}^\{\(m\)\}\-\\mathbf\{x\}\_\{i\}^\{\(m\)\}\.\(13\)Thus a same\-instance relative displacement does not depend on the arbitrary coordinate origin\. ∎
###### Theorem 1\(Cross\-instance displacement is not gauge invariant\)\.
Letiibelong to visual instancemmandjjbelong to visual instancen≠mn\\neq m\. Suppose no registration mapϕm→n:𝒱\(m\)→𝒱\(n\)\\phi\_\{m\\rightarrow n\}:\\mathcal\{V\}^\{\(m\)\}\\rightarrow\\mathcal\{V\}^\{\(n\)\}is given\. Then
𝐱j\(n\)−𝐱i\(m\)\\mathbf\{x\}\_\{j\}^\{\(n\)\}\-\\mathbf\{x\}\_\{i\}^\{\(m\)\}\(14\)is not a gauge\-invariant geometric object\.
###### Proof\.
Under independent translations of the two coordinate charts,
𝐱i\(m\)↦𝐱i\(m\)\+bm,𝐱j\(n\)↦𝐱j\(n\)\+bn\.\\mathbf\{x\}\_\{i\}^\{\(m\)\}\\mapsto\\mathbf\{x\}\_\{i\}^\{\(m\)\}\+b\_\{m\},\\qquad\\mathbf\{x\}\_\{j\}^\{\(n\)\}\\mapsto\\mathbf\{x\}\_\{j\}^\{\(n\)\}\+b\_\{n\}\.\(15\)The apparent cross\-instance displacement becomes
\(𝐱j\(n\)\+bn\)−\(𝐱i\(m\)\+bm\)=\(𝐱j\(n\)−𝐱i\(m\)\)\+\(bn−bm\)\.\(\\mathbf\{x\}\_\{j\}^\{\(n\)\}\+b\_\{n\}\)\-\(\\mathbf\{x\}\_\{i\}^\{\(m\)\}\+b\_\{m\}\)=\(\\mathbf\{x\}\_\{j\}^\{\(n\)\}\-\\mathbf\{x\}\_\{i\}^\{\(m\)\}\)\+\(b\_\{n\}\-b\_\{m\}\)\.\(16\)Becausebmb\_\{m\}andbnb\_\{n\}are independent,bn−bmb\_\{n\}\-b\_\{m\}can be arbitrary\. Therefore the value of Eq\. \([14](https://arxiv.org/html/2608.05154#S5.E14)\) is determined by chart choices rather than by geometry\. Without a registration mapϕm→n\\phi\_\{m\\rightarrow n\}that places both tokens into a common coordinate system, the displacement is not well defined\. ∎
###### Corollary 1\(M\-RoPE cross\-instance phases are gauge\-dependent\)\.
For visual instancesm≠nm\\neq n, any height/width RoPE term of the form
⟨𝐪ih,Rh\(hj\(n\)−hi\(m\)\)𝐤jh⟩\+⟨𝐪iw,Rw\(wj\(n\)−wi\(m\)\)𝐤jw⟩\\left\\langle\\mathbf\{q\}\_\{i\}^\{h\},R\_\{h\}\(h\_\{j\}^\{\(n\)\}\-h\_\{i\}^\{\(m\)\}\)\\mathbf\{k\}\_\{j\}^\{h\}\\right\\rangle\+\\left\\langle\\mathbf\{q\}\_\{i\}^\{w\},R\_\{w\}\(w\_\{j\}^\{\(n\)\}\-w\_\{i\}^\{\(m\)\}\)\\mathbf\{k\}\_\{j\}^\{w\}\\right\\rangle\(17\)depends on arbitrary chart choices unless a cross\-instance registration is supplied\.
This is the reason RIG\-RoPE avoids ordinary height/width rotation not only for text\-vision pairs, but also for visual\-visual pairs across different images or videos\. Importantly, an unregistered spatial relation should not be confused with zero displacement\. Setting the fallback rotation to the identity matrix implicitly assignsΔh=Δw=0\\Delta h=\\Delta w=0, which can make cross\-instance tokens appear artificially close in the H/W subspaces\.
### 5\.2Spatial Marginalization for Unregistered Pairs
For unregistered token pairs, the spatial displacement is unknown rather than zero\. A principled fallback is therefore to marginalize over a prior distribution of possible displacements:
R¯h=𝔼Δh∼ph\[Rh\(Δh\)\],R¯w=𝔼Δw∼pw\[Rw\(Δw\)\]\.\\bar\{R\}\_\{h\}=\\mathbb\{E\}\_\{\\Delta h\\sim p\_\{h\}\}\[R\_\{h\}\(\\Delta h\)\],\\qquad\\bar\{R\}\_\{w\}=\\mathbb\{E\}\_\{\\Delta w\\sim p\_\{w\}\}\[R\_\{w\}\(\\Delta w\)\]\.\(18\)For a RoPE frequencyωk\\omega\_\{k\}, the complex form of the expected phase is
𝔼Δ∼p\[exp\(iωkΔ\)\]\.\\mathbb\{E\}\_\{\\Delta\\sim p\}\[\\exp\(i\\omega\_\{k\}\\Delta\)\]\.\(19\)As the default marginalization model, we use zero\-mean Gaussian uncertainty:
Δ∼𝒩\(0,σ2\)\.\\Delta\\sim\\mathcal\{N\}\(0,\\sigma^\{2\}\)\.\(20\)The characteristic function of a Gaussian gives
𝔼Δ∼𝒩\(0,σ2\)\[exp\(iωkΔ\)\]=exp\(−12ωk2σ2\)\.\\mathbb\{E\}\_\{\\Delta\\sim\\mathcal\{N\}\(0,\\sigma^\{2\}\)\}\[\\exp\(i\\omega\_\{k\}\\Delta\)\]=\\exp\\left\(\-\\frac\{1\}\{2\}\\omega\_\{k\}^\{2\}\\sigma^\{2\}\\right\)\.\(21\)Thus the marginalized fallback is a nonnegative frequency\-dependent attenuation:
c~k=exp\(−12ωk2σ2\),R¯k=c~kI\.\\tilde\{c\}\_\{k\}=\\exp\\left\(\-\\frac\{1\}\{2\}\\omega\_\{k\}^\{2\}\\sigma^\{2\}\\right\),\\qquad\\bar\{R\}\_\{k\}=\\tilde\{c\}\_\{k\}I\.\(22\)Over a full height or width subspace withKKrotary frequency pairs, this corresponds to a block\-diagonal marginal operator:
R¯h=blockdiag\(c~h,1I2,…,c~h,KI2\),R¯w=blockdiag\(c~w,1I2,…,c~w,KI2\)\.\\bar\{R\}\_\{h\}=\\mathrm\{blockdiag\}\(\\tilde\{c\}\_\{h,1\}I\_\{2\},\\ldots,\\tilde\{c\}\_\{h,K\}I\_\{2\}\),\\qquad\\bar\{R\}\_\{w\}=\\mathrm\{blockdiag\}\(\\tilde\{c\}\_\{w,1\}I\_\{2\},\\ldots,\\tilde\{c\}\_\{w,K\}I\_\{2\}\)\.\(23\)For height and width subspaces, we use
σh=ηH,σw=ηW,η∈\[0\.25,1\.0\],\\sigma\_\{h\}=\\eta H,\\qquad\\sigma\_\{w\}=\\eta W,\\qquad\\eta\\in\[0\.25,1\.0\],\(24\)whereHHandWWare the spatial extents measured in patch\-index units\. Therefore
c~h,k=exp\(−12ωh,k2σh2\),c~w,k=exp\(−12ωw,k2σw2\)\.\\tilde\{c\}\_\{h,k\}=\\exp\\left\(\-\\frac\{1\}\{2\}\\omega\_\{h,k\}^\{2\}\\sigma\_\{h\}^\{2\}\\right\),\\qquad\\tilde\{c\}\_\{w,k\}=\\exp\\left\(\-\\frac\{1\}\{2\}\\omega\_\{w,k\}^\{2\}\\sigma\_\{w\}^\{2\}\\right\)\.\(25\)The parameterη\\etacontrols the uncertainty scale\. Largerη\\etameans stronger uncertainty and stronger attenuation\. High\-frequency spatial phases decay fastest, while low\-frequency components may retain weak global evidence\. This avoids the phase\-reversal issue that can occur with uniform\-prior sinc attenuation\. A uniform\-prior variant with clipped sinc attenuation is possible, but we treat it as an ablation rather than the default\.
#### Zero fallback\.
A conservative special case isR¯h=R¯w=0\\bar\{R\}\_\{h\}=\\bar\{R\}\_\{w\}=0, which fully suppresses H/W contributions for unregistered pairs\. This does not mean that the two tokens are at infinite spatial distance; rather, it states that their H/W spatial relation provides no reliable evidence for the attention logit\. Since this also removes any semantic evidence stored in the H/W chunks and changes the variance of the attention logit, we treat zero fallback as a robust ablation rather than the default\. The original identity fallback corresponds toR¯=I\\bar\{R\}=Iand should be treated only as a degenerate option because it encodes zero displacement\.
## 6Static Spatial Assignment Impossibility
One may ask whether a clever static assignment of\(t,h,w\)\(t,h,w\)IDs could remove the above interference\. The following result shows that static IDs alone cannot satisfy the desired constraints under the standard setting where the same non\-degenerate height/width rotary subspaces are reused across relations and no pairwise routing, masking, or relation\-conditioned projection is introduced\.
###### Theorem 2\(Static position assignment incompatibility\)\.
Assume a static position assignmentf\(i\)=\(ti,hi,wi\)f\(i\)=\(t\_\{i\},h\_\{i\},w\_\{i\}\)is used before attention, with shared non\-degenerate H/W RoPE frequencies and no relation\-conditioned routing\. Suppose it must satisfy both:
1. 1\.Text preservation:text\-text attention retains nontrivial one\-dimensional RoPE variation over the full head dimension\.
2. 2\.Text\-vision spatial invariance:for any text tokenaaand any two patchesp1,p2p\_\{1\},p\_\{2\}in the same visual instance, the spatial contribution to the text\-vision attention logit is invariant to the patch coordinates ofp1p\_\{1\}andp2p\_\{2\}\.
Then no single static assignment over the same height/width rotary subspaces can satisfy both conditions for all query and key vectors\.
###### Proof\.
Consider the height subspace; the width subspace is analogous\. Spatial invariance requires
⟨𝐪ah,Rh\(hp1−ha\)𝐤p1h⟩=⟨𝐪ah,Rh\(hp2−ha\)𝐤p2h⟩\\left\\langle\\mathbf\{q\}\_\{a\}^\{h\},R\_\{h\}\(h\_\{p\_\{1\}\}\-h\_\{a\}\)\\mathbf\{k\}\_\{p\_\{1\}\}^\{h\}\\right\\rangle=\\left\\langle\\mathbf\{q\}\_\{a\}^\{h\},R\_\{h\}\(h\_\{p\_\{2\}\}\-h\_\{a\}\)\\mathbf\{k\}\_\{p\_\{2\}\}^\{h\}\\right\\rangle\(26\)as a positional property, independent of the patch coordinates\. For this to hold for arbitrary content vectors without relying on the accidental equality of𝐤p1h\\mathbf\{k\}\_\{p\_\{1\}\}^\{h\}and𝐤p2h\\mathbf\{k\}\_\{p\_\{2\}\}^\{h\}, the relative rotation applied from the text token to every image patch must be identical\. HenceRh\(hp1−ha\)=Rh\(hp2−ha\)R\_\{h\}\(h\_\{p\_\{1\}\}\-h\_\{a\}\)=R\_\{h\}\(h\_\{p\_\{2\}\}\-h\_\{a\}\)for all patches\. For non\-degenerate RoPE frequencies and distinct patch coordinates, this cannot hold except by making the text\-side height component constant or by disabling the height rotation for text\-vision relations\.
If the height and width rotary components are made constant or disabled statically for text tokens, then those subspaces no longer carry the full one\-dimensional text RoPE variation required by text preservation\. Conversely, if text uses full RoPE variation in the same subspaces, then different image patch coordinates produce different text\-vision spatial phases\. Therefore the two conditions are incompatible under a single static assignment\. A relation\-conditioned operation is required\. ∎
## 7Information\-Duration Temporal Coordinates
The spatial argument above asks whether a spatial displacement is well defined\. The temporal argument asks whether the temporal distance has the right unit\. A raw token counter gives every step the same length, regardless of whether the step corresponds to a text token, an image, or a video segment\. We replace this with an*information\-duration*coordinate\.
### 7\.1Block Duration
LetBbB\_\{b\}be a semantic block\. For text, a block is a single token\. For images, a block is the full image instance withPb=HbWbP\_\{b\}=H\_\{b\}W\_\{b\}visual patches\. For videos, a block is the full video instance withFb≥1F\_\{b\}\\geq 1sampled frames andPb=HbWbP\_\{b\}=H\_\{b\}W\_\{b\}visual patches per frame\. We first define a two\-dimensional spatial scale
ϕ2\(Hb,Wb\)=12\[log\(1\+Hb\)\+log\(1\+Wb\)\]\.\\phi\_\{2\}\(H\_\{b\},W\_\{b\}\)=\\frac\{1\}\{2\}\\left\[\\log\(1\+H\_\{b\}\)\+\\log\(1\+W\_\{b\}\)\\right\]\.\(27\)When only the total patch count is available, we use the isotropic approximation
ϕ2\(Pb\)=log\(1\+Pb\)\.\\phi\_\{2\}\(P\_\{b\}\)=\\log\(1\+\\sqrt\{P\_\{b\}\}\)\.\(28\)For video, we use a one\-dimensional temporal extension factor
ϕt\(Fb\)=logFb,Fb≥1\.\\phi\_\{t\}\(F\_\{b\}\)=\\log F\_\{b\},\\qquad F\_\{b\}\\geq 1\.\(29\)The block duration is then
Db=\{1,Bb∈Text,αIϕ2\(Pb\),Bb∈Image,αVϕ2\(Pb\)\[1\+λVϕt\(Fb\)\],Bb∈Video,D\_\{b\}=\\begin\{cases\}1,&B\_\{b\}\\in\\mathrm\{Text\},\\\\ \\alpha\_\{I\}\\phi\_\{2\}\(P\_\{b\}\),&B\_\{b\}\\in\\mathrm\{Image\},\\\\ \\alpha\_\{V\}\\phi\_\{2\}\(P\_\{b\}\)\\left\[1\+\\lambda\_\{V\}\\phi\_\{t\}\(F\_\{b\}\)\\right\],&B\_\{b\}\\in\\mathrm\{Video\},\\end\{cases\}\(30\)whereαI,αV\>0\\alpha\_\{I\},\\alpha\_\{V\}\>0are fixed calibration constants andλV≥0\\lambda\_\{V\}\\geq 0controls the strength of video temporal extension\. They may be set to one in the simplest version or tuned as non\-learned hyperparameters\. A practical calibration anchor is to choose a reference image resolutionP⋆P^\{\\star\}and a desired equivalent text durationDI⋆D\_\{I\}^\{\\star\}, then set
αI=DI⋆ϕ2\(P⋆\)\.\\alpha\_\{I\}=\\frac\{D\_\{I\}^\{\\star\}\}\{\\phi\_\{2\}\(P^\{\\star\}\)\}\.\(31\)The video scaleαV\\alpha\_\{V\}and extensionλV\\lambda\_\{V\}can be calibrated analogously from a reference clip withP⋆P^\{\\star\}patches per frame,F⋆F^\{\\star\}effective frames, and target durationDV⋆D\_\{V\}^\{\\star\}\.
The logarithm implements a diminishing\-return assumption: increasing visual resolution or frame count should increase the semantic inspection length, but not linearly\. The spatial and temporal parts are deliberately not treated as identical axes\. Image duration depends on a two\-dimensional spatial scale, not directly on the area\-like patch count\. Video duration starts from the same per\-frame spatial scale and then adds a one\-dimensional temporal extension\. Thus a single\-frame video satisfiesϕt\(1\)=0\\phi\_\{t\}\(1\)=0and degenerates to the image duration form up to the calibration constant\.
One way to motivate the logarithmic form is to assume that the marginal duration contributed by an additional resolved unit is inversely proportional to the amount already observed,
dDdN∝11\+N,\\frac\{dD\}\{dN\}\\propto\\frac\{1\}\{1\+N\},\(32\)whose solution is logarithmic up to scale and additive constants\. Applying this principle after converting two\-dimensional patch area into a one\-dimensional spatial scale avoids treating resolution growth as linear reading time\. Applying a separate logarithm toFbF\_\{b\}preserves the fact that longer videos occupy longer intervals while still accounting for temporal redundancy between adjacent frames\.
HereFbF\_\{b\}should be interpreted as an effective sampled\-frame count rather than necessarily the raw number of decoded frames\. For densely sampled or highly redundant videos, temporal pooling, scene\-change filtering, or a model\-specific effective\-frame estimator can be used before computingϕt\(Fb\)\\phi\_\{t\}\(F\_\{b\}\)\. This avoids over\-interpreting near\-duplicate frames as independent temporal evidence\.
### 7\.2Token Coordinates Inside a Block
Each block occupies an interval\[ab,ab\+Db\]\[a\_\{b\},a\_\{b\}\+D\_\{b\}\]on the global duration axis, whereaba\_\{b\}is defined in Eq\. \([6](https://arxiv.org/html/2608.05154#S4.E6)\)\. For text and image blocks, tokens are assigned to the block center:
τi=ab\(i\)\+12Db\(i\),Bb\(i\)∈\{Text,Image\}\.\\tau\_\{i\}=a\_\{b\(i\)\}\+\\frac\{1\}\{2\}D\_\{b\(i\)\},\\qquad B\_\{b\(i\)\}\\in\\\{\\mathrm\{Text\},\\mathrm\{Image\}\\\}\.\(33\)For a video token from framefi∈\{1,…,Fb\}f\_\{i\}\\in\\\{1,\\ldots,F\_\{b\}\\\}, temporal coordinates are distributed over centered frame bins:
τi=ab\(i\)\+Db\(i\)ρi,ρi=fi−12Fb\.\\tau\_\{i\}=a\_\{b\(i\)\}\+D\_\{b\(i\)\}\\rho\_\{i\},\\qquad\\rho\_\{i\}=\\dfrac\{f\_\{i\}\-\\frac\{1\}\{2\}\}\{F\_\{b\}\}\.\(34\)All spatial patches from the same video frame share the sameρi\\rho\_\{i\}\. Their temporal distance is zero within the frame and their difference is represented by H/W screen\-space RoPE\. WhenFb=1F\_\{b\}=1,ρi=1/2\\rho\_\{i\}=1/2, so a single\-frame video is temporally centered like an image block\. Since adjacent frame spacing isDb/FbD\_\{b\}/F\_\{b\}, very dense sampling may compress local frame\-to\-frame offsets; this is another reason to use effective frames rather than raw frames\.
To avoid overcommitting to duration expansion in all contexts, we optionally interpolate between raw sequence time and information\-duration time:
τi\(λ\)=\(1−λ\)si\+λτi,λ∈\[0,1\],\\tau\_\{i\}^\{\(\\lambda\)\}=\(1\-\\lambda\)s\_\{i\}\+\\lambda\\tau\_\{i\},\\qquad\\lambda\\in\[0,1\],\(35\)wheresis\_\{i\}is the ordinary sequence index or blockwise token\-count coordinate\. The default theoretical presentation usesλ=1\\lambda=1, whileλ<1\\lambda<1preserves more of the original linguistic distance in heavily interleaved contexts\.
### 7\.3Temporal Consistency
###### Proposition 2\(Pure\-text preservation\)\.
For a text\-only sequence, duration\-aware temporal coordinates preserve ordinary one\-dimensional relative distances up to a constant shift\.
###### Proof\.
Every block is a single text token, soDb=1D\_\{b\}=1andτi=i\+12\\tau\_\{i\}=i\+\\frac\{1\}\{2\}under zero\-based block indexing\. Therefore
τj−τi=j−i,\\tau\_\{j\}\-\\tau\_\{i\}=j\-i,\(36\)which is exactly the ordinary token\-index offset\. ∎
###### Proposition 3\(Visual\-block separation\)\.
Consider two text tokens separated by a single intervening blockBB\. Under equal\-step assignment, the temporal distance is independent of the content ofBB\. Under duration\-aware assignment, the distance increases monotonically with the visual complexity ofBB\.
###### Proof\.
For\[Text1,B,Text3\]\[\\mathrm\{Text\}\_\{1\},B,\\mathrm\{Text\}\_\{3\}\], the two text coordinates differ by
Δτ=τText3−τText1=12DText1\+DB\+12DText3=1\+DB\.\\Delta\\tau=\\tau\_\{\\mathrm\{Text\}\_\{3\}\}\-\\tau\_\{\\mathrm\{Text\}\_\{1\}\}=\\frac\{1\}\{2\}D\_\{\\mathrm\{Text\}\_\{1\}\}\+D\_\{B\}\+\\frac\{1\}\{2\}D\_\{\\mathrm\{Text\}\_\{3\}\}=1\+D\_\{B\}\.\(37\)IfBBis a text token,DB=1D\_\{B\}=1and the distance is22, matching ordinary RoPE\. IfBBis an image or video, Eq\. \([30](https://arxiv.org/html/2608.05154#S7.E30)\) makesDBD\_\{B\}a monotone increasing function of patch count and, for video, frame count\. Thus a visually denser middle block induces a larger temporal separation\. ∎
###### Proposition 4\(Video internal temporal distance\)\.
For two tokensi,ji,jinside the same video blockBbB\_\{b\}, the duration\-aware temporal offset is
Δτij=Db\(ρj−ρi\)\.\\Delta\\tau\_\{ij\}=D\_\{b\}\(\\rho\_\{j\}\-\\rho\_\{i\}\)\.\(38\)
###### Proof\.
Substituting Eq\. \([34](https://arxiv.org/html/2608.05154#S7.E34)\) gives
τj−τi=\(ab\+Dbρj\)−\(ab\+Dbρi\)=Db\(ρj−ρi\)\.\\tau\_\{j\}\-\\tau\_\{i\}=\(a\_\{b\}\+D\_\{b\}\\rho\_\{j\}\)\-\(a\_\{b\}\+D\_\{b\}\\rho\_\{i\}\)=D\_\{b\}\(\\rho\_\{j\}\-\\rho\_\{i\}\)\.\(39\)The block anchor cancels, so internal video timing depends only on the normalized frame separation and the video duration budget\. ∎
#### Remark\.
The proposed duration model does not introduce a second clock\. It keeps a single scalar temporal coordinate but changes its unit from equal token steps to accumulated information duration\. This preserves ordinary text behavior while making interleaved image and video blocks occupy larger intervals on the temporal RoPE axis\. The interpolation in Eq\. \([35](https://arxiv.org/html/2608.05154#S7.E35)\) is an implementation knob for balancing linguistic continuity against multimodal inspection duration\.
## 8Method: RIG\-RoPE
### 8\.1Spatial Gate
RIG\-RoPE introduces the binary spatial gate
gijS=𝟏\[Mi=Vision\]1\[Mj=Vision\]1\[Ii=Ij\]\.g\_\{ij\}^\{S\}=\\mathbf\{1\}\[M\_\{i\}=\\mathrm\{Vision\}\]\\,\\mathbf\{1\}\[M\_\{j\}=\\mathrm\{Vision\}\]\\,\\mathbf\{1\}\[I\_\{i\}=I\_\{j\}\]\.\(40\)WhengijS=1g\_\{ij\}^\{S\}=1, the query\-key pair lies inside the same visual instance and height/width RoPE is enabled\. WhengijS=0g\_\{ij\}^\{S\}=0, height/width rotations are replaced by marginalized spatial operatorsR¯h,R¯w\\bar\{R\}\_\{h\},\\bar\{R\}\_\{w\}from Eq\. \([18](https://arxiv.org/html/2608.05154#S5.E18)\)\. The zero fallbackR¯h=R¯w=0\\bar\{R\}\_\{h\}=\\bar\{R\}\_\{w\}=0is allowed as a conservative implementation\.
### 8\.2General Pairwise Score
RIG\-RoPE uses the duration\-aware temporal offset
Δτij=τj−τi\\Delta\\tau\_\{ij\}=\\tau\_\{j\}\-\\tau\_\{i\}\(41\)for the temporal subspace\. For pairs using the split temporal\-height\-width layout, it computes
sijRIG=\\displaystyle s\_\{ij\}^\{\\mathrm\{RIG\}\}=⟨𝐪it,Rt\(Δτij\)𝐤jt⟩\\displaystyle\\left\\langle\\mathbf\{q\}\_\{i\}^\{t\},R\_\{t\}\(\\Delta\\tau\_\{ij\}\)\\mathbf\{k\}\_\{j\}^\{t\}\\right\\rangle\+gijS\[⟨𝐪ih,Rh\(Δhij\)𝐤jh⟩\+⟨𝐪iw,Rw\(Δwij\)𝐤jw⟩\]\\displaystyle\+g\_\{ij\}^\{S\}\\left\[\\left\\langle\\mathbf\{q\}\_\{i\}^\{h\},R\_\{h\}\(\\Delta h\_\{ij\}\)\\mathbf\{k\}\_\{j\}^\{h\}\\right\\rangle\+\\left\\langle\\mathbf\{q\}\_\{i\}^\{w\},R\_\{w\}\(\\Delta w\_\{ij\}\)\\mathbf\{k\}\_\{j\}^\{w\}\\right\\rangle\\right\]\+\(1−gijS\)\[⟨𝐪ih,R¯h𝐤jh⟩\+⟨𝐪iw,R¯w𝐤jw⟩\]\.\\displaystyle\+\(1\-g\_\{ij\}^\{S\}\)\\left\[\\left\\langle\\mathbf\{q\}\_\{i\}^\{h\},\\bar\{R\}\_\{h\}\\mathbf\{k\}\_\{j\}^\{h\}\\right\\rangle\+\\left\\langle\\mathbf\{q\}\_\{i\}^\{w\},\\bar\{R\}\_\{w\}\\mathbf\{k\}\_\{j\}^\{w\}\\right\\rangle\\right\]\.\(42\)The marginalized terms are important: RIG\-RoPE does not assign zero spatial displacement to unregistered pairs\. Instead, it attenuates or suppresses H/W evidence according to uncertainty over the unknown displacement\. WithR¯=0\\bar\{R\}=0, the H/W channels contribute no spatial evidence for unregistered pairs\.
### 8\.3Text\-Text Branch
Text\-text attention is treated as a special branch over the full head dimension:
sijRIG=⟨𝐪i,R1D\(Δτij\)𝐤j⟩,Mi=Mj=Text\.s\_\{ij\}^\{\\mathrm\{RIG\}\}=\\left\\langle\\mathbf\{q\}\_\{i\},R\_\{\\mathrm\{1D\}\}\(\\Delta\\tau\_\{ij\}\)\\mathbf\{k\}\_\{j\}\\right\\rangle,\\qquad M\_\{i\}=M\_\{j\}=\\mathrm\{Text\}\.\(43\)That is, text tokens are not forced to imitate a pseudo\-3D coordinate system\. In text\-only sequences, Eq\. \([43](https://arxiv.org/html/2608.05154#S8.E43)\) is identical to ordinary one\-dimensional RoPE by pure\-text preservation\. In interleaved sequences, visual blocks can expand the scalar temporal distance between surrounding text tokens according to their information duration\. This is intentional: RIG\-RoPE preserves native text geometry for pure text, while allowing multimodal content to change long\-range text\-text offsets across visual blocks\.
### 8\.4Relation Cases
Table 2:RIG\-RoPE routing rules\. Temporal rotation uses duration\-awareΔτ\\Delta\\tau; H/W rotation is enabled only for same\-instance visual pairs and marginalized otherwise\.
### 8\.5Gauge\-Invariance Property
###### Proposition 5\(No gauge\-dependent spatial phases\)\.
Assume no cross\-instance registration maps are given\. For any text\-vision or different\-instance visual pair, the RIG\-RoPE logit contains no H/W rotation angle that depends on an ill\-defined displacement and does not assign zero spatial displacement by default\.
###### Proof\.
For such pairs,gijS=0g\_\{ij\}^\{S\}=0by Eq\. \([40](https://arxiv.org/html/2608.05154#S8.E40)\)\. Therefore Eq\. \([42](https://arxiv.org/html/2608.05154#S8.E42)\) replaces the height and width rotary terms by the marginalized operatorsR¯h,R¯w\\bar\{R\}\_\{h\},\\bar\{R\}\_\{w\}\. The only remaining explicit positional phase is duration\-aware temporal order\. Hence no term of the formRh\(hj−hi\)R\_\{h\}\(h\_\{j\}\-h\_\{i\}\)orRw\(wj−wi\)R\_\{w\}\(w\_\{j\}\-w\_\{i\}\)is evaluated across incompatible spatial charts, and the fallback does not encodeΔh=Δw=0\\Delta h=\\Delta w=0unless one deliberately chooses the degenerate identity fallback\. ∎
## 9Implementation
### 9\.1Kernel\-Level Routing
A naive implementation could materialize relation masks with shapeL×LL\\times L, whereLLis the sequence length\. This is unnecessary\. In tiled attention kernels such as FlashAttention\[[7](https://arxiv.org/html/2608.05154#bib.bib7),[8](https://arxiv.org/html/2608.05154#bib.bib8)\], query and key blocks are loaded into on\-chip memory\. RIG\-RoPE requires three per\-token metadata arrays:
M∈\{0,1\}L,I∈ℕ0L,τ∈ℝL\.M\\in\\\{0,1\\\}^\{L\},\\qquad I\\in\\mathbb\{N\}\_\{0\}^\{L\},\\qquad\\tau\\in\\mathbb\{R\}^\{L\}\.\(44\)The duration coordinateτ\\tauis computed once during multimodal packing from Eq\. \([30](https://arxiv.org/html/2608.05154#S7.E30)\)–\([34](https://arxiv.org/html/2608.05154#S7.E34)\)\. For each query\-key tile, the kernel computes the spatial gate in registers:
gijS=\(Mi=1\)∧\(Mj=1\)∧\(Ii=Ij\)\.g\_\{ij\}^\{S\}=\(M\_\{i\}=1\)\\wedge\(M\_\{j\}=1\)\\wedge\(I\_\{i\}=I\_\{j\}\)\.\(45\)It then usesτj−τi\\tau\_\{j\}\-\\tau\_\{i\}for the temporal rotation and selects either the rotary path or the marginalized fallback path for the H/W subspaces\.
### 9\.2Pseudocode
```
for Q_block, K_block in tiled_attention:
load q_t, q_h, q_w, k_t, k_h, k_w
load modality ids M_q, M_k, instance ids I_q, I_k, and tau_q, tau_k
delta_tau = tau_k - tau_q
score_t = dot(q_t, rope_t(delta_tau) * k_t)
same_visual_instance = (M_q == VISION) & (M_k == VISION) & (I_q == I_k)
score_hw_rot = dot(q_h, rope_h(delta_h) * k_h) \
+ dot(q_w, rope_w(delta_w) * k_w)
score_hw_marg = dot(q_h, Rbar_h * k_h) + dot(q_w, Rbar_w * k_w)
score = score_t + where(same_visual_instance, score_hw_rot, score_hw_marg)
```
### 9\.3Complexity
RIG\-RoPE adds no learned embeddings and does not require anL×LL\\times Lmask\. The memory overhead isO\(L\)O\(L\)metadata for modality IDs, instance IDs, and duration coordinates\. The marginal operatorsR¯h,R¯w\\bar\{R\}\_\{h\},\\bar\{R\}\_\{w\}are fixed frequency\-wise attenuation factors and can be stored as small per\-head constants\. When the zero fallback is used, the H/W fallback path is skipped entirely\. The duration\-aware temporal coordinate changes only the scalar offset used by RoPE and does not alter attention complexity\.
## 10Analytic and Empirical Validation Protocol
This report separates theoretical formulation from large\-scale empirical claims\. The following protocol specifies lightweight analytic and model\-level checks for validating the proposed geometric and duration\-aware mechanisms before a full benchmark study\.
### 10\.1Analytic Phase\-Bias Probe
Construct synthetic query and key vectors with controlled content similarity\. Compare the positional component of M\-RoPE and RIG\-RoPE as a function of:
1. 1\.text prefix length before an image,
2. 2\.patch coordinate within an image,
3. 3\.number and order of visual instances,
4. 4\.visual block duration induced by patch count and frame count\.
This probe measures whether standard M\-RoPE produces coordinate\-dependent cross\-relation phases and equal\-step temporal distances, and whether RIG\-RoPE removes unsupported spatial phases without collapsing unregistered pairs to zero displacement while expanding text\-image\-text separations according to visual duration\.
### 10\.2Gauge Perturbation Test
Apply independent coordinate shifts or padding transformations to two images while preserving their content\. For a model using static M\-RoPE, cross\-instance height/width phases change under independent shifts\. RIG\-RoPE logits for cross\-instance H/W subspaces remain invariant up to the fixed marginal attenuation because unregistered spatial displacement is marginalized\.
### 10\.3Duration Perturbation Test
Compare\[Text1,Text2,Text3\]\[\\mathrm\{Text\}\_\{1\},\\mathrm\{Text\}\_\{2\},\\mathrm\{Text\}\_\{3\}\]with\[Text1,Image2,Text3\]\[\\mathrm\{Text\}\_\{1\},\\mathrm\{Image\}\_\{2\},\\mathrm\{Text\}\_\{3\}\]and vary the visual patch count ofImage2\\mathrm\{Image\}\_\{2\}\. Equal\-step temporal assignment keeps the text\-text offset fixed, whereas duration\-aware assignment changes the offset byDImage2D\_\{\\mathrm\{Image\}\_\{2\}\}\. For videos, varyFbF\_\{b\}while keeping per\-frame content fixed and verify that internal frame offsets followDb\(ρj−ρi\)D\_\{b\}\(\\rho\_\{j\}\-\\rho\_\{i\}\)\.
### 10\.4Small\-Scale Model Patch
Patch an open\-source M\-RoPE\-based model and evaluate without full retraining:
1. 1\.text\-only reasoning to verify duration\-aware coordinates reduce to ordinary 1D RoPE,
2. 2\.single\-image spatial VQA to verify same\-instance spatial reasoning remains intact,
3. 3\.interleaved multi\-image QA to test whether cross\-instance leakage is reduced,
4. 4\.interleaved text\-image\-text and text\-video\-text probes to test duration scaling\.
This stage should be treated as sanity validation rather than final evidence\.
## 11Related Work
#### Rotary position encoding\.
RoPE was introduced in RoFormer\[[1](https://arxiv.org/html/2608.05154#bib.bib1)\]and has become a standard position encoding mechanism in LLMs because it naturally induces relative\-position structure in attention\.
#### Multimodal RoPE\.
Qwen2\-VL introduces M\-RoPE, splitting positional dimensions into temporal, height, and width components to process text, images, and videos at dynamic resolution\[[2](https://arxiv.org/html/2608.05154#bib.bib2)\]\. RIG\-RoPE is designed as a relation\-gated and marginalization\-based refinement of this family rather than a replacement for intra\-instance M\-RoPE\.
#### Cross\-modal positional bias\.
Circle\-RoPE identifies unintended cross\-modal positional biases and proposes a cone\-like/circular geometry so text tokens maintain equal distance to image tokens\[[3](https://arxiv.org/html/2608.05154#bib.bib3)\]\. RIG\-RoPE shares the goal of reducing cross\-modal bias but differs in two ways: it treats pairwise relation type as the routing variable, and it explicitly handles inter\-instance visual\-visual interference through instance IDs and gauge invariance\.
#### Video position encoding\.
VRoPE and VideoRoPE study rotary designs for video LLMs, with emphasis on spatiotemporal coherence and video\-text transition behavior\[[4](https://arxiv.org/html/2608.05154#bib.bib4),[5](https://arxiv.org/html/2608.05154#bib.bib5)\]\. RIG\-RoPE is complementary: it gates when spatial rotations are meaningful across token pairs and replaces equal\-step temporal counters with duration\-aware coordinates for interleaved text, image, and video blocks\.
#### Long\-context VLM positional encoding\.
HoPE studies position encoding for long\-context vision\-language models and introduces hybrid frequency allocation with dynamic temporal scaling for long video understanding\[[6](https://arxiv.org/html/2608.05154#bib.bib6)\]\. RIG\-RoPE addresses a different but related layer of the problem: rather than reallocating frequencies, it asks whether a given pairwise spatial displacement is geometrically valid and how multimodal blocks should contribute to the scalar temporal coordinate\.
#### Efficient attention kernels\.
FlashAttention and FlashAttention\-2 show that exact attention can be made memory\-efficient by tiling computation around GPU memory hierarchy\[[7](https://arxiv.org/html/2608.05154#bib.bib7),[8](https://arxiv.org/html/2608.05154#bib.bib8)\]\. RIG\-RoPE is intended for this execution model: relation gates can be computed inside each tile without materializing dense masks\.
## 12Limitations
This report is preliminary\. It establishes a geometric argument and a concrete algorithmic rule, but it does not yet include large\-scale empirical results\. Several limitations should be addressed before claiming practical superiority:
1. 1\.Empirical uncertainty\.Marginalizing or suppressing cross\-instance H/W rotations is theoretically motivated, but models may have learned to exploit some static\-coordinate artifacts during training\. Fine\-tuning dynamics must be tested\.
2. 2\.Marginal prior choice\.The spatial marginal operators depend on a displacement priorp\(Δ\)p\(\\Delta\)\. We use a zero\-mean Gaussian uncertainty prior by default, which yields nonnegative frequency\-wise attenuation and avoids phase reversal, but its scale parameterη\\etastill requires calibration\. The zero fallback is robust but may discard semantic evidence stored in H/W channels\.
3. 3\.Duration calibration\.The dimension\-aware logarithmic duration functions are theoretically motivated but not yet empirically calibrated\. The constantsαI\\alpha\_\{I\}andαV\\alpha\_\{V\}, the video extension coefficientλV\\lambda\_\{V\}, the interpolation coefficientλ\\lambda, and alternatives such as power\-law spatial or temporal compression should be validated by ablation\. Duration expansion can also alter the distance between instruction text and later questions in interleaved prompts, so calibration anchors and interpolation should be used conservatively\.
4. 4\.Temporal semantics\.Duration\-aware time is an information\-duration coordinate, not necessarily physical wall\-clock time\. Tasks requiring exact timestamps may still benefit from explicit absolute time encodings\.
5. 5\.Video screen\-space approximation\.H/W coordinates within a video should be interpreted as screen\-space coordinates\. Strong camera motion, cropping changes, or object motion can make physical cross\-frame spatial correspondence approximate rather than exact\.
6. 6\.Registration\-aware tasks\.Some tasks may provide explicit correspondences between images, such as stereo pairs, aligned medical scans, or video frame tracking\. In those cases, cross\-instance spatial rotation may be meaningful if a registration map is available\.
7. 7\.Kernel engineering\.The proposed implementation is straightforward conceptually, but high\-performance kernels require careful benchmarking of branching, vectorization, and cache behavior\.
## 13Conclusion
RIG\-RoPE is based on a simple principle: rotary phases should reflect meaningful relative structure\. Spatial phases should be applied only when the corresponding spatial displacement is well defined; unregistered spatial relations should be marginalized rather than assigned zero displacement\. Temporal phases should be measured in an appropriate duration unit rather than an undifferentiated token counter\. Standard multidimensional RoPE applies height/width rotations uniformly after static position assignment, which implicitly treats text tokens and independent visual instances as if they shared a common spatial manifold\. It also risks assigning the same temporal separation to a text token and an entire image block\. This report formalizes why these assumptions are problematic and proposes a relation\-, instance\-, and duration\-aware alternative\.
The resulting method has no learned parameters, preserves ordinary one\-dimensional RoPE on pure text, preserves M\-RoPE within each visual instance, marginalizes or suppresses unsupported spatial rotations for text\-vision and different\-instance visual\-visual pairs, and expands temporal distances according to image and video information duration\. The next step is to validate the theory with lightweight phase\-bias and duration probes, followed by small\-scale model patches and full multimodal benchmark evaluation\.
## References
- \[1\]Jianlin Su, Yu Lu, Shengfeng Pan, Ahmed Murtadha, Bo Wen, and Yunfeng Liu\.RoFormer: Enhanced Transformer with Rotary Position Embedding\.*arXiv preprint arXiv:2104\.09864*, 2021\.
- \[2\]Peng Wang, Shuai Bai, Sinan Tan, Shijie Wang, Zhihao Fan, Jinze Bai, Keqin Chen, Xuejing Liu, Jialin Wang, Wenbin Ge, Yang Fan, Kai Dang, Mengfei Du, Xuancheng Ren, Rui Men, Dayiheng Liu, Chang Zhou, Jingren Zhou, and Junyang Lin\.Qwen2\-VL: Enhancing Vision\-Language Model’s Perception of the World at Any Resolution\.*arXiv preprint arXiv:2409\.12191*, 2024\.
- \[3\]Chengcheng Wang, Jianyuan Guo, Hongguang Li, Yuchuan Tian, Ying Nie, Chang Xu, and Kai Han\.Circle\-RoPE: Cone\-like Decoupled Rotary Positional Embedding for Large Vision\-Language Models\.*arXiv preprint arXiv:2505\.16416*, 2025\.
- \[4\]Zikang Liu, Longteng Guo, Yepeng Tang, Junxian Cai, Kai Ma, Xi Chen, and Jing Liu\.VRoPE: Rotary Position Embedding for Video Large Language Models\.*arXiv preprint arXiv:2502\.11664*, 2025\.
- \[5\]Xilin Wei, Xiaoran Liu, Yuhang Zang, Xiaoyi Dong, Pan Zhang, Yuhang Cao, Jian Tong, Haodong Duan, Qipeng Guo, Jiaqi Wang, Xipeng Qiu, and Dahua Lin\.VideoRoPE: What Makes for Good Video Rotary Position Embedding?*arXiv preprint arXiv:2502\.05173*, 2025\.
- \[6\]Haoran Li, Yingjie Qin, Baoyuan Ou, Lai Xu, and Ruiwen Xu\.HoPE: Hybrid of Position Embedding for Length Generalization in Vision\-Language Models\.*arXiv preprint arXiv:2505\.20444*, 2025\.
- \[7\]Tri Dao, Daniel Y\. Fu, Stefano Ermon, Atri Rudra, and Christopher Ré\.FlashAttention: Fast and Memory\-Efficient Exact Attention with IO\-Awareness\.*arXiv preprint arXiv:2205\.14135*, 2022\.
- \[8\]Tri Dao\.FlashAttention\-2: Faster Attention with Better Parallelism and Work Partitioning\.*arXiv preprint arXiv:2307\.08691*, 2023\.
- \[9\]Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby\.An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale\.*arXiv preprint arXiv:2010\.11929*, 2020\.相似文章
HRoPE:基于单应变换的相对位置编码
HRoPE 提出了一种表面感知的位置编码,将每个 patch 建模为倾斜的 3D 平面,并将平面诱导的单应变换作为相对变换注入注意力机制,从而在无需真实几何信息的情况下提升跨视角对齐与新视角合成的效果。在 RealEstate10K、CO3Dv2 和 DL3DV 上的实验表明,该方法优于现有的几何位置编码。
T-RoPE:用于序列推荐的时间感知旋转位置嵌入
本文介绍了T-RoPE,一种针对序列推荐系统的旋转位置嵌入的时间感知改进,展示了在基准测试上的显著性能提升以及在电子商务中的实际影响。
用于大语言模型长度外推的周期性 RoPE 与谐波周期性 RoPE
该论文提出了周期性 RoPE(P-RoPE)和谐波周期性 RoPE(HP-RoPE),通过在滑动窗口内重复旋转角度来消除位置耗尽问题,使困惑度在上下文长度从 768 增至 16k 时保持近乎不变,并在 16k 长度下实现了 99–100% 的密钥检索准确率,远超标准 RoPE、NTK 和 YaRN。
高维动态旋转位置编码 [P]
介绍了 HDD-RoPE,这是旋转位置编码的一种扩展,它使用高维块和数据相关的旋转速率,在 TinyStories 数据集上显示出比 xPos 更快的收敛速度。
Position Encoding in Transformers: From Absolute and Relative Methods to Rotary Position Embeddings and Long-Context Scaling
A technical survey on position encoding methods in Transformers, covering absolute and relative methods, RoPE, and long-context scaling techniques like Position Interpolation, NTK-aware scaling, YaRN, and LongRoPE.