TraceSampler: Making Sampling Errors Predictable and Correctable for Accelerated Generative Sampling
Organizations: University of Exeter, United Kingdom · NTT Communication Science Laboratories, Japan
Abstract
Accurate sampling from continuous-time generative models can require many model evaluations. Low-step sampling reduces cost, but coarse updates introduce endpoint errors that can accumulate and degrade generation quality. We introduce TraceSampler, a post-training method that corrects these errors without modifying the pretrained model. Rather than optimising low-step updates directly, TraceSampler models endpoint error as a sample-specific prediction problem. A higher-step reference integration over the same interval provides the supervised target, while a compact representation makes high-dimensional error predictable from the sampling trace. This representation combines shared residual structure, trace-derived directions, and a low-rank remainder, so shallow per-step MLP heads predict sample-dependent coefficients. These coefficients drive a two-stage learned residual correction: the first stage predicts the full endpoint residual, while an intermediate backbone evaluation provides new trace information to predict the remaining residual; this evaluation is reused by the following step. TraceSampler is evaluated with Rectified Flow on CIFAR-10, SiT-XL/2 on ImageNet-256, and SD3.5 Medium for text-to-image generation. At 10 steps, it reduces trajectory MSE relative to matched-step Euler by 90.5% on CIFAR-10 and 85.6% on ImageNet-256, while achieving FID scores of 2.692 and 2.189, close to 120-step Heun references of 2.601 and 2.056 with 24 fewer backbone evaluations. On SD3.5 Medium, TraceSampler improves image quality and prompt following; at 10 steps, ImageReward rises from 0.752 to 0.906 while trajectory MSE falls by 70.7%. These gains preserve Euler's backbone-evaluation budget, add less than 0.4% inference FLOPs, and incur negligible wall-clock overhead, showing that coarse-step sampling error can be made predictable from the sampling trace and efficiently corrected.
Figures & tables
| Model/config. | Offline reference | PCA rank | MLP width | Schedule |
|---|---|---|---|---|
| RF CIFAR-10 | 120-step Heun | Optimised | ||
| SiT-XL/2 | 120-step Heun | Optimised | ||
| SD3.5 Medium (8-step) | 64-step Euler | Shift | ||
| SD3.5 Medium (10-step) | 60-step Euler | Shift |
| Method | Schedule | FID | IS | Trajectory MSE reduction | |
|---|---|---|---|---|---|
| Base Euler | Uniform | 0 | 15.729 | 6.321 | 0.0% |
| Predictor directions only | Uniform | 0 | 9.705 | 7.757 | 34.7% |
| Predictor + corrector directions | Uniform | 0 | 4.101 | 8.612 | 80.5% |
| Full TraceSampler | Uniform | 32 | 3.666 | 8.626 | 87.5% |
| Full TraceSampler + schedule | Optimised | 32 | 2.798 | 8.552 | 90.8% |
| Coefficient prediction | FID | IS | Trajectory MSE reduction |
|---|---|---|---|
| Fixed mean coefficients | 3.240 | 8.563 | 81.5% |
| Sample-dependent heads | 2.798 | 8.552 | 90.8% |
| Budget | Euler | IIA–Euler | UniPC | TraceSampler | Traj. MSE red. | ||||
|---|---|---|---|---|---|---|---|---|---|
| FID | IS | FID | IS | FID | IS | FID | IS | ||
| 5 steps | 33.149 | 4.566 | 22.253 | 5.783 | 12.817 | 7.238 | 4.373 | 8.239 | 89.9% |
| 6 steps | 24.143 | 5.327 | 14.940 | 6.510 | 9.333 | 7.730 | 3.560 | 8.344 | 88.8% |
| 8 steps | 15.729 | 6.321 | 8.846 | 7.357 | 7.751 | 8.011 | 2.798 | 8.552 | 90.8% |
| 10 steps | 11.782 | 6.886 | 6.668 | 7.670 | 6.429 | 8.169 | 2.692 | 8.556 | 90.5% |
| 12 steps | 9.632 | 7.205 | 5.671 | 7.850 | 5.778 | 8.256 | 2.641 | 8.517 | 89.5% |
| Budget | Euler | IIA–Euler | UniPC | TraceSampler | Traj. MSE red. | ||||
| FID | IS | FID | IS | FID | IS | FID | IS | ||
| 6 steps | 19.786 | 114.66 | 13.233 | 151.307 | 4.630 | 206.75 | 3.624 | 209.74 | 79.8% |
| 8 steps | 10.675 | 161.18 | 7.405 | 185.997 | 3.105 | 227.55 | 2.418 | 235.21 | 83.2% |
| 10 steps | 7.189 | 186.80 | 5.204 | 204.654 | 2.544 | 238.45 | 2.189 | 245.15 | 85.6% |
| Heun 120-step reference | FID , IS | ||||||||
| Sampler | IR | FID | IS | CLIP | GenEval | HPS | Traj. MSE red. |
|---|---|---|---|---|---|---|---|
| Euler 8 | 0.611 | 17.320 | 39.23 | 0.2698 | 0.60997 | 0.2572 | – |
| Euler 10 | 0.752 | 17.368 | 40.48 | 0.2697 | 0.64152 | 0.2702 | – |
| TraceSampler 8 | 0.862 | 14.616 | 43.28 | 0.2661 | 0.64554 | 0.2807 | 67.9% |
| TraceSampler 10 | 0.906 | 15.478 | 43.05 | 0.2659 | 0.66811 | 0.2878 | 70.7% |
| Euler 64 eval. ref. | 0.973 | 18.059 | 43.95 | 0.2651 | 0.68275 | 0.2968 | – |
| Model | GFLOPs/step | Throughput (images/s) | Peak VRAM (GiB) | ||||
|---|---|---|---|---|---|---|---|
| Euler | Trace | Increase | Euler | Trace | Euler | Trace | |
| Rectified Flow | 21.6931 | 21.7714 | 0.3610% | 321.45 | 316.05 | 6.77 | 7.52 |
| SiT-XL/2 | 474.4857 | 475.0351 | 0.1158% | 31.07 | 30.97 | 7.92 | 8.51 |
| SD3.5 Medium | 4275.6574 | 4278.4379 | 0.0650% | 4.144 | 4.126 | 11.60 | 14.22 |
Appendix figures & tables13 assets
Supplementary material from the paper’s appendix.
Appendix
| Model | Targeted blocks | Compression | Input dim. |
|---|---|---|---|
| Rectified Flow CIFAR-10 | Zero-indexed NCSN++ residual blocks , , , and | Spatial mean and standard deviation for each activation channel; no learned activation projection | |
| SiT-XL/2 | Conditional halves of block.0 , block.26 , and block.27 | Fixed block-specific PCA projection to 256 dimensions, followed by token-wise mean and standard deviation | |
| SD3.5 Medium | Conditional image streams of block.7 , block.14 , and block.20 | Fixed block-specific PCA projection to 256 dimensions, followed by token-wise mean and standard deviation |
| Setting | Configuration |
|---|---|
| Architecture | Independent one-hidden-layer ReLU MLP for each predictor step and each non-final corrector step; hidden width for Rectified Flow and SiT-XL/2 and for SD3.5 Medium |
| Optimisation | AdamW; initial learning rate , weight decay , dropout , batch size , and 20-epoch linear warm-up |
| Learning-rate schedule | ReduceLROnPlateau with factor and patience 50 |
| Stopping and selection | Up to epochs; early stopping with patience 400 on the -trajectory validation set; best validation checkpoint retained |
| Numerical precision | Backbone evaluations in bfloat16 autocast; residual decomposition, coefficient targets, feature normalisation, and MLP fitting in float32 |
| Rectified Flow CIFAR-10 | SiT-XL/2 | |||
|---|---|---|---|---|
| 0 | 0.001000 | 0.092182 | 0.001000 | 0.103061 |
| 1 | 0.093182 | 0.104293 | 0.104061 | 0.104207 |
| 2 | 0.197475 | 0.115650 | 0.208269 | 0.092542 |
| 3 | 0.313125 | 0.126756 | 0.300811 | 0.095130 |
| 4 | 0.439881 | 0.158832 | 0.395941 | 0.105806 |
| Setting | Value |
|---|---|
| Probe trajectories | for Rectified Flow CIFAR-10; for SiT-XL/2 |
| Sampling-time range | |
| Minimum step size | |
| Error-scaling exponent | |
| Optimiser | L-BFGS-B |
| Maximum optimisation passes |
| Ablation | Setting | FID | IS | Trajectory MSE |
|---|---|---|---|---|
| Reference accuracy | 5 Heun substeps | 2.977 | 8.526 | |
| 10 Heun substeps | 2.925 | 8.508 | ||
| 15 Heun substeps | 2.798 | 8.552 | ||
| 20 Heun substeps | 2.845 | 8.581 | ||
| PCA rank | 2.883 | 8.530 | ||
| 2.798 | 8.552 |
| Label | Prompt |
|---|---|
| P1 | A fluffy white cat sitting on a mossy mountain ledge under a huge full moon, soft starlight, crisp detailed fur, cinematic night landscape. |
| P2 | A close-up portrait of a cyberpunk geisha on a rainy Tokyo rooftop, detailed expressive face, neon skyline, holographic lanterns, wet silk kimono, cinematic lighting. |
| P3 | A masked knight in ornate silver armour standing inside a ruined cathedral, sword point resting on the stone floor in front of him, both hands on the hilt, glowing stained-glass light, misty air, cinematic atmosphere. |
| P4 | A close-up portrait of an old lighthouse keeper in a storm, detailed weathered face, thick wool coat, lantern glow, rain on glass, cinematic lighting. |
| Model | Schedule optimisation | Artefact fitting | Total |
|---|---|---|---|
| RF CIFAR-10 | 0:26:57 | 2:32:42 | 2:59:39 |
| SiT-XL/2 | 1:07:04 | 9:02:39 | 10:09:42 |
| SD3.5 Medium | – | 8:35:00 | 8:35:00 |
| Model | Predictor (M) | Corrector (M) |
|---|---|---|
| Rectified Flow | 20.570 | 20.619 |
| SiT-XL/2 | 25.30 | 25.35 |
| SD3.5 Medium | 88.646 | 88.744 |
| Baseline | Configuration |
|---|---|
| IIA–Euler | Basic IIA adapted to the flow-matching update. Two global coefficients combine the current and previous Euler increments. Calibration uses 512 trajectories, three fine-Euler substeps per coarse step, and ridge regularisation of . |
| UniPC | Multistep predictor with order 3, the bh2 variant, log-SNR spacing, data_prediction , lower-order final steps, and one model evaluation per deployed step. |
| Evaluation | Configuration |
|---|---|
| CIFAR-10 | generated samples. FID uses 2048-dimensional Inception-V3 features against CIFAR-10 training-set statistics; IS uses ten splits. |
| ImageNet-256 | class-conditional samples. FID and IS use the VIRTUAL_imagenet256_labeled.npz reference statistics and ten IS splits. |
| COCO captions | One image for each of captions. The evaluation reports ImageReward-v1.0, Inception FID and IS, raw CLIP-L/14 image–text cosine similarity, reported as CLIP similarity, and trajectory MSE against the matched higher-step reference. |
| GenEval | Standard 553-prompt metadata with four images per prompt, CFG , and the official MMDetection-2 scoring pipeline. |
| HPSv2.1 | Official anime, concept-art, paintings, and photo prompt subsets, with one image per retained prompt and the mean of the four subset scores. Prompts exceeding 77 tokens for any SD3 text encoder are excluded. |
Few-Step Diffusion Sampling
Few-step diffusion sampling develops ways to generate data with far fewer denoising evaluations while retaining quality and diversity.
See all 173 papers