SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.07244 · ICML · 2025

Linear Transformers as VAR Models: Aligning Autoregressive Attention Mechanisms with Autoregressive Forecasting

Jiecheng Lu, Shihao Yang

arXiv · PDF · Open in the Atlas

Code that ran

7 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 0 failures of our instrument; 2 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2502.07244.json · badge: /api/ran/2502.07244.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
ljc-fvnr/structural-aligned-mixture-of-var canonical (classifier label)
classifier basis: classifier_2025
7 ran · 2 no recorded run
FunctionStatusWhere it lives
BatchedInvertibleMatrix Ran
ran on a synthesized input
ljc-fvnr/structural-aligned-mixture-of-var/models/AutoregressiveAlignment.py
code served (permissive licence) · get_code("cc613e8946fad5b9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np

class BatchedInvertibleMatrix(nn.Module):

    def __init__(self, h, d, scale=0.02):
        super(BatchedInvertibleMatrix, self).__init__()
        self.h = h
        self.d = d
        scaling_factor = np.sqrt(scale / np.sqrt(d))
        self.LU = nn.Parameter(scaling_factor * torch.randn(h, d, d))

    def forward(self, get_inverse=True, get_LU=False):
        L = torch.tril(self.LU, -1) + torch.eye(self.d, device=self.LU.device).unsqueeze(0).expand(self.h, -1, -1)
        U = torch.triu(self.LU, 1)
        diag_elements = F.softplus(torch.diagonal(self.LU, dim1=-2, dim2=-1))
        U = U + torch.diag_embed(diag_elements)
        if get_LU:
            return (L, U)
        if not get_inverse:
            return torch.matmul(L, U)
        identity = torch.eye(self.d, device=self.LU.device).unsqueeze(0).expand(self.h, -1, -1)
        L_inv = torch.linalg.solve_triangular(L, identity, upper=False)
        U_inv = torch.linalg.solve_triangular(U, identity, upper=True)
        LU = torch.matmul(L, U)
        LU_inv = torch.matmul(U_inv, L_inv)
        return (LU, LU_inv)


INIT_ARGS = {
    'h': 2,
    'd': 4,
    'scale': 0.02
}

ARGS = {
    'get_inverse': True,
    'get_LU': False
}

if __name__ == '__main__':
    model = BatchedInvertibleMatrix(**INIT_ARGS)
    result = model(**ARGS)
    print("Forward pass successful")
    print(f"Result type: {type(result)}")
    if isinstance(result, tuple):
        print(f"Tuple length: {len(result)}")
        print(f"LU shape: {result[0].shape}")
        print(f"LU_inv shape: {result[1].shape}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
FixedVAR Ran
ran on a synthesized input
ljc-fvnr/structural-aligned-mixture-of-var/models/AutoregressiveAlignment.py
code served (permissive licence) · get_code("6ef77d317ed5c58d")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (4, 8, 16) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

class Config:
    def __init__(self):
        self.n_embd = 16
        self.n_head = 4
        self.enc_in = 2
        self.dropout = 0.1

INIT_ARGS = {
    'config': Config(),
    'max_len': 128
}

ARGS = {
    'X': torch.randn(4, 8, 16)
}

if __name__ == '__main__':
    from torch import nn
    
    class FixedVAR(nn.Module):

        def __init__(self, config, max_len=128):
            super(FixedVAR, self).__init__()
            self.D = config.n_embd
            self.n_head = config.n_head
            assert self.D % self.n_head == 0
            self.d = self.D // self.n_head
            self.C = config.enc_in
            self.fixed_q = nn.Parameter(0.02 * torch.randn(1, self.C, max_len, self.n_head, self.d))
            self.fixed_v = nn.Parameter(0.02 * torch.randn(1, self.C, max_len, self.n_head, self.d))
            self.dropout = nn.Dropout(config.dropout)

        def forward(self, X, *args, **kwargs):
            B, L, D = X.shape
            K = X.reshape(B, L, self.n_head, -1)
            b = B // self.C
            Q = self.fixed_q[:, :, 0:L].expand(b, -1, -1, -1, -1).reshape(B, L, self.n_head, self.d)
            V = self.fixed_v[:, :, 0:L].expand(b, -1, -1, -1, -1).reshape(B, L, self.n_head, self.d)
            W = torch.einsum('blhd,blhe->blhde', K, V)
            W = torch.cumsum(W, dim=1)
            X = torch.einsum('blhd,blhde->blhe', Q, W)
            X = X.reshape(B, L, D)
            X = self.dropout(X)
            return X

    model = FixedVAR(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Expected shape: {ARGS['X'].shape}")
    assert output.shape == ARGS['X'].shape, f"Shape mismatch: {output.shape} vs {ARGS['X'].shape}"
    print("Success!")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (4, 8, 16) — shape (4, 8, 16) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
LinearAttention Ran
ran on a synthesized input
ljc-fvnr/structural-aligned-mixture-of-var/models/AutoregressiveAlignment.py
code served (permissive licence) · get_code("fa3be66911755893")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (2, 3, 8) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

class RMSNormMultiHead(nn.Module):

    def __init__(self, n_head: int, dim: int, eps: float=1e-08):
        super().__init__()
        self.n_head = n_head
        self.dim = dim
        self.eps = eps
        self.weight = nn.Parameter(torch.ones(n_head, dim))

    @staticmethod
    def rms_norm(x, eps=1e-05):
        return x * torch.rsqrt(x.pow(2).mean(dim=-1, keepdim=True) + eps)

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        """
        x: (..., n_head, dim)
        """
        normed = self.rms_norm(x.float(), self.eps).type_as(x)
        return normed * self.weight

class LinearAttention(nn.Module):

    def __init__(self, config):
        super(LinearAttention, self).__init__()
        self.D = config.n_embd
        self.n_head = config.n_head
        assert self.D % self.n_head == 0
        self.d = self.D // self.n_head
        self.q_proj = nn.Linear(self.D, self.D, bias=config.bias)
        self.v_proj = nn.Linear(self.D, self.D, bias=config.bias)
        self.q_norm = RMSNormMultiHead(self.n_head, self.d)
        self.v_norm = RMSNormMultiHead(self.n_head, self.d)
        self.dropout = nn.Dropout(config.dropout)

    def forward(self, X, qv_input=None):
        B, L, D = X.shape
        K = X.reshape(B, L, self.n_head, -1)
        Q = self.q_proj(X if qv_input is None else qv_input).reshape(B, L, self.n_head, -1)
        Q = self.q_norm(Q)
        V = self.v_proj(X if qv_input is None else qv_input).reshape(B, L, self.n_head, -1)
        V = self.v_norm(V)
        W = torch.einsum('blhd,blhe->blhde', K, V)
        W = torch.cumsum(W, dim=1)
        X = torch.einsum('blhd,blhde->blhe', Q, W)
        X = X.reshape(B, L, D)
        X = self.dropout(X)
        return X

    def collect_qkv(self, X, qv_input=None):
        B, L, D = X.shape
        K = X.reshape(B, L, self.n_head, -1)
        Q = self.q_proj(X if qv_input is None else qv_input).reshape(B, L, self.n_head, -1)
        Q = self.q_norm(Q)
        V = self.v_proj(X if qv_input is None else qv_input).reshape(B, L, self.n_head, -1)
        V = self.v_norm(V)
        return (Q, K, V)


class Config:
    def __init__(self, n_embd, n_head, bias, dropout):
        self.n_embd = n_embd
        self.n_head = n_head
        self.bias = bias
        self.dropout = dropout


INIT_ARGS = {
    'config': Config(n_embd=8, n_head=2, bias=False, dropout=0.1)
}

ARGS = {
    'X': torch.randn(2, 3, 8),
    'qv_input': None
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 3, 8) — shape (2, 3, 8) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
MLP Ran
ran on a synthesized input
ljc-fvnr/structural-aligned-mixture-of-var/models/AutoregressiveAlignment.py
code served (permissive licence) · get_code("4af1a565eefe778f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

class Config:
    def __init__(self, n_embd, bias, dropout):
        self.n_embd = n_embd
        self.bias = bias
        self.dropout = dropout

class MLP(nn.Module):

    def __init__(self, config):
        super().__init__()
        self.c_fc = nn.Linear(config.n_embd, 4 * config.n_embd, bias=config.bias)
        self.gelu = nn.GELU()
        self.c_proj = nn.Linear(4 * config.n_embd, config.n_embd)
        self.dropout = nn.Dropout(config.dropout)

    def forward(self, x):
        x = self.c_fc(x)
        x = self.gelu(x)
        x = self.c_proj(x)
        x = self.dropout(x)
        return x

INIT_ARGS = {
    'config': Config(n_embd=4, bias=True, dropout=0.1)
}

ARGS = {
    'x': torch.randn(2, 4)
}

if __name__ == '__main__':
    mlp = MLP(**INIT_ARGS)
    output = mlp(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Expected shape: torch.Size([2, 4])")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
MultiSegmentTokenizer Ran
ran on a synthesized input
ljc-fvnr/structural-aligned-mixture-of-var/models/AutoregressiveAlignment.py
code served (permissive licence) · get_code("60ee36d6fa8c1c67")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 2, 8) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import torch.nn.functional as F

class RMSNorm(torch.nn.Module):

    def __init__(self, dim: int, eps: float=1e-05):
        """
        From: https://github.com/meta-llama/llama/blob/main/llama/model.py
        """
        super().__init__()
        self.eps = eps
        self.weight = nn.Parameter(torch.ones(dim))

    @classmethod
    def norm(self, x):
        return x * torch.rsqrt(x.pow(2).mean(-1, keepdim=True) + 1e-05)

    def forward(self, x):
        output = self.norm(x.float()).type_as(x)
        return output * self.weight

NORM = RMSNorm

class MultiSegmentTokenizer(nn.Module):

    def __init__(self, s: int, n_channels: int, d_model: int, number_of_targets=0, univariate=False):
        super(MultiSegmentTokenizer, self).__init__()
        self.s = s
        self.tokenizer = nn.Linear(s, d_model)
        self.d_model = d_model
        n_targets = number_of_targets if number_of_targets else n_channels
        self.context_channel_projection = nn.Linear(n_channels, n_targets)
        self.context_temporal_projection = nn.Linear(s, d_model)
        self.tokenizer_output = nn.Linear(d_model, s)
        self.C = n_channels
        self.number_of_targets = number_of_targets
        self.input_norm_main = NORM(d_model)
        self.input_norm_ctx = NORM(d_model)
        self.univariate = univariate

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        B, C, L = x.shape
        pad_len = (self.s - L % self.s) % self.s
        x_padded = F.pad(x, (pad_len, 0), 'constant', 0)
        L_padded = L + pad_len
        N = L_padded // self.s
        x_segmented = x_padded.view(B, C, N, self.s)
        return x_segmented

    def tokenize(self, x_segmented):
        x_ctx = x_segmented.clone()
        B, C, N, s = x_ctx.shape
        x_ctx = x_ctx.permute(0, 2, 3, 1)
        x_ctx = self.context_channel_projection(x_ctx)
        x_ctx = x_ctx.permute(0, 3, 1, 2)
        x_ctx = self.context_temporal_projection(x_ctx)
        if self.univariate:
            x_ctx = torch.zeros_like(x_ctx)
        x_main = x_segmented[:, -self.number_of_targets:]
        x_main = self.tokenizer(x_main)
        x_main = torch.stack([self.input_norm_ctx(x_ctx), self.input_norm_main(x_main)], dim=3).reshape(B, -1, N * 2, self.d_model)
        return x_main

    def inverse_tokenize(self, x):
        B, C, N, d = x.shape
        x = self.tokenizer_output(x)
        return x

    def process_single_token(self, x):
        x = self.tokenizer(x)
        x = x.unsqueeze(-2)
        return x


INIT_ARGS = {
    's': 8,
    'n_channels': 4,
    'd_model': 16,
    'number_of_targets': 3,
    'univariate': False
}

ARGS = {
    'x': torch.randn(2, 4, 12)
}

if __name__ == '__main__':
    model = MultiSegmentTokenizer(**INIT_ARGS)
    output = model(**ARGS)
    print("Output shape:", output.shape)
    print("Output:", output)
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 4, 2, 8) — shape (2, 4, 2, 8) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
RMSNorm Ran
ran on a synthesized input
ljc-fvnr/structural-aligned-mixture-of-var/models/AutoregressiveAlignment.py
code served (permissive licence) · get_code("45502bf8690c09af")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

class RMSNorm(torch.nn.Module):

    def __init__(self, dim: int, eps: float=1e-05):
        """
        From: https://github.com/meta-llama/llama/blob/main/llama/model.py
        """
        super().__init__()
        self.eps = eps
        self.weight = nn.Parameter(torch.ones(dim))

    @classmethod
    def norm(self, x):
        return x * torch.rsqrt(x.pow(2).mean(-1, keepdim=True) + 1e-05)

    def forward(self, x):
        output = self.norm(x.float()).type_as(x)
        return output * self.weight


INIT_ARGS = {
    'dim': 4,
    'eps': 1e-05,
}

ARGS = {
    'x': torch.randn(2, 4),
}

if __name__ == '__main__':
    model = RMSNorm(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
RMSNormMultiHead Ran
ran on a synthesized input
ljc-fvnr/structural-aligned-mixture-of-var/models/AutoregressiveAlignment.py
code served (permissive licence) · get_code("cc0ecd2c3201fc4c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float, shape (3, 2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

class RMSNormMultiHead(nn.Module):

    def __init__(self, n_head: int, dim: int, eps: float=1e-08):
        super().__init__()
        self.n_head = n_head
        self.dim = dim
        self.eps = eps
        self.weight = nn.Parameter(torch.ones(n_head, dim))

    @staticmethod
    def rms_norm(x, eps=1e-05):
        return x * torch.rsqrt(x.pow(2).mean(dim=-1, keepdim=True) + eps)

    def forward(self, x: torch.Tensor) -> torch.Tensor:
        """
        x: (..., n_head, dim)
        """
        normed = self.rms_norm(x.float(), self.eps).type_as(x)
        return normed * self.weight


INIT_ARGS = {
    'n_head': 2,
    'dim': 4,
    'eps': 1e-08,
}

ARGS = {
    'x': torch.randn(3, 2, 4),
}

if __name__ == '__main__':
    model = RMSNormMultiHead(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    print(f"Output:\n{output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (3, 2, 4) — shape (3, 2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
Model Not yet run
unverified (harvested, no recorded run)
ljc-fvnr/structural-aligned-mixture-of-var/models/AutoregressiveAlignment.py
code served (permissive licence) · get_code("af4d19e1b7122a73")
How it ran

no invocation recorded.

Transformer Not yet run
unverified (harvested, no recorded run)
ljc-fvnr/structural-aligned-mixture-of-var/models/AutoregressiveAlignment.py
code served (permissive licence) · get_code("ce6f9d53b28653be")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Autoregressive attention-based time series forecasting (TSF) has drawn increasing interest, with mechanisms like linear attention sometimes outperforming vanilla attention. However, deeper Transformer architectures frequently misalign with autoregressive objectives, obscuring the underlying vector autoregressive (VAR) structure embedded within linear attention and hindering their ability to capture the data generative processes in TSF. In this work, we first show that a single linear attention layer can be interpreted as a dynamic VAR structure. We then explain that existing multi-layer Transformers have structural mismatches with the autoregressive forecasting objective, which impair interpretability and generalization ability. To address this, we show that by rearranging the MLP, attention, and inputoutput flow, multi-layer linear attention can also be aligned as a VAR model. Then, we propose Structural Aligned Mixture of VAR (SAMoVAR), a linear Transformer variant that integrates interpretable dynamic VAR weights for multivariate TSF. By aligning the Transformer architecture with autoregressive objectives, SAMoVAR delivers improved performance, interpretability, and computational efficiency, comparing to SOTA TSF models. The code implementation is available at this link.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2502.07244")
get_code_for_paper("2502.07244")
have("2502.07244")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2502.07244.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2502.07244.svg)](https://syntology.ai/paper/2502.07244)

Connect an agent — have() is free.