SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2606.04373 · ICML · 2026

Selective Coupling of Decoupled Informative Regions: Masked Attention Alignment for Data-Free Quantization of Vision Transformers

Jungong Han, Yang Wang, Yong Wu, Biao Qian

arXiv · PDF · Open in the Atlas

Code that ran

10 of 12 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 2 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 5 failures of our instrument; 2 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/2606.04373.json · badge: /api/ran/2606.04373.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
hfutqian/MaskAQ community
Papers with Code archive
10 ran · 2 no recorded run
FunctionStatusWhere it lives
ColorJitter Ran
ran on a synthesized input · constructed an object; no result was computed
hfutqian/MaskAQ/MaskAQ/hydra_image_gen_ssim_att_map.py
code served (permissive licence) · get_code("5483c0322ebd2788")
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, ColorJitter: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

ARGS = {
    'batch_size': 2,
    'shuffle_every': False,
    'mean': 1.0,
    'std': 1.0
}
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 ColorJitter — 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 ColorJitter 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
GaussianNoise Ran
ran on a synthesized input · constructed an object; no result was computed
hfutqian/MaskAQ/MaskAQ/hydra_image_gen_ssim_att_map.py
code served (permissive licence) · get_code("31e36e389cbb635b")
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, GaussianNoise: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

# Construct arguments for GaussianNoise
batch_size = 2
shuffle_every = False
std = 1.0
max_iter = 2000

ARGS = {
    'batch_size': batch_size,
    'shuffle_every': shuffle_every,
    'std': std,
    'max_iter': max_iter
}
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 GaussianNoise — 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 GaussianNoise 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
attention_entropy_loss_similarity Ran
ran, honoured the contract we drafted
hfutqian/MaskAQ/MaskAQ/hydra_image_gen_ssim_att_map.py
code served (permissive licence) · get_code("b647b6fa7c6ef9f7")
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 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 attention maps with different shapes to test various code paths
att_maps = [
    # 4D tensor for non-swin path: (batch=2, heads=3, seq=4, seq=4)
    torch.randn(2, 3, 4, 4),
    # 3D tensor: (batch=2, tokens=5, features=6)
    torch.randn(2, 5, 6),
    # 2D tensor: (batch=2, features=7)
    torch.randn(2, 7),
]

ARGS = {
    "att_maps": att_maps,
    "is_swin": False,
    "patch_subsample_k": 64,
    "eps": 1e-08,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
generate_attention_mask Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
hfutqian/MaskAQ/MaskAQ/hydra_image_gen_ssim_att_map.py
code served (permissive licence) · get_code("be79c10c1ba8dfc0")
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 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)

# Case 1: is_swin=False, 4D attention maps (standard vision transformer)
# Shape: (num_layers, batch, num_heads, seq_len, seq_len)
att_maps_4d = [
    torch.randn(2, 3, 4, 5),  # batch=2, num_heads=3, seq_len=4, seq_len=5
    torch.randn(2, 3, 4, 5),
]

