SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2310.06150 · NeurIPS · 2023

Latent Diffusion Model for DNA Sequence Generation

Yiren Zhao, Guoxuan Xia, Zehui Li, Akashaditya Das, Guy-Bart Stan, Yuhao Ni, Tim August, B Huygelen

arXiv · PDF · Open in the Atlas

Code that ran

4 of 7 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; 1 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-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/2310.06150.json · badge: /api/ran/2310.06150.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
zehui127/latent-dna-diffusion canonical (classifier label)
classifier basis: classifier_2025
2 ran · 2 no recorded run
Zehui127/Latent-DNA-Diffusion canonical (classifier label)
classifier basis: census
2 ran · 1 no recorded run
FunctionStatusWhere it lives
batch_accuracy Ran
ran; our contract draft was wrong, not the code
zehui127/latent-dna-diffusion/src/utils/metrics.py
code served (permissive licence) · get_code("9a6d56bc24ad8da3")
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 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

torch.manual_seed(0)

# The function expects:
# - recons: a tensor with argmax applied along dim-1, so needs at least 2 dims
# - batch_in: a tensor with argmax applied along dim-1, so needs at least 2 dims
# Both tensors should have the same flattened shape after argmax

# Create recons: shape (2, 4) - batch size 2, 4 classes
recons = torch.randn(2, 4)

# Create batch_in: shape (2, 4) - batch size 2, 4 classes
batch_in = torch.randn(2, 4)

ARGS = {
    "recons": recons,
    "batch_in": batch_in,
}
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 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
exponential_linspace_int Ran
ran, honoured the contract we drafted
Zehui127/Latent-DNA-Diffusion/src/utils/dna_encoder.py
code served (permissive licence) · get_code("0adb440f3e3a8e13")
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 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 math

def exponential_linspace_int(start, end, num, divisible_by=1):

    def _round(x):
        return int(round(x / divisible_by) * divisible_by)
    base = math.exp(math.log(end / start) / (num - 1))
    return [_round(start * base ** i) for i in range(num)]


ARGS = {
    "start": 10,
    "end": 1000,
    "num": 5,
    "divisible_by": 1
}
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 list, ndim 1, 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_align_dist Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zehui127/latent-dna-diffusion/src/utils/metrics.py
code served (permissive licence) · get_code("3e8df893316f7f80")
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 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 numpy as np

torch.manual_seed(0)

# Create small tensors with shape (batch=2, seq_len=3, num_classes=4)
# argmax will be applied on dim=2, reducing to (batch=2, seq_len=3)
arr1 = torch.randn(2, 3, 4)
arr2 = torch.randn(2, 3, 4)

# Create a mock ld_build callable that takes two numpy arrays
# and returns a distance metric
def mock_ld_build(a, b):
    """Mock Levenshtein distance builder that compares two sequences."""
    # Simple mock: return sum of absolute differences
    return float(np.sum(np.abs(a - b)))

ARGS = {
    'arr1': arr1,
    'arr2': arr2,
    'ld_build': mock_ld_build,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, 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
tensor_to_dna Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Zehui127/Latent-DNA-Diffusion/src/utils/tensor_to_dna.py
code served (permissive licence) · get_code("8f3128e381f483a2")
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

torch.manual_seed(0)

# Create a 4xn tensor (logits for DNA bases A, T, G, C, N)
# Shape: (5, 4) - 5 positions, 4 logit values per position
tensor = torch.randn(5, 4)

ARGS = {
    "tensor": tensor,
    "inference": 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 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
exponential_linspace_int Not yet run
unverified (harvested, no recorded run)
zehui127/latent-dna-diffusion/src/models/vanilla_vae/sequence_ae/dna_encoder.py
code served (permissive licence) · get_code("6fc25332048ec50a")
How it ran

no invocation recorded. this sample carries JSON test cases instead of a setup block; get_reference_implementation serves them with the level they back.

prepare_loader Not yet run
unverified (harvested, no recorded run)
Zehui127/Latent-DNA-Diffusion/src/datasets/reference_loader.py
code served (permissive licence) · get_code("f046833ee7055571")
How it ran

no invocation recorded.

timer Not yet run
unverified (harvested, no recorded run)
zehui127/latent-dna-diffusion/src/utils/metrics.py
code served (permissive licence) · get_code("003781a63f6b1a17")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 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-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

The harnessing of machine learning, especially deep generative models, has opened up promising avenues in the field of synthetic DNA sequence generation. Whilst Generative Adversarial Networks (GANs) have gained traction for this application, they often face issues such as limited sample diversity and mode collapse. On the other hand, Diffusion Models are a promising new class of generative models that are not burdened with these problems, enabling them to reach the state-of-the-art in domains such as image generation. In light of this, we propose a novel latent diffusion model, DiscDiff, tailored for discrete DNA sequence generation. By simply embedding discrete DNA sequences into a continuous latent space using an autoencoder, we are able to leverage the powerful generative abilities of continuous diffusion models for the generation of discrete data. Additionally, we introduce Fréchet Reconstruction Distance (FReD) as a new metric to measure the sample quality of DNA sequence generations. Our DiscDiff model demonstrates an ability to generate synthetic DNA sequences that align closely with real DNA in terms of Motif Distribution, Latent Embedding Distribution (FReD), and Chromatin Profiles. Additionally, we contribute a comprehensive cross-species dataset of 150K unique promoter-gene sequences from 15 species, enriching resources for future generative modelling in genomics. We have made our code and data publicly available at https://github.com/Zehui127/Latent-DNA-Diffusion.

For agents

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

get_harvested_code_for_paper("2310.06150")
get_code_for_paper("2310.06150")
have("2310.06150")

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

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

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

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

Connect an agent — have() is free.