SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2502.17437 · 2025

Fractal Generative Models

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; 3 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 2 failures of our instrument; 2 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.17437.json · badge: /api/ran/2502.17437.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
LTH14/fractalgen canonical (classifier label)
classifier basis not recorded on the link
7 ran · 2 no recorded run
FunctionStatusWhere it lives
add_weight_decay Ran
ran on a synthesized input
LTH14/fractalgen/util/misc.py
code served (permissive licence) · get_code("793b90955c9ea789")
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

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
        self.bias_layer = nn.Linear(2, 1)
        self.diffloss_param = nn.Parameter(torch.randn(2))
        
    def forward(self, x):
        return x

model = SimpleModel()

ARGS = {
    'model': model,
    'weight_decay': 1e-05,
    'skip_list': ()
}
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
adjust_learning_rate Ran
ran, honoured the contract we drafted
LTH14/fractalgen/util/lr_sched.py
code served (permissive licence) · get_code("3a774664bfc712ec")
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 float, 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
import torch.nn as nn
import torch.optim as optim

torch.manual_seed(0)

# Create a small model to optimize
model = nn.Linear(4, 2)

# Create an optimizer
optimizer = optim.SGD(model.parameters(), lr=0.1)

# Add a parameter group with lr_scale to test that code path
optimizer.add_param_group({'params': [nn.Parameter(torch.randn(3, 4))], 'lr_scale': 0.5})

# Create args dict with all required parameters
ARGS = {
    'optimizer': optimizer,
    'epoch': 5,
    'args': type('Args', (), {
        'warmup_epochs': 2,
        'epochs': 10,
        'lr': 0.1,
        'min_lr': 0.001,
        'lr_schedule': 'cosine'
    })()
}
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 float, 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
all_reduce_mean Ran
ran, honoured the contract we drafted
LTH14/fractalgen/util/misc.py
code served (permissive licence) · get_code("3dc19396537db789")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch.distributed as dist

torch.manual_seed(0)

# The function all_reduce_mean takes a single parameter 'x'
# Looking at the function body:
# - x is converted to a torch.tensor
# - If world_size > 1, it's moved to cuda and used with dist.all_reduce
# - Otherwise, x is returned as-is
# Since we're CPU-only and dist is not initialized, the function will return x unchanged
# We need to provide a numeric value that can be converted to a tensor

ARGS = {
    "x": 5.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 float, 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
center_crop_arr Ran
ran; our contract draft was wrong, not the code
LTH14/fractalgen/util/crop.py
code served (permissive licence) · get_code("1712a07966b542ee")
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 Image. 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 PIL import Image

# Create a small test image
width, height = 256, 256
pil_image = Image.new('RGB', (width, height), color='red')

# Define arguments
ARGS = {
    'pil_image': pil_image,
    'image_size': 64
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
PIL, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int 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
drop_path Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
LTH14/fractalgen/models/ar.py
code served (permissive licence) · get_code("87577b3ff9d32712")
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 Tensor, ndim 4, dtype family float, shape (2, 3, 4, 5) 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)

# Create a small tensor with batch size 2 and 4 dimensions
x = torch.randn(2, 3, 4, 5)

# Define all parameters for drop_path
ARGS = {
    "x": x,
    "drop_prob": 0.5,
    "training": True,
    "scale_by_keep": 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 Tensor, ndim 4, dtype family float, shape (2, 3, 4, 5) — shape (2, 3, 4, 5) 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
find_multiple Ran
ran, honoured the contract we drafted
LTH14/fractalgen/models/ar.py
code served (permissive licence) · get_code("f6ff7671338c9c92")
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 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
import numpy as np

torch.manual_seed(0)

# Analyze the function: find_multiple(n: int, k: int)
# The function takes two integers and returns an integer
# It checks if n is divisible by k, and if not, rounds n up to the next multiple of k

ARGS = {
    "n": 10,
    "k": 3
}
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 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
scaled_dot_product_attention Ran
ran on a synthesized input
LTH14/fractalgen/models/ar.py
code served (permissive licence) · get_code("d2525f74659345d8")
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, 3, 5) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

# Construct tiny tensors for attention mechanism
# query, key, value shapes: (batch, seq_len, embed_dim)
batch_size = 2
seq_len_q = 3
seq_len_k = 4
embed_dim = 5

query = torch.randn(batch_size, seq_len_q, embed_dim)
key = torch.randn(batch_size, seq_len_k, embed_dim)
value = torch.randn(batch_size, seq_len_k, embed_dim)

# Optional attention mask (boolean mask for valid positions)
attn_mask = torch.ones(seq_len_q, seq_len_k, dtype=torch.bool)

ARGS = {
    "query": query,
    "key": key,
    "value": value,
    "attn_mask": attn_mask,
    "dropout_p": 0.1,
    "is_causal": False,
    "scale": None,
}
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, 3, 5) — shape (2, 3, 5) 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_grad_norm_ Not yet run
unverified (harvested, no recorded run)
LTH14/fractalgen/util/misc.py
code served (permissive licence) · get_code("a93537b210192d0c")
How it ran

