When Guidance Goes Off-Scale: Recalibrating Diffusion Transformers under Analog Compute-in-Memory Nonidealities
Authors: Wenshuai Yao, Wenyong Zhou
Organizations: School of Integrated Circuits, Peking University, Beijing, China · Department of Electrical and Computer Engineering, The University of Hong Kong, Hong Kong SAR, China
Diffusion Transformers (DiTs) incur high memory traffic and energy costs because sampling repeatedly evaluates large denoisers dominated by linear operations. Analog compute-in-memory (CIM) can alleviate these costs by executing linear operations within weight-storing memory arrays. However, CIM nonidealities perturb effective weights, with errors accumulating along the state-dependent denoising trajectory; their interaction with classifier-free guidance (CFG) remains underexplored. In this paper, we characterize the impact of analog CIM nonidealities on DiT sampling. Although conditional and unconditional predictions can each remain close to their clean counterparts, their difference (the CFG residual) is disproportionately attenuated and rotated. Identifying this residual as a controllable failure channel, we propose a retraining-free, sampler-side recalibration that adjusts only the CFG scale for a given CIM condition. Trajectory-level analysis shows that moderate recalibration strengthens the target-oriented component preserved in the distorted residual, enabling earlier commitment to a prompt-consistent semantic region. In contrast, excessive guidance amplifies the full noisy residual and degrades quality, resulting in a finite, noise-dependent optimum. Extensive experiments on PixArt-Sigma, PixArt-alpha, and DiT-XL/2 show that the optimal guidance scale increases with CIM noise. Using 30,000 samples per condition, guidance recalibration consistently restores generation quality across simulated CIM mappings, closing at least 87% of the CIM-induced FID gap at a CIM noise level of 0.20. It reduces FID from 59.22 to 20.49 on PixArt-Sigma, 72.37 to 21.12 on PixArt-alpha, and 20.89 to 6.62 on DiT-XL/2.
Figures & tables
Figure 1: Qualitative comparison across four prompts. Each triplet shows clean generation, CIM with clean-selected guidance, and CIM with recalibrated guidance.
Figure 2: Hybrid analog CIM deployment. (a) CIM-based matrix multiplication. (b) DiT mapping: linear layers are executed on CIM arrays, while other operations remain digital.
Figure 3: PixArt- Σ generations at 1024×1024 resolution under increasing CIM nonidealities at the clean-selected scale w0=2.0 .
Figure 4: CFG and residual diagnostics under CIM nonidealities. (a) Branch perturbations. (b) Residual rotation. (c) Clean-aligned decomposition. (d–e) Timestep statistics at σCIM=0.20 ; shading indicates 95% confidence intervals.
Figure 5: Conceptual sampling trajectories under (a) clean inference, (b) CIM inference with the clean-selected scale w0 , and (c) CIM inference with the recalibrated scale w⋆ . Shaded contours indicate semantic basins; arrows denote base and guidance updates. Each trajectory segment is the vector sum of the two component arrows.
Model and benchmark
σCIM
CFG w
FID ↓
KID ×103↓
Alignment ↑
Precision ↑
Density ↑
Coverage ↑
PixArt- Σ ( 5122 , COCO)
0 (clean)
1.5
20.51
7.75
30.34
0.550
0.654
0.595
0.05
1.5 ( =w0 )
20.31
7.68
30.31
0.551
0.647
0.582
0.10
1.5 → 2.0
21.12 → 19.98
8.27 → 7.05
30.09 → 30.69
0.513 → 0.552
0.575 → 0.654
0.556 → 0.580
0.15
1.5 → 2.5
28.62 → 20.18
12.85 → 6.87
29.37 → 30.79
0.432 → 0.543
0.423 → 0.628
0.477 → 0.572
0.20
1.5 → 4.5
59.22 → 20.49
30.41 → 6.49
27.32 → 31.17
0.248 → 0.527
0.203 → 0.602
0.292 → 0.560
PixArt- α ( 5122 , COCO)
0 (clean)
1.5
21.63
8.21
29.98
0.545
0.624
0.567
Table 1: Large-scale population-level evaluation across three diffusion transformers and multiple simulated CIM mappings, with 30,000 samples per setting. Noisy entries report w0→wσ⋆ ; a single value is shown when the selected scales coincide. Underlining marks the recalibrated endpoint, and bold marks improvement over the clean-guidance baseline.
Figure 6: Guidance response on a 3,000-prompt PixArt- Σ sweep. (a) FID and (b) CLIPScore versus w . (c) FID at w0 and wσ⋆ .
Figure 7: Qualitative comparisons under CIM noise. Left: PixArt- Σ text-to-image generation at σCIM=0.15 , using w0=1.5 and wσ⋆=2.5 . Right: SD3.5 Medium text rendering at σCIM=0.10 , using w0=1.5 and wσ⋆=3.0 .
Figure 8: Timestep semantic-entry analysis. (a) Ten evenly spaced checkpoints from 20-step predicted-clean trajectories for two prompts; rows show clean inference, CIM with w0 , and CIM with wσ⋆ . (b–d) Prompt retrieval top-1 accuracy across all steps. (e) Persistent semantic-entry indices at θ=0.30 .
Method
σCIM=0.15
σCIM=0.20
Clean-best CFG
44.93
75.94
CFG Rescale
40.40
40.72
APG
39.21
41.08
C 2 FG
38.11
39.52
Limited-Interval Guidance
37.28
38.76
Fixed recalibration (ours)
36.60
37.61
Table 2: FID in the shared 3,000-prompt PixArt- Σ comparison of sampler-side guidance controls.
(a) Endpoint counterfactuals
Metric
Clean
CIM w0
CIM w⋆
Restore u
Restore g
Remove η
Restore α
FID ↓
36.19
75.41
36.64
42.83
68.34
127.75
44.49
CLIP ↑
30.45
27.27
31.27
28.52
28.87
23.23
30.35
DINO-clean ↑
1.000
0.463
0.673
0.621
0.631
0.261
0.699
Table 3: Residual-surgery analysis at σCIM=0.20 over 3,000 prompts. (a) Endpoint counterfactuals. (b) FID along intervention paths from untreated CIM ( 0 ) to the full intervention ( 1 ).
Diffusion models achieve strong image generation quality but incur high iterative denoising costs. Analog compute-in-memory (CIM) can accelerate matrix-vector multiplications, yet spatial memory variations perturb weights and accumulate during sampling. Unlike conventional neural networks, diffusion models' temporal sensitivity to hardware noise remains underexplored. We investigate diffusion inference using a noise model calibrated and validated against measurements collected from multiple physical CIM chips. Our results show that the early, high-noise denoising stage is substantially more vulnerable than the final refinement stage. A first-order trajectory analysis attributes this behavior to the repeated propagation of correlated prediction errors induced by a fixed hardware mapping. Based on this observation, we propose ASSERT, a training-free sampler that uses higher stochasticity early and smoothly transitions to deterministic denoising. The injected stochasticity changes subsequent activation trajectories and thereby reduces their alignment with persistent spatial errors. Across the evaluated settings, ASSERT achieves up to 2.58× lower FID than deterministic DDIM on high-resolution datasets and 7.68× lower FID in the CIFAR-10 step-count study, without changing model parameters or the number of network evaluations.
Yuannuo Feng, Yizhe Chen, Wenshuai Yao +4
School of Integrated Circuit Science and Engineering, Beihang University, Beijing, China · Zhicun Research Lab, Beijing, China · School of Integrated Circuits, Peking University, Beijing, China +1
Classifier-free guidance (CFG) is the standard way to strengthen class-conditioning in diffusion and flow-matching samplers, yet at large guidance it oversaturates and destabilizes, symptoms practitioners suppress with more steps or limited-interval schedules. We analyze CFG through an asymptotic-preserving, numerical-analysis lens. Building on a recent result that the deterministic DDIM step is the unique fitted operator for the unguided terminal layer, exact on the final small-sigma stretch of sampling, we show that guidance re-stiffens exactly the discriminative subspace to an anomalous exponent 1+w. DDIM is therefore no longer fitted there, and on coarse meshes its guided residual diverges as sigma_min goes to zero. We prove a guided clock barrier with three ordered step-size thresholds, and read one-step oversaturation as its endpoint: a solver artifact on the calibration model rather than the continuous guided law. The same analysis yields a one-coefficient, zero-extra-NFE repair: replace CFG's w(r-1) by r^(1+w)-r on the guidance direction. On the calibration model's discriminative crossover, this removes CFG's sigma_min-divergent blow-up and is first-order accurate against the exact guided flow as sigma_min goes to zero. On learned CIFAR-10 checkpoints, and as a cross-domain smoke test on Stable Diffusion 1.5 DDIM, it acts as a high-guidance stabilizer at no extra cost rather than a universal quality knob: it cuts residual amplification and saturation, gives 9/9 point-FID wins over CFG on the tested grid, and preserves classifier-proxy target accuracy in the hard-cell blocks. We report the limits alongside: it is not a universal image-quality win, and against a dense vanilla-CFG reference it is not a uniformly better integrator of that field.
Diffusion Transformers require repeated denoiser evaluations during iterative sampling, making inference computationally expensive. Cache-based acceleration reduces this cost by reusing intermediate representations across denoising steps, but can introduce representation deviations and degrade generation quality. In this paper, we analyze these deviations and show that effective calibration should consider both the direct mismatch caused by reuse and the subsequent trajectory shift induced by earlier corrections. To address this challenge, we propose Trajectory-Consistent Calibration (TCC), a training-free method that calibrates cached representations toward their full-computation counterparts. Specifically, rather than estimating all calibration priors from a single uncorrected cache trajectory, TCC uses an offline iterative procedure so that each prior accounts for the trajectory shift induced by preceding calibrations. Experiments on PixArt-alpha and DiT-XL/2 show that TCC consistently improves FID across representative cache-based acceleration methods while preserving their underlying reuse policies. Notably, in a representative PixArt-alpha cache-acceleration setting based on FORA, TCC reduces FID from 29.83 to 27.35, slightly surpassing the full-computation baseline.
Mingyu Liang, Dingkun Xu, Jingwei Xu
Laboratory for Novel Software Technology, Nanjing University, China