SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2302.07685 · CVPR · 2023

Video Probabilistic Diffusion Models in Projected Latent Space

Kihyuk Sohn, Jinwoo Shin, Kaist, Sihyun Yu, Subin Kim

arXiv · PDF · Open in the Atlas

Code that ran

4 of 8 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 0 failures of our instrument; 4 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/2302.07685.json · badge: /api/ran/2302.07685.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
sihyun-yu/pvdm community
Papers with Code archive
4 ran · 4 no recorded run
FunctionStatusWhere it lives
AttentionBlock Ran
ran on a synthesized input
sihyun-yu/pvdm/models/ddpm/unet.py
code served (permissive licence) · get_code("db3a2f79b766b428")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, 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 math

# Helper functions from the class definition
class GroupNorm32(nn.GroupNorm):
    def forward(self, x):
        return super().forward(x.float()).type(x.dtype)

def normalization(channels):
    return GroupNorm32(32, channels)

def conv_nd(dims, *args, **kwargs):
    if dims == 1:
        return nn.Conv1d(*args, **kwargs)
    elif dims == 2:
        return nn.Conv2d(*args, **kwargs)
    elif dims == 3:
        return nn.Conv3d(*args, **kwargs)
    raise ValueError(f'unsupported dimensions: {dims}')

def zero_module(module):
    for p in module.parameters():
        p.detach().zero_()
    return module

class QKVAttentionLegacy(nn.Module):
    def __init__(self, n_heads):
        super().__init__()
        self.n_heads = n_heads

    def forward(self, qkv):
        bs, width, length = qkv.shape
        assert width % (3 * self.n_heads) == 0
        ch = width // (3 * self.n_heads)
        q, k, v = qkv.reshape(bs * self.n_heads, ch * 3, length).split(ch, dim=1)
        scale = 1 / math.sqrt(math.sqrt(ch))
        weight = torch.einsum('bct,bcs->bts', q * scale, k * scale)
        weight = torch.softmax(weight.float(), dim=-1).type(weight.dtype)
        a = torch.einsum('bts,bcs->bct', weight, v)
        return a.reshape(bs, -1, length)

# Reconstruct the full AttentionBlock class based on typical diffusion model patterns
class AttentionBlock(nn.Module):
    def __init__(self, channels, num_heads=1, num_head_channels=-1, use_checkpoint=False, use_new_attention_order=False):
        super().__init__()
        self.channels = channels
        if num_head_channels == -1:
            self.num_heads = num_heads
        else:
            assert channels % num_head_channels == 0
            self.num_heads = channels // num_head_channels
        self.use_checkpoint = use_checkpoint
        self.norm = normalization(channels)
        self.qkv = conv_nd(1, channels, channels * 3, 1)
        if use_new_attention_order:
            self.attention = QKVAttention(self.num_heads)
        else:
            self.attention = QKVAttentionLegacy(self.num_heads)
        self.proj_out = zero_module(conv_nd(1, channels, channels, 1))

    def forward(self, x):
        b, c, *spatial = x.shape
        x = x.reshape(b, c, -1)
        qkv = self.qkv(self.norm(x))
        h = self.attention(qkv)
        h = self.proj_out(h)
        return (x + h).reshape(b, c, *spatial)

class QKVAttention(nn.Module):
    def __init__(self, n_heads):
        super().__init__()
        self.n_heads = n_heads

    def forward(self, qkv):
        bs, width, length = qkv.shape
        assert width % (3 * self.n_heads) == 0
        ch = width // (3 * self.n_heads)
        q, k, v = qkv.chunk(3, dim=1)
        scale = 1 / math.sqrt(math.sqrt(ch))
        weight = torch.einsum('bct,bcs->bts', (q * scale).view(bs * self.n_heads, ch, length), (k * scale).view(bs * self.n_heads, ch, length))
        weight = torch.softmax(weight.float(), dim=-1).type(weight.dtype)
        a = torch.einsum('bts,bcs->bct', weight, v.reshape(bs * self.n_heads, ch, length))
        return a.reshape(bs, -1, length)

# Setup code
INIT_ARGS = {
    'channels': 64,
    'num_heads': 4,
    'num_head_channels': -1,
    'use_checkpoint': False,
    'use_new_attention_order': False
}

