Background Gradients Shape Memorization in Flow Matching
Organizations: School of Computer Science, The University of Sydney · Institute of Automation, Chinese Academy of Sciences
Abstract
Repetition is closely associated with memorization in generative models, but how other training images affect the retention and copying of targets remains unclear. We study this question in class-conditioned flow matching, where images outside the target set form the background. At fixed target repetition and same-class background row count, replacing repeated same-class images with distinct images reduces the target extraction rate from 80.7% to 18.0%. To explain this effect, we develop a paired-trajectory framework that isolates target-induced parameter displacement and the background gradient response to it. This response has an exact path-integrated curvature representation, connecting background loss geometry to target learning. Reciprocal response transfer between repeated and distinct backgrounds changes target retention and copying in both directions, establishing the response's causal role. After target removal, the response correction parallel to the target-induced displacement preserves approximately 90% of the copying effects of full response transfer. Directly scaling the displacement also changes copying without further training. The post-removal copying effects of reciprocal transfer are reproduced across datasets and architectures. Together, these results identify the background gradient response as a mechanism through which same-class training data shape the retention of target learning and the reproduction of target images.
Figures & tables
| Background | Target copying rate (%) | ||
|---|---|---|---|
| , | 0.03834 | 0.3206 | 2.520 [2.197, 2.843] |
| , | 0.05200 | 0.2197 | 1.177 [0.978, 1.376] |
| , | 0.06499 | 0.1305 | 0.439 [0.372, 0.506] |
| Correction | Copying | Effect [95% CI] | Copying | Effect [95% CI] |
|---|---|---|---|---|
| Native | 2.685 | n/a | 0.523 | n/a |
| Full | 1.732 | 0.953 [0.912, 0.994] | 1.622 | 1.099 [1.042, 1.156] |
| Parallel only | 1.820 | 0.865 [0.832, 0.898] | 1.500 | 0.977 [0.928, 1.026] |
| Orthogonal only | 2.570 | 0.115 [0.107, 0.123] | 0.640 | 0.117 [0.109, 0.125] |
| State or direction | Target copy | Decoy hit | Non-target copy | |
|---|---|---|---|---|
| 0.33 | 0 | 0.30 | 0.45 | |
| 1.30 | 0.071 | 0.30 | 0.45 | |
| 2.520 | 0.1284 | 0.30 | 0.46 | |
| 3.71 | 0.172 | 0.31 | 0.47 | |
| Random parameter direction | 0.38 | 0.004 | 0.30 | 0.45 |
| Non-target learning direction | 0.44 | 0.006 | 0.31 | 0.46 |
| Setting | Comparator | ||||
|---|---|---|---|---|---|
| Change | 95% CI | Change | 95% CI | ||
| CIFAR-10 / DiT | Native | ||||
| Random | |||||
| CINIC-10 / DiT | Native | ||||
| Random | |||||
| CIFAR-10 / U-Net | Native | ||||
Appendix figures & tables37 assets
Supplementary material from the paper’s appendix.
Appendix
| Regime | Condition | ||
|---|---|---|---|
| Interleaved | R native | 0.1284 | 0.3206 |
| M native | 0.0879 | 0.2197 | |
| U native | 0.0522 | 0.1305 | |
| R receiving U response | 0.0784 | 0.1959 | |
| U receiving R response | 0.0987 | 0.2475 | |
| Pulse-chase | R native | 0.1412 | 0.3517 |
| Background | LPIPS copy | Accuracy | KID |
|---|---|---|---|
| R | 3.403 | 71.299 | 0.04121 |
| M | 1.595 | 70.636 | 0.03899 |
| U | 0.596 | 69.719 | 0.03741 |
| Receiver | Intervention | Pixel copy [95% CI] | Acc. | KID | |
| Pulse-chase | |||||
| R | Native | 0.3517 | 2.685 [2.388, 2.981] | n/a | n/a |
| R | U response | 0.1954 | 1.732 [1.502, 1.961] | ||
| R | Matched random | 0.3146 | 2.408 [2.220, 2.596] | ||
| R | Preclip norm | 0.3157 | 2.424 [2.105, 2.743] | ||
| U | Native | 0.1428 | 0.523 [0.446, 0.600] | n/a | n/a |
| Receiver | Intervention | Pulse-chase | Interleaved |
|---|---|---|---|
| R | U response | [ , ] | [ , ] |
| U | R response | [ , ] | [ , ] |
| Phase | Step interval | Updates | Target draws |
|---|---|---|---|
| Common target learning | 2,500–2,900 | 400 | 640 |
| Interleaved continuation | 2,900–6,000 | 3,100 | 4,960 |
| Pulse-chase continuation | 2,900–6,000 | 3,100 | 0 |
| Diagnostic | ||
|---|---|---|
| , median [IQR] | 1.08 [1.03, 1.14] | 0.93 [0.89, 0.97] |
| Maximum | ||
| Maximum | ||
| Zero-norm steps | 0 | 0 |
| Zero-correction groups per step | 0 | 0 |
| Experiment | Evaluation point | Images | Endpoint |
|---|---|---|---|
| Balanced | Step 10,000, EMA | 2,000 | Target extraction rate |
| Composition | Step 10,000 | 2,000 | Target extraction rate |
| Mechanism | Step 6,000, raw parameters | 4,096 | Target copying rate |
| Regime | Receiver / comparator | Effect [95% CI] | Holm |
|---|---|---|---|
| Pulse-chase | R / native | 0.953 [0.630, 1.277] | |
| U / native | 1.099 [0.929, 1.269] | ||
| R / random | 0.676 [0.489, 0.863] | ||
| U / random | 0.986 [0.805, 1.167] | ||
| R / preclip | 0.692 [0.486, 0.898] | n/a | |
| U / preclip | 0.948 [0.758, 1.137] | n/a |
| Receiver / comparator | Pulse-chase | Interleaved |
|---|---|---|
| R / native | 0.1562 [0.1298, 0.1827] | 0.1247 [0.1072, 0.1422] |
| U / native | 0.1494 [0.1413, 0.1575] | 0.1170 [0.0993, 0.1348] |
| R / random | 0.1191 [0.1005, 0.1378] | 0.1123 [0.0969, 0.1276] |
| U / random | 0.1383 [0.1264, 0.1503] | 0.1089 [0.0933, 0.1245] |
| R / preclip | 0.1203 [0.1005, 0.1401] | 0.0984 [0.0742, 0.1226] |
| U / preclip | 0.1253 [0.1074, 0.1433] | 0.1050 [0.0859, 0.1242] |
| Receiver | Native | Transfer | Random | Beyond random |
|---|---|---|---|---|
| CINIC-10 / DiT | ||||
| R | 2.000 [1.606, 2.394] | 1.318 [1.005, 1.630] | 1.902 [1.516, 2.288] | 0.584 [0.453, 0.716] |
| U | 0.446 [0.347, 0.545] | 1.157 [0.924, 1.389] | 0.542 [0.426, 0.658] | 0.615 [0.485, 0.744] |
| CIFAR-10 / U-Net FM | ||||
| R | 1.742 [1.538, 1.947] | 1.174 [1.086, 1.262] | 1.662 [1.492, 1.832] | 0.488 [0.386, 0.590] |
| U | 0.401 [0.374, 0.428] | 0.969 [0.897, 1.041] | 0.466 [0.408, 0.524] | 0.503 [0.431, 0.574] |
| Setting | Experimental panels | Native minus |
|---|---|---|
| CIFAR-10 with DiT, primary | 8 | 2.162 [1.884, 2.440] |
| CINIC-10 with DiT | 6 | 1.554 [1.249, 1.859] |
| CIFAR-10 with U-Net | 6 | 1.341 [1.143, 1.540] |
| Background composition | Target extraction rate | Conditional accuracy |
|---|---|---|
| Same-class | 18.0 | 56.6 |
| Same-class | 80.7 | 93.9 |
| Same-class | 86.0 | 64.9 |
| Relabeled other-class | 20.0 | 8.3 |
| Relabeled other-class | 82.0 | 5.8 |
| Symbol | Meaning |
|---|---|
| Image, conditioning class, Gaussian noise, and flow time. | |
| Network parameters and class-conditioned velocity field. | |
| Target-copy count and distinct non-target same-class image count in the balanced design. | |
| Cycle and training-run indices. | |
| Attributable hit for one generated image and at least one hit for a target in a model, respectively. | |
| Repetition coefficient, support coefficient, and fitted exponent . |
| Data experiment | Untrained-reference extraction (%) |
|---|---|
| Balanced | 3.0 |
| Composition | 2.7 |
| Near-duplicate | 3.3 |
| Reference policy | Light variations | Strong variations |
|---|---|---|
| Original image | 0.987 [0.968, 1.006] | 0.983 [0.963, 1.005] |
| One training variant | 0.996 [0.978, 1.014] | 0.982 [0.959, 1.006] |
| Endpoint | Quantity | Estimate | 95% interval |
|---|---|---|---|
| Pixel | Repetition coefficient | 3.498 | [3.098, 3.898] |
| Support coefficient | [ , ] | ||
| Support exponent | 0.657 | [0.610, 0.703] | |
| LPIPS-Alex | Support exponent | 1.043 | [0.912, 1.181] |
| Background contrast | Extraction change | Log-odds [95% interval] | Accuracy change |
|---|---|---|---|
| Same-class: 400 distinct vs. | |||
| Other-class: 400 distinct vs. | |||
| Same-class: vs. 25 distinct | |||
| 400 distinct: same-class vs. other-class |
| Background contrast | Block 1 | Block 2 | Block 3 | Mean | 95% interval |
|---|---|---|---|---|---|
| Same-class: 400 distinct vs. | |||||
| Other-class: 400 distinct vs. | |||||
| Same-class: vs. 25 distinct |
| Condition | Block 1 | Block 2 | Block 3 |
|---|---|---|---|
| U | 0 / 44.02 | 3 / 45.36 | 0 / 46.25 |
| R | 268 / 71.13 | 357 / 71.49 | 531 / 70.90 |
| U R | 0 / 44.26 | 3 / 45.64 | 0 / 44.95 |
| R U | 93 / 68.59 | 123 / 69.35 | 142 / 68.91 |
| U + orthogonal control | 0 / 42.22 | 2 / 44.49 | 0 / 45.21 |
| R + orthogonal control | 106 / 55.25 | 124 / 43.30 | 130 / 50.44 |
| Model | Bank | Improvement difference | Relative reduction | 95% lower bound |
|---|---|---|---|---|
| 1 | H | 3.547 | 17.83% | 1.629 |
| 1 | D | 3.722 | 18.14% | 1.653 |
| 2 | H | 3.390 | 15.47% | 1.890 |
| 2 | D | 3.542 | 15.73% | 2.061 |
| Model | Cross-target slope | Pearson | LOTO |
|---|---|---|---|
| 1 | 0.9950 | 0.999979 | 0.999894 |
| 2 | 0.9978 | 0.999863 | 0.999623 |
| Added inputs | Retention MAE | Retention RMSE | Open-loop error | Copy log-loss | Copy Brier | |
|---|---|---|---|---|---|---|
| P0 | Baseline inputs | 0.1427 | 0.1846 | 0.2241 | 0.4131 | 0.1361 |
| P1 | First-order gradients | 0.1220 | 0.1577 | 0.1952 | 0.3722 | 0.1186 |
| P2 | Global curvature, update scale | 0.1163 | 0.1504 | 0.1831 | 0.3578 | 0.1133 |
| P3 | Target-relevant response | 0.0950 | 0.1228 | 0.1502 | 0.3114 | 0.0964 |
| P4 | AdamW state dynamics | 0.0932 | 0.1205 | 0.1468 | 0.3049 | 0.0941 |
| Background | Training steps | Extraction | Accuracy |
|---|---|---|---|
| 10,000 | 80.67 | 93.92 | |
| 10,000 | 18.00 | 56.63 | |
| 10,000 | 86.00 | 64.89 | |
| 20,000 | 78.00 | 94.00 | |
| 20,000 | 30.00 | 80.00 |
| Step | R interleaved | R pulse-chase | U interleaved | U pulse-chase |
| Signed target-specific benefit | ||||
| 2,900 | 0.4010 | 0.4010 | 0.4010 | 0.4010 |
| 2,901 | 0.3950 | 0.3970 | 0.3920 | 0.3940 |
| 2,910 | 0.3600 | 0.3700 | 0.3500 | 0.3600 |
| 2,950 | 0.3000 | 0.3200 | 0.2800 | 0.2900 |
| 3,000 | 0.2500 | 0.2800 | 0.2100 | 0.2300 |
| Background | Regime | Target off | Target on | Decoy off | Decoy on | Copy | ||
|---|---|---|---|---|---|---|---|---|
| R | Interleaved | 0.5000 | 0.3516 | 0.4200 | 0.4000 | 0.1284 | 0.3206 | 2.520 |
| R | Pulse-chase | 0.5000 | 0.3388 | 0.4200 | 0.4000 | 0.1412 | 0.3517 | 2.685 |
| U | Interleaved | 0.5000 | 0.4278 | 0.4200 | 0.4000 | 0.0522 | 0.1305 | 0.439 |
| U | Pulse-chase | 0.5000 | 0.4229 | 0.4200 | 0.4000 | 0.0571 | 0.1428 | 0.523 |
| Receiver | Condition | Copy | ||
|---|---|---|---|---|
| R | Native | 0.1412 | 0.3517 | 2.685 |
| R | Earlier projection exchange | 0.1100 | 0.2750 | 2.200 |
| R | Full U response | 0.0782 | 0.1954 | 1.732 |
| R | Projection-exchange control | 0.1380 | 0.3440 | 2.620 |
| R | Full-response control | 0.1360 | 0.3390 | 2.600 |
| U | Native | 0.0571 | 0.1428 | 0.523 |
| Receiver | Arm | Copy | Accuracy | KID | ||
|---|---|---|---|---|---|---|
| R | Native | 0.1412 | 0.3517 | 2.685 | 90.000 | 0.01000 |
| R | Full response | 0.0782 | 0.1954 | 1.732 | 89.659 | 0.00872 |
| R | Along displacement only | 0.0840 | 0.2100 | 1.820 | 89.800 | 0.00930 |
| R | Orthogonal only | 0.1320 | 0.3300 | 2.570 | 90.100 | 0.01010 |
| U | Native | 0.0571 | 0.1428 | 0.523 | 88.000 | 0.01200 |
| U | Full response | 0.1171 | 0.2922 | 1.622 | 88.688 | 0.01372 |
| Receiver | Contrast | Mean | Paired SD | 95% interval |
|---|---|---|---|---|
| R | Full-response effect | 0.953 | 0.04899 | [0.9120, 0.9940] |
| R | Along-displacement effect | 0.865 | 0.03919 | [0.8322, 0.8978] |
| R | Orthogonal effect | 0.115 | 0.00980 | [0.1068, 0.1232] |
| R | Along-displacement minus orthogonal effect | 0.750 | 0.02939 | [0.7254, 0.7746] |
| R | Along-displacement minus full effect | 0.00980 | [ , ] | |
| U | Full-response effect | 1.099 | 0.06859 | [1.0417, 1.1563] |
| Receiver R | Receiver U | |||||||
|---|---|---|---|---|---|---|---|---|
| Panel | Native | Full | Random | Preclip | Native | Full | Random | Preclip |
| panel00 | 2.033691 | 1.889648 | 2.402344 | 2.910156 | 0.478516 | 1.682129 | 0.534668 | 0.544434 |
| panel01 | 3.071289 | 2.209473 | 2.500000 | 2.949219 | 0.722656 | 2.067871 | 0.769043 | 0.854492 |
| panel02 | 2.956543 | 1.928711 | 2.585449 | 2.470703 | 0.512695 | 1.682129 | 0.637207 | 0.764160 |
| panel03 | 2.436523 | 1.511230 | 2.290039 | 2.399902 | 0.451660 | 1.257324 | 0.551758 | 0.573730 |
| panel04 | 2.851562 | 1.838379 | 2.744141 | 2.353516 | 0.498047 | 1.853027 | 0.732422 | 0.637207 |
| Receiver R | Receiver U | |||||||
|---|---|---|---|---|---|---|---|---|
| Panel | Native | Full | Parallel | Orthogonal | Native | Full | Parallel | Orthogonal |
| S01 | 2.475 | 1.592 | 1.666 | 2.374 | 0.453 | 1.454 | 1.346 | 0.556 |
| S02 | 2.535 | 1.632 | 1.710 | 2.430 | 0.473 | 1.502 | 1.390 | 0.580 |
| S03 | 2.595 | 1.672 | 1.754 | 2.486 | 0.493 | 1.550 | 1.434 | 0.604 |
| S04 | 2.655 | 1.712 | 1.798 | 2.542 | 0.513 | 1.598 | 1.478 | 0.628 |
| S05 | 2.715 | 1.752 | 1.842 | 2.598 | 0.533 | 1.646 | 1.522 | 0.652 |
Memorization in Generative Models
Memorization in generative models studies when models retain training examples, how to detect their recall, and how to limit it without losing utility.
See all 88 papers