Isaacwang commited on
Commit
a321617
Β·
verified Β·
1 Parent(s): 62ee70f

Upload zimg-fdloss/RECIPE.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. zimg-fdloss/RECIPE.md +70 -0
zimg-fdloss/RECIPE.md ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Flow Matching Mid/Post-training β€” Final Recipe Card (frozen 2026-08-04)
2
+
3
+ Model: Z-Image 6B S3-DiT @1024Β². Reference data: BLIP3o-60k (GPT-4o set),
4
+ holdout = sorted-enumeration idx % 12 == 0.
5
+
6
+ ## The recipe
7
+
8
+ 1. **Mid-training (coverage-preserving transport)** β€” iMF/MeanFlow on the
9
+ base model, 3k steps, lr 2e-5: boundary parameterization u(z,t,t)=v via
10
+ zero-init r-branch; v-compound loss with central-difference dF (h=0.01);
11
+ (s,r) = max/min of two U(0,1) + static shift 3.0; groups 50% r=s (FM
12
+ anchor) / 0% r=0 / 50% spans β€” **no explicit full-jump group, no guidance
13
+ fusion (g=0)**. Mode-seeking is deferred entirely to stage 2.
14
+ 2. **Post-training (externally anchored conditional distribution matching)**
15
+ β€” coupled FD, 2k steps, lr 1e-5 cosine: random-NFE {1,2,4,8} rollout with
16
+ one gradient step + direct endpoint jump; loss = Eq.6-normalized sum of
17
+ Gaussian FD terms in frozen SigLIP2-joint / Inception / MAE spaces + a
18
+ standalone cross-covariance term on a factor-probe basis; conditional
19
+ coupling via top-32 diag-whitened CCA text coordinates (K=32 optimal;
20
+ K=64 does not transfer); EMA population moments (Ξ²=0.999). **Global
21
+ batch 64 (4-node) if available** β€” the sole surviving upgrade.
22
+ 3. **Optional TFC finishing dial** β€” short (250–500 step) pass tying the
23
+ 1-jump endpoint's SigLIP2 features to sg(own multi-step endpoint):
24
+ redistributes quality between NFE operating points along a measured
25
+ exchange curve (~1.2 pts gained @1 per pt lost @8). Not net creation.
26
+
27
+ ## Headline numbers (GenEval macro, 553Γ—2 VLM-judged; FDr held-out judge mean)
28
+
29
+ | model | GenEval@8 | GenEval@1 | FDr@8 | FDr@1 |
30
+ |---|---|---|---|---|
31
+ | Z-Image-Turbo (distilled baseline) | 0.811 | 0.719 | 2.174 | 1.700 |
32
+ | **champion (this recipe, b16)** | **0.900** | **0.842** | 1.612 | 1.519 |
33
+ | champion @ batch 64 | 0.910 | 0.846 | 1.621 | 1.447 |
34
+ | 1-NFE specialist (TFC full-run) | 0.843 | 0.879 | 1.909 | 1.596 |
35
+
36
+ McNemar vs turbo: z=+7.0/+8.2 (Holm-robust). No teacher, no discriminator,
37
+ no fake-score network, no CFG at train or inference; ~4.5 h on one 8Γ—H200
38
+ node (b16).
39
+
40
+ ## The three laws (measured)
41
+
42
+ 1. **Division of labor**: mid-training must not spend mode coverage
43
+ (g=0 beats g∈{2,4}; removing the r=0 group is the largest single gain;
44
+ every stage-mixing variant failed). Coverage is a training resource the
45
+ FD stage converts into endpoint quality.
46
+ 2. **Redistribution law**: self-referential signals (self-features,
47
+ self-distillation, self-map consistency) redistribute quality across NFE
48
+ operating points but do not create it β€” ~20 arms, zero replicated
49
+ counterexamples. Creation tracks external information only.
50
+ 3. **Information economics**: extractable population signal beyond two
51
+ moments in the coupled feature space is ~1% of the FM loss and largely
52
+ moment-redundant. Kernel drift, learned score-differences (including
53
+ evidence-gated), adversarial heads, and larger coupling bases all fail
54
+ to beat second-moment FD + EMA. The Gaussian approximation's fast
55
+ saturation acts as an implicit regularizer protecting the conditional
56
+ coupling terms' gradient share.
57
+
58
+ ## Checkpoints in this folder
59
+
60
+ - `champion-D1c-clean/` β€” the b16 champion (FD ckpt + iMF init)
61
+ - `champion-D1c-b64/` β€” batch-64 variant (best both-points nominal)
62
+ - `T1-1nfe-record/` β€” best pure-1-NFE model (0.879@1)
63
+ - `T3-balanced-finisher/`, `T4a-near-pareto-finisher/` β€” TFC dial points
64
+ - `V1g0-clean-rerun-g0c/`, `champion-V1g0/` β€” recipe-ancestor reference
65
+ - `reviewer-SIMv2/`, `reviewer-SMv2/`, `turbo-line-SIMcx/`, `V1prog-g4/`,
66
+ `V3-bestFDr8/` β€” turbo-line and ablation references
67
+
68
+ Full report: Notion "Flow Matching Mid/Post-training" (rev 5) β€” 40-arm
69
+ codename map, 25-row registered-prediction ledger, estimator matrix,
70
+ implementation-integrity audits. sha256 of every checkpoint: manifest.tsv.