SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.05751 · ICLR · 2024

MG-TSD: Multi-Granularity Time Series Diffusion Models with Guided Learning Process

Weiqing Liu, Chang Xu, Jiang Bian, Xinyao Fan, Yueying Wu, Yuhao Huang

arXiv · PDF · Open in the Atlas

Code that ran

5 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; 0 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 4 failures of our instrument; 5 no recorded run), measured 2026-11-21; 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/2403.05751.json · badge: /api/ran/2403.05751.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
Hundredl/MG-TSD canonical (classifier label)
classifier basis: census
5 ran · 5 no recorded run
FunctionStatusWhere it lives
default Ran
ran; our contract draft was wrong, not the code
Hundredl/MG-TSD/src/mgtsd_module.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from Smith42/astroddpm, is pointer only (licence: AGPL-3.0) · get_code("b5c54401114d79c1")
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 Smith42/astroddpm, and AGPL-3.0, as GitHub detects it on that repository, is not in the permissive set Syntology serves inline. 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.

get_module_forward_input_names Ran
ran; our contract draft was wrong, not the code
Hundredl/MG-TSD/src/utils.py
code served (permissive licence) · get_code("5dc406db3d593203")
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 list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 inspect

torch.manual_seed(0)

class SimpleModule(nn.Module):
    def forward(self, x, y, z=None):
        return x + y

class AnotherModule(nn.Module):
    def forward(self, input_tensor):
        return input_tensor * 2

class ModuleWithVarArgs(nn.Module):
    def forward(self, a, b, *args, **kwargs):
        return a + b

# Test the function with different modules
module1 = SimpleModule()
module2 = AnotherModule()
module3 = ModuleWithVarArgs()

