SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.05147 · 2022

Markup-to-Image Diffusion Models with Scheduled Sampling

arXiv · PDF · Open in the Atlas

Code that ran

6 of 8 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 6 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/2210.05147.json · badge: /api/ran/2210.05147.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
da03/markup2im canonical (classifier label)
classifier basis not recorded on the link
6 ran · 2 no recorded run
FunctionStatusWhere it lives
encode_text Ran
ran on a synthesized input
da03/markup2im/src/markup2im_models.py
code served (permissive licence) · get_code("c02507c005d13ce7")
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, 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
import torch.nn as nn

torch.manual_seed(0)

# Create a minimal text encoder that mimics a transformer model
class MinimalTextEncoder(nn.Module):
    def __init__(self, hidden_size=4):
        super().__init__()
        self.hidden_size = hidden_size
        self.embedding = nn.Embedding(100, hidden_size)
        self.linear = nn.Linear(hidden_size, hidden_size)
    
    def forward(self, input_ids, attention_mask=None):
        # Embed the input ids
        embedded = self.embedding(input_ids)  # (batch_size, seq_len, hidden_size)
        # Apply a simple linear transformation
        output = self.linear(embedded)  # (batch_size, seq_len, hidden_size)
        
        # Return an object with last_hidden_state attribute
        class Outputs:
            pass
        
        outputs = Outputs()
        outputs.last_hidden_state = output
        return outputs

# Create instances
text_encoder = MinimalTextEncoder(hidden_size=4)

# Create input_ids: (batch_size=2, seq_len=3)
input_ids = torch.tensor([[1, 2, 3], [4, 5, 6]], dtype=torch.long)

# Create attention_mask: (batch_size=2, seq_len=3)
attention_mask = torch.tensor([[1, 1, 1], [1, 1, 0]], dtype=torch.float32)

ARGS = {
    "text_encoder": text_encoder,
    "input_ids": input_ids,
    "attention_mask": attention_mask,
    "no_grad": 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 Tensor, ndim 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 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: none by the harness; any seed is in the setup block
get_column_features Ran
ran on a synthesized input
da03/markup2im/eval_utils/metric_utils.py
code served (permissive licence) · get_code("0c42525b641a7c61")
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 2, dtype family int; 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 cv2
import numpy as np

# Create a small 2D grayscale image (4 rows, 3 columns)
# Values range from 0-255 to test the threshold parameter
img = np.array([
    [100, 200, 50],
    [160, 120, 180],
    [80, 250, 90],
    [170, 140, 110]
], dtype=np.uint8)

# Define arguments for get_column_features
ARGS = {
    'img': img,
    'th': 150
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family int — 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
get_encoder_model_type Ran
ran on a synthesized input
da03/markup2im/src/markup2im_constants.py
code served (permissive licence) · get_code("0ac64afe7da2ea47")
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 str. 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

DATASET_TO_ENCODER_MODEL_TYPES = {'yuntian-deng/im2latex-100k': 'EleutherAI/gpt-neo-125M', 'yuntian-deng/im2html-100k': 'EleutherAI/gpt-neo-125M', 'yuntian-deng/im2ly-35k-syn': 'EleutherAI/gpt-neo-125M', 'yuntian-deng/im2smiles-20k': 'DeepChem/ChemBERTa-77M-MLM'}

def get_encoder_model_type(dataset_name):
    if dataset_name not in DATASET_TO_ENCODER_MODEL_TYPES:
        print(f'Please specify encoder model type for customized datasets through encoder_model_type!')
        raise NotImplementedError
    return DATASET_TO_ENCODER_MODEL_TYPES[dataset_name]

ARGS = {
    'dataset_name': 'yuntian-deng/im2latex-100k'
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
get_image_size Ran
ran on a synthesized input
da03/markup2im/src/markup2im_constants.py
code served (permissive licence) · get_code("c4c8ed0cccf40206")
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, ndim 1, dtype family int; 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 numpy as np

torch.manual_seed(0)

ARGS = {
    'dataset_name': 'yuntian-deng/im2latex-100k'
}
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 tuple, ndim 1, dtype family int — a tuple 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
get_input_field Ran
ran on a synthesized input
da03/markup2im/src/markup2im_constants.py
code served (permissive licence) · get_code("9ed74ba3f1a0f8f4")
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 str. 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

DATASET_TO_INPUT_FIELDS = {
    'yuntian-deng/im2latex-100k': 'formula',
    'yuntian-deng/im2html-100k': 'html',
    'yuntian-deng/im2ly-35k-syn': 'source',
    'yuntian-deng/im2smiles-20k': 'smiles'
}

def get_input_field(dataset_name):
    if dataset_name not in DATASET_TO_INPUT_FIELDS:
        print(f'Please specify image size for customized datasets through input_field!')
        raise NotImplementedError
    return DATASET_TO_INPUT_FIELDS[dataset_name]

# Setup code to construct valid arguments
ARGS = {
    'dataset_name': 'yuntian-deng/im2latex-100k'
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
load_image_cv2 Ran
ran on a synthesized input
da03/markup2im/eval_utils/metric_utils.py
code served (permissive licence) · get_code("dd2266bcddfb50b0")
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 int, shape (10, 15) 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 cv2
import numpy as np
import tempfile
import os

# Create a temporary directory and a small test image file
temp_dir = tempfile.mkdtemp()
img_path = os.path.join(temp_dir, "test_image.png")

# Create a simple grayscale image and save it
test_image = np.random.randint(0, 256, (10, 15), dtype=np.uint8)
cv2.imwrite(img_path, test_image)

ARGS = {
    "img_path": img_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — 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 int, shape (10, 15) — shape (10, 15) 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
clip_score Not yet run
unverified (harvested, no recorded run)
da03/markup2im/eval_utils/clip_utils.py
code served (permissive licence) · get_code("c18ca7f68e0b6c5b")
How it ran

no invocation recorded.

load_image_pil Not yet run
unverified (harvested, no recorded run)
da03/markup2im/eval_utils/metric_utils.py
code served (permissive licence) · get_code("cd8beb90d5c8da82")
How it ran

no invocation recorded.

Also present in other papers' code

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

Building on recent advances in image generation, we present a fully data-driven approach to rendering markup into images. The approach is based on diffusion models, which parameterize the distribution of data using a sequence of denoising operations on top of a Gaussian noise distribution. We view the diffusion denoising process as a sequential decision making process, and show that it exhibits compounding errors similar to exposure bias issues in imitation learning problems. To mitigate these issues, we adapt the scheduled sampling algorithm to diffusion training. We conduct experiments on four markup datasets: mathematical formulas (LaTeX), table layouts (HTML), sheet music (LilyPond), and molecular images (SMILES). These experiments each verify the effectiveness of the diffusion process and the use of scheduled sampling to fix generation issues. These results also show that the markup-to-image task presents a useful controlled compositional setting for diagnosing and analyzing generative image models.

For agents

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

get_harvested_code_for_paper("2210.05147")
get_code_for_paper("2210.05147")
have("2210.05147")

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

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

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

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

Connect an agent — have() is free.