SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2607.18091 · 2026

SciForma: Structure-Faithful Generation of Scientific Diagrams

Zhouhui Lian, Yan Lu, Xun Guo, Peng Zhang, Xinjie Zhang, Yuxuan Luo

arXiv · PDF

Code that ran

3 of 6 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 0 have no contract verdict; 3 failures of our instrument; 3 no recorded run), measured 2026-11-23; 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/2607.18091.json · badge: /api/ran/2607.18091.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
microsoft/SciForma canonical (classifier label)
classifier basis: census
3 ran · 3 no recorded run
FunctionStatusWhere it lives
get_class_from_module Ran
ran; our contract draft was wrong, not the code
microsoft/SciForma/sciforma/utils/model_factory.py
code served (permissive licence) · get_code("da6253786109f1e3")
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 type. 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 importlib
from typing import Dict, Any, Tuple, Optional, Type

# Test case 1: Import a standard library class
module_path_1 = "collections"
class_name_1 = "OrderedDict"

# Test case 2: Import from torch
module_path_2 = "torch.nn"
class_name_2 = "Linear"

# Test case 3: Import from a built-in module
module_path_3 = "json"
class_name_3 = "JSONDecoder"

# Use the first test case as the primary args
ARGS = {
    "module_path": "collections",
    "class_name": "OrderedDict"
}
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 type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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_closest_ratio Ran
ran; our contract draft was wrong, not the code
microsoft/SciForma/sciforma/datasets/ar_batch_sampler.py
code served (permissive licence) · get_code("a3d380ac20906c72")
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 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

# Analyze the function:
# - height: float - a numeric value
# - width: float - a numeric value
# - ratios: dict - a dictionary where keys are ratio values (convertible to float)
#   and values are some objects (returned in tuple)
# The function computes aspect_ratio = height/width, finds the key in ratios
# that is closest to this aspect ratio, and returns (ratios[key], float(key))

ARGS = {
    "height": 480.0,
    "width": 640.0,
    "ratios": {
        "0.5": "small",
        "0.75": "medium",
        "1.0": "square",
        "1.5": "wide",
        "2.0": "ultrawide"
    }
}
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 tuple, ndim 1, dtype family float — 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_hf_token Ran
ran; our contract draft was wrong, not the code
microsoft/SciForma/sciforma/utils/model_factory.py
code served (permissive licence) · get_code("203a4f4566345b8a")
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 os
from typing import Optional

# Mock _local_secrets module behavior
_SECRETS_HF_TOKEN = None

# Create a mock config class
class MockConfig:
    def __init__(self, huggingface_token: Optional[str] = None):
        self.huggingface_token = huggingface_token

# Test case 1: Token from environment variable
os.environ['HF_TOKEN'] = 'env_token_value'

# Create config with no token
config = MockConfig(huggingface_token=None)

ARGS = {
    'config': config
}
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 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
build_aspect_ratio_dict Not yet run
unverified (harvested, no recorded run)
microsoft/SciForma/sciforma/datasets/ar_batch_sampler.py
code served (permissive licence) · get_code("aef204067861acdd")
How it ran

no invocation recorded.

get_model_spec Not yet run
unverified (harvested, no recorded run)
microsoft/SciForma/sciforma/utils/model_factory.py
code served (permissive licence) · get_code("35b9b89a610a91f8")
How it ran

no invocation recorded.

prepare_latent_image_ids Not yet run
unverified (harvested, no recorded run)
microsoft/SciForma/sciforma/utils/model_utils.py
code served (permissive licence) · get_code("b1595304e6ce5b67")
How it ran

no invocation recorded.

Also present in other papers' code

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

structural fidelity is inherently conjunctive: correctness on one axis cannot compensate for failure on another. Current open-source models fail to satisfy this criterion. Supervised fine-tuning (SFT) learns plausible layouts but cannot reliably ensure structural correctness, while scalar reward-based post-training obscures which structural dimension has failed. To address this, we introduce SciForma, a framework for the structure-faithful generation of scientific methodology diagrams. Specifically, SciForma decomposes diagram quality into three structural axes: Component, Arrow, and Text, guided by a structural inventory. Built on this foundation, we curate SciFormaData-700K for structured training and SciFormaBench-2K for logic-verified evaluation. To close the gap left by SFT, we develop Multi-Dimensional Conjunctive Preference Optimization (M-DPO), which enforces simultaneous correctness across all axes and adaptively routes gradients to the most deficient dimension in post-training. The same structural inventory also enables iterative editing at inference time to correct residual errors. This combination allows SciForma-9B to exceed all open-source baselines and GPT-Image-1.5 on both SciFormaBench-2K and AIBench, bringing open scientificdiagram generation close to proprietary-level structural fidelity. Our code and data will be available at: https://github.com/microsoft/SciForma. , , .

For agents

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

get_harvested_code_for_paper("2607.18091")
get_code_for_paper("2607.18091")
have("2607.18091")

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

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

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

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

Connect an agent — have() is free.