SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · aaai_28503 · AAAI · 2024

Step Vulnerability Guided Mean Fluctuation Adversarial Attack against Conditional Diffusion Models

Huimin Ma, Jiansheng Chen, Xinlong Ding, Hongwei Yu, Yudong Zhang, Ting Tang

Open in the Atlas

Code that ran

11 of 14 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, 5 violated it and 2 have no contract verdict; 3 failures of our instrument; 3 no recorded run), measured 2026-11-22; 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/aaai_28503.json · badge: /api/ran/aaai_28503.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
yuhongwei22/MFA canonical (classifier label)
classifier basis: census
11 ran · 3 no recorded run
FunctionStatusWhere it lives
always Ran
ran; our contract draft was wrong, not the code
yuhongwei22/MFA/ldm/modules/x_transformer.py
code served (permissive licence) · get_code("fe5dd5258046898c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned function. 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.

ARGS = {
    'val': 42
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
ceil_modulo Ran
ran, honoured the contract we drafted
yuhongwei22/MFA/attack/dataset.py
code served (permissive licence) · get_code("c925ce390296992d")
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 int, ndim 0, dtype family int, 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

torch.manual_seed(0)

# ceil_modulo takes two parameters: x and mod
# x should be an integer (used with % and // operators)
# mod should be an integer (used as divisor and multiplier)

ARGS = {
    "x": 10,
    "mod": 3
}
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 int, ndim 0, dtype family int, 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
default Ran
ran, violated the contract we drafted
yuhongwei22/MFA/ldm/modules/attention.py
code served (permissive licence) · get_code("424012cb37b31172")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned int, ndim 0, dtype family int, 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.

from inspect import isfunction

def exists(val):
    return val is not None

def default(val, d):
    if exists(val):
        return val
    return d() if isfunction(d) else d

# Test case 1: val exists (not None), d is a regular value
ARGS_1 = {
    'val': 42,
    'd': 100
}

# Test case 2: val is None, d is a regular value
ARGS_2 = {
    'val': None,
    'd': 100
}

# Test case 3: val is None, d is a function
def default_func():
    return 200

ARGS_3 = {
    'val': None,
    'd': default_func
}

# Test case 4: val exists, d is a function
ARGS_4 = {
    'val': "existing_value",
    'd': lambda: "default_value"
}

# Use one of the test cases as the final ARGS
ARGS = ARGS_3
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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 int, ndim 0, dtype family int, 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
disabled_train Ran
ran, violated the contract we drafted
yuhongwei22/MFA/ldm/models/diffusion/classifier.py
code served (permissive licence) · get_code("4cb732f513d69dfd")
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 SimpleModel. 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

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()

ARGS = {
    "self": model,
    "mode": True
}
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 SimpleModel — a SimpleModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a SimpleModel 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
exists Ran
ran, violated the contract we drafted
yuhongwei22/MFA/ldm/modules/attention.py
pointer only (licence: MIT); the stored copy get_code serves, from ThomasMrY/VCT, is pointer only (licence: NONE) · get_code("aa5486a3650902d8")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ThomasMrY/VCT, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

isimage Ran
ran, violated the contract we drafted
yuhongwei22/MFA/ldm/util.py
code served (permissive licence) · get_code("b1368330cf0f5642")
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 torch

torch.manual_seed(0)

# The function isimage checks if x is a torch.Tensor with 4 dimensions
# and the second dimension (channel dim) is either 3 or 1
# Test case: valid image tensor with shape (batch, channels, height, width)
x = torch.randn(2, 3, 4, 5)

ARGS = {
    "x": x
}
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 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
ismap Ran
ran, violated the contract we drafted
yuhongwei22/MFA/ldm/util.py
code served (permissive licence) · get_code("d72762b700feee6f")
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 torch

torch.manual_seed(0)

# The function checks if x is a torch.Tensor with 4 dimensions where the second dimension (x.shape[1]) is > 3
# We need to construct a tensor that satisfies this condition

# Create a tensor with shape (batch=2, channels=5, height=4, width=3)
# This has 4 dimensions and x.shape[1] = 5 > 3, so it should return True
x = torch.randn(2, 5, 4, 3)

ARGS = {
    'x': x
}
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 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
load_image Ran
ran on a synthesized input
yuhongwei22/MFA/attack/dataset.py
code served (permissive licence) · get_code("8cb9cdaf94262270")
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 3, dtype family float, shape (3, 4, 3) 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 numpy as np
import PIL.Image as Image
import tempfile
import os

# Create a temporary image file for testing
temp_dir = tempfile.mkdtemp()
fname = os.path.join(temp_dir, "test_image.png")

# Create a small RGB image (4x3 pixels with 3 channels)
img_array = np.random.randint(0, 256, (4, 3, 3), dtype=np.uint8)
img = Image.fromarray(img_array, mode='RGB')
img.save(fname)

ARGS = {
    'fname': fname,
    'mode': 'RGB',
    'return_orig': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family float, shape (3, 4, 3) — shape (3, 4, 3) 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
pad_img_to_modulo Ran
ran on a synthesized input
yuhongwei22/MFA/attack/dataset.py
code served (permissive licence) · get_code("5db84139b1c887ad")
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 3, dtype family float, shape (3, 8, 8) 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 numpy as np

# Create a small test image with shape (channels, height, width)
# Using distinct dimensions: 3 channels, 5 height, 7 width
img = np.random.rand(3, 5, 7).astype(np.float32)

# Define modulo value
mod = 8

ARGS = {
    "img": img,
    "mod": mod,
}
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 ndarray, ndim 3, dtype family float, shape (3, 8, 8) — shape (3, 8, 8) 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
uniform_on_device Ran
ran; our contract draft was wrong, not the code
yuhongwei22/MFA/ldm/models/diffusion/ddpm.py
code served (permissive licence) · get_code("d48d8354986e3b0e")
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 2, dtype family float, shape (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)

# Analyze the function:
# - r1: used in arithmetic (r1 - r2), should be a scalar or tensor
# - r2: used in arithmetic (r1 - r2), should be a scalar or tensor
# - shape: unpacked with *shape in torch.rand(*shape, device=device), should be a tuple/list of ints
# - device: passed to torch.rand, should be a valid torch device

ARGS = {
    "r1": 2.0,
    "r2": 1.0,
    "shape": (2, 4),
    "device": torch.device("cpu")
}
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 2, dtype family float, shape (2, 4) — shape (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
uniq Ran
ran; our contract draft was wrong, not the code
yuhongwei22/MFA/ldm/modules/attention.py
pointer only (licence: MIT); the stored copy get_code serves, from JingWu321/MUNBa, is pointer only (licence: NONE) · get_code("9a299fe5ae09e407")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from JingWu321/MUNBa, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

attack_img Not yet run
unverified (harvested, no recorded run)
yuhongwei22/MFA/attack/MFA_Inpainting.py
code served (permissive licence) · get_code("031d2754ee661147")
How it ran

no invocation recorded.

download_models Not yet run
unverified (harvested, no recorded run)
yuhongwei22/MFA/notebook_helpers.py
code served (permissive licence) · get_code("4533e43e06a12dc5")
How it ran

no invocation recorded.

log_txt_as_img Not yet run
unverified (harvested, no recorded run)
yuhongwei22/MFA/ldm/util.py
code served (permissive licence) · get_code("f9bd2e83191afad1")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 12 are also present in other papers whose code we hold (10 with at least one paper dated earlier, 0 the same month, 10 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
exists 486 other papers
283 dated earlier, 53 later, 148 same year, order not determinable, 2 undated · 78 only as an assembly brick
1603.08155 (2016-03)
Perceptual Losses for Real-Time Style Transfer and Super-Resolution
1611.07004 (2016-11)
Image-to-Image Translation with Conditional Adversarial Networks
1804.04637 (2018-04)
EMBER: An Open Dataset for Training Static PE Malware Machine Learning Models
and 483 more not named here
default 207 other papers
117 dated earlier, 20 later, 70 same year, order not determinable · 41 only as an assembly brick
1711.11585 (2017-11)
High-Resolution Image Synthesis and Semantic Manipulation with Conditional GANs
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2010.08162 (2020-10)
SidechainNet: An All-Atom Protein Structure Dataset for Machine Learning
and 204 more not named here
disabled_train 173 other papers
75 dated earlier, 17 later, 81 same year, order not determinable · 5 only as an assembly brick
2012.09841 (2020-12)
Taming Transformers for High-Resolution Image Synthesis
2102.05379 (2021-02)
Argmax Flows and Multinomial Diffusion: Learning Categorical Distributions
2104.07652 (2021-04)
Geometry-Free View Synthesis: Transformers and no 3D Priors
and 170 more not named here
uniq 115 other papers
58 dated earlier, 6 later, 51 same year, order not determinable
2112.10752 (2021-12)
High-Resolution Image Synthesis with Latent Diffusion Models
2204.06125 (2022-04)
Hierarchical Text-Conditional Image Generation with CLIP Latents
2206.02779 (2022-06)
Blended Latent Diffusion
and 112 more not named here
ismap 69 other papers
38 dated earlier, 3 later, 28 same year, order not determinable
2204.06125 (2022-04)
Hierarchical Text-Conditional Image Generation with CLIP Latents
2206.02779 (2022-06)
Blended Latent Diffusion
2208.13753 (2022-08)
Frido: Feature Pyramid Diffusion for Complex Scene Image Synthesis
and 66 more not named here
isimage 61 other papers
35 dated earlier, 3 later, 23 same year, order not determinable
2206.02779 (2022-06)
Blended Latent Diffusion
2208.13753 (2022-08)
Frido: Feature Pyramid Diffusion for Complex Scene Image Synthesis
2210.12965 (2022-10)
High-Resolution Image Editing via Multi-Stage Blended Diffusion
and 58 more not named here
always 56 other papers
36 dated earlier, 2 later, 18 same year, order not determinable
2102.12092 (2021-02)
Zero-Shot Text-to-Image Generation
2107.03312 (2021-07)
SoundStream: An End-to-End Neural Audio Codec
2206.00100 (2022-06)
VALHALLA: Visual Hallucination for Machine Translation
and 53 more not named here
log_txt_as_img 55 other papers
28 dated earlier, 3 later, 24 same year, order not determinable
2204.06125 (2022-04)
Hierarchical Text-Conditional Image Generation with CLIP Latents
2206.02779 (2022-06)
Blended Latent Diffusion
2210.12965 (2022-10)
High-Resolution Image Editing via Multi-Stage Blended Diffusion
and 52 more not named here
uniform_on_device 44 other papers
23 dated earlier, 3 later, 18 same year, order not determinable
2112.10752 (2021-12)
High-Resolution Image Synthesis with Latent Diffusion Models
2204.06125 (2022-04)
Hierarchical Text-Conditional Image Generation with CLIP Latents
2206.02779 (2022-06)
Blended Latent Diffusion
and 41 more not named here
download_models 17 other papers
9 dated earlier, 1 later, 7 same year, order not determinable
2211.01324 (2022-11)
eDiff-I: Text-to-Image Diffusion Models with an Ensemble of Expert Denoisers
Dombrowski_Foreground-Background_Separation_through_Concept_Distillation_from_Generative_Image_Foundation_Models_ICCV_2023_paper (2023 (year only))
Foreground-Background Separation through Concept Distillation from Generative Image Foundation Models
2303.00836 (2023-03)
Ensemble flow reconstruction in the atmospheric boundary layer from spatially limited measurements through latent diffusion models
and 14 more not named here
ceil_modulo 1 other paper
1 same year, order not determinable
2412.12974 (2024-12)
Attentive Eraser: Unleashing Diffusion Model's Object Removal Potential via Self-Attention Redirection Guidance
pad_img_to_modulo 1 other paper
1 same year, order not determinable
2412.12974 (2024-12)
Attentive Eraser: Unleashing Diffusion Model's Object Removal Potential via Self-Attention Redirection Guidance

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 high-quality generation results of conditional diffusion models have brought about concerns regarding privacy and copyright issues. As a possible technique for preventing the abuse of diffusion models, the adversarial attack against diffusion models has attracted academic attention recently. In this work, utilizing the phenomenon that diffusion models are highly sensitive to the mean value of the input noise, we propose the Mean Fluctuation Attack (MFA) to introduce mean fluctuations by shifting the mean values of the estimated noises during the reverse process. In addition, we reveal that the vulnerability of different reverse steps against adversarial attacks actually varies significantly. By modeling the step vulnerability and using it as guidance to sample the target steps for generating adversarial examples, the effectiveness of adversarial attacks can be substantially enhanced. Extensive experiments show that our algorithm can steadily cause the mean shift of the predicted noises so as to disrupt the entire reverse generation process and degrade the generation results significantly. We also demonstrate that the step vulnerability is intrinsic to the reverse process by verifying its effectiveness in an attack method other than MFA. Code and Supplementary is available at https://github.com/yuhongwei22/MFA

For agents

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

get_harvested_code_for_paper("aaai_28503")
get_code_for_paper("aaai_28503")
have("aaai_28503")

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

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

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

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

Connect an agent — have() is free.