SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.03264 · ICLR · 2025

GTM: A General Time-series Model for Enhanced Representation Learning of Time-Series Data

Enhong Chen, Defu Lian, Hong Xie, Gangwei Jiang, Cheng He, Xu Huang, Zhaoyi Li, Xijie Liang, Zengrong Zheng, Patrick Lee

arXiv · PDF · Open in the Atlas

Code that ran

8 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (8 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 0 failures of our instrument; 4 no recorded run), measured 2026-11-22; 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.03264.json · badge: /api/ran/2502.03264.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
MMTS4All/GTM community
Papers with Code archive
8 ran · 4 no recorded run
FunctionStatusWhere it lives
AdaptiveFourierNeuralOperator Ran
ran on a synthesized input · constructed an object; no result was computed
MMTS4All/GTM/models/GTM.py
code served (permissive licence) · get_code("44485ec726cccb0f")
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 an instance of its own class, AdaptiveFourierNeuralOperator: the run constructed the object and did not call it, so no result was computed. 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 torch import nn

torch.manual_seed(0)

class ArgsConfig:
    """Stand-in config object for AdaptiveFourierNeuralOperator"""
    def __init__(self):
        self.num_gran = 3  # number of granularities

ARGS = {
    "args": ArgsConfig(),
    "dim": 4
}
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 AdaptiveFourierNeuralOperator — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a AdaptiveFourierNeuralOperator 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
AttentionLayer Ran
ran on a synthesized input · constructed an object; no result was computed
MMTS4All/GTM/models/GTM.py
code served (permissive licence) · get_code("eff770b42c87befc")
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 an instance of its own class, AttentionLayer: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

# Define a simple inner attention mechanism that the AttentionLayer will use
class SimpleAttention(nn.Module):
    """Minimal attention mechanism that accepts queries, keys, values, and mask."""
    
    def __init__(self):
        super(SimpleAttention, self).__init__()
    
    def forward(self, queries, keys, values, attn_mask):
        """
        Simple attention that returns output and attention weights.
        
        Args:
            queries: [B, L, H, d_keys]
            keys: [B, S, H, d_keys]
            values: [B, S, H, d_values]
            attn_mask: [B, H, L, S] or None
            
        Returns:
            tuple: (output, attention_weights)
        """
        B, L, H, d_k = queries.shape
        S = keys.shape[1]
        d_v = values.shape[-1]
        
        # Simple dot-product attention
        scores = torch.matmul(queries, keys.transpose(-2, -1)) / (d_k ** 0.5)
        
        if attn_mask is not None:
            scores = scores.masked_fill(attn_mask, float('-inf'))
        
        attn_weights = torch.softmax(scores, dim=-1)
        attn_weights = torch.nan_to_num(attn_weights, 0.0)
        
        output = torch.matmul(attn_weights, values)
        
        return output, attn_weights

# Set up parameters
d_model = 8
n_heads = 2
d_keys = 4
d_values = 4

attention_mechanism = SimpleAttention()

ARGS = {
    'attention': attention_mechanism,
    'd_model': d_model,
    'n_heads': n_heads,
    'd_keys': d_keys,
    'd_values': d_values
}
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 AttentionLayer — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a AttentionLayer 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
BaseMaskProcessor Ran
ran on a synthesized input · constructed an object; no result was computed
MMTS4All/GTM/models/GTM.py
code served (permissive licence) · get_code("aeb8b10e4192caf8")
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 an instance of its own class, BaseMaskProcessor: the run constructed the object and did not call it, so no result was computed. 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 numpy as np

torch.manual_seed(0)

# Create a simple batch of time series samples
# Each sample has shape [L, D] where L is sequence length, D is feature dimension
sample1 = np.random.randn(8, 3).astype(np.float32)  # 8 timesteps, 3 features
sample2 = np.random.randn(6, 3).astype(np.float32)  # 6 timesteps, 3 features
sample3 = np.random.randn(7, 3).astype(np.float32)  # 7 timesteps, 3 features

