SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.15637 · ICML · 2025

Mantis: Lightweight Foundation Model for Time Series Classification

Zeynep Akata, Jianfeng Zhang, Ievgen Redko, Simon Roschmann, Quentin Bouniot, Romain Ilbert, Vasilii Feofanov, Lujia Pan, Shifeng Xie, Marius Alonso, Songkang Wen, Hongbo Guo, and 1 more

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 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 4 have no contract verdict; 0 failures of our instrument; 1 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.15637.json · badge: /api/ran/2502.15637.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
vfeofanov/mantis canonical (classifier label)
classifier basis: classifier_2025
4 ran · 1 no recorded run
FunctionStatusWhere it lives
Convolution Ran
ran on a synthesized input
vfeofanov/mantis/src/mantis/architecture/version1.py
code served (permissive licence) · get_code("dd4ec79975efed03")
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, 7, 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
from torch import nn

class Convolution(nn.Module):

    def __init__(self, kernel_size, out_channels, dilation):
        super().__init__()
        self.receptive_field = (kernel_size - 1) * dilation + 1
        padding = self.receptive_field // 2
        self.conv = nn.Conv1d(in_channels=1, out_channels=out_channels, kernel_size=kernel_size, dilation=1, padding=padding)

    def forward(self, x):
        out = self.conv(x)
        out = out.transpose(1, 2)
        return out


INIT_ARGS = {
    'kernel_size': 3,
    'out_channels': 4,
    'dilation': 2,
}

ARGS = {
    'x': torch.randn(2, 1, 5),
}
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, 7, 4) — shape (2, 7, 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)
LinearEncoder Ran
ran on a synthesized input
vfeofanov/mantis/src/mantis/architecture/version1.py
code served (permissive licence) · get_code("dbf7a6bc99c16887")
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, 3) 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
from torch import nn

class LinearEncoder(nn.Module):

    def __init__(self, input_dim, output_dim):
        super(LinearEncoder, self).__init__()
        self.linear = nn.Linear(input_dim, output_dim)
        self.layer_norm = nn.LayerNorm(normalized_shape=output_dim, eps=1e-15)

    def forward(self, x):
        return self.layer_norm(self.linear(x))


INIT_ARGS = {
    'input_dim': 4,
    'output_dim': 3,
}

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

if __name__ == '__main__':
    encoder = LinearEncoder(**INIT_ARGS)
    output = encoder(**ARGS)
    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 2, dtype family float, shape (2, 3) — shape (2, 3) 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)
MultiScaledScalarEncoder Ran
ran on a synthesized input
vfeofanov/mantis/src/mantis/architecture/version1.py
code served (permissive licence) · get_code("d4a16ea8c89fe27c")
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
from torch import nn

class ScalarEncoder(nn.Module):

    def __init__(self, k, hidden_dim):
        super(ScalarEncoder, self).__init__()
        self.w = torch.nn.Parameter(torch.rand((1, hidden_dim), dtype=torch.float, requires_grad=True))
        self.b = torch.nn.Parameter(torch.rand((1, hidden_dim), dtype=torch.float, requires_grad=True))
        self.k = k
        self.layer_norm = torch.nn.LayerNorm(normalized_shape=hidden_dim, eps=1e-15)

    def forward(self, x):
        z = x * self.w + self.k * self.b
        y = self.layer_norm(z)
        return y

class MultiScaledScalarEncoder(nn.Module):

    def __init__(self, scales, hidden_dim, epsilon):
        """
        A multi-scaled encoding of a scalar variable:
        https://arxiv.org/pdf/2310.07402.pdf

        Parameters
        ----------
        scales: list, default=None
            List of scales. By default, initialized as [1e-4, 1e-3, 1e-2, 1e-1, 1, 1e1, 1e2, 1e3, 1e4].
        hidden_dim: int, default=32
            Hidden dimension of a scalar encoder.
        epsilon: float, default=1.1
            A constant term used to tolerate the computational error in computation of scale weights.
        """
        super(MultiScaledScalarEncoder, self).__init__()
        self.register_buffer('scales', torch.tensor(scales))
        self.epsilon = epsilon
        self.encoders = nn.ModuleList([ScalarEncoder(k, hidden_dim) for k in scales])

    def forward(self, x):
        alpha = abs(1 / torch.log(torch.matmul(abs(x), 1 / self.scales.reshape(1, -1)) + self.epsilon))
        alpha = alpha / torch.sum(alpha, dim=-1, keepdim=True)
        alpha = torch.unsqueeze(alpha, dim=-1)
        y = [encoder(x) for encoder in self.encoders]
        y = torch.stack(y, dim=-2)
        y = torch.sum(y * alpha, dim=-2)
        return y

INIT_ARGS = {
    'scales': [1e-4, 1e-3, 1e-2, 1e-1, 1.0, 1e1, 1e2, 1e3, 1e4],
    'hidden_dim': 4,
    'epsilon': 1.1
}

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

if __name__ == '__main__':
    model = MultiScaledScalarEncoder(**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)
ScalarEncoder Ran
ran on a synthesized input
vfeofanov/mantis/src/mantis/architecture/version1.py
code served (permissive licence) · get_code("e34c3323bf729c14")
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
from torch import nn

class ScalarEncoder(nn.Module):

    def __init__(self, k, hidden_dim):
        super(ScalarEncoder, self).__init__()
        self.w = torch.nn.Parameter(torch.rand((1, hidden_dim), dtype=torch.float, requires_grad=True))
        self.b = torch.nn.Parameter(torch.rand((1, hidden_dim), dtype=torch.float, requires_grad=True))
        self.k = k
        self.layer_norm = torch.nn.LayerNorm(normalized_shape=hidden_dim, eps=1e-15)

    def forward(self, x):
        z = x * self.w + self.k * self.b
        y = self.layer_norm(z)
        return y


INIT_ARGS = {
    'k': 2.5,
    'hidden_dim': 4
}

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

if __name__ == '__main__':
    encoder = ScalarEncoder(**INIT_ARGS)
    output = encoder(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    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)
TokenGeneratorUnit Not yet run
unverified (harvested, no recorded run)
vfeofanov/mantis/src/mantis/architecture/version1.py
code served (permissive licence) · get_code("82e5bb6028adec5a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 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 5 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

While foundation models have revolutionized various domains, their application to time series classification remains rather under-explored, with existing literature predominantly focused on forecasting. To bridge this gap, we introduce Mantis, a transformer-based foundation model pretrained exclusively on synthetic data via selfsupervised contrastive learning. We demonstrate that effective tokenization is critical to unlocking the full potential of transformers, proposing a novel token generator unit. Furthermore, we introduce an enhanced test-time methodology that bridges the performance gap between Mantis and strong specialized approaches by leveraging intermediate-layer representations, selfensembling, and cross-model embedding fusion. Extensive experiments demonstrate that Mantis establishes a new state-of-the-art, outperforming existing foundation models across four diverse dataset collections covering various application domains. The source code is available at https://github.com/vfeofanov/mantis.

For agents

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

get_harvested_code_for_paper("2502.15637")
get_code_for_paper("2502.15637")
have("2502.15637")

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

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

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

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

Connect an agent — have() is free.