ARGS = {
    "att_maps": att_maps_4d,
    "ratio": 0.3,
    "is_swin": 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 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
get_image_prior_losses Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
hfutqian/MaskAQ/MaskAQ/hydra_image_gen_ssim_att_map.py
code served (permissive licence) · get_code("5ba2c5affabe46db")
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 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 a small 4D tensor (batch, channels, height, width)
# Using distinct sizes: batch=2, channels=3, height=4, width=5
inputs_jit = torch.randn(2, 3, 4, 5)

ARGS = {
    "inputs_jit": inputs_jit
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
hook_class Ran
ran on a synthesized input · constructed an object; no result was computed
hfutqian/MaskAQ/MaskAQ/hydra_image_gen_ssim_att_map.py
code served (permissive licence) · get_code("caed5009a1578053")
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, hook_class: 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

torch.manual_seed(0)

ARGS = {}
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 hook_class — 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 hook_class 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
masked_attention_difference_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
hfutqian/MaskAQ/MaskAQ/hydra_image_gen_ssim_att_map.py
code served (permissive licence) · get_code("591c839354b2719c")
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 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.functional as F

torch.manual_seed(0)

# Create attention maps for full model
# For the 4D case (len == 4): shape [batch, heads, seq_len, seq_len]
att_maps_full_4d = torch.randn(2, 3, 5, 5)
att_maps_quant_4d = torch.randn(2, 3, 5, 5)

# For the 2D case: shape [batch, seq_len]
att_maps_full_2d = torch.randn(2, 8)
att_maps_quant_2d = torch.randn(2, 8)

# Create lists with mixed cases to test different branches
att_maps_full = [att_maps_full_4d, att_maps_full_2d]
att_maps_quant = [att_maps_quant_4d, att_maps_quant_2d]

# Create mask with shape [batch, num_tokens]
# Using 5 tokens to match the flattened 4D case
mask = torch.randint(0, 2, (2, 5)).float()

# Test with is_swin=False (default)
ARGS = {
    "att_maps_full": att_maps_full,
    "att_maps_quant": att_maps_quant,
    "mask": mask,
    "is_swin": 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 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
ssim_loss_att_map Ran
ran; our contract draft was wrong, not the code
hfutqian/MaskAQ/MaskAQ/hydra_image_gen_ssim_att_map.py
code served (permissive licence) · get_code("cf587069fbbe0afd")
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 (3, 392, 4, 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
from einops import rearrange

torch.manual_seed(0)

# Analyze the function to understand what att_hook_output should be:
# 1. att_hook_output is stacked into hook_stack with shape [L, B, H, N, d]
# 2. After slicing [:, :, :, 1:, 1:197], it becomes [L, B, H, N-1, 197]
# 3. Then rearranged to [L, (B*N), H, d]
# 4. Later reshaped to [L, B, H, 14, 14] (w=14, h=14)
# So we need N such that (N-1) = 14*14 = 196, thus N = 197
# And d = 197 (the last dimension after slicing [1:197])

# Let's construct att_hook_output as a list of tensors
# Each tensor should be [B, H, N, d] where:
# - B = 2 (batch size)
# - H = 4 (num heads)
# - N = 197 (sequence length)
# - d = 197 (feature dimension)

L = 3  # number of layers
B = 2  # batch size
H = 4  # number of heads
N = 197  # sequence length
d = 197  # feature dimension

# Create att_hook_output as a list of L tensors
att_hook_output = [
    torch.randn(B, H, N, d) for _ in range(L)
]

ARGS = {
    'att_hook_output': att_hook_output,
    'mode': 'full_map',
    'self_zero': False,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, 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 (3, 392, 4, 4) — shape (3, 392, 4, 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
stochastic_mask_drop Ran
ran; our contract draft was wrong, not the code
hfutqian/MaskAQ/MaskAQ/hydra_image_gen_ssim_att_map.py
code served (permissive licence) · get_code("f6230f919b38e3b4")
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 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)

# Create a small binary mask tensor: batch_size=2, features=4
# Values should be binary (0.0 or 1.0) or close to it for the > 0.5 check
mask = torch.tensor([
    [1.0, 1.0, 0.0, 1.0],
    [1.0, 0.0, 1.0, 1.0]
])

ARGS = {
    "mask": mask,
    "drop_prob": 0.3,
    "min_keep": 1,
    "seed": 42
}
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 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
update_mask_ratio Ran
ran, honoured the contract we drafted
hfutqian/MaskAQ/MaskAQ/hydra_image_gen_ssim_att_map.py
code served (permissive licence) · get_code("f88a9d4be2458283")
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 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 torch.nn as nn

torch.manual_seed(0)

# Analyzing the function:
# - current_iter: int, used in division
# - total_iter: int, used in division
# - initial_ratio: float, used in arithmetic
# - final_ratio: float, used in arithmetic
# All parameters are simple numeric types, no complex objects needed

ARGS = {
    "current_iter": 5,
    "total_iter": 10,
    "initial_ratio": 0.5,
    "final_ratio": 0.1,
}
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 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
generate Not yet run
unverified (harvested, no recorded run)
hfutqian/MaskAQ/MaskAQ/hydra_image_gen_ssim_att_map.py
code served (permissive licence) · get_code("0bbe2df88e08bd7d")
How it ran

no invocation recorded.

ssim_loss_att_map_swin Not yet run
unverified (harvested, no recorded run)
hfutqian/MaskAQ/MaskAQ/hydra_image_gen_ssim_att_map.py
code served (permissive licence) · get_code("f13dc6e6820fb836")
How it ran

no invocation recorded.

Also present in other papers' code

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

Data-Free Quantization (DFQ) addresses data security concerns by synthesizing samples, without accessing real data. It has garnered increasing attention in the context of Vision Transformers (ViTs), owing to the superiority of the selfattention mechanism compared to classical convolutional operation. However, previous DFQ arts for ViTs often suffer from a distribution mismatch between synthetic samples and input distribution expected by quantized models Q, resulting in the suboptimal performance. In this paper, we propose a novel Masked Attention Alignment approach for Data-Free Quantization of ViTs, named MaskAQ, revealing that: 1) the semantics in the self-attention mechanism is predominantly localized to a sparse subset of patches, called informative regions; 2) the informative regions dominate the mutual information between synthetic samples and Q's outputs. To these ends, we incorporate differential entropy maximum over patch similarity of synthetic samples, to decouple informative regions from noisy background. To couple with varied Q, the informative regions are selected to align full-precision models with Q via a masked attention alignment objective, thus yielding high-quality synthetic samples. Furthermore, a periodic sample refreshing strategy comes up to endow MaskAQ with the capacity to continually adapt to the evolving state of Q throughout the training process, to preserve desirable mutual information with synthetic samples. Extensive experiments verify the merits of MaskAQ over stateof-the-art approaches across multiple backbones and downstream tasks. Our code is available at https://github.com/hfutqian/MaskAQ.

For agents

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

get_harvested_code_for_paper("2606.04373")
get_code_for_paper("2606.04373")
have("2606.04373")

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

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

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

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

Connect an agent — have() is free.