SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.30116 · ICML · 2026

SGMD: Score Gradient Matching Distillation for Few-Step Video Diffusion Distillation

Dahua Lin, Ruihao Gong, Xianglong Liu, Lei Yang, Yushi Huang, Xiangyu Fan, Yang Yong, Zhuguanyu Wu

arXiv · PDF · Open in the Atlas

Code that ran

5 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, 1 violated it and 0 have no contract verdict; 4 failures of our instrument; 1 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/2605.30116.json · badge: /api/ran/2605.30116.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
ModelTC/LightX2V canonical (classifier label)
classifier basis: census
5 ran · 1 no recorded run
FunctionStatusWhere it lives
dynamic_metadata Ran
ran; our contract draft was wrong, not the code
ModelTC/LightX2V/lightx2v_kernel_xpu/build_version.py
code served (permissive licence) · get_code("7615179034d1e782")
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
import sys

# Set up environment for testing
os.environ.pop('XPU_TARGET', None)
os.environ.pop('CMAKE_ARGS', None)

# Define ARGS with all parameters for dynamic_metadata
ARGS = {
    'field': 'version',
    'settings': None
}
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
fi_force_retune Ran
ran, violated the contract we drafted
ModelTC/LightX2V/lightx2v/common/flashinfer_autotune.py
code served (permissive licence) · get_code("0cbcc1bd5c7993ca")
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 bool, 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 os

FI_FORCE_RETUNE_ENV = 'LIGHTX2V_FI_FORCE_RETUNE'

# The function fi_force_retune takes one parameter: env_name
# It reads an environment variable and checks if its value is in ('1', 'true', 'yes', 'on')
# We need to set up a test case where we can control this behavior

# Set an environment variable to test
os.environ[FI_FORCE_RETUNE_ENV] = '1'

ARGS = {
    'env_name': FI_FORCE_RETUNE_ENV
}
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 bool, 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
get_qkv_subset Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ModelTC/LightX2V/lightx2v/utils/print_atten_score.py
code served (permissive licence) · get_code("6194816c4482a0fe")
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 4, dtype family float, shape (1, 1, 2, 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

torch.manual_seed(0)

# Create a tensor with shape [seq_len, num_heads, head_dim]
# Using distinct dimensions: seq_len=5, num_heads=3, head_dim=4
x = torch.randn(5, 3, 4)

# Parameters for the function
head_index = 1  # Select head at index 1 (valid since num_heads=3)
token_start = 1  # Start at token 1
token_end = 3    # End at token 3 (so we get tokens 1-2, length=2)

ARGS = {
    "x": x,
    "head_index": head_index,
    "token_start": token_start,
    "token_end": token_end,
}
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 4, dtype family float, shape (1, 1, 2, 4) — shape (1, 1, 2, 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
group_concurrent_contiguous Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ModelTC/LightX2V/lightx2v/disagg/conn.py
code served (permissive licence) · get_code("750c36f042d67fdb")
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. 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

# Construct valid arguments for group_concurrent_contiguous
# The function takes two arrays of int64 indices and groups them by contiguity

# Create sample src_indices: contiguous sequences with breaks
src_indices = np.array([0, 1, 2, 5, 6, 10], dtype=np.int64)

# Create sample dst_indices: contiguous sequences with breaks
dst_indices = np.array([10, 11, 12, 20, 21, 30], dtype=np.int64)

ARGS = {
    "src_indices": src_indices,
    "dst_indices": dst_indices,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
scaled_dot_product_attention Ran
ran; our contract draft was wrong, not the code
ModelTC/LightX2V/lightx2v/utils/print_atten_score.py
code served (permissive licence) · get_code("68fcdfd881d93961")
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. 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 math

torch.manual_seed(0)

# Scaled dot-product attention expects:
# Q, K, V: tensors of shape [batch_size, num_heads, seq_len, d_k]
# mask: optional attention mask of same shape as attention scores

batch_size = 2
num_heads = 3
seq_len = 4
d_k = 5

# Create query, key, value tensors
Q = torch.randn(batch_size, num_heads, seq_len, d_k)
K = torch.randn(batch_size, num_heads, seq_len, d_k)
V = torch.randn(batch_size, num_heads, seq_len, d_k)

# Create an attention mask: 1 for positions to keep, 0 for positions to mask
# Shape should be broadcastable to [batch_size, num_heads, seq_len, seq_len]
# (the shape of the attention scores after Q @ K^T)
mask = torch.ones(batch_size, num_heads, seq_len, seq_len)
# Mask out some positions (e.g., causal mask or padding)
mask[:, :, 1, 0] = 0
mask[:, :, 2, :1] = 0

ARGS = {
    "Q": Q,
    "K": K,
    "V": V,
    "mask": mask
}
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 — a tuple output has no array shape of its own; none is 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
fi_autotune_cache_path Not yet run
unverified (harvested, no recorded run)
ModelTC/LightX2V/lightx2v/common/flashinfer_autotune.py
code served (permissive licence) · get_code("187b6079a8eddec8")
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

Distribution Matching Distillation (DMD) is a widely used paradigm for accelerating inference in few-step video diffusion models. However, DMD-style video distillation faces two coupled challenges: the fake score must track a continuously evolving generator, making training costly when frequent updates are required, while reverse-KL-style matching can be mode-seeking and conservative for preserving strong motion dynamics. To address these issues, we propose Score Gradient Matching Distillation (SGMD). SGMD adopts a fake-score perspective by directly optimizing the fake score toward the teacher, while using teacher stop-gradient Fisher as a stable distribution-matching objective. We provide a gradient analysis that motivates this objective choice under ideal tracking. Building on this, SGMD introduces a pair of dual potentials: negative-residual (NR) for outer-loop correction and residual-contraction (RC) for inner-loop tracking. Empirically, compared to DMD2, SGMD achieves an approximately ∼ 3× training speedup and substantially improves motion dynamics for 4-step distilled models while preserving temporal consistency. A human study confirms that SGMD is preferred in motion quality and overall preference, while visual quality and text alignment remain comparable. Code is available at https: //github.com/ModelTC/LightX2V/ tree/main/lightx2v_train.

For agents

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

get_harvested_code_for_paper("2605.30116")
get_code_for_paper("2605.30116")
have("2605.30116")

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

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

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

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

Connect an agent — have() is free.