SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.04517 · 2024

xLSTM: Extended Long Short-Term Memory

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-22; 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/2405.04517.json · badge: /api/ran/2405.04517.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
gonzalopezgil/xlstm-ts community (classifier label)
classifier basis not recorded on the link
7 ran · 2 no recorded run
FunctionStatusWhere it lives
create_dataloader Ran
ran on a synthesized input
gonzalopezgil/xlstm-ts/src/ml/models/xlstm_ts/training.py
code served (permissive licence) · get_code("c418ccbf439fb6c1")
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 DataLoader. 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)

# Create small tensors for x and y
# x: 8 samples, 4 features
# y: 8 samples, 3 classes (or labels)
x = torch.randn(8, 4)
y = torch.randint(0, 3, (8,))

# Define arguments
ARGS = {
    'x': x,
    'y': y,
    'batch_size': 2,
    'shuffle': 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 DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader 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
display_metrics Ran
ran on a synthesized input
gonzalopezgil/xlstm-ts/src/ml/results/results.py
code served (permissive licence) · get_code("6ecfef88bb7757dc")
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 DataFrame. 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 pandas as pd
import matplotlib.pyplot as plt

# Create sample metrics accumulators
# The function expects dicts that can be converted to DataFrames via from_dict with orient='index'
# This means the structure should be: {index_name: {column_name: value, ...}, ...}

metrics_accumulator = {
    'model_1': {'RMSSE': 0.85, 'Test Accuracy': 92.5},
    'model_2': {'RMSSE': 0.72, 'Test Accuracy': 94.1},
    'model_3': {'RMSSE': 0.91, 'Test Accuracy': 89.3},
}

metrics_accumulator_denoised = {
    'model_1': {'RMSSE': 0.65, 'Test Accuracy': 95.2},
    'model_2': {'RMSSE': 0.52, 'Test Accuracy': 96.8},
    'model_3': {'RMSSE': 0.71, 'Test Accuracy': 93.5},
}

ARGS = {
    'metrics_accumulator': metrics_accumulator,
    'metrics_accumulator_denoised': metrics_accumulator_denoised,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
get_logger Ran
ran on a synthesized input
gonzalopezgil/xlstm-ts/src/ml/utils/logger.py
code served (permissive licence) · get_code("5a707ddedc88e249")
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 Logger. 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 logging
import sys
import tempfile
import os

# Set up logging
LOG_FORMAT = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
LOG_LEVEL = logging.DEBUG

def is_notebook():
    """Check if the environment is a Jupyter Notebook."""
    try:
        from IPython import get_ipython
        if 'ipykernel' in sys.modules:
            return True
    except ImportError:
        return False
    return False

def get_logger(name, log_to_file=False, file_path='xlstm-ts.log'):
    """Set up and return a logger with handlers based on the environment.

    Args:
        name (str): Logger name.
        log_to_file (bool): Whether to log to a file (Desktop app).
        file_path (str): Path to the log file (if log_to_file is True).
    """
    logger = logging.getLogger(name)
    if not logger.hasHandlers():
        stream_handler = logging.StreamHandler(sys.stdout)
        stream_handler.setFormatter(logging.Formatter(LOG_FORMAT))
        logger.addHandler(stream_handler)
        if is_notebook():
            from IPython.display import display
            stream_handler.setFormatter(logging.Formatter('%(message)s'))
        elif log_to_file:
            file_handler = logging.FileHandler(file_path)
            file_handler.setFormatter(logging.Formatter(LOG_FORMAT))
            logger.addHandler(file_handler)
        logger.setLevel(LOG_LEVEL)
    return logger

# Create a temporary directory for log files
temp_dir = tempfile.gettempdir()
temp_log_path = os.path.join(temp_dir, 'xlstm-ts-test.log')

ARGS = {
    'name': 'test_logger',
    'log_to_file': False,
    'file_path': temp_log_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
IPython — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger 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
inverse_normalise_data_xlstm Ran
ran on a synthesized input
gonzalopezgil/xlstm-ts/src/ml/models/xlstm_ts/preprocessing.py
code served (permissive licence) · get_code("41d97ba1265b3c73")
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 ndarray, ndim 2, dtype family float, shape (8, 1) 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 numpy as np
from sklearn.preprocessing import MinMaxScaler

torch.manual_seed(0)

# Create a small tensor (batch=2, dim=4)
data = torch.randn(2, 4)

# Create a scaler fitted on dummy data
dummy_data = np.random.randn(10, 1)
scaler = MinMaxScaler()
scaler.fit(dummy_data)

ARGS = {
    "data": data,
    "scaler": scaler,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (8, 1) — shape (8, 1) 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
normalise_data_xlstm Ran
ran on a synthesized input
gonzalopezgil/xlstm-ts/src/ml/models/xlstm_ts/preprocessing.py
code served (permissive licence) · get_code("24736fff7894ed00")
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 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 numpy as np
from sklearn.preprocessing import MinMaxScaler

# Create a small numpy array as test data
# Using shape (6, 1) to represent a 1D array that can be reshaped
data = np.array([[1.0], [2.0], [3.0], [4.0], [5.0], [6.0]])

ARGS = {
    "data": data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn — 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: none by the harness; any seed is in the setup block
show_results Ran
ran on a synthesized input
gonzalopezgil/xlstm-ts/src/ml/results/results.py
code served (permissive licence) · get_code("a32843f8e0256e8a")
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 DataFrame. 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 pandas as pd
import torch
import numpy as np

# Create a sample DataFrame that matches what show_results expects
data = {
    'data_type': [0, 0, 1, 1],
    'Test Accuracy': [85.5, 87.3, 82.1, 88.9],
    'Train Accuracy': [90.2, 91.5, 89.3, 92.1],
    'Validation Accuracy': [86.1, 88.2, 83.5, 89.5],
    'MAPE': [5.3, 4.2, 6.1, 3.8],
    'Recall': [0.82, 0.85, 0.79, 0.87],
    'Precision (Rise)': [0.88, 0.89, 0.86, 0.91],
    'Precision (Fall)': [0.80, 0.82, 0.78, 0.84],
    'F1 Score': [0.85, 0.87, 0.82, 0.89],
    'Model': ['ModelA', 'ModelB', 'ModelC', 'ModelD']
}

results_df = pd.DataFrame(data)

ARGS = {
    'results': results_df,
    'data_type': 'Original'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
validate_date Ran
ran on a synthesized input
gonzalopezgil/xlstm-ts/src/gui/utils.py
code served (permissive licence) · get_code("dc006911ff24188e")
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 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.

from datetime import datetime

def validate_date(date_text):
    try:
        datetime.strptime(date_text, '%d/%m/%Y')
        return True
    except ValueError:
        return False

ARGS = {
    'date_text': '25/12/2023'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
evaluate_model Not yet run
unverified (harvested, no recorded run)
gonzalopezgil/xlstm-ts/src/ml/models/xlstm_ts/training.py
code served (permissive licence) · get_code("eefa6a8362a8958c")
How it ran

no invocation recorded.

train_model Not yet run
unverified (harvested, no recorded run)
gonzalopezgil/xlstm-ts/src/ml/models/xlstm_ts/training.py
code served (permissive licence) · get_code("5fec394cd964815b")
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-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

In the 1990s, the constant error carousel and gating were introduced as the central ideas of the Long Short-Term Memory (LSTM). Since then, LSTMs have stood the test of time and contributed to numerous deep learning success stories, in particular they constituted the first Large Language Models (LLMs). However, the advent of the Transformer technology with parallelizable self-attention at its core marked the dawn of a new era, outpacing LSTMs at scale. We now raise a simple question: How far do we get in language modeling when scaling LSTMs to billions of parameters, leveraging the latest techniques from modern LLMs, but mitigating known limitations of LSTMs? Firstly, we introduce exponential gating with appropriate normalization and stabilization techniques. Secondly, we modify the LSTM memory structure, obtaining: (i) sLSTM with a scalar memory, a scalar update, and new memory mixing, (ii) mLSTM that is fully parallelizable with a matrix memory and a covariance update rule. Integrating these LSTM extensions into residual block backbones yields xLSTM blocks that are then residually stacked into xLSTM architectures. Exponential gating and modified memory structures boost xLSTM capabilities to perform favorably when compared to state-of-the-art Transformers and State Space Models, both in performance and scaling.

For agents

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

get_harvested_code_for_paper("2405.04517")
get_code_for_paper("2405.04517")
have("2405.04517")

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

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

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

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

Connect an agent — have() is free.