# Input tensor: batch=2, channels=64, spatial dimensions 8x8
ARGS = {
    'x': torch.randn(2, 64, 8, 8)
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
AttentionBlock1D Ran
ran on a synthesized input · constructed an object; no result was computed
sihyun-yu/pvdm/models/ddpm/unet.py
code served (permissive licence) · get_code("103e2546dd25cd12")
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 an instance of its own class, AttentionBlock1D: the run constructed the object and did not call it, so no result was computed. 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
import math

torch.manual_seed(0)

# Build minimal stand-in for AttentionBlock1D parameters
ARGS = {
    "channels": 64,
    "num_head_channels": -1,
    "use_checkpoint": False,
    "use_new_attention_order": 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 AttentionBlock1D — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a AttentionBlock1D 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
QKVAttention Ran
ran on a synthesized input · constructed an object; no result was computed
sihyun-yu/pvdm/models/ddpm/unet.py
code served (permissive licence) · get_code("126e0aad3feac35a")
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 an instance of its own class, QKVAttention: the run constructed the object and did not call it, so no result was computed. 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 math
import torch as th
import torch.nn as nn

th.manual_seed(0)

class QKVAttention(nn.Module):
    """
    A module which performs QKV attention and splits in a different order.
    """

    def __init__(self, n_heads):
        super().__init__()
        self.n_heads = n_heads

    def forward(self, qkv):
        """
        Apply QKV attention.
        :param qkv: an [N x (3 * H * C) x T] tensor of Qs, Ks, and Vs.
        :return: an [N x (H * C) x T] tensor after attention.
        """
        bs, width, length = qkv.shape
        assert width % (3 * self.n_heads) == 0
        ch = width // (3 * self.n_heads)
        q, k, v = qkv.chunk(3, dim=1)
        scale = 1 / math.sqrt(math.sqrt(ch))
        weight = th.einsum('bct,bcs->bts', (q * scale).view(bs * self.n_heads, ch, length), (k * scale).view(bs * self.n_heads, ch, length))
        weight = th.softmax(weight.float(), dim=-1).type(weight.dtype)
        a = th.einsum('bts,bcs->bct', weight, v.reshape(bs * self.n_heads, ch, length))
        return a.reshape(bs, -1, length)

    @staticmethod
    def count_flops(model, _x, y):
        return 0

# Create instance with n_heads=2
n_heads = 2
attention_module = QKVAttention(n_heads=n_heads)

# Create qkv tensor: [N x (3 * H * C) x T]
# N=2 (batch), H=2 (heads), C=4 (channels per head), T=5 (time/sequence length)
# width = 3 * H * C = 3 * 2 * 4 = 24
batch_size = 2
num_heads = 2
channels_per_head = 4
seq_length = 5
width = 3 * num_heads * channels_per_head

qkv_tensor = th.randn(batch_size, width, seq_length)

ARGS = {
    'n_heads': num_heads,
}
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 QKVAttention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a QKVAttention 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
QKVAttentionLegacy Ran
ran on a synthesized input
sihyun-yu/pvdm/models/ddpm/unet.py
code served (permissive licence) · get_code("26f661f1ebafd2e9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, 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 math
import torch as th
import torch.nn as nn

class QKVAttentionLegacy(nn.Module):
    """
    A module which performs QKV attention. Matches legacy QKVAttention + input/ouput heads shaping
    """

    def __init__(self, n_heads):
        super().__init__()
        self.n_heads = n_heads

    def forward(self, qkv):
        """
        Apply QKV attention.
        :param qkv: an [N x (H * 3 * C) x T] tensor of Qs, Ks, and Vs.
        :return: an [N x (H * C) x T] tensor after attention.
        """
        bs, width, length = qkv.shape
        assert width % (3 * self.n_heads) == 0
        ch = width // (3 * self.n_heads)
        q, k, v = qkv.reshape(bs * self.n_heads, ch * 3, length).split(ch, dim=1)
        scale = 1 / math.sqrt(math.sqrt(ch))
        weight = th.einsum('bct,bcs->bts', q * scale, k * scale)
        weight = th.softmax(weight.float(), dim=-1).type(weight.dtype)
        a = th.einsum('bts,bcs->bct', weight, v)
        return a.reshape(bs, -1, length)

    @staticmethod
    def count_flops(model, _x, y):
        return count_flops_attn(model, _x, y)


INIT_ARGS = {
    'n_heads': 2,
}

ARGS = {
    'qkv': th.randn(2, 24, 8),
}

if __name__ == '__main__':
    model = QKVAttentionLegacy(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
ResBlock Not yet run
unverified (harvested, no recorded run)
sihyun-yu/pvdm/models/ddpm/unet.py
code served (permissive licence) · get_code("3517e469e5ac8118")
How it ran

no invocation recorded.

SpatialTransformer Not yet run
unverified (harvested, no recorded run)
sihyun-yu/pvdm/models/ddpm/unet.py
code served (permissive licence) · get_code("be2ef04b4935912b")
How it ran

no invocation recorded.

TimestepEmbedSequential Not yet run
unverified (harvested, no recorded run)
sihyun-yu/pvdm/models/ddpm/unet.py
code served (permissive licence) · get_code("740f3cb32cafdf77")
How it ran

no invocation recorded.

UNetModel Not yet run
unverified (harvested, no recorded run)
sihyun-yu/pvdm/models/ddpm/unet.py
code served (permissive licence) · get_code("18f39c82c98ac39d")
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, 6 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 2 the same month, 6 later) and 2 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
QKVAttention
brick of this paper's assembly: helper
17 other papers
3 dated earlier, 1 the same month, 13 later · 7 only as an assembly brick
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2209.15264 (2022-09)
Diffusion-based Image Translation using Disentangled Style and Content Representation
2301.05225 (2023-01)
Domain Expansion of Image Generators
and 14 more not named here
QKVAttentionLegacy
brick of this paper's assembly: helper
15 other papers
3 dated earlier, 12 later · 6 only as an assembly brick
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2209.15264 (2022-09)
Diffusion-based Image Translation using Disentangled Style and Content Representation
2301.05225 (2023-01)
Domain Expansion of Image Generators
and 12 more not named here
AttentionBlock
brick of this paper's assembly: model
12 other papers
2 dated earlier, 1 the same month, 9 later · 2 only as an assembly brick
2209.15264 (2022-09)
Diffusion-based Image Translation using Disentangled Style and Content Representation
2301.05225 (2023-01)
Domain Expansion of Image Generators
2302.04304 (2023-02)
Q-Diffusion: Quantizing Diffusion Models
and 9 more not named here
ResBlock
brick of this paper's assembly: model
11 other papers
2 dated earlier, 9 later · 4 only as an assembly brick
2209.15264 (2022-09)
Diffusion-based Image Translation using Disentangled Style and Content Representation
2301.05225 (2023-01)
Domain Expansion of Image Generators
2304.02012 (2023-04)
EGC: Image Generation and Classification via a Diffusion Energy-Based Model
and 8 more not named here
TimestepEmbedSequential
brick of this paper's assembly: model
8 other papers
1 dated earlier, 7 later
2301.05225 (2023-01)
Domain Expansion of Image Generators
2304.02012 (2023-04)
EGC: Image Generation and Classification via a Diffusion Energy-Based Model
2305.18259 (2023-05)
GlyphControl: Glyph Conditional Control for Visual Text Generation
and 5 more not named here
SpatialTransformer
brick of this paper's assembly: model
5 other papers
5 later · 1 only as an assembly brick
2304.02012 (2023-04)
EGC: Image Generation and Classification via a Diffusion Energy-Based Model
2305.16283 (2023-05)
CommonScenes: Generating Commonsense 3D Indoor Scenes with Scene Graph Diffusion
2407.10179 (2024-07)
CLIP-Guided Generative Networks for Transferable Targeted Adversarial Attacks
and 2 more not named here

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

Despite the remarkable progress in deep generative models, synthesizing high-resolution and temporally coherent videos still remains a challenge due to their highdimensionality and complex temporal dynamics along with large spatial variations. Recent works on diffusion models have shown their potential to solve this challenge, yet they suffer from severe computation-and memory-inefficiency that limit the scalability. To handle this issue, we propose a novel generative model for videos, coined projected latent video diffusion model (PVDM), a probabilistic diffusion model which learns a video distribution in a lowdimensional latent space and thus can be efficiently trained with high-resolution videos under limited resources. Specifically, PVDM is composed of two components: (a) an autoencoder that projects a given video as 2D-shaped latent vectors that factorize the complex cubic structure of video pixels and (b) a diffusion model architecture specialized for our new factorized latent space and the training/sampling procedure to synthesize videos of arbitrary length with a single model. Experiments on popular video generation datasets demonstrate the superiority of PVDM compared with previous video synthesis methods; e.g., PVDM obtains the FVD score of 639.7 on the UCF-101 long video (128 frames) generation benchmark, which improves 1773.4 of the prior state-of-the-art.

For agents

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

get_harvested_code_for_paper("2302.07685")
get_code_for_paper("2302.07685")
have("2302.07685")

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

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

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

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

Connect an agent — have() is free.