SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.06625 · 2023

iTransformer: Inverted Transformers Are Effective for Time Series Forecasting

arXiv · PDF · Open in the Atlas

Code that ran

8 of 10 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; 2 honoured the contract we drafted, 4 violated it and 0 have no contract verdict; 2 failures of our instrument; 2 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, 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/2310.06625.json · badge: /api/ran/2310.06625.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
lss-1138/SegRNN canonical (classifier label)
classifier basis not recorded on the link
2 ran · 1 no recorded run
lucidrains/iTransformer community (classifier label)
classifier basis: plan_row
6 ran · 1 no recorded run
FunctionStatusWhere it lives
identity Ran
ran, honoured the contract we drafted
lucidrains/iTransformer/iTransformer/iTransformer.py
code served (permissive licence) · get_code("7f1040f5e3991d5e")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) 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. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-05T00:37:21Z). 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

torch.manual_seed(0)

# The identity function simply returns its first argument
# and ignores all other args and kwargs
# So we need to provide a value for t and can optionally provide other args/kwargs

t = torch.randn(2, 4)
extra_arg_1 = torch.randn(3, 5)
extra_arg_2 = "some_string"
extra_kwarg_1 = 42
extra_kwarg_2 = [1, 2, 3]

ARGS = {
    "t": t,
    "args": (extra_arg_1, extra_arg_2),
    "kwargs": {"key1": extra_kwarg_1, "key2": extra_kwarg_2}
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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: none by the harness; any seed is in the setup block
PositionalEncoding Ran
ran, honoured the contract we drafted
lss-1138/SegRNN/layers/PatchTST_layers.py
code served (permissive licence) · get_code("16b9b78d429636b7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (8, 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 math

torch.manual_seed(0)

ARGS = {
    'q_len': 8,
    'd_model': 4,
    'normalize': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
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 (8, 4) — shape (8, 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: none by the harness; any seed is in the setup block
default Ran
ran, violated the contract we drafted
lucidrains/iTransformer/iTransformer/attend.py
pointer only (licence: MIT); the stored copy get_code serves, from ThomasMrY/VCT, is pointer only (licence: NONE) · get_code("60fff7c3c400d7ff")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ThomasMrY/VCT, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

default Ran
ran, violated the contract we drafted
lucidrains/iTransformer/iTransformer/iTransformer.py
code served (permissive licence) · get_code("99b3563ebc6734ad")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned int, ndim 0, dtype family int, shape () 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

def exists(v):
    return v is not None

def default(v, d):
    return v if exists(v) else d

# Test case 1: v is not None
v_value = 42
d_value = 100
ARGS = {
    "v": v_value,
    "d": d_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () 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: none by the harness; any seed is in the setup block
exists Ran
ran, violated the contract we drafted
lucidrains/iTransformer/iTransformer/attend.py
pointer only (licence: MIT); the stored copy get_code serves, from ThomasMrY/VCT, is pointer only (licence: NONE) · get_code("aa5486a3650902d8")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ThomasMrY/VCT, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

exists Ran
ran, violated the contract we drafted
lucidrains/iTransformer/iTransformer/iTransformer.py
code served (permissive licence) · get_code("b7c3487f192e31b7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned bool, ndim 0, dtype family float, shape () 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

torch.manual_seed(0)

# The function exists(v) simply checks if v is not None
# It takes a single parameter 'v' and returns True if v is not None, False otherwise

# Test with a non-None value
ARGS = {
    "v": 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () 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: none by the harness; any seed is in the setup block
get_activation_fn Ran
ran; our contract draft was wrong, not the code
lss-1138/SegRNN/layers/PatchTST_layers.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from liubolab/CausalMoE, is pointer only (licence: NONE) · get_code("72b9272542f279c6")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from liubolab/CausalMoE, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

once Ran
ran; our contract draft was wrong, not the code
lucidrains/iTransformer/iTransformer/attend.py
code served (permissive licence) · get_code("52e10a7d6b0fa036")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. 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
from functools import wraps

def once(fn):
    called = False

    @wraps(fn)
    def inner(x):
        nonlocal called
        if called:
            return
        called = True
        return fn(x)
    return inner


def sample_function(x):
    """A simple function that the decorator will wrap."""
    return x * 2


ARGS = {
    "fn": sample_function
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not 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: none by the harness; any seed is in the setup block
Coord2dPosEncoding Not yet run
unverified (harvested, no recorded run)
lss-1138/SegRNN/layers/PatchTST_layers.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from liubolab/CausalMoE, is pointer only (licence: NONE) · get_code("c3fc6992d1e467f3")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from liubolab/CausalMoE, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

pack_one Not yet run
unverified (harvested, no recorded run)
lucidrains/iTransformer/iTransformer/iTransformer2D.py
code served (permissive licence) · get_code("6182326691dd827b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 10 are also present in other papers whose code we hold (10 with at least one paper dated earlier, 9 the same month, 10 later) and 0 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.

FunctionAlso present inEarliest-datedOthers named
exists 486 other papers
231 dated earlier, 15 the same month, 234 later, 4 same year, order not determinable, 2 undated · 78 only as an assembly brick
1603.08155 (2016-03)
Perceptual Losses for Real-Time Style Transfer and Super-Resolution
1611.07004 (2016-11)
Image-to-Image Translation with Conditional Adversarial Networks
1804.04637 (2018-04)
EMBER: An Open Dataset for Training Static PE Malware Machine Learning Models
and 483 more not named here
default 163 other papers
99 dated earlier, 4 the same month, 58 later, 1 same year, order not determinable, 1 undated · 27 only as an assembly brick
1603.08155 (2016-03)
Perceptual Losses for Real-Time Style Transfer and Super-Resolution
1810.00825 (2018-10)
Set Transformer: A Framework for Attention-based Permutation-Invariant Neural Networks
1907.01470 (2019-07)
Augmenting Self-attention with Persistent Memory
and 160 more not named here
identity 54 other papers
18 dated earlier, 3 the same month, 32 later, 1 same year, order not determinable · 11 only as an assembly brick
1611.07004 (2016-11)
Image-to-Image Translation with Conditional Adversarial Networks
1907.01470 (2019-07)
Augmenting Self-attention with Persistent Memory
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
and 51 more not named here
exists 27 other papers
5 dated earlier, 1 the same month, 21 later · 3 only as an assembly brick
1810.00825 (2018-10)
Set Transformer: A Framework for Attention-based Permutation-Invariant Neural Networks
2006.15055 (2020-06)
Object-Centric Learning with Slot Attention
2010.10241 (2020-10)
BYOL works even without batch statistics
and 24 more not named here
default 21 other papers
3 dated earlier, 1 the same month, 17 later · 1 only as an assembly brick
2006.15055 (2020-06)
Object-Centric Learning with Slot Attention
2110.00218 (2021-10)
On the Importance of Gradients for Detecting Distributional Shifts in the Wild
2309.02612 (2023-09)
Music Source Separation with Band-Split RoPE Transformer
and 18 more not named here
once 19 other papers
11 dated earlier, 1 the same month, 7 later · 4 only as an assembly brick
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2202.01855 (2022-02)
Self-Supervised Learning with Random-Projection Quantizer for Speech Recognition
2203.07852 (2022-03)
Block-Recurrent Transformers
and 16 more not named here
PositionalEncoding 16 other papers
1 dated earlier, 2 the same month, 13 later
2308.04791 (2023-08)
PETformer: Long-term Time Series Forecasting via Placeholder-enhanced Transformer
2310.00655 (2023-10)
PatchMixer: A Patch-Mixing Architecture for Long-Term Time Series Forecasting
2310.14838 (2023-10)
Calibration of Time-Series Forecasting: Detecting and Adapting Context-Driven Distribution Shift
and 13 more not named here
pack_one 16 other papers
8 dated earlier, 8 later · 4 only as an assembly brick
2203.07852 (2022-03)
Block-Recurrent Transformers
2205.14135 (2022-05)
FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness
2206.11990 (2022-06)
Equiformer: Equivariant Graph Attention Transformer for 3D Atomistic Graphs
and 13 more not named here
Coord2dPosEncoding 15 other papers
1 dated earlier, 2 the same month, 12 later
2308.04791 (2023-08)
PETformer: Long-term Time Series Forecasting via Placeholder-enhanced Transformer
2310.00655 (2023-10)
PatchMixer: A Patch-Mixing Architecture for Long-Term Time Series Forecasting
2310.14838 (2023-10)
Calibration of Time-Series Forecasting: Detecting and Adapting Context-Driven Distribution Shift
and 12 more not named here
get_activation_fn 15 other papers
1 dated earlier, 2 the same month, 12 later
2308.04791 (2023-08)
PETformer: Long-term Time Series Forecasting via Placeholder-enhanced Transformer
2310.00655 (2023-10)
PatchMixer: A Patch-Mixing Architecture for Long-Term Time Series Forecasting
2310.14838 (2023-10)
Calibration of Time-Series Forecasting: Detecting and Adapting Context-Driven Distribution Shift
and 12 more not named here

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

The recent boom of linear forecasting models questions the ongoing passion for architectural modifications of Transformer-based forecasters. These forecasters leverage Transformers to model the global dependencies over temporal tokens of time series, with each token formed by multiple variates of the same timestamp. However, Transformers are challenged in forecasting series with larger lookback windows due to performance degradation and computation explosion. Besides, the embedding for each temporal token fuses multiple variates that represent potential delayed events and distinct physical measurements, which may fail in learning variate-centric representations and result in meaningless attention maps. In this work, we reflect on the competent duties of Transformer components and repurpose the Transformer architecture without any modification to the basic components. We propose iTransformer that simply applies the attention and feed-forward network on the inverted dimensions. Specifically, the time points of individual series are embedded into variate tokens which are utilized by the attention mechanism to capture multivariate correlations; meanwhile, the feed-forward network is applied for each variate token to learn nonlinear representations. The iTransformer model achieves state-of-the-art on challenging real-world datasets, which further empowers the Transformer family with promoted performance, generalization ability across different variates, and better utilization of arbitrary lookback windows, making it a nice alternative as the fundamental backbone of time series forecasting. Code is available at this repository: https://github.com/thuml/iTransformer.

For agents

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

get_harvested_code_for_paper("2310.06625")
get_code_for_paper("2310.06625")
have("2310.06625")

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

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

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

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

Connect an agent — have() is free.