ARGS = {
    "module": module1
}
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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
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
noise_like Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Hundredl/MG-TSD/src/mgtsd_module.py
code served (permissive licence) · get_code("c5fe8ab6ba5d7df5")
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 3, dtype family float, shape (2, 4, 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

torch.manual_seed(0)

# The function noise_like takes:
# - shape: a tuple/list representing tensor dimensions
# - device: a torch device
# - repeat: a boolean flag

# Based on the function body:
# - shape is used with indexing (shape[0], shape[1:]) and len()
# - device is passed to torch.randn()
# - repeat is a boolean controlling which branch to execute

ARGS = {
    "shape": (2, 4, 3),
    "device": torch.device("cpu"),
    "repeat": False,
}
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 3, dtype family float, shape (2, 4, 3) — shape (2, 4, 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: none by the harness; any seed is in the setup block
str2bool Ran
ran, violated the contract we drafted
Hundredl/MG-TSD/src/run_mgtsd.py
code served (permissive licence) · get_code("25c7475539e39da4")
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

def str2bool(v):
    return v.lower() in ('yes', 'true', 't', '1')

ARGS = {
    'v': 'true'
}
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
weighted_average Ran
ran; our contract draft was wrong, not the code
Hundredl/MG-TSD/src/utils.py
code served (permissive licence) · get_code("23cd21b046ab5b4d")
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 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)

# Test case 1: weighted average with weights and dim specified
x = torch.randn(2, 4)
weights = torch.ones(2, 4)
weights[0, 1] = 0  # zero out one weight to test masking

ARGS = {
    "x": x,
    "weights": weights,
    "dim": 0,
}
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 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
creat_coarse_data Not yet run
unverified (harvested, no recorded run)
Hundredl/MG-TSD/src/multi_gran_generator.py
code served (permissive licence) · get_code("2c9062939ccf6c68")
How it ran

no invocation recorded.

creat_coarse_data_elec Not yet run
unverified (harvested, no recorded run)
Hundredl/MG-TSD/src/multi_gran_generator.py
code served (permissive licence) · get_code("5da4ff41f061dd67")
How it ran

no invocation recorded.

extract Not yet run
unverified (harvested, no recorded run)
Hundredl/MG-TSD/src/mgtsd_module.py
code served (permissive licence) · get_code("09c8479d9a5b3e06")
How it ran

no invocation recorded.

lags_for_fourier_time_features_from_frequency Not yet run
unverified (harvested, no recorded run)
Hundredl/MG-TSD/src/feature.py
code served (permissive licence) · get_code("223b94f466aac14c")
How it ran

no invocation recorded.

plot Not yet run
unverified (harvested, no recorded run)
Hundredl/MG-TSD/src/utils.py
code served (permissive licence) · get_code("1c63d0cd11d2c9b7")
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, 6 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 2 the same month, 5 later) and 4 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
extract 77 other papers
37 dated earlier, 2 the same month, 36 later, 2 same year, order not determinable · 32 only as an assembly brick
1711.11585 (2017-11)
High-Resolution Image Synthesis and Semantic Manipulation with Conditional GANs
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2102.05379 (2021-02)
Argmax Flows and Multinomial Diffusion: Learning Categorical Distributions
and 74 more not named here
str2bool 23 other papers
22 dated earlier, 1 later
1410.5401 (2014-10)
Neural Turing Machines
1502.04623 (2015-02)
DRAW: A Recurrent Neural Network For Image Generation
1504.06852 (2015-04)
FlowNet: Learning Optical Flow with Convolutional Networks
and 20 more not named here
default 4 other papers
2 dated earlier, 1 the same month, 1 later
2111.01713 (2021-11)
Realistic galaxy image simulation via score-based generative models
2309.00073 (2023-09)
Diffusion Variational Autoencoder for Tackling Stochasticity in Multi-Step Regression Stock Price Prediction
2403.07860 (2024-03)
Bridging Different Language Models and Generative Vision Models for Text-to-Image Generation
and 1 more not named here
noise_like 2 other papers
1 dated earlier, 1 later · 1 only as an assembly brick
2209.14566 (2022-09)
Diffusion Adversarial Representation Learning for Self-supervised Vessel Segmentation
2503.22983 (2025-03)
scSplit: Bringing Severity Cognizance to Image Decomposition in Fluorescence Microscopy
get_module_forward_input_names 1 other paper
1 later
2509.19975 (2025-09)
From Samples to Scenarios: A New Paradigm for Probabilistic Forecasting
weighted_average 1 other paper
1 dated earlier
2004.10240 (2020-04)
Deep Learning for Time Series Forecasting: Tutorial and Literature Survey

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-21.

Repositories linked to this paper

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

Abstract

Recently, diffusion probabilistic models have attracted attention in generative time series forecasting due to their remarkable capacity to generate high-fidelity samples. However, the effective utilization of their strong modeling ability in the probabilistic time series forecasting task remains an open question, partially due to the challenge of instability arising from their stochastic nature. To address this challenge, we introduce a novel Multi-Granularity Time Series Diffusion (MG-TSD) model, which achieves state-of-the-art predictive performance by leveraging the inherent granularity levels within the data as given targets at intermediate diffusion steps to guide the learning process of diffusion models. The way to construct the targets is motivated by the observation that the forward process of the diffusion model, which sequentially corrupts the data distribution to a standard normal distribution, intuitively aligns with the process of smoothing fine-grained data into a coarse-grained representation, both of which result in a gradual loss of fine distribution features. In the study, we derive a novel multigranularity guidance diffusion loss function and propose a concise implementation method to effectively utilize coarse-grained data across various granularity levels. More importantly, our approach does not rely on additional external data, making it versatile and applicable across various domains. Extensive experiments conducted on real-world datasets demonstrate that our MG-TSD model outperforms existing time series prediction methods. Our code is available at https://github.com/Hundredl/MG-TSD.

For agents

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

get_harvested_code_for_paper("2403.05751")
get_code_for_paper("2403.05751")
have("2403.05751")

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

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

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

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

Connect an agent — have() is free.