-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1054 lines (949 loc) · 51.3 KB
/
index.html
File metadata and controls
1054 lines (949 loc) · 51.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>What Drives Compositional Generalization in Visual Generative Models?</title>
<meta name="description" content="Project page for 'What Drives Compositional Generalization in Visual Generative Models?'—a systematic study of how objectives and conditioning affect compositionality in image and video generation." />
<meta property="og:title" content="What Drives Compositional Generalization in Visual Generative Models?" />
<meta property="og:description" content="Continuous objectives + full conditioning drive robust compositionality; discrete categorical losses hinder it. JEPA-style auxiliary loss improves MaskGIT." />
<meta property="og:image" content="figures/teaser.png" />
<meta property="og:type" content="website" />
<meta name="twitter:card" content="summary_large_image" />
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 128'><text y='1em' font-size='96'>🧩</text></svg>">
<style>
/* -------- Light theme tokens (RAE-ish) -------- */
:root{
--bg:#ffffff; --text:#111827; --muted:#6b7280;
--card:#f5f7fb; --panel:#ffffff;
--border:#e5e7eb; --accent:#1f3a63;
--accent-pill:#233b6b;
--pill-text:#0b234f;
--pill-ring:#c7d2fe; --pill-bg:#eef2ff;
--dot:#e5e7eb; --dot-active:#9ca3af;
--arrow-grey:#9ca3af;
--maxw:1180px;
}
*{ box-sizing:border-box; }
html,body{
margin:0; padding:0; background:var(--bg); color:var(--text);
font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Noto Color Emoji";
}
a{ color:#2563eb; text-decoration:none; } a:hover{ text-decoration:underline; }
img{ max-width:100%; height:auto; display:block; }
/* provide anchor offset for in-page links while keeping your invisible anchor */
section[id]{ scroll-margin-top: 84px; }
/* -------- Top navigation -------- */
.topnav{
position:sticky; top:0; z-index:10;
backdrop-filter:saturate(160%) blur(6px);
border-bottom:1px solid var(--border);
background:linear-gradient(180deg,#ffffff, #fcfdff);
}
.topnav .container{
max-width:var(--maxw); margin:0 auto; padding:12px 20px;
display:flex; align-items:center; justify-content:space-between;
}
.brand{ font-weight:800; letter-spacing:.2px; }
.topnav nav a{
color:var(--pill-text); padding:8px 10px; border-radius:8px; margin-left:4px;
}
.topnav nav a:hover{ background:#eef2ff; text-decoration:none; }
/* -------- Hero -------- */
.hero{
max-width:var(--maxw); margin:36px auto 22px; padding:0 20px;
display:grid; grid-template-columns:1.2fr 1fr; gap:28px; align-items:center;
}
.hero h1{
font-size: clamp(44px, 6vw, 76px);
letter-spacing:-0.02em; line-height:0.98; margin:0 0 12px;
}
.authors,.affils{ color:var(--muted); margin:6px 0; font-size:1rem; }
.muted{ color:var(--muted); font-size:.9em; }
/* Pills */
.pill-row{ display:flex; flex-wrap:wrap; gap:14px; margin-top:22px; }
.pill{
display:inline-flex; align-items:center; gap:8px; padding:10px 22px;
border-radius:9999px; font-weight:600; color:var(--pill-text);
background:linear-gradient(180deg,#d4dae3,#c6ced8);
border:1.5px solid #dce2ea;
box-shadow:0 1px 2px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.6);
transition:all 0.15s ease;
}
.pill:hover{ background:#d6dde8; border-color:#d9e0ea; transform:translateY(-1px); text-decoration:none; }
.hero-media{ width:100%; max-width:640px; margin-left:auto; }
.hero-cols{
display:grid;
grid-template-columns:repeat(2,minmax(0,1fr));
gap:12px;
margin-bottom:8px;
}
.col-label{
text-align:center;
font-weight:700;
color:var(--pill-text);
padding:10px 12px;
border-radius:10px;
border:1px solid var(--border);
background:#f8fafc;
}
.col-discrete{ background:rgba(239,68,68,0.12); border-color:rgba(239,68,68,0.35); }
.col-continuous{ background:rgba(16,185,129,0.12); border-color:rgba(16,185,129,0.35); }
.hero-vids{
display:grid;
grid-template-columns:repeat(2,minmax(0,1fr));
gap:12px;
}
.hero-vid{
position:relative;
margin:0;
border-radius:12px;
overflow:hidden;
aspect-ratio:16/9;
border:1px solid var(--border);
background:#0b1120;
box-shadow:0 8px 20px rgba(0,0,0,0.08);
}
.hero-vid img{
position:absolute;
inset:0;
width:100%;
height:100%;
object-fit:cover;
z-index:1;
}
.vid-label{
position:absolute;
top:10px; left:10px;
padding:6px 10px;
border-radius:999px;
font-size:0.8rem;
font-weight:700;
color:var(--pill-text);
background:rgba(255,255,255,0.9);
border:1px solid #dce2ea;
box-shadow:0 1px 2px rgba(0,0,0,0.08), inset 0 1px 0 rgba(255,255,255,0.6);
z-index:2;
}
.badge-discrete{
background:rgba(239,68,68,0.9);
color:#fff;
border-color:rgba(239,68,68,0.65);
}
.badge-continuous{
background:rgba(16,185,129,0.9);
color:#fff;
border-color:rgba(16,185,129,0.65);
}
.vid-cap{
position:absolute;
bottom:0; left:0; width:100%;
margin:0;
padding:8px 10px 10px;
font-weight:700;
font-size:0.92rem;
color:#f8fafc;
background:linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.2) 28%, rgba(0,0,0,0.65) 100%);
}
.hero-ribbon{
margin-top:12px;
padding:10px 12px;
border-radius:12px;
text-align:center;
font-weight:700;
color:#0b234f;
background:linear-gradient(90deg, rgba(59,130,246,0.15), rgba(236,72,153,0.15), rgba(239,68,68,0.2));
border:1px solid rgba(59,130,246,0.25);
}
.hero-ribbon-sub { display:block; }
@media (max-width: 980px){
.hero{ grid-template-columns:1fr; }
.hero-media{ order:2; }
}
@media (max-width: 640px){
.hero-vids{ grid-template-columns:1fr; }
.hero-cols{ grid-template-columns:1fr; }
}
/* -------- Sections -------- */
main{ padding:0 20px 48px; }
section.card{
background:var(--card); border:1px solid var(--border); border-radius:12px;
padding:18px; margin:20px auto; max-width:var(--maxw);
}
h2{ margin:0 0 12px; font-size:1.25rem; }
h3{ margin:0 0 6px; font-size:1.1rem; }
h4{ margin:8px 0 6px; font-size:1.0rem; }
.cap{ color:var(--muted); font-size:.95rem; margin-top:6px; text-align:center; }
/* --- Overview / Abstract (no boxes) --- */
.prose { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section-title {
font-size: clamp(28px, 3.2vw, 44px);
font-weight: 800; letter-spacing: -0.01em;
margin: 6px 0 10px;
}
.hr { height:1px; background:var(--border); border:0; margin:14px 0 22px; }
.prose p { line-height:1.7; font-size:1.05rem; margin: 0 0 16px; color: var(--text); }
.prose ul { margin: 8px 0 22px 1.1rem; padding-left: 0.9rem; }
.prose li { margin: 8px 0; font-size:1.05rem; }
.prose li::marker { color: var(--muted); }
.teaser-inline { margin: 18px 0 8px; }
.teaser-inline img { width:100%; border-radius:12px; border:1px solid var(--border); }
/* ---- Findings sections (unboxed academic layout) ---- */
.finding-section{
max-width: var(--maxw);
margin: 42px auto 0;
padding: 0 4px;
border: none;
background: none;
}
.finding-section .lead{
margin: 6px 0 18px;
color: var(--text);
line-height: 1.65;
font-size: 1.05rem;
max-width: 900px;
}
.finding-callout{
margin-top: 16px;
background: rgba(37, 99, 235, 0.06); /* blue!4 vibe */
border: 1px solid #111;
border-radius: 10px;
padding: 12px 14px;
font-weight: 600;
color: #0b234f;
}
.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.fig{ background:var(--panel); border:1px solid var(--border); border-radius:10px; padding:10px; }
.orbis-grid{
display:grid;
grid-template-columns:minmax(56px,auto) repeat(2,minmax(0,1fr));
grid-template-rows:minmax(28px,auto) repeat(2,auto);
gap:12px;
justify-items:center;
align-items:center;
}
.orbis-label{
font-size:0.95rem;
font-weight:600;
color:var(--muted);
}
.orbis-label-col{ font-size:1.1rem; }
.orbis-label-row{
justify-self:end;
text-align:right;
}
.orbis-grid img{ place-self:center; }
@media (max-width:640px){
.orbis-grid{
grid-template-columns:minmax(48px,auto) repeat(2,minmax(0,1fr));
}
.orbis-label{ font-size:0.9rem; }
}
/* ---------- Objective Comparison: compact spacing + dots ---------- */
.oc-anim{ border:1px solid var(--border); border-radius:12px; padding:12px 12px 10px; background:var(--panel); }
.pair-top{ display:grid; grid-template-columns:repeat(4,1fr); gap:12px; align-items:start; row-gap:6px; }
.pair-top .cell img{ margin-bottom:6px; width:100%; border:1px solid var(--border); border-radius:10px; }
.cell{ opacity:0; transform:translateY(2px); transition:opacity .2s ease, transform .2s ease; }
.cell.visible{ opacity:1; transform:none; }
.arrows-row{ position:relative; height:clamp(48px, 6.5vw, 64px); margin-top:2px; margin-bottom:6px; }
.short-arrow{ position:absolute; top:50%; transform:translate(-50%,-50%); width:clamp(220px, 28vw, 300px); }
/* Responsive, still minimal */
.short-arrow text {
font-size: clamp(16px, 2vw, 26px);
font-weight: 600;
}
.arrows-row .short-arrow:nth-of-type(1){ left:25%; }
.arrows-row .short-arrow:nth-of-type(2){ left:50%; }
.arrows-row .short-arrow:nth-of-type(3){ left:75%; }
.mini-dots{ display:flex; gap:6px; justify-content:center; margin-top:0; margin-bottom:2px; }
.mini-dot{
position:relative;
width:6px; height:6px; border-radius:50%;
background:var(--dot); border:1px solid var(--border);
padding:0; outline:none; cursor:pointer;
transition: transform .12s ease, background-color .12s ease, opacity .12s ease;
opacity:.9;
}
/* bigger hit area without changing visual size */
.mini-dot::before{ content:""; position:absolute; inset:-10px; border-radius:50%; }
.mini-dot:hover{ transform:scale(1.15); opacity:1; }
.mini-dot.active{ background:var(--dot-active); border-color:var(--dot-active); transform:none; opacity:1; }
.mini-dot:focus-visible{ outline:2px solid #2563eb; outline-offset:4px; }
.pair-top .cap{ text-align:center; margin-top:4px; line-height:1.25; color:var(--muted); font-size:0.9rem; }
/* ---------- Finding 2 animation (no arrows) ---------- */
.oc-anim-plain{ border:1px solid var(--border); border-radius:12px; padding:12px 12px 10px; background:var(--panel); }
.pair-top-plain{ display:grid; grid-template-columns:repeat(4,1fr); gap:12px; align-items:start; row-gap:6px; }
.pair-top-plain .cell img{ margin-bottom:6px; width:100%; border:1px solid var(--border); border-radius:10px; }
.mini-dots-plain{ display:flex; gap:6px; justify-content:center; margin-top:4px; }
.mini-dot-plain{
position:relative;
width:6px; height:6px; border-radius:50%;
background:var(--dot); border:1px solid var(--border);
padding:0; outline:none; cursor:pointer;
transition: transform .12s ease, background-color .12s ease, opacity .12s ease;
opacity:.9;
}
.mini-dot-plain::before{ content:""; position:absolute; inset:-10px; border-radius:50%; }
.mini-dot-plain:hover{ transform:scale(1.15); opacity:1; }
.mini-dot-plain.active{ background:var(--dot-active); border-color:var(--dot-active); opacity:1; }
.mini-dot-plain:focus-visible{ outline:2px solid #2563eb; outline-offset:4px; }
.composition-legend{
margin: 10px 0 0;
font-size: 0.92rem;
color: var(--muted);
}
.composition-legend strong{ color: var(--text); }
.composition-legend .swatch{
font-weight: 600;
}
.composition-legend .swatch-orange{ color: #ffbb78; }
.composition-legend .swatch-red{ color: #d62728; }
.composition-legend .swatch-blue{ color: #679fce; }
.composition-legend .swatch-pink{ color: #FF9FD5; }
/* Shapes3D slideshow + floating label */
.shapes3d{ position: relative; }
.shapes3d .shapes3d-label{
position: sticky; top: 12px; left: 12px; z-index: 5;
padding: 6px 10px; border-radius: 9999px; font-size: 0.9rem; font-weight: 700;
color: #0b234f; background: #cbd5e1; border: 1.5px solid #dce2ea;
box-shadow: 0 1px 2px rgba(0,0,0,0.04), inset 0 1px 0 rgba(255,255,255,0.6);
pointer-events: none; user-select: none; opacity: .96;
}
.shapes3d .shapes3d-label.fixed{ position: fixed; z-index: 50; }
.shapes3d .slides{
position: relative; overflow: hidden; border: 1px solid var(--border);
border-radius: 10px; background: var(--panel);
}
.shapes3d .slide{
margin: 0; position: absolute; inset: 0; opacity: 0; transform: scale(0.995);
transition: opacity .25s ease, transform .25s ease;
display: grid; grid-template-rows: 1fr auto;
}
.shapes3d .slide img{
width: 100%; height: auto; display: block;
border-bottom: 1px solid var(--border);
border-top-left-radius: 10px; border-top-right-radius: 10px;
}
.shapes3d .slide .cap{ text-align: center; padding: 8px 6px; }
.shapes3d .slide.active{ opacity: 1; transform: none; position: relative; }
.foot{ text-align:center; color:var(--muted); font-size:.85rem; margin:28px 0; }
/* ===== FAIL-SAFE VISIBILITY IF JS FAILS (only when .js-enabled is NOT present) ===== */
/* Make animated panels visible by default only if JS didn't run */
:root:not(.js-enabled) .pair-top .cell,
:root:not(.js-enabled) .pair-top-plain .cell {
opacity: 1 !important;
transform: none !important;
}
/* Shapes3D: show the first slide statically if JS doesn't run */
:root:not(.js-enabled) .shapes3d .slide {
position: relative !important;
opacity: 1 !important;
transform: none !important;
}
:root:not(.js-enabled) .shapes3d .slides .slide:not(:first-child) {
display: none !important;
}
/* Keep dots visible and clickable even without JS */
:root:not(.js-enabled) .mini-dot,
:root:not(.js-enabled) .mini-dot-plain {
opacity: 1 !important;
}
</style>
<!-- Mark page as JS-enabled so fail-safe CSS stays off when scripts run -->
<script>
document.documentElement.classList.add('js-enabled');
</script>
</head>
<body>
<!-- Top nav -->
<header class="topnav">
<div class="container">
<div class="brand">Compositionality</div>
<nav>
<a href="#overview-text">Overview</a>
<a href="#results">Results</a>
<a href="#findings">Findings</a>
<a href="#bibtex">BibTeX</a>
<a href="#contact">Contact</a>
</nav>
</div>
</header>
<!-- HERO -->
<section id="overview" class="hero">
<div>
<h1>What Drives Compositional Generalization in Visual Generative Models?</h1>
<div class="authors">Karim Farid* · Rajat Sahay* · Yumna Ali Alnaggar* · Simon Schrodi · Volker Fischer · Cordelia Schmid · Thomas Brox</div>
<div class="affils">University of Freiburg · Bosch Center for AI · Inria/ENS/PSL/CNRS</div>
<div class="affils"><span class="muted">*equal contribution</span></div>
<div class="pill-row">
<a class="pill" href="https://arxiv.org/abs/2510.03075">📄 Paper</a>
<a class="pill" href="#">💻 Code (soon)</a>
<!-- <a class="pill" href="#">😊 Models</a> -->
</div>
</div>
<div class="hero-media">
<div class="hero-cols">
<div class="col-label col-discrete">Discrete</div>
<div class="col-label col-continuous">Continuous</div>
</div>
<div class="hero-vids">
<figure class="hero-vid">
<span class="vid-label badge-discrete">☀️→ </span>
<img src="figures/orbis/mg_right_day.gif" alt="MaskGIT: right-turn during daytime" fetchpriority="high" decoding="async" />
</figure>
<figure class="hero-vid">
<span class="vid-label badge-continuous">☀️→ </span>
<img src="figures/orbis/right_day.gif" alt="Continuous objective: right-turn during daytime" decoding="async" />
</figure>
<figure class="hero-vid">
<span class="vid-label badge-discrete">🌑← </span>
<img src="figures/orbis/mg_left_dark.gif" alt="MaskGIT: left-turn at night" decoding="async" />
</figure>
<figure class="hero-vid">
<span class="vid-label badge-continuous">🌑← </span>
<img src="figures/orbis/left_dark.gif" alt="Continuous objective: left-turn at night" decoding="async" />
</figure>
</div>
<div class="hero-ribbon">
All clips are novel concept compositions.
<span class="hero-ribbon-sub"> (concepts: time of day, direction)</span>
</div>
</div>
</section>
<main>
<!-- Overview -->
<section class="prose" id="overview-text">
<h2 class="section-title">Overview</h2>
<div class="hr"></div>
<p><strong>Abstract.</strong> Compositional generalization, the ability to generate novel combinations of known concepts, is a key ingredient for visual generative models. Yet, not all mechanisms that enable or inhibit it are fully understood. In this work, we conduct a systematic
study of how various design choices influence compositional generalization in image and video generation in a positive or negative way. Through controlled experiments, we identify two key factors: (i) whether the training objective operates on a discrete or continuous distribution, and (ii) to what extent conditioning provides information about the constituent concepts during training. Building on these insights, we show that relaxing the MaskGIT discrete loss with an auxiliary continuous JEPA-based objective can improve compositional performance in discrete models like MaskGIT.</p>
<div class="teaser-inline">
<img src="figures/teaser.png" alt="Teaser: what drives compositional generalization" loading="lazy" decoding="async">
</div>
<div class="hr"></div>
<ul>
<li><strong>RQ1.</strong> Does the type of the tokenizer affect compositional generalization? (VAE with KL regularization vs. VQ-VAE with quantization/commitment regularization.)</li>
<li><strong>RQ2.</strong> How does the generative model design affect compositionality? In particular, does it matter whether the modeled distribution is continuous or discrete (e.g., continuous latents vs. discrete tokens)? And is a denoising-based objective essential, or does a masking-based loss suffice?</li>
<li><strong>RQ3.</strong> How does the nature of conditioning during training influence compositionality?</li>
<li><strong>RQ4.</strong> Can we intervene on non-compositional models to endow them with compositional capabilities?</li>
</ul>
<p class="composition-legend">
<strong>Evaluation Setup:</strong> To answer these questions, we conduct controlled experiments where models are trained on a subset of possible factor combinations (e.g., 4 out of 8 combinations of gender, hair color, and smile) and evaluated on held-out compositions. We use trained probes to verify whether generated samples correctly match the intended factors. We distinguish between level-1 compositions (one factor differs from training) and level-2 compositions (two factors differ), with level-2 serving as the strongest test of compositional generalization. Throughout our results, <span class="swatch-blue"> blue curves</span> show performance on training compositions, <span class="swatch-pink">pink curves</span> show level-1 generalization, and <span class="swatch-red">red curves</span> show level-2 generalization. Higher probe accuracy indicates the model successfully generates the intended factor combinations.
</p>
<div class="hr"></div>
</section>
<!-- Invisible anchor to keep the nav link working -->
<div id="findings" style="position:relative; top:-80px;"></div>
<!-- NEW: Tokenizer matter section -->
<section class="prose" id="tokenizer-matter">
<h2 class="section-title">Does the choice of tokenizer matter?</h2>
<div class="hr"></div>
<p>DiT achieves comparable compositional generalization performance across both tokenizer types by the end of training. The training dynamics, however, differ: with a continuous tokenizer progress is more gradual and steady, whereas with a discrete tokenizer, compositional generalization emerges more abruptly.</p>
<article class="teaser-inline" aria-label="Tokenizer control figure">
<div class="grid-2">
<div>
<img src="figures/diffusion_vae.png" alt="(a) VAE tokenizer results with DiT" loading="lazy" decoding="async" />
<div class="cap">(a) VAE</div>
</div>
<div>
<img src="figures/diffusion_token.png" alt="(b) VQ-VAE tokenizer results with DiT" loading="lazy" decoding="async" />
<div class="cap">(b) VQ-VAE</div>
</div>
</div>
</article>
<div class="finding-callout" id="find-vae-vs-vqvae" role="note" aria-label="Tokenizer choice insight">
The choice of tokenizer does not fundamentally alter the compositional abilities of a generative model. It primarily affects training efficiency and stability.
</div>
<div class="hr"></div>
</section>
<!-- Finding 1 — prose -->
<section class="prose" id="finding-1">
<h2 class="section-title">Output Space Continuity is the Key.</h2>
<div class="hr"></div>
<p>Through systematically controlling for the main differences between DiT and MaskGIT, including the choice of the tokenizer, masking strategies and loss functions, we find that none of these factors critically impact compositional generalization. The remaining distinguishing factor is the nature of the predicted outputs: DiT predicts continuous-valued quantities, while MaskGIT predicts discrete tokens. Based on our experiments, we can conclude that this difference in output representation (and thereby the respective objective) is the key factor underlying DiT’s ability to achieve compositional generalization, not observed in MaskGIT.</p>
<div class="hr"></div>
<article>
<h4 style="text-align:left;">Objective Comparison (Shapes2D)</h4>
<div id="oc-figure" class="oc-anim" data-dwell="1400">
<div class="pair-top">
<div class="cell show-at-0">
<img src="figures/maskgit.png" alt="(a) MaskGIT — categorical objective" loading="lazy" decoding="async" />
<div class="cap">(a) MaskGIT</div>
</div>
<div class="cell show-at-1">
<img src="figures/givt.png" alt="(b) GIVT — GMM continuous objective" loading="lazy" decoding="async" />
<div class="cap">(b) GIVT</div>
</div>
<div class="cell show-at-2">
<img src="figures/mar_token_final.png" alt="(c) MAR — diffusion head per token" loading="lazy" decoding="async" />
<div class="cap">(c) MAR</div>
</div>
<div class="cell show-at-3">
<img src="figures/diffusion_token.png" alt="(d) DiT — diffusion on all tokens" loading="lazy" decoding="async" />
<div class="cap">(d) DiT</div>
</div>
</div>
<div class="arrows-row">
<!-- a→b -->
<svg class="short-arrow" viewBox="0 0 600 100" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="a→b" style="visibility:hidden;">
<defs><marker id="arr1" markerWidth="8" markerHeight="8" refX="7" refY="3" orient="auto">
<path d="M0,0 L0,6 L7,3 z" fill="var(--arrow-grey)"/></marker></defs>
<g fill="none" stroke="var(--arrow-grey)" stroke-width="4" stroke-linecap="round">
<line x1="120" y1="50" x2="480" y2="50" marker-end="url(#arr1)"/>
</g>
<g font-family="system-ui,-apple-system,Segoe UI,Roboto" font-size="18" font-weight="700">
<text x="300" y="35" text-anchor="middle" fill="#ef4444">- categorical discrete</text>
<text x="300" y="70" text-anchor="middle" fill="#16a34a">+ GMM continuous</text>
</g>
</svg>
<!-- b→c -->
<svg class="short-arrow" viewBox="0 0 600 100" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="b→c" style="visibility:hidden;">
<defs><marker id="arr2" markerWidth="8" markerHeight="8" refX="7" refY="3" orient="auto">
<path d="M0,0 L0,6 L7,3 z" fill="var(--arrow-grey)"/></marker></defs>
<g fill="none" stroke="var(--arrow-grey)" stroke-width="4" stroke-linecap="round">
<line x1="120" y1="50" x2="480" y2="50" marker-end="url(#arr2)"/>
</g>
<g font-family="system-ui,-apple-system,Segoe UI,Roboto" font-size="18" font-weight="700">
<text x="300" y="35" text-anchor="middle" fill="#ef4444">- GMM</text>
<text x="300" y="70" text-anchor="middle" fill="#16a34a">+ diffusion head per token</text>
</g>
</svg>
<!-- c→d -->
<svg class="short-arrow" viewBox="0 0 600 100" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="c→d" style="visibility:hidden;">
<defs><marker id="arr3" markerWidth="8" markerHeight="8" refX="7" refY="3" orient="auto">
<path d="M0,0 L0,6 L7,3 z" fill="var(--arrow-grey)"/></marker></defs>
<g fill="none" stroke="var(--arrow-grey)" stroke-width="4" stroke-linecap="round">
<line x1="120" y1="50" x2="480" y2="50" marker-end="url(#arr3)"/>
</g>
<g font-family="system-ui,-apple-system,Segoe UI,Roboto" font-size="18" font-weight="700">
<text x="300" y="35" text-anchor="middle" fill="#ef4444">- masking</text>
<text x="300" y="70" text-anchor="middle" fill="#16a34a">+ diffusion on all tokens</text>
</g>
</svg>
</div>
<div class="mini-dots" role="group" aria-label="progress">
<button class="mini-dot" type="button" data-step="0" aria-label="Step 1" aria-pressed="true"></button>
<button class="mini-dot" type="button" data-step="1" aria-label="Step 2" aria-pressed="false"></button>
<button class="mini-dot" type="button" data-step="2" aria-label="Step 3" aria-pressed="false"></button>
<button class="mini-dot" type="button" data-step="3" aria-label="Step 4" aria-pressed="false"></button>
</div>
</div>
</article>
<div class="finding-callout" id="find-cont-vs-cat" role="note" aria-label="Continuous vs categorical insight">
Generative models trained to model continuous distributions reliably exhibit strong compositionality, whereas models trained on discrete, categorical distributions do not.
</div>
<div class="hr"></div>
</section>
<!-- Finding 2 — now prose-styled -->
<section class="prose" id="finding-2">
<h2 class="section-title">Importance of the Conditioning Information Levels</h2>
<div class="hr"></div>
<p>Compositional generalization becomes less stable under <em>quantized</em> conditioning. When some factors present in the image are occasionally missing from the conditioning signal, compositional generalization typically fails (see <strong>(2b) Conditioning dropout</strong>). Combining both conditions—quantization and incompleteness—a setting common in practice—produces the strongest negative effect (see <strong>(2c) Discrete (quantized) conditioning</strong> and <strong>(2d) Average over seeds</strong>).</p>
<p>Overall, these results show that limited information—whether through quantization or incomplete conditioning—can impair compositional generalization, even when all factors are provided during generation.</p>
<div class="hr"></div>
<!-- Keep your existing step-through figure -->
<article style="margin-top:8px;">
<!-- <h4 style="text-align:left;">Full vs. Secondary / Dropout / Quantized (step-through)</h4> -->
<div id="cond-figure" class="oc-anim-plain" data-dwell="1400">
<div class="pair-top-plain">
<div class="cell show-at-0">
<img src="figures/DiT_cont_label_sec_run.png" alt="(2a) Full vs secondary label" loading="lazy" decoding="async" />
<div class="cap">(a) Full-information conditioning</div>
</div>
<div class="cell show-at-1">
<img src="figures/diff_cont_dropout.png" alt="(2b) Conditioning dropout" loading="lazy" decoding="async" />
<div class="cap">(b) Full-information conditioning + dropout</div>
</div>
<div class="cell show-at-2">
<img src="figures/discrete_DiT_XAI3.png" alt="(2c) Discrete (quantized) conditioning" loading="lazy" decoding="async" />
<div class="cap">(c) Quantized conditioning</div>
</div>
<div class="cell show-at-3">
<img src="figures/diffusion_real_dropout_avg_3seeds.png" alt="(2d) Average over seeds" loading="lazy" decoding="async" />
<div class="cap">(d) Quantized conditioning + dropout</div>
</div>
</div>
<div class="mini-dots-plain" role="group" aria-label="progress">
<button class="mini-dot-plain" type="button" data-step="0" aria-label="Step 1" aria-pressed="true"></button>
<button class="mini-dot-plain" type="button" data-step="1" aria-label="Step 2" aria-pressed="false"></button>
<button class="mini-dot-plain" type="button" data-step="2" aria-label="Step 3" aria-pressed="false"></button>
<button class="mini-dot-plain" type="button" data-step="3" aria-label="Step 4" aria-pressed="false"></button>
</div>
</div>
</article>
<!-- Callout finding -->
<div class="finding-callout" id="find-conditioning" role="note" aria-label="Conditioning information insight">
Full, precise conditioning is critical for robust compositional generalization. Models trained with quantized or incomplete signals show poor or inconsistent recombination of factors.
</div>
<div class="hr"></div>
</section>
<!-- Finding 3 — prose-styled: text (incl. caption) LEFT, image RIGHT -->
<section class="prose" id="finding-3">
<h2 class="section-title">JEPA Auxiliary Objective Helps Discrete Models</h2>
<div class="hr"></div>
<div class="grid-2" style="align-items:start; gap:18px;">
<!-- LEFT: narrative + caption-as-text -->
<div>
<p>In the previous section, we identified a key factor that can hinder compositional generalization in modern generative models: training objectives that operate over discrete, categorical distributions. Despite this, discrete training objectives—such as the one used in MaskGIT—offer advantages in, e.g., sampling speed compared to alternatives like DiT. This raises an important question: <em>Can we retain these advantages while also improving compositional generalization?</em></p>
<p><strong>An overview of MaskGIT combined with the JEPA-based training objective.</strong>
We apply the JEPA loss at specific layers (<em>l</em>) on an intermediate masked token representation in the transformer
(H<sub>C</sub><sup>(l)</sup>) and train a lightweight predictor to reconstruct target states
(H<sub>T</sub><sup>(l)</sup>) using MSE as an error metric and a stop-gradient signal to avoid representation collapse.</p>
</div>
<!-- RIGHT: image only -->
<div class="fig" style="margin-top:0;">
<img src="figures/figure_jepa.drawio.png" alt="Overview of MaskGIT with JEPA-based auxiliary objective (stop-gradient on target branch)" />
</div>
</div>
<div class="hr"></div>
<!-- Results animation (unchanged pattern as other sections) -->
<article aria-label="JEPA intervention results" style="margin-top:8px;">
<h4 style="text-align:left;">Standard vs. JEPA objective</h4>
<div id="jepa-figure" class="oc-anim-plain" data-dwell="1400">
<div class="pair-top-plain">
<div class="cell show-at-0">
<img src="figures/maskgit.png" alt="(a) MaskGIT with standard categorical objective" />
<div class="cap">(a) Standard Objective (MaskGIT)</div>
</div>
<div class="cell show-at-1">
<img src="figures/maskgit_jepa.png" alt="(b) MaskGIT with JEPA-based auxiliary objective" />
<div class="cap">(b) JEPA-based Objective (MaskGIT + JEPA)</div>
</div>
<div class="cell show-at-2">
<img src="figures/polysemanticity_images_new.png" alt="(c) Polysemanticity trend with JEPA" />
<div class="cap">(c) Polysemanticity Trend</div>
</div>
<div class="cell show-at-3">
<img src="figures/jaccard_trend.png" alt="(d) Jaccard trend with JEPA" />
<div class="cap">(d) Jaccard Trend</div>
</div>
</div>
<div class="mini-dots-plain" role="group" aria-label="progress">
<button class="mini-dot-plain" type="button" data-step="0" aria-label="Show (a) Standard Objective" aria-pressed="true"></button>
<button class="mini-dot-plain" type="button" data-step="1" aria-label="Show (b) JEPA-based Objective" aria-pressed="false"></button>
<button class="mini-dot-plain" type="button" data-step="2" aria-label="Show (c) Polysemanticity Trend" aria-pressed="false"></button>
<button class="mini-dot-plain" type="button" data-step="3" aria-label="Show (d) Jaccard Trend" aria-pressed="false"></button>
</div>
</div>
</article>
<div class="hr"></div>
<p>We also analyze how the model separates visual factors like color and shape. First, we find that some attention heads are polysemantic, attending to multiple features at once, which leads to entangled representations. Next, by examining the most influential neurons for each concept, we observe how internal circuits form and overlap. <b>(c)</b> and <b>(d)</b> show that adding the auxiliary JEPA objective reduces both polysemanticity and neuron overlap, leading to more distinct, factor-specific representations.</p>
<!-- JEPA finding callout -->
<div class="finding-callout" id="find-jepa" role="note" aria-label="JEPA compositionality insight">
A JEPA-based training objective induces more disentangled and semantically structured representations,
and enables stronger compositional generalization.
</div>
<div class="hr"></div>
</section>
<section class="prose" id="results">
<h2 class="section-title">Results</h2>
<div class="hr"></div>
<p>We validate our findings across datasets of increasing complexity and different modalities. We start with simple synthetic Shapes2D, then move to Shapes3D, a much larger, fully factorial dataset with far more possible compositions and harder-to-disentangle factors. To test real-world images we use CelebA, and for video we evaluate on synthetic CLEVRER and on CoVLA — the latter using a learned world model. Finally, we present first evidence that the trends extend to language by testing Points224 with LLaMa-3 using different reasoning mechanisms.</p>
<!-- Shapes3D — unchanged -->
<section class="finding-section" id="finding-shapes3d">
<h2>Shapes3D — Real vs. DiT vs. MaskGIT</h2>
<figure class="fig" style="margin-top:12px;">
<img src="figures/comp-gen-shapesd3d-crop.gif" alt="Shapes3D generations: Real vs. DiT vs. MaskGIT" loading="lazy" decoding="async" />
<!-- <figcaption class="cap">Comparison clip (plays once, then pauses on the last frame).</figcaption> -->
</figure>
<p>While our results on CelebA show that our findings hold true for real-world data, we also wanted to test if we observe the same properties for compositional generalization when increase the complexity of the dataset itself, making the task harder. To do so, we test on Shapes3D- a synthetic dataset of rendered 3D scenes with six, varying, independent factors, Of these, we select three factors to control for, varying in 240 different compositions (up from 8). </p>
<p class="composition-legend"><span class="swatch swatch-orange">Pale orange</span> marks level 1 compositions, <span class="swatch swatch-red">red</span> highlights the most novel level 2 compositions, and <span class="swatch swatch-blue">blue</span> denotes seen combinations.</p>
<article style="margin-top:14px;">
<div id="shapes3d-figure" class="oc-anim-plain shapes3d" data-dwell="1600" aria-label="Shapes3D slideshow">
<span class="shapes3d-label" aria-live="polite"></span>
<div class="slides">
<figure class="slide" data-name="Real">
<img src="figures/shapes3d_results/3dshapes_grid_real.png" alt="Shapes3D real samples" loading="lazy" decoding="async"/>
<figcaption class="cap">Real (Shapes3D)</figcaption>
</figure>
<figure class="slide" data-name="DiT">
<img src="figures/shapes3d_results/composition_grid_dit.png" alt="Shapes3D generations by DiT" loading="lazy" decoding="async"/>
<figcaption class="cap">DiT</figcaption>
</figure>
<figure class="slide" data-name="MaskGIT">
<img src="figures/shapes3d_results/composition_grid_seed7_mg.png" alt="Shapes3D generations by MaskGIT" loading="lazy" decoding="async"/>
<figcaption class="cap">MaskGIT</figcaption>
</figure>
</div>
<div class="mini-dots-plain shapes3d-dots" role="group" aria-label="slideshow progress">
<button class="mini-dot-plain" type="button" data-step="0" aria-label="Show Real" aria-pressed="true"></button>
<button class="mini-dot-plain" type="button" data-step="1" aria-label="Show DiT" aria-pressed="false"></button>
<button class="mini-dot-plain" type="button" data-step="2" aria-label="Show MaskGIT" aria-pressed="false"></button>
</div>
</div>
</article>
</section>
<!-- CelebA — unchanged
<section class="finding-section" id="finding-celeba">
<h2>CelebA — Real vs. DiT vs. MaskGIT</h2>
<p>We further assess compositional generalization on the **CelebA** dataset, which involves combining facial attributes in novel ways. This experiment tests whether our models can generalize to real-world, high-variance visual domains beyond synthetic benchmarks.</p>
</section>
CLEVRER — unchanged -->
<!-- <section class="finding-section" id="finding-clevrer">
<h2>CLEVRER</h2>
</section> -->
<!-- CoVLA — unchanged -->
<section class="finding-section" id="finding-4">
<h2>Real-World Validation on CoVLA</h2>
<p>To test whether our findings hold in real-world video, we evaluate compositional generalization on CoVLA, a driving dataset with factors like time of day and turn direction. We use a learned world model to assess how well the model can generate or predict unseen combinations of these factors.</p>
<div class="fig" style="margin-top:10px;">
<div class="orbis-grid">
<span class="orbis-label" aria-hidden="true"></span>
<span class="orbis-label orbis-label-col" aria-label="Right turn during daytime">☀️→</span>
<span class="orbis-label orbis-label-col" aria-label="Left turn at night">🌑←</span>
<span class="orbis-label orbis-label-row">Discrete</span>
<img src="figures/orbis/mg_right_day.gif" alt="MaskGIT right-turn during daytime" loading="lazy" decoding="async" />
<img src="figures/orbis/mg_left_dark.gif" alt="MaskGIT left-turn at night" loading="lazy" decoding="async" />
<span class="orbis-label orbis-label-row">Continuous</span>
<img src="figures/orbis/right_day.gif" alt="Non-MaskGIT right-turn during daytime" loading="lazy" decoding="async" />
<img src="figures/orbis/left_dark.gif" alt="Non-MaskGIT left-turn at night" loading="lazy" decoding="async" />
</div>
</div>
</section>
<!-- Results — unchanged -->
<section id="results" class="card">
<h2>Results — CRA Retrieval (CoVLA)</h2>
<div class="fig" style="margin-top:12px;">
<img src="figures/cra_table.png" alt="CRA retrieval performance on CoVLA for DiT and MaskGIT across splits" loading="lazy" decoding="async" />
<div class="cap">CRA metric (V-JEPA2 features) for generated videos vs. real splits. Higher Hit@1 indicates stronger compositional alignment.</div>
</div>
</section>
<!-- Language — unchanged -->
<section class="finding-section" id="finding-shapes3d">
<h2>Language</h2>
<p>Our findings on visual models appear to extend to language. Evaluating LLaMa-3.2 on the Points24 dataset, we compared discrete Chain-of-Thought (CoT) reasoning with its continuous variant, COntinuous-Chain-Of-Thought (COCONUT). <b>COCONUT achieved substantially higher accuracy (12.39% vs. 4.82%) on compositional splits</b>, indicating that continuous reasoning objectives may also enhance compositional generalization in language. Further exploration of this cross-modal consistency remains an open direction.</p>
</section>
<!-- <section id="results" class="card">
<div class="fig" style="margin-top:12px;">
<img src="figures/points24_prompt_example.png" alt="CRA retrieval performance on CoVLA for DiT and MaskGIT across splits" loading="lazy" decoding="async" />
<div class="cap">Example system prompt, successful model output, and verifier feedback for our language task with compositional rules:.</div>
</div>
</section> -->
<!-- BibTeX -->
<section id="bibtex" class="card">
<h2>Cite</h2>
<pre>@article{farid2025compositional,
title = {What Drives Compositional Generalization in Visual Generative Models?},
author = {Farid, Karim and Sahay, Rajat and Alnaggar, Yumna Ali and Schrodi, Simon and Fischer, Volker and Schmid, Cordelia and Brox, Thomas},
journal = {arXiv preprint arXiv:2510.03075},
year = {2025},
url = {https://arxiv.org/abs/2510.03075}
}</pre>
</section>
<!-- Contact -->
<section id="contact" class="card">
<h2>Contact</h2>
<p>📧 <a href="mailto:[email protected]">[email protected]</a></p>
</section>
<div class="foot">© 2025 The Authors — Static HTML. Place as <b>index.html</b> at repo root and enable GitHub Pages.</div>
</main>
<!-- Scripts: animations -->
<script>
// Respect reduced motion
const REDUCE_MOTION = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
// === Finding 1: 4 panels + arrows + dots ===
try {
(function(){
const root = document.getElementById('oc-figure');
if(!root) return;
const cells = Array.from(root.querySelectorAll('.pair-top .cell'));
const arrows = Array.from(root.querySelectorAll('.arrows-row .short-arrow'));
const dots = Array.from(root.querySelectorAll('.mini-dot'));
const dwell = parseInt(root.getAttribute('data-dwell') || '1400', 10);
let step = 0, timer = null;
const maxStep = cells.length - 1;
function apply(){
cells.forEach((c,i)=> c.classList.toggle('visible', i <= step));
arrows.forEach((a,i)=> a.style.visibility = (i < step ? 'visible' : 'hidden'));
dots.forEach((d,i)=> {
d.classList.toggle('active', i === step);
d.setAttribute('aria-pressed', i === step ? 'true' : 'false');
});
}
function to(i){ step = Math.max(0, Math.min(maxStep, i)); apply(); }
function autoplay(){
if(REDUCE_MOTION) return;
timer = setInterval(()=>{
if(step >= maxStep){ clearInterval(timer); timer = null; }
else { to(step+1); }
}, dwell);
}
dots.forEach((d,i)=>{
d.addEventListener('click', ()=>{ to(i); if(timer){ clearInterval(timer); timer=null; } });
d.addEventListener('keydown', (e)=>{
if(e.key === 'Enter' || e.key === ' '){ e.preventDefault(); d.click(); }
});
});
document.addEventListener('visibilitychange', ()=>{
if(document.hidden && timer){ clearInterval(timer); timer = null; }
else if(!document.hidden && !timer && step < maxStep){ autoplay(); }
});
requestAnimationFrame(()=>{ to(0); autoplay(); });
})();
} catch(e){ console.warn('Finding 1 script disabled:', e); }
// === Finding 2: dots only (no arrows) ===
try {
(function(){
const root = document.getElementById('cond-figure');
if(!root) return;
const cells = Array.from(root.querySelectorAll('.pair-top-plain .cell'));
const dots = Array.from(root.querySelectorAll('.mini-dot-plain'));
const dwell = parseInt(root.getAttribute('data-dwell') || '1400', 10);
let step = 0, timer = null;
const maxStep = cells.length - 1;
function apply(){
cells.forEach((c,i)=> c.classList.toggle('visible', i <= step));
dots.forEach((d,i)=> {
d.classList.toggle('active', i === step);
d.setAttribute('aria-pressed', i === step ? 'true' : 'false');
});
}
function to(i){ step = Math.max(0, Math.min(maxStep, i)); apply(); }
function autoplay(){
if(REDUCE_MOTION) return;
timer = setInterval(()=>{
if(step >= maxStep){ clearInterval(timer); timer = null; }
else { to(step+1); }
}, dwell);
}
dots.forEach((d,i)=>{
d.addEventListener('click', ()=>{ to(i); if(timer){ clearInterval(timer); timer=null; } });
d.addEventListener('keydown', (e)=>{
if(e.key === 'Enter' || e.key === ' '){ e.preventDefault(); d.click(); }
});
});
document.addEventListener('visibilitychange', ()=>{
if(document.hidden && timer){ clearInterval(timer); timer = null; }
else if(!document.hidden && !timer && step < maxStep){ autoplay(); }
});
requestAnimationFrame(()=>{ to(0); autoplay(); });
})();
} catch(e){ console.warn('Finding 2 script disabled:', e); }
// === Finding 3 (JEPA results): dots only ===
try {
(function(){
const root = document.getElementById('jepa-figure');
if(!root) return;
const cells = Array.from(root.querySelectorAll('.pair-top-plain .cell'));
const dots = Array.from(root.querySelectorAll('.mini-dot-plain'));
const dwell = parseInt(root.getAttribute('data-dwell') || '1400', 10);
let step = 0, timer = null;
const maxStep = cells.length - 1;
function apply(){
cells.forEach((c,i)=> c.classList.toggle('visible', i <= step));
dots.forEach((d,i)=> {
d.classList.toggle('active', i === step);
d.setAttribute('aria-pressed', i === step ? 'true' : 'false');
});
}
function to(i){ step = Math.max(0, Math.min(maxStep, i)); apply(); }
function autoplay(){
if(REDUCE_MOTION) return;
timer = setInterval(()=>{
if(step >= maxStep){ clearInterval(timer); timer = null; }
else { to(step+1); }
}, dwell);
}
dots.forEach((d,i)=>{
d.addEventListener('click', ()=>{ to(i); if(timer){ clearInterval(timer); timer=null; } });
d.addEventListener('keydown', (e)=>{
if(e.key === 'Enter' || e.key === ' '){ e.preventDefault(); d.click(); }
});
});
document.addEventListener('visibilitychange', ()=>{
if(document.hidden && timer){ clearInterval(timer); timer = null; }
else if(!document.hidden && !timer && step < maxStep){ autoplay(); }
});
requestAnimationFrame(()=>{ to(0); autoplay(); });
})();
} catch(e){ console.warn('JEPA results script disabled:', e); }
// === Shapes3D slideshow + floating badge ===
try {
(function(){
const root = document.getElementById('shapes3d-figure');
if(!root) return;
const slides = Array.from(root.querySelectorAll('.slide'));
const dots = Array.from(root.querySelectorAll('.shapes3d-dots .mini-dot-plain'));
const label = root.querySelector('.shapes3d-label');
const dwell = parseInt(root.getAttribute('data-dwell') || '1600', 10);
const header = document.querySelector('.topnav');
let step = 0, timer = null;
const maxStep = slides.length - 1;
function setLabel(i){
const name = slides[i]?.getAttribute('data-name') || '';
if(label) label.textContent = name;
}
function positionLabel(){
if(!label) return;
const r = root.getBoundingClientRect();
const h = header ? header.getBoundingClientRect().height : 0;
if (r.bottom <= 0 || r.top >= window.innerHeight) return;
const inset = 12;
const top = Math.max(h + inset, r.top + inset);
const labelW = label.offsetWidth || 120;
let left = r.left + inset;
const maxLeft = r.right - inset - labelW;
left = Math.min(Math.max(left, r.left + inset), maxLeft);
label.style.top = `${top}px`;
label.style.left = `${left}px`;
label.style.right = 'auto';
}
function apply(){
slides.forEach((s,i)=>{
s.classList.toggle('active', i === step);
s.style.zIndex = (i === step) ? 1 : 0;
});
dots.forEach((d,i)=> {
d.classList.toggle('active', i === step);
d.setAttribute('aria-pressed', i === step ? 'true' : 'false');
});
setLabel(step);
positionLabel();
}