no invocation recorded.

mask_by_order Not yet run
unverified (harvested, no recorded run)
LTH14/fractalgen/models/mar.py
code served (permissive licence) · get_code("d076098d89dd7262")
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, 8 are also present in other papers whose code we hold (6 with at least one paper dated earlier, 2 the same month, 7 later) and 1 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
drop_path 66 other papers
49 dated earlier, 1 the same month, 13 later, 1 same year, order not determinable, 2 undated · 15 only as an assembly brick
1906.01502 (2019-06)
How multilingual is Multilingual BERT?
2011.10566 (2020-11)
Exploring Simple Siamese Representation Learning
2103.03230 (2021-03)
Barlow Twins: Self-Supervised Learning via Redundancy Reduction
and 63 more not named here
center_crop_arr 37 other papers
24 dated earlier, 2 the same month, 9 later, 2 same year, order not determinable
2211.17091 (2022-11)
Refining Generative Process with Discriminator Guidance in Score-based Diffusion Models
2212.09748 (2022-12)
Scalable Diffusion Models with Transformers
2311.09257 (2023-11)
UFOGen: You Forward Once Large Scale Text-to-Image Generation via Diffusion GANs
and 34 more not named here
all_reduce_mean 25 other papers
20 dated earlier, 4 later, 1 same year, order not determinable
2105.12723 (2021-05)
Nested Hierarchical Transformer: Towards Accurate, Data-Efficient and Interpretable Visual Understanding
2204.09435 (2022-04)
Hephaestus: A large scale multitask dataset towards InSAR understanding
2211.12941 (2022-11)
EurNet: Efficient Multi-Range Relational Modeling of Spatial Multi-Relational Data
and 22 more not named here
get_grad_norm_ 21 other papers
17 dated earlier, 3 later, 1 same year, order not determinable
2308.00566 (2023-08)
Stochastic positional embeddings improve masked image modeling
2310.12979 (2023-10)
Predicting a Protein's Stability under a Million Mutations
2311.13627 (2023-11)
Vamos: Versatile Action Models for Video Understanding
and 18 more not named here
find_multiple 13 other papers
7 dated earlier, 5 later, 1 undated · 2 only as an assembly brick
2406.06525 (2024-06)
Autoregressive Model Beats Diffusion: Llama for Scalable Image Generation
2409.13689 (2024-09)
Temporally Aligned Audio for Video with Autoregression
2410.02705 (2024-10)
ControlAR: Controllable Image Generation with Autoregressive Models
and 10 more not named here
mask_by_order 4 other papers
1 dated earlier, 2 later, 1 undated
2406.11838 (2024-06)
Autoregressive Image Generation without Vector Quantization
2503.08619 (2025-03)
LightGen: Efficient Image Generation through Knowledge Distillation and Direct Preference Optimization
2505.07812 (2025-05)
Continuous Visual Autoregressive Generation via Score Maximization
and 1 more not named here
adjust_learning_rate 3 other papers
3 later
2503.10568 (2025-03)
Autoregressive Image Generation with Randomized Parallel Decoding
2605.27102 (2026-05)
JLT: Clean-Latent Prediction in Latent Diffusion Transformers
2607.17849 (2026-07)
AlphaOracle: Oracle bone script decipherment via human-workflow-inspired deep learning
add_weight_decay 1 other paper
1 same year, order not determinable
2025.acl-long.61 (2025 (year only))
Modeling Uncertainty in Composed Image Retrieval via Probabilistic Embeddings

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

Modularization is a cornerstone of computer science, abstracting complex functions into atomic building blocks. In this paper, we introduce a new level of modularization by abstracting generative models into atomic generative modules. Analogous to fractals in mathematics, our method constructs a new type of generative model by recursively invoking atomic generative modules, resulting in self-similar fractal architectures that we call fractal generative models. As a running example, we instantiate our fractal framework using autoregressive models as the atomic generative modules and examine it on the challenging task of pixel-by-pixel image generation, demonstrating strong performance in both likelihood estimation and generation quality. We hope this work could open a new paradigm in generative modeling and provide a fertile ground for future research. Code is available at https://github.com/LTH14/fractalgen.

For agents

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

get_harvested_code_for_paper("2502.17437")
get_code_for_paper("2502.17437")
have("2502.17437")

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

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

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

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

Connect an agent — have() is free.