batch = [sample1, sample2, sample3]

# Optional: sequence lengths for padded sequences
seq_lengths = np.array([8, 6, 7])

ARGS = {
    'mask_ratio': 0.15
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type BaseMaskProcessor — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BaseMaskProcessor 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
Decoder Ran
ran on a synthesized input · constructed an object; no result was computed
MMTS4All/GTM/models/GTM.py
code served (permissive licence) · get_code("3d8dc3ec2d21aba3")
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 an instance of its own class, Decoder: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

# Create a minimal decoder layer that satisfies the forward signature
class MinimalDecoderLayer(nn.Module):
    def __init__(self, d_model):
        super(MinimalDecoderLayer, self).__init__()
        self.linear = nn.Linear(d_model, d_model)
    
    def forward(self, x, cross, time_gra, x_mask=None, cross_mask=None):
        # Process x with cross-attention information
        # time_gra is a list, cross and x are tensors, masks are optional
        return self.linear(x)

# Create decoder layers
d_model = 4
num_layers = 2
layers = [MinimalDecoderLayer(d_model) for _ in range(num_layers)]

# Create normalization layer
norm_layer = nn.LayerNorm(d_model)

# Create projection layer
projection = nn.Linear(d_model, d_model)

ARGS = {
    "layers": layers,
    "norm_layer": norm_layer,
    "projection": projection,
}

# Test the forward pass to ensure it works
if __name__ == "__main__":
    decoder = nn.Module()
    # Manually construct to test
    decoder = type('Decoder', (), {
        'layers': nn.ModuleList(layers),
        'norm': norm_layer,
        'projection': projection,
    })()
    
    # Create test inputs
    batch_size = 2
    seq_len = 3
    cross_seq_len = 5
    
    x = torch.randn(batch_size, seq_len, d_model)
    cross = torch.randn(batch_size, cross_seq_len, d_model)
    time_gra = [1, 2, 3]  # Simple list of temporal granularity
    x_mask = None
    cross_mask = None
    
    # This would be called in actual execution:
    # output = decoder.forward(x, cross, time_gra, x_mask, cross_mask)
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 Decoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Decoder 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
FullAttention Ran
ran on a synthesized input · constructed an object; no result was computed
MMTS4All/GTM/models/GTM.py
code served (permissive licence) · get_code("0d20d1932c9bebf4")
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 an instance of its own class, FullAttention: the run constructed the object and did not call it, so no result was computed. 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 torch import nn
import numpy as np

torch.manual_seed(0)

# Create sample tensors
B, L, H, E, S, D = 2, 4, 3, 5, 6, 7

queries = torch.randn(B, L, H, E)
keys = torch.randn(B, S, H, E)
values = torch.randn(B, S, H, D)

# Create attn_mask - can be None or a TriangularCausalMask instance
from math import sqrt

class TriangularCausalMask:
    def __init__(self, B, L, device='cpu'):
        mask_shape = [B, 1, L, L]
        with torch.no_grad():
            self._mask = torch.triu(torch.ones(mask_shape, dtype=torch.bool), diagonal=1).to(device)
    
    @property
    def mask(self):
        return self._mask

attn_mask = TriangularCausalMask(B, L, device='cpu')

# Define ARGS dict with all FullAttention parameters
ARGS = {
    'mask_flag': True,
    'factor': 5,
    'scale': None,
    'attention_dropout': 0.1,
    'output_attention': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type FullAttention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a FullAttention 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
Lora_linear Ran
ran on a synthesized input · constructed an object; no result was computed
MMTS4All/GTM/models/GTM.py
code served (permissive licence) · get_code("9dadf5b0f704b074")
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 an instance of its own class, Lora_linear: the run constructed the object and did not call it, so no result was computed. 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 torch import nn

torch.manual_seed(0)

# Parameters for Lora_linear
alpha = 0.5
r = 2
d_model = 4

ARGS = {
    "alpha": alpha,
    "r": r,
    "d_model": d_model,
}
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 Lora_linear — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Lora_linear 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
PositionalEmbedding Ran
ran on a synthesized input · constructed an object; no result was computed
MMTS4All/GTM/models/GTM.py
code served (permissive licence) · get_code("d25f0fc2a64d647c")
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 an instance of its own class, PositionalEmbedding: the run constructed the object and did not call it, so no result was computed. 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 torch import nn

torch.manual_seed(0)

# Define ARGS dict with all parameters for PositionalEmbedding.__init__
ARGS = {
    "d_model": 4,
    "max_len": 5000,
}

# Create a test module instance to verify it works
pos_embed = nn.Module.__new__(type('PositionalEmbedding', (nn.Module,), {}))

# Additional test data for forward pass
test_pos_1 = torch.tensor([[1, 2, 3], [4, 5, 6]], dtype=torch.long)
test_pos_2 = torch.tensor([[1, 2, 3], [4, 5, 6]], dtype=torch.long)
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 PositionalEmbedding — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a PositionalEmbedding 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
TriangularCausalMask Ran
ran on a synthesized input · constructed an object; no result was computed
MMTS4All/GTM/models/GTM.py
code served (permissive licence) · get_code("f83f888e1d762aef")
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 an instance of its own class, TriangularCausalMask: the run constructed the object and did not call it, so no result was computed. 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

torch.manual_seed(0)

ARGS = {
    'B': 2,
    'L': 4,
    'device': 'cpu',
}
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 TriangularCausalMask — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TriangularCausalMask 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
DecoderLayer Not yet run
unverified (harvested, no recorded run)
MMTS4All/GTM/models/GTM.py
code served (permissive licence) · get_code("b6cad3bbf33a540a")
How it ran

no invocation recorded.

GLMMaskProcessor4TSGPU Not yet run
unverified (harvested, no recorded run)
MMTS4All/GTM/models/GTM.py
code served (permissive licence) · get_code("416b68ad56ace4fd")
How it ran

no invocation recorded.

Model Not yet run
unverified (harvested, no recorded run)
MMTS4All/GTM/models/GTM.py
code served (permissive licence) · get_code("8c3f69bf3422858a")
How it ran

no invocation recorded.

PatchEmbedding Not yet run
unverified (harvested, no recorded run)
MMTS4All/GTM/models/GTM.py
code served (permissive licence) · get_code("001088d43371581b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 11 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
TriangularCausalMask
brick of this paper's assembly: helper
14 other papers
4 dated earlier, 10 later · 12 only as an assembly brick
2012.07436 (2020-12)
Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting
2212.08151 (2022-12)
First De-Trend then Attend: Rethinking Attention for Time-Series Forecasting
2411.04554 (2024-11)
Peri-midFormer: Periodic Pyramid Transformer for Time Series Analysis
and 11 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-22.

Repositories linked to this paper

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

Abstract

Despite recent progress in time-series foundation models, challenges persist in improving representation learning and adapting to diverse downstream tasks. We introduce a General Time-series Model (GTM), which advances representation learning via a novel frequency-domain attention mechanism that captures timegranularity-aware features, an aspect underexplored in prior research. We further propose a novel pre-training strategy that unifies reconstruction and autoregressive objectives through a hybrid masking mechanism. Our pre-training strategy, combined with 2D positional encoding and span shuffling, enhances the robustness and generalization of representations. GTM is established as the first generative-taskagnostic model for time-series analysis, enabling seamless adaptation to various generative tasks without any task-specific modifications. Extensive experiments demonstrate that GTM consistently outperforms SOTA models on various generative tasks and achieves strong classification results with minimal adaptation. Furthermore, GTM exhibits clear scaling behavior, with accuracy improving as model size and pre-training data increase.

For agents

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

get_harvested_code_for_paper("2502.03264")
get_code_for_paper("2502.03264")
have("2502.03264")

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

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

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

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

Connect an agent — have() is free.