Chelsea707 commited on
Commit
476c291
·
verified ·
1 Parent(s): 1a0ede0

Add Batch 0f62b3e2-269a-4f59-a832-198e02eeb29b data

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitattributes +48 -0
  2. 2025/$K^2$VAE_ A Koopman-Kalman Enhanced Variational AutoEncoder for Probabilistic Time Series Forecasting/5fbb46ea-2214-4236-ba77-8c515feb1cc3_content_list.json +0 -0
  3. 2025/$K^2$VAE_ A Koopman-Kalman Enhanced Variational AutoEncoder for Probabilistic Time Series Forecasting/5fbb46ea-2214-4236-ba77-8c515feb1cc3_model.json +0 -0
  4. 2025/$K^2$VAE_ A Koopman-Kalman Enhanced Variational AutoEncoder for Probabilistic Time Series Forecasting/5fbb46ea-2214-4236-ba77-8c515feb1cc3_origin.pdf +3 -0
  5. 2025/$K^2$VAE_ A Koopman-Kalman Enhanced Variational AutoEncoder for Probabilistic Time Series Forecasting/full.md +0 -0
  6. 2025/$K^2$VAE_ A Koopman-Kalman Enhanced Variational AutoEncoder for Probabilistic Time Series Forecasting/images.zip +3 -0
  7. 2025/$K^2$VAE_ A Koopman-Kalman Enhanced Variational AutoEncoder for Probabilistic Time Series Forecasting/layout.json +0 -0
  8. 2025/$S^2$FGL_ Spatial Spectral Federated Graph Learning/a72798c3-b530-4d2b-8f38-0412b72285b0_content_list.json +1736 -0
  9. 2025/$S^2$FGL_ Spatial Spectral Federated Graph Learning/a72798c3-b530-4d2b-8f38-0412b72285b0_model.json +0 -0
  10. 2025/$S^2$FGL_ Spatial Spectral Federated Graph Learning/a72798c3-b530-4d2b-8f38-0412b72285b0_origin.pdf +3 -0
  11. 2025/$S^2$FGL_ Spatial Spectral Federated Graph Learning/full.md +351 -0
  12. 2025/$S^2$FGL_ Spatial Spectral Federated Graph Learning/images.zip +3 -0
  13. 2025/$S^2$FGL_ Spatial Spectral Federated Graph Learning/layout.json +0 -0
  14. 2025/$_mathcalVista_mathcalDPO$_ Video Hierarchical Spatial-Temporal Direct Preference Optimization for Large Video Models/95db5337-6c04-4ac6-82a6-686d937752ac_content_list.json +0 -0
  15. 2025/$_mathcalVista_mathcalDPO$_ Video Hierarchical Spatial-Temporal Direct Preference Optimization for Large Video Models/95db5337-6c04-4ac6-82a6-686d937752ac_model.json +0 -0
  16. 2025/$_mathcalVista_mathcalDPO$_ Video Hierarchical Spatial-Temporal Direct Preference Optimization for Large Video Models/95db5337-6c04-4ac6-82a6-686d937752ac_origin.pdf +3 -0
  17. 2025/$_mathcalVista_mathcalDPO$_ Video Hierarchical Spatial-Temporal Direct Preference Optimization for Large Video Models/full.md +680 -0
  18. 2025/$_mathcalVista_mathcalDPO$_ Video Hierarchical Spatial-Temporal Direct Preference Optimization for Large Video Models/images.zip +3 -0
  19. 2025/$_mathcalVista_mathcalDPO$_ Video Hierarchical Spatial-Temporal Direct Preference Optimization for Large Video Models/layout.json +0 -0
  20. 2025/$_mathrmμ$nit Scaling_ Simple and Scalable FP8 LLM Training/1b23a01c-8312-4db1-9bf6-0617c15708db_content_list.json +0 -0
  21. 2025/$_mathrmμ$nit Scaling_ Simple and Scalable FP8 LLM Training/1b23a01c-8312-4db1-9bf6-0617c15708db_model.json +0 -0
  22. 2025/$_mathrmμ$nit Scaling_ Simple and Scalable FP8 LLM Training/1b23a01c-8312-4db1-9bf6-0617c15708db_origin.pdf +3 -0
  23. 2025/$_mathrmμ$nit Scaling_ Simple and Scalable FP8 LLM Training/full.md +489 -0
  24. 2025/$_mathrmμ$nit Scaling_ Simple and Scalable FP8 LLM Training/images.zip +3 -0
  25. 2025/$_mathrmμ$nit Scaling_ Simple and Scalable FP8 LLM Training/layout.json +0 -0
  26. 2025/$_textttI$^2$MoE$_ Interpretable Multimodal Interaction-aware Mixture-of-Experts/432bdcf8-db80-4266-af20-ab0a1059e8db_content_list.json +0 -0
  27. 2025/$_textttI$^2$MoE$_ Interpretable Multimodal Interaction-aware Mixture-of-Experts/432bdcf8-db80-4266-af20-ab0a1059e8db_model.json +0 -0
  28. 2025/$_textttI$^2$MoE$_ Interpretable Multimodal Interaction-aware Mixture-of-Experts/432bdcf8-db80-4266-af20-ab0a1059e8db_origin.pdf +3 -0
  29. 2025/$_textttI$^2$MoE$_ Interpretable Multimodal Interaction-aware Mixture-of-Experts/full.md +563 -0
  30. 2025/$_textttI$^2$MoE$_ Interpretable Multimodal Interaction-aware Mixture-of-Experts/images.zip +3 -0
  31. 2025/$_textttI$^2$MoE$_ Interpretable Multimodal Interaction-aware Mixture-of-Experts/layout.json +0 -0
  32. 2025/$∞$-Video_ A Training-Free Approach to Long Video Understanding via Continuous-Time Memory Consolidation/280d515d-d106-42b4-8125-041403c18d40_content_list.json +0 -0
  33. 2025/$∞$-Video_ A Training-Free Approach to Long Video Understanding via Continuous-Time Memory Consolidation/280d515d-d106-42b4-8125-041403c18d40_model.json +0 -0
  34. 2025/$∞$-Video_ A Training-Free Approach to Long Video Understanding via Continuous-Time Memory Consolidation/280d515d-d106-42b4-8125-041403c18d40_origin.pdf +3 -0
  35. 2025/$∞$-Video_ A Training-Free Approach to Long Video Understanding via Continuous-Time Memory Consolidation/full.md +571 -0
  36. 2025/$∞$-Video_ A Training-Free Approach to Long Video Understanding via Continuous-Time Memory Consolidation/images.zip +3 -0
  37. 2025/$∞$-Video_ A Training-Free Approach to Long Video Understanding via Continuous-Time Memory Consolidation/layout.json +0 -0
  38. 2025/(How) Can Transformers Predict Pseudo-Random Numbers_/3bbdd284-a0d6-49bf-8936-4fb5fce85525_content_list.json +0 -0
  39. 2025/(How) Can Transformers Predict Pseudo-Random Numbers_/3bbdd284-a0d6-49bf-8936-4fb5fce85525_model.json +0 -0
  40. 2025/(How) Can Transformers Predict Pseudo-Random Numbers_/3bbdd284-a0d6-49bf-8936-4fb5fce85525_origin.pdf +3 -0
  41. 2025/(How) Can Transformers Predict Pseudo-Random Numbers_/full.md +832 -0
  42. 2025/(How) Can Transformers Predict Pseudo-Random Numbers_/images.zip +3 -0
  43. 2025/(How) Can Transformers Predict Pseudo-Random Numbers_/layout.json +0 -0
  44. 2025/(How) Do Language Models Track State_/695912dc-99b2-4f17-bf7d-f54159e0f6ec_content_list.json +0 -0
  45. 2025/(How) Do Language Models Track State_/695912dc-99b2-4f17-bf7d-f54159e0f6ec_model.json +0 -0
  46. 2025/(How) Do Language Models Track State_/695912dc-99b2-4f17-bf7d-f54159e0f6ec_origin.pdf +3 -0
  47. 2025/(How) Do Language Models Track State_/full.md +625 -0
  48. 2025/(How) Do Language Models Track State_/images.zip +3 -0
  49. 2025/(How) Do Language Models Track State_/layout.json +0 -0
  50. 2025/3D Question Answering via only 2D Vision-Language Models/328a3b80-b211-4a99-aaf9-20826a719f1b_content_list.json +0 -0
.gitattributes CHANGED
@@ -57,3 +57,51 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
57
  # Video files - compressed
58
  *.mp4 filter=lfs diff=lfs merge=lfs -text
59
  *.webm filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  # Video files - compressed
58
  *.mp4 filter=lfs diff=lfs merge=lfs -text
59
  *.webm filter=lfs diff=lfs merge=lfs -text
60
+ 2025/$K^2$VAE_[[:space:]]A[[:space:]]Koopman-Kalman[[:space:]]Enhanced[[:space:]]Variational[[:space:]]AutoEncoder[[:space:]]for[[:space:]]Probabilistic[[:space:]]Time[[:space:]]Series[[:space:]]Forecasting/5fbb46ea-2214-4236-ba77-8c515feb1cc3_origin.pdf filter=lfs diff=lfs merge=lfs -text
61
+ 2025/$S^2$FGL_[[:space:]]Spatial[[:space:]]Spectral[[:space:]]Federated[[:space:]]Graph[[:space:]]Learning/a72798c3-b530-4d2b-8f38-0412b72285b0_origin.pdf filter=lfs diff=lfs merge=lfs -text
62
+ 2025/$_mathcalVista_mathcalDPO$_[[:space:]]Video[[:space:]]Hierarchical[[:space:]]Spatial-Temporal[[:space:]]Direct[[:space:]]Preference[[:space:]]Optimization[[:space:]]for[[:space:]]Large[[:space:]]Video[[:space:]]Models/95db5337-6c04-4ac6-82a6-686d937752ac_origin.pdf filter=lfs diff=lfs merge=lfs -text
63
+ 2025/$_mathrmμ$nit[[:space:]]Scaling_[[:space:]]Simple[[:space:]]and[[:space:]]Scalable[[:space:]]FP8[[:space:]]LLM[[:space:]]Training/1b23a01c-8312-4db1-9bf6-0617c15708db_origin.pdf filter=lfs diff=lfs merge=lfs -text
64
+ 2025/$_textttI$^2$MoE$_[[:space:]]Interpretable[[:space:]]Multimodal[[:space:]]Interaction-aware[[:space:]]Mixture-of-Experts/432bdcf8-db80-4266-af20-ab0a1059e8db_origin.pdf filter=lfs diff=lfs merge=lfs -text
65
+ 2025/$∞$-Video_[[:space:]]A[[:space:]]Training-Free[[:space:]]Approach[[:space:]]to[[:space:]]Long[[:space:]]Video[[:space:]]Understanding[[:space:]]via[[:space:]]Continuous-Time[[:space:]]Memory[[:space:]]Consolidation/280d515d-d106-42b4-8125-041403c18d40_origin.pdf filter=lfs diff=lfs merge=lfs -text
66
+ 2025/(How)[[:space:]]Can[[:space:]]Transformers[[:space:]]Predict[[:space:]]Pseudo-Random[[:space:]]Numbers_/3bbdd284-a0d6-49bf-8936-4fb5fce85525_origin.pdf filter=lfs diff=lfs merge=lfs -text
67
+ 2025/(How)[[:space:]]Do[[:space:]]Language[[:space:]]Models[[:space:]]Track[[:space:]]State_/695912dc-99b2-4f17-bf7d-f54159e0f6ec_origin.pdf filter=lfs diff=lfs merge=lfs -text
68
+ 2025/3D[[:space:]]Question[[:space:]]Answering[[:space:]]via[[:space:]]only[[:space:]]2D[[:space:]]Vision-Language[[:space:]]Models/328a3b80-b211-4a99-aaf9-20826a719f1b_origin.pdf filter=lfs diff=lfs merge=lfs -text
69
+ 2025/3D-LMVIC_[[:space:]]Learning-based[[:space:]]Multi-View[[:space:]]Image[[:space:]]Compression[[:space:]]with[[:space:]]3D[[:space:]]Gaussian[[:space:]]Geometric[[:space:]]Priors/5e6865ea-eda9-4185-b206-0aa53c1799a1_origin.pdf filter=lfs diff=lfs merge=lfs -text
70
+ 2025/A[[:space:]]Bayesian[[:space:]]Model[[:space:]]Selection[[:space:]]Criterion[[:space:]]for[[:space:]]Selecting[[:space:]]Pretraining[[:space:]]Checkpoints/d764eba9-b19e-4dc8-899d-9ddfff6c33dd_origin.pdf filter=lfs diff=lfs merge=lfs -text
71
+ 2025/A[[:space:]]Bregman[[:space:]]Proximal[[:space:]]Viewpoint[[:space:]]on[[:space:]]Neural[[:space:]]Operators/fb784e84-6b51-4f83-889d-f7fd615be7a0_origin.pdf filter=lfs diff=lfs merge=lfs -text
72
+ 2025/A[[:space:]]Causal[[:space:]]World[[:space:]]Model[[:space:]]Underlying[[:space:]]Next[[:space:]]Token[[:space:]]Prediction_[[:space:]]Exploring[[:space:]]GPT[[:space:]]in[[:space:]]a[[:space:]]Controlled[[:space:]]Environment/0e23178b-8568-443c-bfa1-332da3097a69_origin.pdf filter=lfs diff=lfs merge=lfs -text
73
+ 2025/A[[:space:]]Certified[[:space:]]Unlearning[[:space:]]Approach[[:space:]]without[[:space:]]Access[[:space:]]to[[:space:]]Source[[:space:]]Data/6baf0cf7-6029-42d4-b864-278949c2ff3d_origin.pdf filter=lfs diff=lfs merge=lfs -text
74
+ 2025/A[[:space:]]Chaotic[[:space:]]Dynamics[[:space:]]Framework[[:space:]]Inspired[[:space:]]by[[:space:]]Dorsal[[:space:]]Stream[[:space:]]for[[:space:]]Event[[:space:]]Signal[[:space:]]Processing/de08e935-a370-4509-aaad-1800bba4d4fb_origin.pdf filter=lfs diff=lfs merge=lfs -text
75
+ 2025/A[[:space:]]Checks-and-Balances[[:space:]]Framework[[:space:]]for[[:space:]]Context-Aware[[:space:]]Ethical[[:space:]]AI[[:space:]]Alignment/d6a7d66e-1c99-4a21-8439-6df02dc2be22_origin.pdf filter=lfs diff=lfs merge=lfs -text
76
+ 2025/A[[:space:]]Classification[[:space:]]View[[:space:]]on[[:space:]]Meta[[:space:]]Learning[[:space:]]Bandits/ccc60988-010c-4e77-9b57-958c79961da1_origin.pdf filter=lfs diff=lfs merge=lfs -text
77
+ 2025/A[[:space:]]Closer[[:space:]]Look[[:space:]]at[[:space:]]Backdoor[[:space:]]Attacks[[:space:]]on[[:space:]]CLIP/daaa08c8-66b4-46b8-8bc3-959a71d4075a_origin.pdf filter=lfs diff=lfs merge=lfs -text
78
+ 2025/A[[:space:]]Closer[[:space:]]Look[[:space:]]at[[:space:]]Generalized[[:space:]]BH[[:space:]]Algorithm[[:space:]]for[[:space:]]Out-of-Distribution[[:space:]]Detection/68af78e5-3774-4bc2-83f9-0e1ff6afd8eb_origin.pdf filter=lfs diff=lfs merge=lfs -text
79
+ 2025/A[[:space:]]Closer[[:space:]]Look[[:space:]]at[[:space:]]Multimodal[[:space:]]Representation[[:space:]]Collapse/3f84fba0-7d29-4c16-9b4d-dfab15cd5c01_origin.pdf filter=lfs diff=lfs merge=lfs -text
80
+ 2025/A[[:space:]]Closer[[:space:]]Look[[:space:]]at[[:space:]]Transformers[[:space:]]for[[:space:]]Time[[:space:]]Series[[:space:]]Forecasting_[[:space:]]Understanding[[:space:]]Why[[:space:]]They[[:space:]]Work[[:space:]]and[[:space:]]Where[[:space:]]They[[:space:]]Struggle/a20f4040-9bc5-4478-88d7-158e2817cf5e_origin.pdf filter=lfs diff=lfs merge=lfs -text
81
+ 2025/A[[:space:]]Cognac[[:space:]]Shot[[:space:]]To[[:space:]]Forget[[:space:]]Bad[[:space:]]Memories_[[:space:]]Corrective[[:space:]]Unlearning[[:space:]]for[[:space:]]Graph[[:space:]]Neural[[:space:]]Networks/07b62110-1606-4230-92b9-ae4e6bc4b8d7_origin.pdf filter=lfs diff=lfs merge=lfs -text
82
+ 2025/A[[:space:]]Comprehensive[[:space:]]Framework[[:space:]]for[[:space:]]Analyzing[[:space:]]the[[:space:]]Convergence[[:space:]]of[[:space:]]Adam_[[:space:]]Bridging[[:space:]]the[[:space:]]Gap[[:space:]]with[[:space:]]SGD/2939d18d-8be6-4e1a-8529-9893b92b287d_origin.pdf filter=lfs diff=lfs merge=lfs -text
83
+ 2025/A[[:space:]]Computationally[[:space:]]Efficient[[:space:]]Algorithm[[:space:]]for[[:space:]]Infinite-Horizon[[:space:]]Average-Reward[[:space:]]Linear[[:space:]]MDPs/d152c6ce-f1fb-4888-b961-46e2318e7a39_origin.pdf filter=lfs diff=lfs merge=lfs -text
84
+ 2025/A[[:space:]]Cross[[:space:]]Modal[[:space:]]Knowledge[[:space:]]Distillation[[:space:]]&[[:space:]]Data[[:space:]]Augmentation[[:space:]]Recipe[[:space:]]for[[:space:]]Improving[[:space:]]Transcriptomics[[:space:]]Representations[[:space:]]through[[:space:]]Morphological[[:space:]]Features/d48bd14d-f656-421f-8a2a-6bb91bddc816_origin.pdf filter=lfs diff=lfs merge=lfs -text
85
+ 2025/A[[:space:]]Dynamical[[:space:]]Systems-Inspired[[:space:]]Pruning[[:space:]]Strategy[[:space:]]for[[:space:]]Addressing[[:space:]]Oversmoothing[[:space:]]in[[:space:]]Graph[[:space:]]Attention[[:space:]]Networks/3daf9907-45cc-4904-9946-cc4416e5e818_origin.pdf filter=lfs diff=lfs merge=lfs -text
86
+ 2025/A[[:space:]]First-order[[:space:]]Generative[[:space:]]Bilevel[[:space:]]Optimization[[:space:]]Framework[[:space:]]for[[:space:]]Diffusion[[:space:]]Models/5ba0ad45-0b51-436a-bef5-30f32fcaef67_origin.pdf filter=lfs diff=lfs merge=lfs -text
87
+ 2025/A[[:space:]]Forget-and-Grow[[:space:]]Strategy[[:space:]]for[[:space:]]Deep[[:space:]]Reinforcement[[:space:]]Learning[[:space:]]Scaling[[:space:]]in[[:space:]]Continuous[[:space:]]Control/d0c5f167-7cc6-4dd6-843e-0718ac038eca_origin.pdf filter=lfs diff=lfs merge=lfs -text
88
+ 2025/A[[:space:]]General[[:space:]]Framework[[:space:]]for[[:space:]]Inference-time[[:space:]]Scaling[[:space:]]and[[:space:]]Steering[[:space:]]of[[:space:]]Diffusion[[:space:]]Models/90cfcf76-fac6-4232-ae9d-7811e45cffe1_origin.pdf filter=lfs diff=lfs merge=lfs -text
89
+ 2025/A[[:space:]]General[[:space:]]Graph[[:space:]]Spectral[[:space:]]Wavelet[[:space:]]Convolution[[:space:]]via[[:space:]]Chebyshev[[:space:]]Order[[:space:]]Decomposition/ca6a5049-a60c-48c5-ae77-2d7605cb6f2e_origin.pdf filter=lfs diff=lfs merge=lfs -text
90
+ 2025/A[[:space:]]General[[:space:]]Representation-Based[[:space:]]Approach[[:space:]]to[[:space:]]Multi-Source[[:space:]]Domain[[:space:]]Adaptation/537b1765-c226-4f2c-9ee6-97770f926cf1_origin.pdf filter=lfs diff=lfs merge=lfs -text
91
+ 2025/A[[:space:]]Generalizable[[:space:]]Physics-Enhanced[[:space:]]State[[:space:]]Space[[:space:]]Model[[:space:]]for[[:space:]]Long-Term[[:space:]]Dynamics[[:space:]]Forecasting[[:space:]]in[[:space:]]Complex[[:space:]]Environments/97e50113-6ba1-4974-acb9-7c0727625bed_origin.pdf filter=lfs diff=lfs merge=lfs -text
92
+ 2025/A[[:space:]]Generalization[[:space:]]Result[[:space:]]for[[:space:]]Convergence[[:space:]]in[[:space:]]Learning-to-Optimize/9c00d8d7-1f31-4af0-a2b3-555e7aa1da76_origin.pdf filter=lfs diff=lfs merge=lfs -text
93
+ 2025/A[[:space:]]Generalization[[:space:]]Theory[[:space:]]for[[:space:]]Zero-Shot[[:space:]]Prediction/a8f36c8f-02d0-4231-8e83-7384510cbce9_origin.pdf filter=lfs diff=lfs merge=lfs -text
94
+ 2025/A[[:space:]]Generic[[:space:]]Family[[:space:]]of[[:space:]]Graphical[[:space:]]Models_[[:space:]]Diversity,[[:space:]]Efficiency,[[:space:]]and[[:space:]]Heterogeneity/652adeb4-7610-46dd-9aa3-bc8b38fd6f34_origin.pdf filter=lfs diff=lfs merge=lfs -text
95
+ 2025/A[[:space:]]Geometric[[:space:]]Approach[[:space:]]to[[:space:]]Personalized[[:space:]]Recommendation[[:space:]]with[[:space:]]Set-Theoretic[[:space:]]Constraints[[:space:]]Using[[:space:]]Box[[:space:]]Embeddings/99f6f239-dad9-42a2-bfb1-3152d1939a7d_origin.pdf filter=lfs diff=lfs merge=lfs -text
96
+ 2025/A[[:space:]]Hitchhiker’s[[:space:]]Guide[[:space:]]to[[:space:]]Scaling[[:space:]]Law[[:space:]]Estimation/31954b9f-7f2b-41bd-8848-53cd31f469bb_origin.pdf filter=lfs diff=lfs merge=lfs -text
97
+ 2025/A[[:space:]]Large[[:space:]]Recurrent[[:space:]]Action[[:space:]]Model_[[:space:]]xLSTM[[:space:]]enables[[:space:]]Fast[[:space:]]Inference[[:space:]]for[[:space:]]Robotics[[:space:]]Tasks/1d986b8e-36e5-4fbf-8db2-42204daea09e_origin.pdf filter=lfs diff=lfs merge=lfs -text
98
+ 2025/A[[:space:]]Lens[[:space:]]into[[:space:]]Interpretable[[:space:]]Transformer[[:space:]]Mistakes[[:space:]]via[[:space:]]Semantic[[:space:]]Dependency/c97a70d8-fc1b-4777-8563-9d7d1e94a46f_origin.pdf filter=lfs diff=lfs merge=lfs -text
99
+ 2025/A[[:space:]]Likelihood[[:space:]]Based[[:space:]]Approach[[:space:]]to[[:space:]]Distribution[[:space:]]Regression[[:space:]]Using[[:space:]]Conditional[[:space:]]Deep[[:space:]]Generative[[:space:]]Models/46660fb9-15b4-4b80-a153-58ad0ee26420_origin.pdf filter=lfs diff=lfs merge=lfs -text
100
+ 2025/A[[:space:]]Machine[[:space:]]Learning[[:space:]]Approach[[:space:]]to[[:space:]]Duality[[:space:]]in[[:space:]]Statistical[[:space:]]Physics/c94859fa-c78d-4d19-9ca0-c7fe5ab10733_origin.pdf filter=lfs diff=lfs merge=lfs -text
101
+ 2025/A[[:space:]]Manifold[[:space:]]Perspective[[:space:]]on[[:space:]]the[[:space:]]Statistical[[:space:]]Generalization[[:space:]]of[[:space:]]Graph[[:space:]]Neural[[:space:]]Networks/42d259ac-890f-463d-85aa-cf5c10ce33bc_origin.pdf filter=lfs diff=lfs merge=lfs -text
102
+ 2025/A[[:space:]]Market[[:space:]]for[[:space:]]Accuracy_[[:space:]]Classification[[:space:]]Under[[:space:]]Competition/c5ca5328-5d31-4800-8e46-bc6f6cf15dd1_origin.pdf filter=lfs diff=lfs merge=lfs -text
103
+ 2025/A[[:space:]]Mathematical[[:space:]]Framework[[:space:]]for[[:space:]]AI-Human[[:space:]]Integration[[:space:]]in[[:space:]]Work/86ac7cff-a0f9-45c1-b258-acb4af87d426_origin.pdf filter=lfs diff=lfs merge=lfs -text
104
+ 2025/A[[:space:]]Memory[[:space:]]Efficient[[:space:]]Randomized[[:space:]]Subspace[[:space:]]Optimization[[:space:]]Method[[:space:]]for[[:space:]]Training[[:space:]]Large[[:space:]]Language[[:space:]]Models/7ff3b432-f87e-458a-85f2-63658f0a8b25_origin.pdf filter=lfs diff=lfs merge=lfs -text
105
+ 2025/A[[:space:]]Meta-learner[[:space:]]for[[:space:]]Heterogeneous[[:space:]]Effects[[:space:]]in[[:space:]]Difference-in-Differences/278f9fac-7835-43ec-b626-d923f0fca493_origin.pdf filter=lfs diff=lfs merge=lfs -text
106
+ 2025/A[[:space:]]Mixed-Curvature[[:space:]]based[[:space:]]Pre-training[[:space:]]Paradigm[[:space:]]for[[:space:]]Multi-Task[[:space:]]Vehicle[[:space:]]Routing[[:space:]]Solver/2b7234f0-4869-42fa-8563-4e9e58528952_origin.pdf filter=lfs diff=lfs merge=lfs -text
107
+ 2025/A[[:space:]]Mixture-Based[[:space:]]Framework[[:space:]]for[[:space:]]Guiding[[:space:]]Diffusion[[:space:]]Models/290295d7-e929-4d1d-9239-6653556db349_origin.pdf filter=lfs diff=lfs merge=lfs -text
2025/$K^2$VAE_ A Koopman-Kalman Enhanced Variational AutoEncoder for Probabilistic Time Series Forecasting/5fbb46ea-2214-4236-ba77-8c515feb1cc3_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/$K^2$VAE_ A Koopman-Kalman Enhanced Variational AutoEncoder for Probabilistic Time Series Forecasting/5fbb46ea-2214-4236-ba77-8c515feb1cc3_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/$K^2$VAE_ A Koopman-Kalman Enhanced Variational AutoEncoder for Probabilistic Time Series Forecasting/5fbb46ea-2214-4236-ba77-8c515feb1cc3_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4715630e9e447c14806af38a22389ead1959f976e1ab1274e7063cc977673cb1
3
+ size 1341609
2025/$K^2$VAE_ A Koopman-Kalman Enhanced Variational AutoEncoder for Probabilistic Time Series Forecasting/full.md ADDED
The diff for this file is too large to render. See raw diff
 
2025/$K^2$VAE_ A Koopman-Kalman Enhanced Variational AutoEncoder for Probabilistic Time Series Forecasting/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5180a291edc5182a35ee2fd7de77fa732be5f67568f11df25afac70667d920f8
3
+ size 2316260
2025/$K^2$VAE_ A Koopman-Kalman Enhanced Variational AutoEncoder for Probabilistic Time Series Forecasting/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/$S^2$FGL_ Spatial Spectral Federated Graph Learning/a72798c3-b530-4d2b-8f38-0412b72285b0_content_list.json ADDED
@@ -0,0 +1,1736 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "$S^2$ FGL: Spatial Spectral Federated Graph Learning",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 222,
8
+ 112,
9
+ 751,
10
+ 135
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Zihan Tan $^{*1}$ Suyuan Huang $^{*1}$ Guancheng Wan $^{1}$ Wenke Huang $^{1}$ He Li $^{1}$ Mang Ye $^{1}$",
17
+ "bbox": [
18
+ 174,
19
+ 178,
20
+ 795,
21
+ 196
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Abstract",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 241,
31
+ 222,
32
+ 320,
33
+ 238
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "Federated Graph Learning (FGL) combines the privacy-preserving capabilities of Federated Learning (FL) with the strong graph modeling capability of Graph Neural Networks (GNNs). Current research addresses subgraph-FL from the structural perspective, neglecting the propagation of graph signals on the spatial and spectral domains of the structure. From a spatial perspective, subgraph-FL introduces edge disconnections between clients, leading to disruptions in label signals and a degradation in the semantic knowledge of the global GNN. From a spectral perspective, spectral heterogeneity causes inconsistencies in signal frequencies across subgraphs, which makes local GNNs overfit the local signal propagation schemes. As a result, spectral client drift occurs, undermining global generalizability. To tackle the challenges, we propose a global knowledge repository to mitigate the challenge of poor semantic knowledge caused by label signal disruption. Furthermore, we design a frequency alignment to address spectral client drift. The combination of Spatial and Spectral strategies forms our framework $S^2$ FGL. Extensive experiments on multiple datasets demonstrate the superiority of $S^2$ FGL. The code is available at https://github.com/Wonder7racer/S2FGL.git",
40
+ "bbox": [
41
+ 117,
42
+ 250,
43
+ 444,
44
+ 657
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1. Introduction",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 86,
54
+ 691,
55
+ 217,
56
+ 707
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "Graph Neural Networks (GNNs) have demonstrated remarkable efficacy in modeling graph-structured data (Wan et al., 2025a; Fang et al., 2025), thereby finding applications across various domains, such as social networks (Fan et al., 2020; Zhang et al., 2022b), epidemiology (Liu et al., 2024), and",
63
+ "bbox": [
64
+ 84,
65
+ 718,
66
+ 475,
67
+ 794
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "*Equal contribution 1National Engineering Research Center for Multimedia Software, School of Computer Science, Wuhan University, Wuhan, China. Correspondence to: Mang Ye <yemang@whu.edu.cn>.",
74
+ "bbox": [
75
+ 84,
76
+ 803,
77
+ 473,
78
+ 854
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "Proceedings of the $42^{nd}$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).",
85
+ "bbox": [
86
+ 84,
87
+ 864,
88
+ 473,
89
+ 905
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "image",
95
+ "img_path": "images/e1147d7267355e1b34d3327a2a473bd60c0f3c3f748cef6aa3101e3b0b7260af.jpg",
96
+ "image_caption": [
97
+ "Figure 1. In the first place, compared with centralized GNN training, subgraph-FL is encountering label signal disruption challenge, leading to decreased structure inertia score and poor semantic knowledge for GNNs. Moreover, we demonstrate the heat map of the Kullback-Leibler divergence of eigenvalue distributions across clients. Inconsistency in subgraph signal frequency caused by spectral heterogeneity leads to spectral client drift."
98
+ ],
99
+ "image_footnote": [],
100
+ "bbox": [
101
+ 501,
102
+ 220,
103
+ 870,
104
+ 470
105
+ ],
106
+ "page_idx": 0
107
+ },
108
+ {
109
+ "type": "text",
110
+ "text": "fraud detection (Wang et al., 2019; Tang et al., 2022). However, in real-world scenarios, graph data is often generated at the edge devices rather than in centralized systems (Zhang et al., 2021a). To address this, Federated Graph Learning (FGL) has emerged (Fu et al., 2022; Liu & Yu, 2022; Tan et al., 2025; 2024; Huang et al., 2022; Wan et al., 2024b; 2025b), leveraging the data privacy-preserving capabilities of Federated Learning (FL) (Huang et al., 2024; 2023b;c; 2022) to enable the efficient distributed training of GNNs (Huang et al., 2024). A prominent application of FGL is subgraph-FL, in which each participant holds a subgraph derived from the same overall graph data.",
111
+ "bbox": [
112
+ 495,
113
+ 602,
114
+ 887,
115
+ 782
116
+ ],
117
+ "page_idx": 0
118
+ },
119
+ {
120
+ "type": "text",
121
+ "text": "Although numerous FGL methods have attempted to provide solutions based on structure to enhance effectiveness, including identifying structurally similar collaborators (Baek et al., 2023; Xie et al., 2021; Li et al., 2024), enhancing structural knowledge exchange (Tan et al., 2023; Huang et al., 2023a; Tan et al., 2025), and retrieving generic information under structural shifts (Wan et al., 2024a; Tan et al., 2024). Nevertheless, these approaches overlooked the propagation",
122
+ "bbox": [
123
+ 495,
124
+ 785,
125
+ 888,
126
+ 905
127
+ ],
128
+ "page_idx": 0
129
+ },
130
+ {
131
+ "type": "page_number",
132
+ "text": "1",
133
+ "bbox": [
134
+ 480,
135
+ 922,
136
+ 491,
137
+ 934
138
+ ],
139
+ "page_idx": 0
140
+ },
141
+ {
142
+ "type": "image",
143
+ "img_path": "images/e5e69d068c605f0b87900cf54505a0e3407c07e3b950bfb34d4092bd37537262.jpg",
144
+ "image_caption": [
145
+ "Figure 2. Problem Illustration. (a) From the spatial perspective, nodes in subgraph-FL lose label signals from originally nearby labeled nodes due to edge loss, namely label signal disruption. Correspondingly, GNNs suffer from poor semantic knowledge, leading to a deteriorated global GNN. (b) From the spectral perspective, spectral heterogeneity induces inconsistencies in signal frequencies across subgraphs, leading to spectral client drift in the signal propagation paradigms of GNNs and degraded global generalizability."
146
+ ],
147
+ "image_footnote": [],
148
+ "bbox": [
149
+ 106,
150
+ 88,
151
+ 864,
152
+ 344
153
+ ],
154
+ "page_idx": 1
155
+ },
156
+ {
157
+ "type": "text",
158
+ "text": "of graph signals within the structure. Specifically, graph signal propagation can be analyzed from two perspectives: the spatial and the spectral domain. Specifically, the spatial domain governs the explicit transmission of signals among linked nodes, while the spectral domain characterizes signal diffusion across varying frequency spectra.",
159
+ "bbox": [
160
+ 84,
161
+ 417,
162
+ 475,
163
+ 508
164
+ ],
165
+ "page_idx": 1
166
+ },
167
+ {
168
+ "type": "text",
169
+ "text": "From the spatial perspective, due to edge loss, we hypothesize that nodes in subgraph-FL lose label signals from originally nearby labeled nodes. This degradation hampers the ability of GNNs to learn comprehensive semantic knowledge, resulting in poor global performance and reduced generalizability. Correspondingly, we define this phenomenon as label signal disruption, which naturally exists in subgraph-FL. For verifying, inspired by graph active learning research (Han et al., 2023), we investigate how the Structure Inertia Score (SIS) varies in subgraph-FL. Specifically, SIS evaluates the influence and significance of labels on graphs. In Fig. 1, we empirically demonstrate that the SIS decreases in subgraph-FL compared with centralized training. Correspondingly, existing methods suffer from poor semantic knowledge. Based on our empirical analysis, we pose the question: I) How can we address the challenge of poor semantic knowledge under label signal disruption?",
170
+ "bbox": [
171
+ 84,
172
+ 516,
173
+ 475,
174
+ 773
175
+ ],
176
+ "page_idx": 1
177
+ },
178
+ {
179
+ "type": "text",
180
+ "text": "From the spectral perspective, inconsistencies in signal frequencies across clients caused by spectral heterogeneity induce spectral client drift in the signal transmission schemes of GNNs, thereby undermining the collaboration. To verify this phenomenon, we examine graph spectra across clients and demonstrate the heterogeneity in Fig. 1. It reveals inconsistent eigenvalue distribution across clients. As a result, GNNs learn distinct signal propagation schemes of sub",
181
+ "bbox": [
182
+ 84,
183
+ 781,
184
+ 478,
185
+ 902
186
+ ],
187
+ "page_idx": 1
188
+ },
189
+ {
190
+ "type": "text",
191
+ "text": "graphs and optimize in different spectral directions, leading to spectral client drift and degraded generalizability. Based on our analysis, we pose the question: II) How can we alleviate spectral client drift under spectral heterogeneity?",
192
+ "bbox": [
193
+ 496,
194
+ 417,
195
+ 888,
196
+ 479
197
+ ],
198
+ "page_idx": 1
199
+ },
200
+ {
201
+ "type": "text",
202
+ "text": "To address the challenge of poor semantic knowledge under label signal disruption in Question I), we propose Node Label Information Reinforcement (NLIR). Specifically, our strategy leverages structurally and semantically representative nodes to construct a prototype-based global repository of semantic knowledge. During training, NLIR calculates the similarity distribution between all representative prototypes with node features, which provides multidimensional semantic localization of nodes. Consequently, our strategy injects semantic knowledge from the repository into the local GNN during training, effectively mitigating the issue of poor semantic knowledge under label signal disruption.",
203
+ "bbox": [
204
+ 495,
205
+ 486,
206
+ 888,
207
+ 669
208
+ ],
209
+ "page_idx": 1
210
+ },
211
+ {
212
+ "type": "text",
213
+ "text": "Considering the spectral client drift posed by spectral heterogeneity in II), we propose Frequency-aware Graph Modeling Alignment (FGMA). Our method utilizes the similarity relationship of the node feature of the frozen global GNN and the local GNN to reconstruct spectra that incorporates GNNs adjacency awareness. FGMA then projects the high-frequency and low-frequency components of the features onto this spectrum. Subsequently, by aligning the local projections with the global one, we encourage the GNNs to learn a globally generic frequency processing scheme, thereby mitigating spectral client drift.",
214
+ "bbox": [
215
+ 495,
216
+ 675,
217
+ 888,
218
+ 843
219
+ ],
220
+ "page_idx": 1
221
+ },
222
+ {
223
+ "type": "text",
224
+ "text": "In conclusion, our key contributions are:",
225
+ "bbox": [
226
+ 496,
227
+ 849,
228
+ 764,
229
+ 863
230
+ ],
231
+ "page_idx": 1
232
+ },
233
+ {
234
+ "type": "text",
235
+ "text": "- First, we identify and empirically reveal the issue of",
236
+ "bbox": [
237
+ 514,
238
+ 890,
239
+ 887,
240
+ 905
241
+ ],
242
+ "page_idx": 1
243
+ },
244
+ {
245
+ "type": "header",
246
+ "text": "S2FGL: Spatial Spectral Federated Graph Learning",
247
+ "bbox": [
248
+ 318,
249
+ 56,
250
+ 653,
251
+ 70
252
+ ],
253
+ "page_idx": 1
254
+ },
255
+ {
256
+ "type": "page_number",
257
+ "text": "2",
258
+ "bbox": [
259
+ 480,
260
+ 922,
261
+ 491,
262
+ 934
263
+ ],
264
+ "page_idx": 1
265
+ },
266
+ {
267
+ "type": "text",
268
+ "text": "poor semantic knowledge under label signal disruption. In addition, we reveal the spectral client drift under spectral heterogeneity in subgraph-FL.",
269
+ "bbox": [
270
+ 117,
271
+ 85,
272
+ 475,
273
+ 130
274
+ ],
275
+ "page_idx": 2
276
+ },
277
+ {
278
+ "type": "list",
279
+ "sub_type": "text",
280
+ "list_items": [
281
+ "- We design our framework $S^2$ FGL including strategy Node Label Information Reinforcement and Frequency-aware Graph Modeling Alignment, effectively addressing the challenges of poor semantic knowledge and spectral client drift in subgraph-FL.",
282
+ "- We conduct extensive experiments on various datasets, validating the superiority of our proposed $S^2$ FGL."
283
+ ],
284
+ "bbox": [
285
+ 104,
286
+ 143,
287
+ 475,
288
+ 263
289
+ ],
290
+ "page_idx": 2
291
+ },
292
+ {
293
+ "type": "text",
294
+ "text": "2. Related Work",
295
+ "text_level": 1,
296
+ "bbox": [
297
+ 84,
298
+ 282,
299
+ 227,
300
+ 299
301
+ ],
302
+ "page_idx": 2
303
+ },
304
+ {
305
+ "type": "text",
306
+ "text": "Federated Graph Learning. Federated graph learning leverages the powerful graph modeling capabilities of GNNs along with the privacy-preserving attributes of federated learning, thus gaining increasing attention these days (He et al., 2021a; Fu et al., 2022; Liu & Yu, 2022; Wan et al., 2025b). Current FGL research can generally be categorized into two types: intra-graph FGL and inter-graph FGL. Intra-graph FGL research primarily focuses on subgraph-FL scenarios, where each client participates in the collaboration with a part of the whole graph (Zhang et al., 2021b). Correspondingly, the training targets include missing link prediction (Chen et al., 2021; Baek et al., 2023), node classification (Huang et al., 2023a; Li et al., 2024; Wan et al., 2024a; Zhu et al., 2024), and so on. On the other hand, clients in inter-graph FGL own independent local graph data, such as multiple graphs from different domains (Tan et al., 2023; Xie et al., 2021). In this paper, we focus on subgraph-FL scenarios of intra-graph FGL. Specifically, we are the first to empirically reveal and address the challenge of poor semantic knowledge under label signal disruption and client drift under spectral heterogeneity among subgraphs, while existing methods inevitably fail spatially and spectrally due to the lack of targeted solutions.",
307
+ "bbox": [
308
+ 84,
309
+ 309,
310
+ 475,
311
+ 656
312
+ ],
313
+ "page_idx": 2
314
+ },
315
+ {
316
+ "type": "text",
317
+ "text": "Federated Learning. Federated learning (Huang et al., 2023c; 2024; Yang et al., 2023; Wan et al., 2024a) has gained increasing attention in recent years as it addresses the issue of data silos while ensuring data privacy. Several research directions have emerged from FL, including robustness (Xu et al., 2022; Hong et al., 2023; Zhu et al., 2023; Fang & Ye, 2022), fairness (Chen et al., 2024; Ezzeldin et al., 2023; Ray Chaudhury et al., 2022), and asynchronous federated learning (Xu et al., 2023; Zhang et al., 2023d). Generally, FL can be categorized into two main types by their optimization objective: traditional FL (tFL) and personalized FL (Hu et al., 2024; Shang et al., 2022; Lv et al., 2024; Smith et al., 2017). Research of tFL aims at aggregating a highly generalizable global model (McMahan et al., 2017; Li et al., 2020; Acar et al., 2021; Zhang et al., 2022a). For instance, FedNTD (Lee et al., 2022) preserves the global",
318
+ "bbox": [
319
+ 84,
320
+ 664,
321
+ 475,
322
+ 905
323
+ ],
324
+ "page_idx": 2
325
+ },
326
+ {
327
+ "type": "text",
328
+ "text": "perspective on local data for the not-true classes, FEDGEN (Zhu et al., 2021) ensembles user information in a data-free manner to regulate local training, and SCAFFOLD (Karimireddy et al., 2020) uses variance reduction for the client drift phenomenon. Instead, strategies of personalized FL (pFL) aim to customize models that perform optimally for each client (Wu et al., 2023; Zhou & Konukoglu, 2023; Li et al., 2021; Zhang et al., 2023b). Specifically, FedALA (Zhang et al., 2023c) proposed adaptive masks to achieve personalized aggregation, DBE (Zhang et al., 2023a) stores domain biases for elimination, and FedRoD (Chen & Chao, 2022) leverages two heads for global and personalized tasks.",
329
+ "bbox": [
330
+ 495,
331
+ 84,
332
+ 887,
333
+ 266
334
+ ],
335
+ "page_idx": 2
336
+ },
337
+ {
338
+ "type": "text",
339
+ "text": "Graph Spectrum Being related closely to graph connectivity, signal propagation, and structure, graph spectra have proven essential in performing various tasks on graph-structured data. For instance, it plays an essential role in anatomy detection, (Gao et al., 2023; Tang et al., 2022), graph condensation (Kreuzer et al., 2021; Liu et al., 2023), and graph contrastive learning (Bo et al., 2023a; Liu et al., 2022). Additionally, spectral GNNs (Wu et al., 2020) based on spectral filters are showing powerful ability in modeling graph data and attracting more attention. Specifically, existing research either (He et al., 2021b; Defferrard et al., 2016; He et al., 2022; Wang & Zhang, 2023) leverages various orthogonal polynomials to approximate arbitrary filters, or utilizes neural networks to parameterize the filters (Liao et al., 2019; Bo et al., 2023b). Although the potential of graph spectrum has been explored in various scenarios and tasks, the spectral domain in generalizable subgraph-FL has remained unexplored. Consequently, current methods suffer from optimization diverging on spectra and are trapped in suboptimal learning. Instead, our approach remarkably mitigates the challenge by targeted alignment on spectra.",
340
+ "bbox": [
341
+ 495,
342
+ 273,
343
+ 888,
344
+ 592
345
+ ],
346
+ "page_idx": 2
347
+ },
348
+ {
349
+ "type": "text",
350
+ "text": "Graph Signal Propagation: Graph signal propagation describes how node signals diffuse on graph structures. In the spatial domain, propagation occurs through explicit signal passing along edges. In the spectral domain, propagation is characterized by how signals distribute across different frequency components. Label Signal Disruption: As subgraphs experience edge loss, nodes lose critical label signals containing class knowledge from their formerly adjacent labeled neighbors. Consequently, it limits the ability of GNNs to capture class distinctions accurately, leading to poor semantic knowledge under label signal disruption. Spectral Client Drift: Inconsistencies in signal frequencies on graph spectra across subgraphs lead to spectral heterogeneity and diverging signal propagation schemes, causing spectral client drift and degrading the generalizability of the global model.",
351
+ "bbox": [
352
+ 514,
353
+ 616,
354
+ 870,
355
+ 875
356
+ ],
357
+ "page_idx": 2
358
+ },
359
+ {
360
+ "type": "header",
361
+ "text": "S2FGL: Spatial Spectral Federated Graph Learning",
362
+ "bbox": [
363
+ 318,
364
+ 56,
365
+ 653,
366
+ 70
367
+ ],
368
+ "page_idx": 2
369
+ },
370
+ {
371
+ "type": "page_number",
372
+ "text": "3",
373
+ "bbox": [
374
+ 480,
375
+ 922,
376
+ 491,
377
+ 934
378
+ ],
379
+ "page_idx": 2
380
+ },
381
+ {
382
+ "type": "image",
383
+ "img_path": "images/1f0bf6cd9e04b00bbc9ecdccaa3d89dc7c2ea5369660b5bd494ae24f2fbbe734.jpg",
384
+ "image_caption": [
385
+ "(a) Node Label Information Reinforcement",
386
+ "(b) Frequency-aware Graph Modeling Alignment",
387
+ "Figure 3. Framework Illustration. (a) Node Label Information Reinforcement (NLIR) leverages a structurally and semantically representative global prototype repository. It provides multidimensional semantic localization of nodes through similarity distribution and allows $L_{\\mathbf{FKD}}$ to inject the semantic knowledge during training. (b) Frequency-aware Graph Modeling Alignment (FGMA) aligns local high and low spectral adjacency awareness with the global GNN for a generic signal propagation scheme, mitigating spectral drifts."
388
+ ],
389
+ "image_footnote": [],
390
+ "bbox": [
391
+ 93,
392
+ 80,
393
+ 880,
394
+ 402
395
+ ],
396
+ "page_idx": 3
397
+ },
398
+ {
399
+ "type": "text",
400
+ "text": "3. Problem Statement",
401
+ "text_level": 1,
402
+ "bbox": [
403
+ 84,
404
+ 516,
405
+ 272,
406
+ 532
407
+ ],
408
+ "page_idx": 3
409
+ },
410
+ {
411
+ "type": "text",
412
+ "text": "Notation. Let the graph data be represented as $\\mathcal{G} = (\\mathcal{V},\\mathcal{E})$ where $\\mathcal{V}$ is the set of nodes with $|\\mathcal{V}| = N$ vertices, and $\\mathcal{E}\\subseteq \\mathcal{V}\\times \\mathcal{V}$ denotes the set of edges connecting these nodes. The adjacency matrix is represented by $\\mathbf{A}\\in \\mathbb{R}^{N\\times N}$ , where $\\mathbf{A}_{uv} = 1$ indicates the presence of an edge $e_{uv}\\in \\mathcal{E}$ and $\\mathbf{A}_{uv} = 0$ otherwise. Moreover, $\\mathbf{X}$ the feature vector matrix of the graph $\\mathcal{G}$ . The Laplacian matrix is given by $\\mathbf{L} = \\mathbf{D} - \\mathbf{A}$ , where $\\mathbf{D}$ is the degree matrix. The unitary matrix $\\mathbf{U}$ is composed of the eigenvectors of $\\mathbf{L}$ . To distinguish between local and global properties, we introduce the following notation: the symbol $i$ represents local properties or entities, whereas $g$ denotes global properties or entities.",
413
+ "bbox": [
414
+ 84,
415
+ 541,
416
+ 475,
417
+ 724
418
+ ],
419
+ "page_idx": 3
420
+ },
421
+ {
422
+ "type": "text",
423
+ "text": "Definition 3.1. Personalized PageRank (PPR): The PPR matrix quantifies the influence each node has on every other node within the graph and is defined as:",
424
+ "bbox": [
425
+ 84,
426
+ 727,
427
+ 475,
428
+ 773
429
+ ],
430
+ "page_idx": 3
431
+ },
432
+ {
433
+ "type": "equation",
434
+ "text": "\n$$\nP = \\alpha (I - (1 - \\alpha) D ^ {- 1} A) ^ {- 1}. \\tag {1}\n$$\n",
435
+ "text_format": "latex",
436
+ "bbox": [
437
+ 171,
438
+ 784,
439
+ 475,
440
+ 806
441
+ ],
442
+ "page_idx": 3
443
+ },
444
+ {
445
+ "type": "text",
446
+ "text": "Here, $\\alpha \\in (0,1)$ is the teleportation probability, representing the probability of the random walk restarting from the source node. A typical value is 0.15, which makes the continuation probability $(1 - \\alpha) = 0.85$ . $I$ is the identity matrix, $A$ is the adjacency matrix of the graph, and $D$ is the degree matrix with $D_{ii}$ denoting the degree of node $i$ .",
447
+ "bbox": [
448
+ 84,
449
+ 814,
450
+ 477,
451
+ 906
452
+ ],
453
+ "page_idx": 3
454
+ },
455
+ {
456
+ "type": "text",
457
+ "text": "Definition 3.2. Structure Inertia Score (SIS): The SIS quantifies the cumulative influence of the training nodes on the entire graph and is defined as:",
458
+ "bbox": [
459
+ 496,
460
+ 517,
461
+ 885,
462
+ 564
463
+ ],
464
+ "page_idx": 3
465
+ },
466
+ {
467
+ "type": "equation",
468
+ "text": "\n$$\nS I S (P, t) = \\sum_ {i = 1} ^ {n} \\max _ {j} \\left(P _ {i, j} \\cdot t _ {j}\\right). \\tag {2}\n$$\n",
469
+ "text_format": "latex",
470
+ "bbox": [
471
+ 578,
472
+ 575,
473
+ 885,
474
+ 613
475
+ ],
476
+ "page_idx": 3
477
+ },
478
+ {
479
+ "type": "text",
480
+ "text": "Here, $P$ is the PPR matrix, and $t \\in \\{0,1\\}^n$ is a binary vector indicating the training nodes, where $t_j = 1$ if node $j$ is part of the training set, and $t_j = 0$ otherwise. The SIS aggregates the maximum personalized PageRank values from each node to any labeled node, effectively measuring the strongest influence each node in the graph receives from the training set. A higher SIS indicates greater structural inertia, suggesting that the labels have a significant influence over the network overall graph structure.",
481
+ "bbox": [
482
+ 495,
483
+ 625,
484
+ 888,
485
+ 762
486
+ ],
487
+ "page_idx": 3
488
+ },
489
+ {
490
+ "type": "text",
491
+ "text": "4. Methodology",
492
+ "text_level": 1,
493
+ "bbox": [
494
+ 496,
495
+ 780,
496
+ 633,
497
+ 797
498
+ ],
499
+ "page_idx": 3
500
+ },
501
+ {
502
+ "type": "text",
503
+ "text": "4.1. Motivation",
504
+ "text_level": 1,
505
+ "bbox": [
506
+ 496,
507
+ 806,
508
+ 609,
509
+ 820
510
+ ],
511
+ "page_idx": 3
512
+ },
513
+ {
514
+ "type": "text",
515
+ "text": "Signal propagation over graph structures fundamentally shapes the signal transmission paradigm of GNNs. Therefore, rather than focusing solely on challenges arising from static graph structures in subgraph-FL, it is crucial to consider the dynamics of signal propagation. Correspondingly,",
516
+ "bbox": [
517
+ 495,
518
+ 829,
519
+ 888,
520
+ 906
521
+ ],
522
+ "page_idx": 3
523
+ },
524
+ {
525
+ "type": "header",
526
+ "text": "S2FGL: Spatial Spectral Federated Graph Learning",
527
+ "bbox": [
528
+ 318,
529
+ 56,
530
+ 653,
531
+ 70
532
+ ],
533
+ "page_idx": 3
534
+ },
535
+ {
536
+ "type": "page_number",
537
+ "text": "4",
538
+ "bbox": [
539
+ 480,
540
+ 922,
541
+ 491,
542
+ 934
543
+ ],
544
+ "page_idx": 3
545
+ },
546
+ {
547
+ "type": "text",
548
+ "text": "we conduct our analysis from both the spatial and spectral domains from the perspective of the graph signal. Specifically, the spatial domain governs the explicit passing of signals between connected nodes, while the spectral domain captures signal diffusion across different frequencies. Accordingly, we empirically validate the presence of two major challenges from the spatial and spectral perspectives: label signal disruption and spectral client drift. These phenomena respectively pose challenges of poor semantic knowledge and spectral client drift, which severely constrain the potential of subgraph-FL collaboration.",
549
+ "bbox": [
550
+ 84,
551
+ 84,
552
+ 475,
553
+ 251
554
+ ],
555
+ "page_idx": 4
556
+ },
557
+ {
558
+ "type": "text",
559
+ "text": "Motivation of NLIR. Graph data is fragmented across clients in subgraph-FL, which inevitably disrupts semantic signals from labeled nodes across clients. Label signal disruption undermines key pathways for propagating semantic information. This results in biased local feature representations, which ultimately degrade the performance of GNNs. For validation, we investigate the relationship between the decrease in SIS and the client scale. Specifically, the SIS exhibits a downward trend as the client scale increases, with notably lower scores in the range emphasized by mainstream subgraph-FL studies, thereby highlighting the label signal disruption phenomenon. We aim to mitigate its negative impact by preserving valuable semantic knowledge across fragmented subgraphs. Correspondingly, we propose NLIR. By selecting nodes with both structural representativeness and rich semantic information for the construction of a global repository and injecting it during local training, NLIR reduces the information loss inherent in the subgraph scenarios. Subsequently, NLIR assesses the similarity distributions between node features and all representative prototypes for both local and global GNNs during local training, thereby enabling multidimensional semantic localization of nodes. By aligning the two similarity distributions, it effectively injects semantic knowledge and enhances feature modeling semantically.",
560
+ "bbox": [
561
+ 86,
562
+ 258,
563
+ 477,
564
+ 636
565
+ ],
566
+ "page_idx": 4
567
+ },
568
+ {
569
+ "type": "text",
570
+ "text": "Motivation of FGMA. We reveal the challenge of spectral client drift in subgraph-FL in Fig. 1, where GNNs across different clients capture frequency information inconsistently due to graph spectral heterogeneity. This further leads to overfitting local signal propagation frequencies, which brings spectral conflicts during collaboration and compromises the generalizability of the global GNN. To address spectral client drift, we propose the Frequency-aware Graph Modeling Alignment. Specifically, FGMA reconstructs the local graph spectra with the GNN adjacency awareness by calculating the node similarity matrix. Subsequently, by projecting feature representations separately onto high- and low-frequency components of the reconstructed spectra and aligning the local and global projections, FGMA promotes the learning of a generalizable spectral signal propagation paradigm across clients, thereby reducing frequency-based discrepancies during collaboration and mitigating spectral",
571
+ "bbox": [
572
+ 84,
573
+ 643,
574
+ 475,
575
+ 900
576
+ ],
577
+ "page_idx": 4
578
+ },
579
+ {
580
+ "type": "text",
581
+ "text": "client drift. Consequently, our strategy effectively enhances the global generalizability spectrally.",
582
+ "bbox": [
583
+ 496,
584
+ 84,
585
+ 885,
586
+ 114
587
+ ],
588
+ "page_idx": 4
589
+ },
590
+ {
591
+ "type": "text",
592
+ "text": "4.2. Node Label Information Reinforcement",
593
+ "text_level": 1,
594
+ "bbox": [
595
+ 496,
596
+ 131,
597
+ 807,
598
+ 145
599
+ ],
600
+ "page_idx": 4
601
+ },
602
+ {
603
+ "type": "text",
604
+ "text": "First of all, we introduce the Structure-Aware Label Centrality (SALC) metric, denoted as $\\Lambda_u^{\\mathrm{SALC}}$ for node $u$ . It is defined as the combination of the label influence centrality $\\Lambda_u^l$ and the structural prominence score $\\Lambda_u^s$ :",
605
+ "bbox": [
606
+ 495,
607
+ 155,
608
+ 885,
609
+ 215
610
+ ],
611
+ "page_idx": 4
612
+ },
613
+ {
614
+ "type": "equation",
615
+ "text": "\n$$\n\\Lambda_ {u} ^ {\\mathrm {S A L C}} = \\Lambda_ {u} ^ {s} + \\Lambda_ {u} ^ {l}, \\tag {3}\n$$\n",
616
+ "text_format": "latex",
617
+ "bbox": [
618
+ 624,
619
+ 224,
620
+ 885,
621
+ 244
622
+ ],
623
+ "page_idx": 4
624
+ },
625
+ {
626
+ "type": "text",
627
+ "text": "where $\\Lambda_u^s$ assesses the structural representativeness of node $u$ , while $\\Lambda_u^l$ quantifies the influence propagation of labels.",
628
+ "bbox": [
629
+ 496,
630
+ 255,
631
+ 885,
632
+ 286
633
+ ],
634
+ "page_idx": 4
635
+ },
636
+ {
637
+ "type": "equation",
638
+ "text": "\n$$\n\\Lambda_ {u} ^ {s} = \\max \\left(\\tilde {P} _ {u, v} \\cdot \\tau_ {v}\\right), \\quad \\Lambda_ {u} ^ {l} = \\sum_ {v \\in \\mathcal {V} _ {L}} \\tilde {P} _ {v, u} ^ {(L)}, \\tag {4}\n$$\n",
639
+ "text_format": "latex",
640
+ "bbox": [
641
+ 542,
642
+ 296,
643
+ 885,
644
+ 330
645
+ ],
646
+ "page_idx": 4
647
+ },
648
+ {
649
+ "type": "text",
650
+ "text": "where $\\tilde{P}_{u,v}$ is the $(u,v)$ -th element of the standard PPR matrix $\\tilde{\\mathbf{P}}$ , and $\\tau_v$ represents the prior importance score of node $v$ , typically initialized to 1 for all nodes. The structural prominence score captures the maximum influence exerted by any node on node $u$ , weighted by its importance. As clarified, the PPR matrix used for computing label influence centrality is denoted as $\\tilde{\\mathbf{P}}^{(L)}$ , and defined as:",
651
+ "bbox": [
652
+ 495,
653
+ 343,
654
+ 885,
655
+ 450
656
+ ],
657
+ "page_idx": 4
658
+ },
659
+ {
660
+ "type": "equation",
661
+ "text": "\n$$\n\\tilde {\\mathbf {P}} ^ {(L)} = \\alpha (\\mathbf {I} - (1 - \\alpha) \\mathbf {D} ^ {- 1} \\mathbf {A} ^ {\\prime}) ^ {- 1}. \\tag {5}\n$$\n",
662
+ "text_format": "latex",
663
+ "bbox": [
664
+ 568,
665
+ 460,
666
+ 885,
667
+ 483
668
+ ],
669
+ "page_idx": 4
670
+ },
671
+ {
672
+ "type": "text",
673
+ "text": "Here, $\\mathcal{V}_L$ denotes the set of labeled nodes, and $\\tilde{P}_{v,u}^{(L)}$ represents the influence of node $v$ on node $u$ as captured by $\\tilde{\\mathbf{P}}^{(L)}$ . To accurately capture the influence of labeled nodes, the inclusion of self-loops in $\\mathbf{A}'$ ensures that each labeled node's own label contributes to its $\\Lambda_u^l$ . Compared to the intuitive approach of directly selecting labeled nodes, the SALC metric $\\Lambda_{u}^{\\mathrm{SALC}}$ considers both structural representativeness of the nodes and diffusion of label signals, thus avoiding biases caused by isolated labeled nodes. It is also capable of selecting unlabeled nodes that still possess rich label signals and structural advantages. This improves knowledge quality, enriches the repository, and mitigates the label signal disruption problem. After computing the SALC scores, we rank the nodes based on their $\\Lambda_u^{\\mathrm{SALC}}$ values and select the top $K$ nodes, where the default value of $K$ is $1/3$ of the total number of nodes. Subsequently, for each class $c$ , the local prototype $\\mathbf{H}_c^i$ at each client is computed as the mean feature vector of the selected nodes belonging to class $c$ :",
674
+ "bbox": [
675
+ 495,
676
+ 494,
677
+ 885,
678
+ 768
679
+ ],
680
+ "page_idx": 4
681
+ },
682
+ {
683
+ "type": "equation",
684
+ "text": "\n$$\n\\mathbf {H} _ {c} ^ {i} = \\frac {1}{| \\mathcal {V} _ {c} ^ {i} |} \\sum_ {u \\in \\mathcal {V} _ {c} ^ {i}} \\mathbf {h} _ {u} ^ {i}, \\tag {6}\n$$\n",
685
+ "text_format": "latex",
686
+ "bbox": [
687
+ 620,
688
+ 779,
689
+ 885,
690
+ 818
691
+ ],
692
+ "page_idx": 4
693
+ },
694
+ {
695
+ "type": "text",
696
+ "text": "where $\\mathcal{V}_c^i$ represents the set of selected nodes categorized as class $c$ on client $i$ , and $\\mathbf{h}_u^i$ is the feature vector of node $u$ on client $i$ . Once the local prototypes are computed, clients upload their prototypes to the server along with the node count. For each class $c$ , the server aggregates the",
697
+ "bbox": [
698
+ 495,
699
+ 829,
700
+ 885,
701
+ 906
702
+ ],
703
+ "page_idx": 4
704
+ },
705
+ {
706
+ "type": "header",
707
+ "text": "S2FGL: Spatial Spectral Federated Graph Learning",
708
+ "bbox": [
709
+ 318,
710
+ 56,
711
+ 653,
712
+ 70
713
+ ],
714
+ "page_idx": 4
715
+ },
716
+ {
717
+ "type": "page_number",
718
+ "text": "5",
719
+ "bbox": [
720
+ 480,
721
+ 922,
722
+ 491,
723
+ 934
724
+ ],
725
+ "page_idx": 4
726
+ },
727
+ {
728
+ "type": "text",
729
+ "text": "prototypes from $\\alpha$ percent of the clients by weighting each local prototype according to its sample size. Four global anchor prototypes are constructed for each class. Each global prototype $\\mathbf{H}_c^{g,k}$ is computed as:",
730
+ "bbox": [
731
+ 84,
732
+ 85,
733
+ 473,
734
+ 147
735
+ ],
736
+ "page_idx": 5
737
+ },
738
+ {
739
+ "type": "equation",
740
+ "text": "\n$$\n\\mathbf {H} _ {c} ^ {g, k} = \\frac {1}{\\sum_ {i \\in \\mathcal {N} _ {c} ^ {k}} | \\mathcal {V} _ {c} ^ {i} |} \\sum_ {i \\in \\mathcal {N} _ {c} ^ {k}} | \\mathcal {V} _ {c} ^ {i} | \\mathbf {H} _ {c} ^ {i}, \\quad \\mathcal {H} = \\left[ \\begin{array}{c} \\mathbf {H} _ {1} ^ {g, 1} \\\\ \\mathbf {H} _ {1} ^ {g, 2} \\\\ \\vdots \\\\ \\mathbf {H} _ {C} ^ {g, 4} \\end{array} \\right], (7)\n$$\n",
741
+ "text_format": "latex",
742
+ "bbox": [
743
+ 94,
744
+ 154,
745
+ 475,
746
+ 231
747
+ ],
748
+ "page_idx": 5
749
+ },
750
+ {
751
+ "type": "text",
752
+ "text": "where $\\mathbf{H}_c^{g,k}$ represents the $k$ -th global prototype for class $c$ , $\\mathcal{N}_c^k$ is the set of clients randomly selected to contribute to the $k$ -th global prototype for class $c$ , and $C$ is the number of classes. The global repository $\\mathcal{H}$ contains all the global prototypes and will be broadcast back to clients. After the global knowledge repository is constructed, it is distributed to the local clients along with the model parameters. The global features $\\mathbf{h}_u^g$ used in the following loss formulation refer to the frozen inference features extracted locally using the distributed global model. To regulate local training, we propose a federated knowledge distillation loss function aimed at harmonizing the semantic feature localization of the local GNN with its global counterpart, namely by aligning their similarity distributions for the representative prototypes stored in the global repository:",
753
+ "bbox": [
754
+ 84,
755
+ 239,
756
+ 475,
757
+ 467
758
+ ],
759
+ "page_idx": 5
760
+ },
761
+ {
762
+ "type": "equation",
763
+ "text": "\n$$\n\\mathcal {L} _ {\\mathrm {F K D}} = \\frac {1}{| \\mathcal {V} _ {i} |} \\sum_ {u \\in \\mathcal {V} _ {i}} \\operatorname {K L} \\left(\\sigma \\left(\\varphi \\left(\\mathbf {h} _ {u} ^ {i}, \\mathcal {H}\\right)\\right), \\sigma \\left(\\varphi \\left(\\mathbf {h} _ {u} ^ {g}, \\mathcal {H}\\right)\\right)\\right), \\tag {8}\n$$\n",
764
+ "text_format": "latex",
765
+ "bbox": [
766
+ 96,
767
+ 477,
768
+ 473,
769
+ 526
770
+ ],
771
+ "page_idx": 5
772
+ },
773
+ {
774
+ "type": "text",
775
+ "text": "where $\\mathrm{KL}(\\cdot ,\\cdot)$ represents the Kullback-Leibler divergence, and $\\sigma (\\cdot)$ is the softmax function applied to similarity scores computed by the function $\\varphi (\\mathbf{h},\\mathcal{H})$ , which returns a vector of cosine similarities between the feature and all prototypes.",
776
+ "bbox": [
777
+ 84,
778
+ 526,
779
+ 475,
780
+ 587
781
+ ],
782
+ "page_idx": 5
783
+ },
784
+ {
785
+ "type": "text",
786
+ "text": "4.3. Frequency-aware Graph Modeling Alignment",
787
+ "text_level": 1,
788
+ "bbox": [
789
+ 84,
790
+ 603,
791
+ 444,
792
+ 619
793
+ ],
794
+ "page_idx": 5
795
+ },
796
+ {
797
+ "type": "text",
798
+ "text": "To emphasize the GNN spectral adjacency awareness and more accurately capture similarities between nodes, we leverage the feature matrix $\\mathbf{h}$ to compute node similarity matrices. In the construction of the following similarity matrix, $\\mathbf{h}$ denotes operations applied to both $\\mathbf{h}^i$ and $\\mathbf{h}^g$ . Specifically, for each node $u$ , we identify its $k_{\\mathrm{sim}}$ most similar neighbors based on the cosine similarity of their feature vectors $\\mathbf{h}_u$ . We then construct a sparse self-similarity matrix $\\mathbf{S}'$ as:",
799
+ "bbox": [
800
+ 84,
801
+ 627,
802
+ 475,
803
+ 750
804
+ ],
805
+ "page_idx": 5
806
+ },
807
+ {
808
+ "type": "equation",
809
+ "text": "\n$$\n\\mathbf {S} _ {u, v} ^ {\\prime} = \\left\\{ \\begin{array}{l l} \\frac {\\mathbf {h} _ {u} \\cdot \\mathbf {h} _ {v}}{\\| \\mathbf {h} _ {u} \\| _ {2} \\| \\mathbf {h} _ {v} \\| _ {2}} & v \\text {a m o n g t h e t o p} k _ {\\mathrm {s i m}} \\\\ 0 & \\text {o t h e r w i s e} \\end{array} . \\right. \\tag {9}\n$$\n",
810
+ "text_format": "latex",
811
+ "bbox": [
812
+ 124,
813
+ 757,
814
+ 473,
815
+ 799
816
+ ],
817
+ "page_idx": 5
818
+ },
819
+ {
820
+ "type": "text",
821
+ "text": "Subsequently, we calculate the graph laplacian matrix $\\mathbf{L}'$ based on this sparse similarity matrix $\\mathbf{S}'$ as:",
822
+ "bbox": [
823
+ 84,
824
+ 806,
825
+ 472,
826
+ 838
827
+ ],
828
+ "page_idx": 5
829
+ },
830
+ {
831
+ "type": "equation",
832
+ "text": "\n$$\n\\mathbf {L} ^ {\\prime} = \\mathbf {D} ^ {\\prime} - \\mathbf {S} ^ {\\prime}, \\tag {10}\n$$\n",
833
+ "text_format": "latex",
834
+ "bbox": [
835
+ 228,
836
+ 848,
837
+ 473,
838
+ 864
839
+ ],
840
+ "page_idx": 5
841
+ },
842
+ {
843
+ "type": "text",
844
+ "text": "where $\\mathbf{D}'$ is the diagonal degree matrix of $\\mathbf{S}'$ . Moreover, we perform eigendecomposition on the laplacians $\\mathbf{L}^{\\prime i}$ and $\\mathbf{L}^{\\prime g}$ .",
845
+ "bbox": [
846
+ 84,
847
+ 875,
848
+ 475,
849
+ 906
850
+ ],
851
+ "page_idx": 5
852
+ },
853
+ {
854
+ "type": "text",
855
+ "text": "For $\\mathbf{L}^{\\prime i}$ , let $\\{\\mathbf{u}_m^{\\mathrm{low},i}\\}_{m = 1}^{k_{\\mathrm{eig}}}$ be the eigenvectors corresponding to the smallest eigenvalues, which represents low-frequency. While $\\{\\mathbf{u}_m^{\\mathrm{high},i}\\}_{m = 1}^{k_{\\mathrm{eig}}}$ denotes the largest eigenvalues, which represents high-frequency. Similarly, for $\\mathbf{L}^{\\prime g}$ , we obtain $\\{\\mathbf{u}_m^{\\mathrm{low},g}\\}_{m = 1}^{k_{\\mathrm{eig}}}$ and $\\{\\mathbf{u}_m^{\\mathrm{high},g}\\}_{m = 1}^{k_{\\mathrm{eig}}}$ . The feature matrix $\\mathbf{h}$ is then projected onto each of these eigenvectors. For instance:",
856
+ "bbox": [
857
+ 496,
858
+ 83,
859
+ 885,
860
+ 180
861
+ ],
862
+ "page_idx": 5
863
+ },
864
+ {
865
+ "type": "equation",
866
+ "text": "\n$$\n\\mathbf {Z} _ {m} ^ {\\text {l o w}} = \\left(\\mathbf {u} _ {m} ^ {\\text {l o w}} \\mathbf {u} _ {m} ^ {\\text {l o w} T}\\right) \\mathbf {h}, \\quad \\mathbf {Z} _ {m} ^ {\\text {h i g h}} = \\left(\\mathbf {u} _ {m} ^ {\\text {h i g h}} \\mathbf {u} _ {m} ^ {\\text {h i g h} T}\\right) \\mathbf {h}. \\tag {11}\n$$\n",
867
+ "text_format": "latex",
868
+ "bbox": [
869
+ 516,
870
+ 188,
871
+ 885,
872
+ 210
873
+ ],
874
+ "page_idx": 5
875
+ },
876
+ {
877
+ "type": "text",
878
+ "text": "Applying these projections for each $m \\in \\{1, \\dots, k_{\\mathrm{eig}}\\}$ , we obtain several sets of projected feature matrices used in the loss computation. Specifically, local features $\\mathbf{h}^i$ are projected onto low/high-frequency eigenvectors of the local graph, yielding $\\mathbf{Z}_m^{i,\\mathrm{low}}$ and $\\mathbf{Z}_m^{i,\\mathrm{high}}$ , respectively. Similarly, frozen global inference features $\\mathbf{h}^g$ are projected onto corresponding eigenvectors from $\\mathbf{L}^{\\prime g}$ , yielding $\\mathbf{Z}_m^{g,\\mathrm{low}}$ and $\\mathbf{Z}_m^{g,\\mathrm{high}}$ . Consequently, loss $\\mathcal{L}_{\\mathrm{FGMA}}$ is then defined as the sum of MSE over all eigenvector-projected pairs:",
879
+ "bbox": [
880
+ 495,
881
+ 218,
882
+ 888,
883
+ 354
884
+ ],
885
+ "page_idx": 5
886
+ },
887
+ {
888
+ "type": "equation",
889
+ "text": "\n$$\n\\mathcal {L} _ {\\mathrm {F G M A}} = \\sum_ {m = 1} ^ {k _ {\\text {e i g}}} \\left(\\operatorname {M S E} \\left(\\mathbf {Z} _ {m} ^ {i, \\text {l o w}}, \\mathbf {Z} _ {m} ^ {g, \\text {l o w}}\\right) + \\operatorname {M S E} \\left(\\mathbf {Z} _ {m} ^ {i, \\text {h i g h}}, \\mathbf {Z} _ {m} ^ {g, \\text {h i g h}}\\right)\\right). \\tag {12}\n$$\n",
890
+ "text_format": "latex",
891
+ "bbox": [
892
+ 496,
893
+ 366,
894
+ 908,
895
+ 419
896
+ ],
897
+ "page_idx": 5
898
+ },
899
+ {
900
+ "type": "text",
901
+ "text": "This loss addresses spectral heterogeneity by aligning client and global signal characteristics in both spectral domains. Combining strategies Node Label Information Reinforcement Frequency-aware Graph Modeling Alignment, our framework $S^2$ FGL reinforces semantic knowledge during local modeling and mitigates spectral client drift. Ultimately, the loss for local training is:",
902
+ "bbox": [
903
+ 495,
904
+ 420,
905
+ 888,
906
+ 526
907
+ ],
908
+ "page_idx": 5
909
+ },
910
+ {
911
+ "type": "equation",
912
+ "text": "\n$$\n\\mathcal {L} = \\mathcal {L} _ {\\mathrm {C E}} + \\lambda_ {1} \\mathcal {L} _ {\\mathrm {F K D}} + \\lambda_ {2} \\mathcal {L} _ {\\mathrm {F G M A}}, \\tag {13}\n$$\n",
913
+ "text_format": "latex",
914
+ "bbox": [
915
+ 578,
916
+ 537,
917
+ 885,
918
+ 554
919
+ ],
920
+ "page_idx": 5
921
+ },
922
+ {
923
+ "type": "text",
924
+ "text": "where $\\mathcal{L}_{\\mathrm{CE}}$ denotes the standard cross-entropy loss for node classification, while $\\lambda_{1}$ and $\\lambda_{2}$ are balancing hyperparameters for the proposed methods NLIR and FGMA.",
925
+ "bbox": [
926
+ 495,
927
+ 565,
928
+ 887,
929
+ 609
930
+ ],
931
+ "page_idx": 5
932
+ },
933
+ {
934
+ "type": "text",
935
+ "text": "5. Experiments",
936
+ "text_level": 1,
937
+ "bbox": [
938
+ 496,
939
+ 628,
940
+ 630,
941
+ 647
942
+ ],
943
+ "page_idx": 5
944
+ },
945
+ {
946
+ "type": "text",
947
+ "text": "5.1. Experimental Setup",
948
+ "text_level": 1,
949
+ "bbox": [
950
+ 496,
951
+ 656,
952
+ 669,
953
+ 671
954
+ ],
955
+ "page_idx": 5
956
+ },
957
+ {
958
+ "type": "text",
959
+ "text": "Datasets. We conducted experiments on various datasets to validate the superiority of our framework $S^2$ FGL. The homophilic graph datasets include Cora, CiteSeer, and Pubmed, while the heterophilic graph datasets comprise Texas, Wisconsin, and Minesweeper. The following provides a description of each dataset. Cora (McCallum et al., 2000) dataset consists of 2708 scientific publications classified into one of seven classes. There are 5429 edges in the network of citations. 1433 distinct words make up the dictionary. CiteSeer (Giles et al., 1998) dataset consists of 3312 scientific publications classified into one of six classes and 4732 edges. The dictionary contains 3703 unique words. Pubmed (Sen et al., 2008) dataset consists of 19717 scientific papers on diabetes that have been categorized into one of three categories in the PubMed database. The citation network has 44338 edges.",
960
+ "bbox": [
961
+ 495,
962
+ 679,
963
+ 888,
964
+ 905
965
+ ],
966
+ "page_idx": 5
967
+ },
968
+ {
969
+ "type": "header",
970
+ "text": "S2FGL: Spatial Spectral Federated Graph Learning",
971
+ "bbox": [
972
+ 318,
973
+ 56,
974
+ 653,
975
+ 71
976
+ ],
977
+ "page_idx": 5
978
+ },
979
+ {
980
+ "type": "page_number",
981
+ "text": "6",
982
+ "bbox": [
983
+ 480,
984
+ 922,
985
+ 491,
986
+ 934
987
+ ],
988
+ "page_idx": 5
989
+ },
990
+ {
991
+ "type": "table",
992
+ "img_path": "images/95fff84de8fb743ba3abc6b67b56c4c31438e5afc7fbb5c5ae934589bc04f604.jpg",
993
+ "table_caption": [
994
+ "Table 1. Performance Comparison with the state-of-the-art methods on homophilic and heterophilic graph datasets. We report the node classification accuracies with the performance improvement over FedAvg. The best results are highlighted in bold."
995
+ ],
996
+ "table_footnote": [],
997
+ "table_body": "<table><tr><td>Methods</td><td>Cora</td><td>CiteSeer</td><td>PubMed</td><td>Texas</td><td>Wisconsin</td><td>Minesweeper</td></tr><tr><td>FedAvg [ASTAT17]</td><td>81.9 ± 0.7</td><td>74.3 ± 0.4</td><td>87.3 ± 0.3</td><td>72.8 ± 2.2</td><td>77.6 ± 2.7</td><td>79.6 ± 0.1</td></tr><tr><td>FedProx [arXiv18]</td><td>82.1 ± 0.5 ↑0.2</td><td>74.4 ± 0.3 ↑0.1</td><td>87.9 ± 0.4 ↑0.6</td><td>73.5 ± 3.7 ↑0.7</td><td>77.3 ± 3.4 ↓0.3</td><td>79.7 ± 0.1 ↑0.1</td></tr><tr><td>FedNova [NeurIPS20]</td><td>81.6 ± 1.2 ↓0.3</td><td>74.4 ± 0.4 ↑0.1</td><td>88.2 ± 0.5 ↑0.9</td><td>73.0 ± 4.4 ↑0.2</td><td>77.4 ± 4.2 ↓0.2</td><td>79.9 ± 0.4 ↑0.3</td></tr><tr><td>FedFa [ICLR23]</td><td>82.7 ± 0.5 ↑0.8</td><td>74.9 ± 0.6 ↑0.6</td><td>87.8 ± 0.5 ↑0.5</td><td>73.9 ± 3.6 ↑1.1</td><td>78.1 ± 4.6 ↑0.5</td><td>80.1 ± 0.3 ↑0.5</td></tr><tr><td>FedSage+ [NeurIPS19]</td><td>82.3 ± 0.7 ↑0.4</td><td>75.2 ± 0.3 ↑0.9</td><td>88.2 ± 0.7 ↑0.9</td><td>73.7 ± 4.0 ↑0.9</td><td>79.0 ± 3.3 ↑1.4</td><td>79.9 ± 0.2 ↑0.3</td></tr><tr><td>FedStar [AAAI23]</td><td>82.6 ± 0.5 ↑0.7</td><td>74.5 ± 0.3 ↑0.2</td><td>88.1 ± 0.6 ↑0.8</td><td>74.3 ± 2.7 ↑1.5</td><td>78.3 ± 4.7 ↑0.7</td><td>79.8 ± 0.1 ↑0.2</td></tr><tr><td>FedPub [ICML23]</td><td>82.3 ± 0.8 ↑0.4</td><td>74.8 ± 0.7 ↑0.5</td><td>88.0 ± 0.4 ↑0.7</td><td>73.4 ± 3.5 ↑0.6</td><td>77.8 ± 3.1 ↑0.2</td><td>79.9 ± 0.2 ↑0.3</td></tr><tr><td>FGSSL [IJCAI23]</td><td>82.6 ± 0.4 ↑0.7</td><td>74.9 ± 0.2 ↑0.6</td><td>87.6 ± 0.7 ↑0.3</td><td>73.6 ± 4.6 ↑0.8</td><td>77.8 ± 3.8 ↑0.2</td><td>79.9 ± 0.2 ↑0.3</td></tr><tr><td>FedGTA [VLDB24]</td><td>82.4 ± 0.8 ↑0.5</td><td>75.1 ± 0.5 ↑0.8</td><td>87.7 ± 0.9 ↑0.4</td><td>72.6 ± 4.2 ↓0.2</td><td>77.8 ± 4.1 ↑0.2</td><td>80.2 ± 0.3 ↑0.6</td></tr><tr><td>FGGP [AAAI24]</td><td>82.5 ± 0.4 ↑0.6</td><td>74.7 ± 0.5 ↑0.4</td><td>87.5 ± 0.4 ↑0.2</td><td>73.6 ± 2.8 ↑0.8</td><td>78.2 ± 3.4 ↑0.6</td><td>80.4 ± 0.3 ↑0.8</td></tr><tr><td>S2FGL (ours)</td><td>83.4 ± 0.2 ↑1.5</td><td>76.0 ± 0.3 ↑1.7</td><td>88.6 ± 0.2 ↑1.3</td><td>74.8 ± 2.3 ↑2.0</td><td>79.0 ± 1.0 ↑1.4</td><td>80.5 ± 0.1 ↑0.9</td></tr></table>",
998
+ "bbox": [
999
+ 99,
1000
+ 121,
1001
+ 885,
1002
+ 340
1003
+ ],
1004
+ "page_idx": 6
1005
+ },
1006
+ {
1007
+ "type": "text",
1008
+ "text": "Texas and Wisconsin datasets are subsets of the WebKB dataset (Craven et al., 1998). The WebKB dataset was introduced in 1998, comprising web pages from the computer science departments of various universities, including the University of Texas and the University of Wisconsin. The dataset is commonly used for tasks such as webpage classification and link prediction, serving as a benchmark for evaluating machine learning models in graph-based learning scenarios. Minesweeper (Baranovskiy et al., 2023) dataset is a synthetic graph dataset inspired by the Minesweeper game. In this dataset, the graph is structured as a regular $100 \\times 100$ grid, where each node represents a cell connected to its neighboring nodes, except for edge nodes, which have fewer neighbors. The primary task is to predict which nodes contain mines. This dataset is commonly used to evaluate the performance of GNNs under heterophily.",
1009
+ "bbox": [
1010
+ 84,
1011
+ 368,
1012
+ 475,
1013
+ 609
1014
+ ],
1015
+ "page_idx": 6
1016
+ },
1017
+ {
1018
+ "type": "text",
1019
+ "text": "Evaluation Metric. Following mainstream FGL research experimental practices, we utilize the accuracy of the node classification task as the evaluation metric.",
1020
+ "bbox": [
1021
+ 84,
1022
+ 617,
1023
+ 473,
1024
+ 661
1025
+ ],
1026
+ "page_idx": 6
1027
+ },
1028
+ {
1029
+ "type": "text",
1030
+ "text": "Baselines. We compare $S^2$ FGL with several state-of-the-art approaches, including traditional federated learning methods such as FedAvg (McMahan et al., 2017), FedProx (Li et al., 2020), FedNova (Wang et al., 2020), and FedFa (Zhou & Konukoglu, 2023); federated graph learning approaches including FGSSL (Huang et al., 2023a) and FGGP (Wan et al., 2024a); as well as personalized federated graph learning methods such as FedSage+ (Zhang et al., 2021b), FedStar (Tan et al., 2023), FedPub (Baek et al., 2023), and FedGTA (Li et al., 2024). This comprehensive set of baseline methods spans various FL and FGL paradigms, allowing us to evaluate the performance and advantages of our proposed $S^2$ FGL across diverse scenarios.",
1031
+ "bbox": [
1032
+ 84,
1033
+ 669,
1034
+ 475,
1035
+ 866
1036
+ ],
1037
+ "page_idx": 6
1038
+ },
1039
+ {
1040
+ "type": "text",
1041
+ "text": "Implement Details. Following prevalent methodologies in FGL research, we employ the Louvain community detection",
1042
+ "bbox": [
1043
+ 84,
1044
+ 873,
1045
+ 473,
1046
+ 905
1047
+ ],
1048
+ "page_idx": 6
1049
+ },
1050
+ {
1051
+ "type": "text",
1052
+ "text": "algorithm to partition the graph into subgraphs assigned to different clients. For each dataset, we divide the nodes into training, validation, and testing sets with ratios of $60\\%$ , $20\\%$ , and $20\\%$ , respectively. Additionally, we simulate various collaborative scenarios by configuring the number of clients to 10 for Cora, CiteSeer, Pubmed, and Minesweeper datasets, and 3 for the Texas and Wisconsin datasets. The primary evaluation metric is the node classification accuracy on the clients' test sets. We conduct each experiment five times and report the average accuracy from the last five communication epochs as the final performance. We conduct experiments with the ACM-GCN (Luan et al., 2022), which achieves a strong ability on both homophilic and heterophilic graph datasets.",
1053
+ "bbox": [
1054
+ 495,
1055
+ 368,
1056
+ 888,
1057
+ 580
1058
+ ],
1059
+ "page_idx": 6
1060
+ },
1061
+ {
1062
+ "type": "text",
1063
+ "text": "5.2. Experiment Results",
1064
+ "text_level": 1,
1065
+ "bbox": [
1066
+ 496,
1067
+ 595,
1068
+ 669,
1069
+ 611
1070
+ ],
1071
+ "page_idx": 6
1072
+ },
1073
+ {
1074
+ "type": "text",
1075
+ "text": "In this section, we comprehensively evaluate the proposed $S^2$ FGL by addressing the following questions:",
1076
+ "bbox": [
1077
+ 496,
1078
+ 619,
1079
+ 885,
1080
+ 650
1081
+ ],
1082
+ "page_idx": 6
1083
+ },
1084
+ {
1085
+ "type": "list",
1086
+ "sub_type": "text",
1087
+ "list_items": [
1088
+ "- Q1: How does $S^2$ FGL perform compared to existing FL and FGL methods in subgraph-FL?",
1089
+ "- Q2: What is the impact of each component of $S^2$ FGL on the overall performance?",
1090
+ "Q3: Does $S^2$ FGL maintain consistent performance across different hyperparameter and client scales?",
1091
+ "Q4: Do NLIR and FGMA mitigate the effects of label signal disruption and spectral heterogeneity?"
1092
+ ],
1093
+ "bbox": [
1094
+ 514,
1095
+ 666,
1096
+ 887,
1097
+ 820
1098
+ ],
1099
+ "page_idx": 6
1100
+ },
1101
+ {
1102
+ "type": "text",
1103
+ "text": "Q1: How does $S^2$ FGL perform compared to existing FL and FGL methods in subgraph-FL?",
1104
+ "text_level": 1,
1105
+ "bbox": [
1106
+ 496,
1107
+ 837,
1108
+ 885,
1109
+ 867
1110
+ ],
1111
+ "page_idx": 6
1112
+ },
1113
+ {
1114
+ "type": "text",
1115
+ "text": "We present the results of node classification tasks across various FGL scenarios using multiple graph datasets, and",
1116
+ "bbox": [
1117
+ 496,
1118
+ 875,
1119
+ 885,
1120
+ 905
1121
+ ],
1122
+ "page_idx": 6
1123
+ },
1124
+ {
1125
+ "type": "header",
1126
+ "text": "S2FGL: Spatial Spectral Federated Graph Learning",
1127
+ "bbox": [
1128
+ 318,
1129
+ 56,
1130
+ 653,
1131
+ 71
1132
+ ],
1133
+ "page_idx": 6
1134
+ },
1135
+ {
1136
+ "type": "page_number",
1137
+ "text": "7",
1138
+ "bbox": [
1139
+ 480,
1140
+ 922,
1141
+ 491,
1142
+ 934
1143
+ ],
1144
+ "page_idx": 6
1145
+ },
1146
+ {
1147
+ "type": "text",
1148
+ "text": "we summarize the final average test accuracy in Tab. 1. It demonstrates that our proposed $S^2$ FGL consistently outperforms all baseline approaches across all six datasets. This superiority highlights the effectiveness of $S^2$ FGL.",
1149
+ "bbox": [
1150
+ 84,
1151
+ 85,
1152
+ 475,
1153
+ 147
1154
+ ],
1155
+ "page_idx": 7
1156
+ },
1157
+ {
1158
+ "type": "text",
1159
+ "text": "Q2: What is the impact of each component of $S^2$ FGL on the overall performance?",
1160
+ "text_level": 1,
1161
+ "bbox": [
1162
+ 84,
1163
+ 152,
1164
+ 475,
1165
+ 184
1166
+ ],
1167
+ "page_idx": 7
1168
+ },
1169
+ {
1170
+ "type": "text",
1171
+ "text": "To evaluate the individual contributions of NLIR and FGMA strategies within the $S^2$ FGL framework, we conducted ablation experiments on the Cora and Citeseer datasets. In this study, we removed each component to assess its impact on the overall performance. The results are presented in Tab. 2, which demonstrate that both NLIR and FGMA independently contribute to the overall performance.",
1172
+ "bbox": [
1173
+ 84,
1174
+ 190,
1175
+ 475,
1176
+ 297
1177
+ ],
1178
+ "page_idx": 7
1179
+ },
1180
+ {
1181
+ "type": "table",
1182
+ "img_path": "images/fff90e2cb492ce0bdb44bb5b477e03b64d31f12a857a6d6686631c8819db4954.jpg",
1183
+ "table_caption": [],
1184
+ "table_footnote": [],
1185
+ "table_body": "<table><tr><td rowspan=\"2\">NLIR</td><td rowspan=\"2\">FGMA</td><td colspan=\"2\">Dataset</td></tr><tr><td>Cora</td><td>CiteSeer</td></tr><tr><td>X</td><td>X</td><td>81.9 ± 0.7</td><td>74.3 ± 0.4</td></tr><tr><td>✓</td><td>X</td><td>83.2 ± 0.4</td><td>75.6 ± 0.3</td></tr><tr><td>X</td><td>✓</td><td>82.6 ± 0.3</td><td>75.0 ± 0.2</td></tr><tr><td>✓</td><td>✓</td><td>83.4 ± 0.2</td><td>76.0 ± 0.3</td></tr></table>",
1186
+ "bbox": [
1187
+ 94,
1188
+ 303,
1189
+ 475,
1190
+ 397
1191
+ ],
1192
+ "page_idx": 7
1193
+ },
1194
+ {
1195
+ "type": "text",
1196
+ "text": "Table 2. Ablation study on key components of ${S}^{2}\\mathrm{{FGL}}$ .",
1197
+ "bbox": [
1198
+ 112,
1199
+ 406,
1200
+ 444,
1201
+ 421
1202
+ ],
1203
+ "page_idx": 7
1204
+ },
1205
+ {
1206
+ "type": "text",
1207
+ "text": "Q3: Does $S^2$ FGL maintain consistent performance across different hyperparameter and client scales?",
1208
+ "text_level": 1,
1209
+ "bbox": [
1210
+ 84,
1211
+ 436,
1212
+ 473,
1213
+ 468
1214
+ ],
1215
+ "page_idx": 7
1216
+ },
1217
+ {
1218
+ "type": "text",
1219
+ "text": "We evaluated the stability and adaptability of our proposed framework $S^2$ FGL under varying hyperparameter configurations of and different client scales.",
1220
+ "bbox": [
1221
+ 84,
1222
+ 474,
1223
+ 475,
1224
+ 518
1225
+ ],
1226
+ "page_idx": 7
1227
+ },
1228
+ {
1229
+ "type": "text",
1230
+ "text": "Varying Hyperparameters of NLIR and FGMA. For NLIR, we test hyperparameter sets of 100, 50, 10, and 1. For FGMA, the settings are 0.01, 0.05, 0.5, and 1. The results in Fig. 4 indicate that our method maintains consistent performance across varying hyperparameter configurations.",
1231
+ "bbox": [
1232
+ 84,
1233
+ 527,
1234
+ 475,
1235
+ 604
1236
+ ],
1237
+ "page_idx": 7
1238
+ },
1239
+ {
1240
+ "type": "image",
1241
+ "img_path": "images/cefc86a487a1a05bcc61a866ed8c05011f0d935cd119acc879e56c48b530478e.jpg",
1242
+ "image_caption": [
1243
+ "(a) Cora"
1244
+ ],
1245
+ "image_footnote": [],
1246
+ "bbox": [
1247
+ 94,
1248
+ 625,
1249
+ 267,
1250
+ 733
1251
+ ],
1252
+ "page_idx": 7
1253
+ },
1254
+ {
1255
+ "type": "image",
1256
+ "img_path": "images/44f0030259e2c6c587bf7d718b7b3a3ee4700cdaec5142d58a1b240cb85de575.jpg",
1257
+ "image_caption": [
1258
+ "(b) Citeseer"
1259
+ ],
1260
+ "image_footnote": [],
1261
+ "bbox": [
1262
+ 297,
1263
+ 625,
1264
+ 468,
1265
+ 734
1266
+ ],
1267
+ "page_idx": 7
1268
+ },
1269
+ {
1270
+ "type": "text",
1271
+ "text": "Varying Client Scales. We assessed performance with different client scales: 5, 10 and 20. Specifically, we compared $S^2$ FGL with other FL and FGL baselines, including FedAvg, FedProx, and FGSSL. The results in Fig. 5 demonstrate that $S^2$ FGL consistently delivers reliable results regardless of the client scales. Overall, $S^2$ FGL exhibits strong stability",
1272
+ "bbox": [
1273
+ 84,
1274
+ 814,
1275
+ 475,
1276
+ 906
1277
+ ],
1278
+ "page_idx": 7
1279
+ },
1280
+ {
1281
+ "type": "image",
1282
+ "img_path": "images/b6677c11f49c4c9485bcd4f20eb070645e2f53f978e11dd9f3f8c2399471a9be.jpg",
1283
+ "image_caption": [
1284
+ "(a) Cora"
1285
+ ],
1286
+ "image_footnote": [],
1287
+ "bbox": [
1288
+ 506,
1289
+ 87,
1290
+ 686,
1291
+ 169
1292
+ ],
1293
+ "page_idx": 7
1294
+ },
1295
+ {
1296
+ "type": "image",
1297
+ "img_path": "images/0df512c6531d93e0b73f2f6f0cbde12fe38d44e4580b49c3054fe4641f118708.jpg",
1298
+ "image_caption": [
1299
+ "(b) Citeseer",
1300
+ "Figure 5. Analysis of performance under different client scales."
1301
+ ],
1302
+ "image_footnote": [],
1303
+ "bbox": [
1304
+ 697,
1305
+ 89,
1306
+ 875,
1307
+ 170
1308
+ ],
1309
+ "page_idx": 7
1310
+ },
1311
+ {
1312
+ "type": "text",
1313
+ "text": "and adaptability across varying hyperparameter settings and client partition configurations on both the Cora and Cite-seer datasets. These findings confirm that $S^2$ FGL not only sustains its effectiveness under diverse conditions but also adapts seamlessly to varying client scales, demonstrating its suitability for real-world subgraph-FL scenarios.",
1314
+ "bbox": [
1315
+ 495,
1316
+ 234,
1317
+ 885,
1318
+ 325
1319
+ ],
1320
+ "page_idx": 7
1321
+ },
1322
+ {
1323
+ "type": "text",
1324
+ "text": "Q4: Do NLIR and FGMA mitigate the effects of label signal disruption and spectral heterogeneity?",
1325
+ "text_level": 1,
1326
+ "bbox": [
1327
+ 495,
1328
+ 334,
1329
+ 885,
1330
+ 364
1331
+ ],
1332
+ "page_idx": 7
1333
+ },
1334
+ {
1335
+ "type": "text",
1336
+ "text": "In Fig. 1, our experiments demonstrate that the SIS score in subgraph scenarios declines compared to centralized training, while spectral heterogeneity exists among clients. Here, we further verify the targeted effectiveness of NILR and FGMA with respect to these two issues, respectively. First, in Fig. 6 (a), we investigate the relationship between the performance gain brought by NILR to FedAvg and the change in the SIS score. The results show that this method achieves higher performance when semantic signals are more limited, thereby confirming its effectiveness and targeted nature. Second, in Fig. 6 (b), we examine the relationship between the performance improvement of FGMA for FedAvg and spectral heterogeneity, measured by the average KL divergence between the eigenvalue distributions of different clients. Experimental results show that greater spectral heterogeneity corresponds to larger performance gains, confirming the effectiveness of our method. Specifically, green indicates the performance gain of the proposed method relative to FedAvg, blue denotes variations in SIS, and orange corresponds to spectral heterogeneity.",
1337
+ "bbox": [
1338
+ 495,
1339
+ 371,
1340
+ 888,
1341
+ 675
1342
+ ],
1343
+ "page_idx": 7
1344
+ },
1345
+ {
1346
+ "type": "image",
1347
+ "img_path": "images/6f26bd088a5d35580ec7b4f313b2fa7617944e8722361a1afdab281e0dd81e75.jpg",
1348
+ "image_caption": [
1349
+ "Figure 4. Analysis of the performance growth between $S^2$ FGL and FedAvg under different hyperparameters of NLIR and FGMA",
1350
+ "(a) NILR"
1351
+ ],
1352
+ "image_footnote": [],
1353
+ "bbox": [
1354
+ 501,
1355
+ 694,
1356
+ 686,
1357
+ 803
1358
+ ],
1359
+ "page_idx": 7
1360
+ },
1361
+ {
1362
+ "type": "image",
1363
+ "img_path": "images/23e167e760ad9d618d4cbf7f540046aec3a6edb377d26ca0543ac5da883bfbca.jpg",
1364
+ "image_caption": [
1365
+ "(b) FGMA",
1366
+ "Figure 6. Analysis of the targeted effectiveness of NILR and FGMA. (a) The performance gain from NILR increases as the semantic signal becomes limited. (b) The performance improvement from FGMA grows with higher spectral heterogeneity."
1367
+ ],
1368
+ "image_footnote": [],
1369
+ "bbox": [
1370
+ 694,
1371
+ 696,
1372
+ 877,
1373
+ 804
1374
+ ],
1375
+ "page_idx": 7
1376
+ },
1377
+ {
1378
+ "type": "header",
1379
+ "text": "S2FGL: Spatial Spectral Federated Graph Learning",
1380
+ "bbox": [
1381
+ 318,
1382
+ 56,
1383
+ 653,
1384
+ 71
1385
+ ],
1386
+ "page_idx": 7
1387
+ },
1388
+ {
1389
+ "type": "page_number",
1390
+ "text": "8",
1391
+ "bbox": [
1392
+ 480,
1393
+ 922,
1394
+ 491,
1395
+ 934
1396
+ ],
1397
+ "page_idx": 7
1398
+ },
1399
+ {
1400
+ "type": "text",
1401
+ "text": "6. Conclusion",
1402
+ "text_level": 1,
1403
+ "bbox": [
1404
+ 84,
1405
+ 83,
1406
+ 205,
1407
+ 99
1408
+ ],
1409
+ "page_idx": 8
1410
+ },
1411
+ {
1412
+ "type": "text",
1413
+ "text": "In this paper, we identify and empirically demonstrate two phenomena in subgraph-FL from both spatial and spectral perspectives of graph signal propagation: label signal disruption and spectral heterogeneity. These phenomena pose challenges of poor semantic knowledge and spectral client drift. To address these challenges, we propose two key strategies: NLIR and FGMA. NLIR selects structurally and semantically representative nodes and constructs a global repository accordingly. By injecting semantic information from the repository into local training, it alleviates the poor semantic knowledge caused by label signal disruption. In addition, FGMA aligns and feature projections in both the high- and low-frequency reconstructed graph spectra, thereby promoting a generic signal propagation paradigm and mitigating client drifts under spectral heterogeneity. By integrating these strategies, $S^2$ FGL effectively tackles both spatial and spectral challenges in subgraph-FL. Extensive experiments on multiple datasets demonstrate that $S^2$ FGL significantly enhances global generalizability.",
1414
+ "bbox": [
1415
+ 84,
1416
+ 109,
1417
+ 475,
1418
+ 396
1419
+ ],
1420
+ "page_idx": 8
1421
+ },
1422
+ {
1423
+ "type": "text",
1424
+ "text": "Acknowledgement",
1425
+ "text_level": 1,
1426
+ "bbox": [
1427
+ 86,
1428
+ 416,
1429
+ 246,
1430
+ 431
1431
+ ],
1432
+ "page_idx": 8
1433
+ },
1434
+ {
1435
+ "type": "text",
1436
+ "text": "This work is supported by the National Key Research and Development Program of China (2024YFC3308400), and National Natural Science Foundation of China under Grant (62361166629, 62176188, 62225113, 623B2080), the Wuhan University Undergraduate Innovation Research Fund Project. The supercomputing system at the Supercomputing Center of Wuhan University supported the numerical calculations in this paper.",
1437
+ "bbox": [
1438
+ 84,
1439
+ 441,
1440
+ 477,
1441
+ 563
1442
+ ],
1443
+ "page_idx": 8
1444
+ },
1445
+ {
1446
+ "type": "text",
1447
+ "text": "Impact Statement",
1448
+ "text_level": 1,
1449
+ "bbox": [
1450
+ 86,
1451
+ 580,
1452
+ 241,
1453
+ 599
1454
+ ],
1455
+ "page_idx": 8
1456
+ },
1457
+ {
1458
+ "type": "text",
1459
+ "text": "This paper presents work whose goal is to advance the field of Machine Learning. There are many potential societal consequences of our work, none of which we feel must be specifically highlighted here.",
1460
+ "bbox": [
1461
+ 84,
1462
+ 607,
1463
+ 475,
1464
+ 669
1465
+ ],
1466
+ "page_idx": 8
1467
+ },
1468
+ {
1469
+ "type": "text",
1470
+ "text": "References",
1471
+ "text_level": 1,
1472
+ "bbox": [
1473
+ 86,
1474
+ 686,
1475
+ 183,
1476
+ 703
1477
+ ],
1478
+ "page_idx": 8
1479
+ },
1480
+ {
1481
+ "type": "list",
1482
+ "sub_type": "ref_text",
1483
+ "list_items": [
1484
+ "Acar, D. A. E., Zhao, Y., Matas, R., Mattina, M., Whatmough, P., and Saligrama, V. Federated learning based on dynamic regularization. In ICLR, 2021.",
1485
+ "Baek, J., Jeong, W., Jin, J., Yoon, J., and Hwang, S. J. Personalized subgraph federated learning. In ICML, pp. 1396-1415, 2023.",
1486
+ "Baranovskiy, D., Oseledets, I., and Babenko, A. A critical look at the evaluation of gnns under heterophily: Are we really making progress? arXiv preprint arXiv:2302.11640, 2023.",
1487
+ "Bo, D., Fang, Y., Liu, Y., and Shi, C. Graph contrastive learn"
1488
+ ],
1489
+ "bbox": [
1490
+ 86,
1491
+ 710,
1492
+ 477,
1493
+ 906
1494
+ ],
1495
+ "page_idx": 8
1496
+ },
1497
+ {
1498
+ "type": "list",
1499
+ "sub_type": "ref_text",
1500
+ "list_items": [
1501
+ "ing with stable and scalable spectral encoding. NeurIPS, 36:45516-45532, 2023a.",
1502
+ "Bo, D., Shi, C., Wang, L., and Liao, R. Specformer: Spectral graph neural networks meet transformers. arXiv preprint arXiv:2303.01028, 2023b.",
1503
+ "Chen, H.-Y. and Chao, W.-L. On bridging generic and personalized federated learning for image classification. In ICLR, 2022.",
1504
+ "Chen, M., Zhang, W., Yuan, Z., Jia, Y., and Chen, H. Fede: Embedding knowledge graphs in federated setting. In IJCKG, pp. 80-88, 2021.",
1505
+ "Chen, Y., Huang, W., and Ye, M. Fair federated learning under domain skew with local consistency and domain diversity. In CVPR, pp. 12077-12086, 2024.",
1506
+ "Craven, M., DiPasquo, D., Freitag, D., McCallum, A., Mitchell, T., Nigam, K., and Slattery, S. Learning to extract symbolic knowledge from the world wide web. AAAI/IAAI, pp. 2, 1998.",
1507
+ "Defferrard, M., Bresson, X., and Vandergheynst, P. Convolutional neural networks on graphs with fast localized spectral filtering. In NeurIPS, 2016.",
1508
+ "Ezzeldin, Y. H., Yan, S., He, C., Ferrara, E., and Avestimehr, A. S. Fairfed: Enabling group fairness in federated learning. In AAAI, 2023.",
1509
+ "Fan, W., Ma, Y., Li, Q., Wang, J., Cai, G., Tang, J., and Yin, D. A graph neural network framework for social recommendations. TKDE, 2020.",
1510
+ "Fang, X. and Ye, M. Robust federated learning with noisy and heterogeneous clients. In CVPR, pp. 10072-10081, 2022.",
1511
+ "Fang, X., Easwaran, A., Genest, B., and Suganthan, P. N. Adaptive hierarchical graph cut for multi-granularity out-of-distribution detection. IEEE TAI, 2025.",
1512
+ "Fu, X., Zhang, B., Dong, Y., Chen, C., and Li, J. Federated graph machine learning: A survey of concepts, techniques, and applications. arXiv preprint arXiv:2207.11812, 2022.",
1513
+ "Gao, Y., Wang, X., He, X., Liu, Z., Feng, H., and Zhang, Y. Addressing heterophily in graph anomaly detection: A perspective of graph spectrum. In Proceedings of the ACM Web Conference 2023, pp. 1528-1538, 2023.",
1514
+ "Giles, C. L., Bollacker, K. D., and Lawrence, S. Citeseer: An automatic citation indexing system. In Proceedings of the third ACM conference on Digital libraries, pp. 89-98, 1998."
1515
+ ],
1516
+ "bbox": [
1517
+ 500,
1518
+ 84,
1519
+ 887,
1520
+ 904
1521
+ ],
1522
+ "page_idx": 8
1523
+ },
1524
+ {
1525
+ "type": "header",
1526
+ "text": "S2FGL: Spatial Spectral Federated Graph Learning",
1527
+ "bbox": [
1528
+ 318,
1529
+ 56,
1530
+ 653,
1531
+ 71
1532
+ ],
1533
+ "page_idx": 8
1534
+ },
1535
+ {
1536
+ "type": "page_number",
1537
+ "text": "9",
1538
+ "bbox": [
1539
+ 480,
1540
+ 922,
1541
+ 491,
1542
+ 934
1543
+ ],
1544
+ "page_idx": 8
1545
+ },
1546
+ {
1547
+ "type": "list",
1548
+ "sub_type": "ref_text",
1549
+ "list_items": [
1550
+ "Han, H., Liu, X., Ma, L., Torkamani, M., Liu, H., Tang, J., and Yamada, M. Structural fairness-aware active learning for graph neural networks. In ICLR, 2023.",
1551
+ "He, C., Balasubramanian, K., Ceyani, E., Yang, C., Xie, H., Sun, L., He, L., Yang, L., Yu, P. S., Rong, Y., et al. Fedgraphnn: A federated learning system and benchmark for graph neural networks. In ICLR, 2021a.",
1552
+ "He, M., Wei, Z., Xu, H., et al. Bernnet: Learning arbitrary graph spectral filters via bernstein approximation. In NeurIPS, pp. 14239-14251, 2021b.",
1553
+ "He, M., Wei, Z., and Wen, J.-R. Convolutional neural networks on graphs with chebyshev approximation, revisited. In NeurIPS, pp. 7264-7276, 2022.",
1554
+ "Hong, J., Wang, H., Wang, Z., and Zhou, J. Federated robustness propagation: sharing adversarial robustness in heterogeneous federated learning. In AAAI, pp. 7893-7901, 2023.",
1555
+ "Hu, M., Yue, Z., Xie, X., Chen, C., Huang, Y., Wei, X., Lian, X., Liu, Y., and Chen, M. Is aggregation the only choice? federated learning via layer-wise model recombination. In SIGKDD, pp. 1096-1107, 2024.",
1556
+ "Huang, W., Ye, M., and Du, B. Learn from others and be yourself in heterogeneous federated learning. In CVPR, pp. 10143-10153, 2022.",
1557
+ "Huang, W., Wan, G., Ye, M., and Du, B. Federated graph semantic and structural learning. In Proceedings of the Thirty-Second International Joint Conference on Artificial Intelligence, pp. 3830-3838, 2023a.",
1558
+ "Huang, W., Ye, M., Shi, Z., and Du, B. Generalizable heterogeneous federated cross-correlation and instance similarity learning. TPAMI, pp. 712-728, 2023b.",
1559
+ "Huang, W., Ye, M., Shi, Z., Li, H., and Du, B. Rethinking federated learning with domain shift: A prototype view. In CVPR, pp. 16312-16322. IEEE, 2023c.",
1560
+ "Huang, W., Ye, M., Shi, Z., Wan, G., Li, H., Du, B., and Yang, Q. A federated learning for generalization, robustness, fairness: A survey and benchmark. TPAMI, 2024.",
1561
+ "Karimireddy, S. P., Kale, S., Mohri, M., Reddi, S. J., Stich, S. U., and Suresh, A. T. Scaffold: Stochastic controlled averaging for on-device federated learning. In ICML, pp. 5132-5143, 2020.",
1562
+ "Kreuzer, D., Beaini, D., Hamilton, W., Létourneau, V., and Tossou, P. Rethinking graph transformers with spectral attention. In *NeruIPS*, pp. 21618-21629, 2021."
1563
+ ],
1564
+ "bbox": [
1565
+ 86,
1566
+ 84,
1567
+ 475,
1568
+ 905
1569
+ ],
1570
+ "page_idx": 9
1571
+ },
1572
+ {
1573
+ "type": "list",
1574
+ "sub_type": "ref_text",
1575
+ "list_items": [
1576
+ "Lee, G., Jeong, M., Shin, Y., Bae, S., and Yun, S.-Y. Preservation of the global knowledge by not-true distillation in federated learning. In Koyejo, S., Mohamed, S., Agarwal, A., Belgrave, D., Cho, K., and Oh, A. (eds.), NeurIPS, pp. 38461-38474, 2022.",
1577
+ "Li, T., Sahu, A. K., Zaheer, M., Sanjabi, M., Talwalkar, A., and Smith, V. Federated optimization in heterogeneous networks. MLSys, 2:429-450, 2020.",
1578
+ "Li, X., Wu, Z., Zhang, W., Zhu, Y., Li, R.-H., and Wang, G. Fedgta: Topology-aware averaging for federated graph learning. arXiv preprint arXiv:2401.11755, 2024.",
1579
+ "Li, X.-C., Zhan, D.-C., Shao, Y., Li, B., and Song, S. Fedphp: Federated personalization with inherited private models. In ECML, pp. 587-602, 2021.",
1580
+ "Liao, R., Zhao, Z., Urtasun, R., and Zemel, R. S. Lanczos-net: Multi-scale deep graph convolutional networks. In ICLR, 2019.",
1581
+ "Liu, N., Wang, X., Bo, D., Shi, C., and Pei, J. Revisiting graph contrastive learning from the perspective of graph spectrum. In NeurIPS, pp. 2972-2983, 2022.",
1582
+ "Liu, R. and Yu, H. Federated graph neural networks: Overview, techniques and challenges. arXiv preprint arXiv:2202.07256, 2022.",
1583
+ "Liu, Y., Bo, D., and Shi, C. Graph condensation via eigenbasis matching. arXiv preprint arXiv:2310.09202, 2023.",
1584
+ "Liu, Z., Wan, G., Prakash, B. A., Lau, M. S., and Jin, W. A review of graph neural networks in epidemic modeling. arXiv preprint arXiv:2403.19852, 2024.",
1585
+ "Luan, S., Hua, C., Lu, Q., Zhu, J., Zhao, M., Zhang, S., Chang, X.-W., and Precup, D. Revisiting heterophily for graph neural networks. In NeurIPS22, pp. 1362-1375, 2022.",
1586
+ "Lv, F., Shang, X., Zhou, Y., Zhang, Y., Li, M., and Lu, Y. Personalized federated learning on heterogeneous and long-tailed data via expert collaborative learning. arXiv preprint arXiv:2408.02019, 2024.",
1587
+ "McCallum, A. K., Nigam, K., Rennie, J., and Seymour, K. Automating the construction of internet portals with machine learning. Information Retrieval, 3(2):127-163, 2000.",
1588
+ "McMahan, B., Moore, E., Ramage, D., Hampson, S., and y Arcas, B. A. Communication-efficient learning of deep networks from decentralized data. In AISTATS, pp. 1273-1282, 2017."
1589
+ ],
1590
+ "bbox": [
1591
+ 498,
1592
+ 84,
1593
+ 887,
1594
+ 904
1595
+ ],
1596
+ "page_idx": 9
1597
+ },
1598
+ {
1599
+ "type": "header",
1600
+ "text": "S2FGL: Spatial Spectral Federated Graph Learning",
1601
+ "bbox": [
1602
+ 318,
1603
+ 56,
1604
+ 653,
1605
+ 71
1606
+ ],
1607
+ "page_idx": 9
1608
+ },
1609
+ {
1610
+ "type": "page_number",
1611
+ "text": "10",
1612
+ "bbox": [
1613
+ 477,
1614
+ 922,
1615
+ 495,
1616
+ 934
1617
+ ],
1618
+ "page_idx": 9
1619
+ },
1620
+ {
1621
+ "type": "list",
1622
+ "sub_type": "ref_text",
1623
+ "list_items": [
1624
+ "Ray Chaudhury, B., Li, L., Kang, M., Li, B., and Mehta, R. Fairness in federated learning via core-stability. In NeurIPS, pp. 5738-5750, 2022.",
1625
+ "Sen, P., Namata, G., Bilgic, M., Getoor, L., Galligher, B., and Eliassi-Rad, T. Collective classification in network data. AI magazine, 29(3):93-93, 2008.",
1626
+ "Shang, X., Lu, Y., Huang, G., and Wang, H. Federated learning on heterogeneous and long-tailed data via classifier re-training with federated features. In *IJCAI*, 2022.",
1627
+ "Smith, V., Chiang, C.-K., Sanjabi, M., and Talwalkar, A. S. Federated multi-task learning. In NeurIPS, 2017.",
1628
+ "Tan, Y., Liu, Y., Long, G., Jiang, J., Lu, Q., and Zhang, C. Federated learning on non-iid graphs via structural knowledge sharing. In AAAI, pp. 9953-9961, 2023.",
1629
+ "Tan, Z., Wan, G., Huang, W., and Ye, M. Fedssp: Federated graph learning with spectral knowledge and personalized preference. In NeurIPS, pp. 34561-34581, 2024.",
1630
+ "Tan, Z., Wan, G., Huang, W., Li, H., Zhang, G., Yang, C., and Ye, M. Fedspa: Generalizable federated graph learning under homophily heterogeneity. In CVPR, pp. 15464-15475, 2025.",
1631
+ "Tang, J., Li, J., Gao, Z., and Li, J. Rethinking graph neural networks for anomaly detection. In ICML, pp. 21076-21089, 2022.",
1632
+ "Wan, G., Huang, W., and Ye, M. Federated graph learning under domain shift with generalizable prototypes. In AAAI, pp. 15429-15437, 2024a.",
1633
+ "Wan, G., Tian, Y., Huang, W., Chawla, N. V., and Ye, M. S3gcl: Spectral, swift, spatial graph contrastive learning. In ICML, pp. 49973-49990, 2024b.",
1634
+ "Wan, G., Huang, Z., Zhao, W., Luo, X., Sun, Y., and Wang, W. Rethink graphode generalization within coupled dynamical system. In ICML, 2025a.",
1635
+ "Wan, G., Shi, Z., Huang, W., Zhang, G., Tao, D., and Ye, M. Energy-based backdoor defense against federated graph learning. In ICLR, 2025b.",
1636
+ "Wang, D., Lin, J., Cui, P., Jia, Q., Wang, Z., Fang, Y., Yu, Q., Zhou, J., Yang, S., and Qi, Y. A semi-supervised graph attentive network for financial fraud detection. In ICDM, pp. 598-607, 2019.",
1637
+ "Wang, J., Liu, Q., Liang, H., Joshi, G., and Poor, H. V. Tackling the objective inconsistency problem in heterogeneous federated optimization. In NeurIPS, pp. 7611-7623, 2020."
1638
+ ],
1639
+ "bbox": [
1640
+ 86,
1641
+ 84,
1642
+ 475,
1643
+ 904
1644
+ ],
1645
+ "page_idx": 10
1646
+ },
1647
+ {
1648
+ "type": "list",
1649
+ "sub_type": "ref_text",
1650
+ "list_items": [
1651
+ "Wang, X. and Zhang, M. How powerful are spectral graph neural networks. In ICML, pp. 23341-23362, 2023.",
1652
+ "Wu, X., Liu, X., Niu, J., Zhu, G., and Tang, S. Bold but cautious: Unlocking the potential of personalized federated learning through cautiously aggressive collaboration. In ICCV, pp. 19375-19384, 2023.",
1653
+ "Wu, Z., Pan, S., Chen, F., Long, G., Zhang, C., and Philip, S. Y. A comprehensive survey on graph neural networks. TNNLS, pp. 4-24, 2020.",
1654
+ "Xie, H., Ma, J., Xiong, L., and Yang, C. Federated graph classification over non-iid graphs. In NerulPS, pp. 18839-18852, 2021.",
1655
+ "Xu, C., Qu, Y., Xiang, Y., and Gao, L. Asynchronous federated learning on heterogeneous devices: A survey. Computer Science Review, 50:100595, 2023.",
1656
+ "Xu, J., Chen, Z., Quek, T. Q., and Chong, K. F. E. Fedcorr: Multi-stage federated learning for label noise correction. In CVPR, pp. 10184-10193, 2022.",
1657
+ "Yang, X., Huang, W., and Ye, M. Dynamic personalized federated learning with adaptive differential privacy. Advances in Neural Information Processing Systems, 36: 72181-72192, 2023.",
1658
+ "Zhang, H., Shen, T., Wu, F., Yin, M., Yang, H., and Wu, C. Federated graph learning - a position paper. In arXiv preprint arXiv:2105.11099, 2021a.",
1659
+ "Zhang, J., Li, Z., Li, B., Xu, J., Wu, S., Ding, S., and Wu, C. Federated learning with label distribution skew via logits calibration. In ICML, pp. 26311-26329, 2022a.",
1660
+ "Zhang, J., Hua, Y., Cao, J., Wang, H., Song, T., XUE, Z., Ma, R., and Guan, H. Eliminating domain bias for federated learning in representation space. In NeurIPS, pp. 14204-14227, 2023a.",
1661
+ "Zhang, J., Hua, Y., Wang, H., Song, T., Xue, Z., Ma, R., Cao, J., and Guan, H. GpfI: Simultaneously learning global and personalized feature information for personalized federated learning. In CVPR, pp. 5041-5051, 2023b.",
1662
+ "Zhang, J., Hua, Y., Wang, H., Song, T., Xue, Z., Ma, R., and Guan, H. Fedala: Adaptive local aggregation for personalized federated learning. In AAAI, pp. 11237-11244, 2023c.",
1663
+ "Zhang, K., Yang, C., Li, X., Sun, L., and Yiu, S. M. Subgraph federated learning with missing neighbor generation. In NeurIPS, pp. 6671-6682, 2021b.",
1664
+ "Zhang, T., Gao, L., Lee, S., Zhang, M., and Avestimehr, S. Timelyfl: Heterogeneity-aware asynchronous federated learning with adaptive partial training. In CVPR, pp. 5064-5073, 2023d."
1665
+ ],
1666
+ "bbox": [
1667
+ 500,
1668
+ 84,
1669
+ 885,
1670
+ 904
1671
+ ],
1672
+ "page_idx": 10
1673
+ },
1674
+ {
1675
+ "type": "header",
1676
+ "text": "S2FGL: Spatial Spectral Federated Graph Learning",
1677
+ "bbox": [
1678
+ 318,
1679
+ 56,
1680
+ 653,
1681
+ 71
1682
+ ],
1683
+ "page_idx": 10
1684
+ },
1685
+ {
1686
+ "type": "page_number",
1687
+ "text": "11",
1688
+ "bbox": [
1689
+ 477,
1690
+ 922,
1691
+ 493,
1692
+ 934
1693
+ ],
1694
+ "page_idx": 10
1695
+ },
1696
+ {
1697
+ "type": "list",
1698
+ "sub_type": "ref_text",
1699
+ "list_items": [
1700
+ "Zhang, Y., Gao, S., Pei, J., and Huang, H. Improving social network embedding via new second-order continuous graph neural networks. In KDD, pp. 2515-2523, 2022b.",
1701
+ "Zhou, T. and Konukoglu, E. Fedfa: Federated feature augmentation. In ICLR, 2023.",
1702
+ "Zhu, B., Wang, L., Pang, Q., Wang, S., Jiao, J., Song, D., and Jordan, M. I. Byzantine-robust federated learning with optimal statistical rates. In AISTATS, pp. 3151-3178, 2023.",
1703
+ "Zhu, Y., Li, X., Wu, Z., Wu, D., Hu, M., and Li, R.-H. Fedtad: Topology-aware data-free knowledge distillation for subgraph federated learning. arXiv preprint arXiv:2404.14061, 2024.",
1704
+ "Zhu, Z., Hong, J., and Zhou, J. Data-free knowledge distillation for heterogeneous federated learning. In ICML, pp. 12878-12889, 2021."
1705
+ ],
1706
+ "bbox": [
1707
+ 86,
1708
+ 84,
1709
+ 478,
1710
+ 366
1711
+ ],
1712
+ "page_idx": 11
1713
+ },
1714
+ {
1715
+ "type": "header",
1716
+ "text": "S2FGL: Spatial Spectral Federated Graph Learning",
1717
+ "bbox": [
1718
+ 318,
1719
+ 56,
1720
+ 653,
1721
+ 71
1722
+ ],
1723
+ "page_idx": 11
1724
+ },
1725
+ {
1726
+ "type": "page_number",
1727
+ "text": "12",
1728
+ "bbox": [
1729
+ 477,
1730
+ 922,
1731
+ 495,
1732
+ 934
1733
+ ],
1734
+ "page_idx": 11
1735
+ }
1736
+ ]
2025/$S^2$FGL_ Spatial Spectral Federated Graph Learning/a72798c3-b530-4d2b-8f38-0412b72285b0_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/$S^2$FGL_ Spatial Spectral Federated Graph Learning/a72798c3-b530-4d2b-8f38-0412b72285b0_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5e3d2762df85c1d716e13c3a18ad1ff20c3a4aa58d867a5a8e43012e264b1be0
3
+ size 3724275
2025/$S^2$FGL_ Spatial Spectral Federated Graph Learning/full.md ADDED
@@ -0,0 +1,351 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # $S^2$ FGL: Spatial Spectral Federated Graph Learning
2
+
3
+ Zihan Tan $^{*1}$ Suyuan Huang $^{*1}$ Guancheng Wan $^{1}$ Wenke Huang $^{1}$ He Li $^{1}$ Mang Ye $^{1}$
4
+
5
+ # Abstract
6
+
7
+ Federated Graph Learning (FGL) combines the privacy-preserving capabilities of Federated Learning (FL) with the strong graph modeling capability of Graph Neural Networks (GNNs). Current research addresses subgraph-FL from the structural perspective, neglecting the propagation of graph signals on the spatial and spectral domains of the structure. From a spatial perspective, subgraph-FL introduces edge disconnections between clients, leading to disruptions in label signals and a degradation in the semantic knowledge of the global GNN. From a spectral perspective, spectral heterogeneity causes inconsistencies in signal frequencies across subgraphs, which makes local GNNs overfit the local signal propagation schemes. As a result, spectral client drift occurs, undermining global generalizability. To tackle the challenges, we propose a global knowledge repository to mitigate the challenge of poor semantic knowledge caused by label signal disruption. Furthermore, we design a frequency alignment to address spectral client drift. The combination of Spatial and Spectral strategies forms our framework $S^2$ FGL. Extensive experiments on multiple datasets demonstrate the superiority of $S^2$ FGL. The code is available at https://github.com/Wonder7racer/S2FGL.git
8
+
9
+ # 1. Introduction
10
+
11
+ Graph Neural Networks (GNNs) have demonstrated remarkable efficacy in modeling graph-structured data (Wan et al., 2025a; Fang et al., 2025), thereby finding applications across various domains, such as social networks (Fan et al., 2020; Zhang et al., 2022b), epidemiology (Liu et al., 2024), and
12
+
13
+ *Equal contribution 1National Engineering Research Center for Multimedia Software, School of Computer Science, Wuhan University, Wuhan, China. Correspondence to: Mang Ye <yemang@whu.edu.cn>.
14
+
15
+ Proceedings of the $42^{nd}$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
16
+
17
+ ![](images/e1147d7267355e1b34d3327a2a473bd60c0f3c3f748cef6aa3101e3b0b7260af.jpg)
18
+ Figure 1. In the first place, compared with centralized GNN training, subgraph-FL is encountering label signal disruption challenge, leading to decreased structure inertia score and poor semantic knowledge for GNNs. Moreover, we demonstrate the heat map of the Kullback-Leibler divergence of eigenvalue distributions across clients. Inconsistency in subgraph signal frequency caused by spectral heterogeneity leads to spectral client drift.
19
+
20
+ fraud detection (Wang et al., 2019; Tang et al., 2022). However, in real-world scenarios, graph data is often generated at the edge devices rather than in centralized systems (Zhang et al., 2021a). To address this, Federated Graph Learning (FGL) has emerged (Fu et al., 2022; Liu & Yu, 2022; Tan et al., 2025; 2024; Huang et al., 2022; Wan et al., 2024b; 2025b), leveraging the data privacy-preserving capabilities of Federated Learning (FL) (Huang et al., 2024; 2023b;c; 2022) to enable the efficient distributed training of GNNs (Huang et al., 2024). A prominent application of FGL is subgraph-FL, in which each participant holds a subgraph derived from the same overall graph data.
21
+
22
+ Although numerous FGL methods have attempted to provide solutions based on structure to enhance effectiveness, including identifying structurally similar collaborators (Baek et al., 2023; Xie et al., 2021; Li et al., 2024), enhancing structural knowledge exchange (Tan et al., 2023; Huang et al., 2023a; Tan et al., 2025), and retrieving generic information under structural shifts (Wan et al., 2024a; Tan et al., 2024). Nevertheless, these approaches overlooked the propagation
23
+
24
+ ![](images/e5e69d068c605f0b87900cf54505a0e3407c07e3b950bfb34d4092bd37537262.jpg)
25
+ Figure 2. Problem Illustration. (a) From the spatial perspective, nodes in subgraph-FL lose label signals from originally nearby labeled nodes due to edge loss, namely label signal disruption. Correspondingly, GNNs suffer from poor semantic knowledge, leading to a deteriorated global GNN. (b) From the spectral perspective, spectral heterogeneity induces inconsistencies in signal frequencies across subgraphs, leading to spectral client drift in the signal propagation paradigms of GNNs and degraded global generalizability.
26
+
27
+ of graph signals within the structure. Specifically, graph signal propagation can be analyzed from two perspectives: the spatial and the spectral domain. Specifically, the spatial domain governs the explicit transmission of signals among linked nodes, while the spectral domain characterizes signal diffusion across varying frequency spectra.
28
+
29
+ From the spatial perspective, due to edge loss, we hypothesize that nodes in subgraph-FL lose label signals from originally nearby labeled nodes. This degradation hampers the ability of GNNs to learn comprehensive semantic knowledge, resulting in poor global performance and reduced generalizability. Correspondingly, we define this phenomenon as label signal disruption, which naturally exists in subgraph-FL. For verifying, inspired by graph active learning research (Han et al., 2023), we investigate how the Structure Inertia Score (SIS) varies in subgraph-FL. Specifically, SIS evaluates the influence and significance of labels on graphs. In Fig. 1, we empirically demonstrate that the SIS decreases in subgraph-FL compared with centralized training. Correspondingly, existing methods suffer from poor semantic knowledge. Based on our empirical analysis, we pose the question: I) How can we address the challenge of poor semantic knowledge under label signal disruption?
30
+
31
+ From the spectral perspective, inconsistencies in signal frequencies across clients caused by spectral heterogeneity induce spectral client drift in the signal transmission schemes of GNNs, thereby undermining the collaboration. To verify this phenomenon, we examine graph spectra across clients and demonstrate the heterogeneity in Fig. 1. It reveals inconsistent eigenvalue distribution across clients. As a result, GNNs learn distinct signal propagation schemes of sub
32
+
33
+ graphs and optimize in different spectral directions, leading to spectral client drift and degraded generalizability. Based on our analysis, we pose the question: II) How can we alleviate spectral client drift under spectral heterogeneity?
34
+
35
+ To address the challenge of poor semantic knowledge under label signal disruption in Question I), we propose Node Label Information Reinforcement (NLIR). Specifically, our strategy leverages structurally and semantically representative nodes to construct a prototype-based global repository of semantic knowledge. During training, NLIR calculates the similarity distribution between all representative prototypes with node features, which provides multidimensional semantic localization of nodes. Consequently, our strategy injects semantic knowledge from the repository into the local GNN during training, effectively mitigating the issue of poor semantic knowledge under label signal disruption.
36
+
37
+ Considering the spectral client drift posed by spectral heterogeneity in II), we propose Frequency-aware Graph Modeling Alignment (FGMA). Our method utilizes the similarity relationship of the node feature of the frozen global GNN and the local GNN to reconstruct spectra that incorporates GNNs adjacency awareness. FGMA then projects the high-frequency and low-frequency components of the features onto this spectrum. Subsequently, by aligning the local projections with the global one, we encourage the GNNs to learn a globally generic frequency processing scheme, thereby mitigating spectral client drift.
38
+
39
+ In conclusion, our key contributions are:
40
+
41
+ - First, we identify and empirically reveal the issue of
42
+
43
+ poor semantic knowledge under label signal disruption. In addition, we reveal the spectral client drift under spectral heterogeneity in subgraph-FL.
44
+
45
+ - We design our framework $S^2$ FGL including strategy Node Label Information Reinforcement and Frequency-aware Graph Modeling Alignment, effectively addressing the challenges of poor semantic knowledge and spectral client drift in subgraph-FL.
46
+ - We conduct extensive experiments on various datasets, validating the superiority of our proposed $S^2$ FGL.
47
+
48
+ # 2. Related Work
49
+
50
+ Federated Graph Learning. Federated graph learning leverages the powerful graph modeling capabilities of GNNs along with the privacy-preserving attributes of federated learning, thus gaining increasing attention these days (He et al., 2021a; Fu et al., 2022; Liu & Yu, 2022; Wan et al., 2025b). Current FGL research can generally be categorized into two types: intra-graph FGL and inter-graph FGL. Intra-graph FGL research primarily focuses on subgraph-FL scenarios, where each client participates in the collaboration with a part of the whole graph (Zhang et al., 2021b). Correspondingly, the training targets include missing link prediction (Chen et al., 2021; Baek et al., 2023), node classification (Huang et al., 2023a; Li et al., 2024; Wan et al., 2024a; Zhu et al., 2024), and so on. On the other hand, clients in inter-graph FGL own independent local graph data, such as multiple graphs from different domains (Tan et al., 2023; Xie et al., 2021). In this paper, we focus on subgraph-FL scenarios of intra-graph FGL. Specifically, we are the first to empirically reveal and address the challenge of poor semantic knowledge under label signal disruption and client drift under spectral heterogeneity among subgraphs, while existing methods inevitably fail spatially and spectrally due to the lack of targeted solutions.
51
+
52
+ Federated Learning. Federated learning (Huang et al., 2023c; 2024; Yang et al., 2023; Wan et al., 2024a) has gained increasing attention in recent years as it addresses the issue of data silos while ensuring data privacy. Several research directions have emerged from FL, including robustness (Xu et al., 2022; Hong et al., 2023; Zhu et al., 2023; Fang & Ye, 2022), fairness (Chen et al., 2024; Ezzeldin et al., 2023; Ray Chaudhury et al., 2022), and asynchronous federated learning (Xu et al., 2023; Zhang et al., 2023d). Generally, FL can be categorized into two main types by their optimization objective: traditional FL (tFL) and personalized FL (Hu et al., 2024; Shang et al., 2022; Lv et al., 2024; Smith et al., 2017). Research of tFL aims at aggregating a highly generalizable global model (McMahan et al., 2017; Li et al., 2020; Acar et al., 2021; Zhang et al., 2022a). For instance, FedNTD (Lee et al., 2022) preserves the global
53
+
54
+ perspective on local data for the not-true classes, FEDGEN (Zhu et al., 2021) ensembles user information in a data-free manner to regulate local training, and SCAFFOLD (Karimireddy et al., 2020) uses variance reduction for the client drift phenomenon. Instead, strategies of personalized FL (pFL) aim to customize models that perform optimally for each client (Wu et al., 2023; Zhou & Konukoglu, 2023; Li et al., 2021; Zhang et al., 2023b). Specifically, FedALA (Zhang et al., 2023c) proposed adaptive masks to achieve personalized aggregation, DBE (Zhang et al., 2023a) stores domain biases for elimination, and FedRoD (Chen & Chao, 2022) leverages two heads for global and personalized tasks.
55
+
56
+ Graph Spectrum Being related closely to graph connectivity, signal propagation, and structure, graph spectra have proven essential in performing various tasks on graph-structured data. For instance, it plays an essential role in anatomy detection, (Gao et al., 2023; Tang et al., 2022), graph condensation (Kreuzer et al., 2021; Liu et al., 2023), and graph contrastive learning (Bo et al., 2023a; Liu et al., 2022). Additionally, spectral GNNs (Wu et al., 2020) based on spectral filters are showing powerful ability in modeling graph data and attracting more attention. Specifically, existing research either (He et al., 2021b; Defferrard et al., 2016; He et al., 2022; Wang & Zhang, 2023) leverages various orthogonal polynomials to approximate arbitrary filters, or utilizes neural networks to parameterize the filters (Liao et al., 2019; Bo et al., 2023b). Although the potential of graph spectrum has been explored in various scenarios and tasks, the spectral domain in generalizable subgraph-FL has remained unexplored. Consequently, current methods suffer from optimization diverging on spectra and are trapped in suboptimal learning. Instead, our approach remarkably mitigates the challenge by targeted alignment on spectra.
57
+
58
+ Graph Signal Propagation: Graph signal propagation describes how node signals diffuse on graph structures. In the spatial domain, propagation occurs through explicit signal passing along edges. In the spectral domain, propagation is characterized by how signals distribute across different frequency components. Label Signal Disruption: As subgraphs experience edge loss, nodes lose critical label signals containing class knowledge from their formerly adjacent labeled neighbors. Consequently, it limits the ability of GNNs to capture class distinctions accurately, leading to poor semantic knowledge under label signal disruption. Spectral Client Drift: Inconsistencies in signal frequencies on graph spectra across subgraphs lead to spectral heterogeneity and diverging signal propagation schemes, causing spectral client drift and degrading the generalizability of the global model.
59
+
60
+ ![](images/1f0bf6cd9e04b00bbc9ecdccaa3d89dc7c2ea5369660b5bd494ae24f2fbbe734.jpg)
61
+ (a) Node Label Information Reinforcement
62
+ (b) Frequency-aware Graph Modeling Alignment
63
+ Figure 3. Framework Illustration. (a) Node Label Information Reinforcement (NLIR) leverages a structurally and semantically representative global prototype repository. It provides multidimensional semantic localization of nodes through similarity distribution and allows $L_{\mathbf{FKD}}$ to inject the semantic knowledge during training. (b) Frequency-aware Graph Modeling Alignment (FGMA) aligns local high and low spectral adjacency awareness with the global GNN for a generic signal propagation scheme, mitigating spectral drifts.
64
+
65
+ # 3. Problem Statement
66
+
67
+ Notation. Let the graph data be represented as $\mathcal{G} = (\mathcal{V},\mathcal{E})$ where $\mathcal{V}$ is the set of nodes with $|\mathcal{V}| = N$ vertices, and $\mathcal{E}\subseteq \mathcal{V}\times \mathcal{V}$ denotes the set of edges connecting these nodes. The adjacency matrix is represented by $\mathbf{A}\in \mathbb{R}^{N\times N}$ , where $\mathbf{A}_{uv} = 1$ indicates the presence of an edge $e_{uv}\in \mathcal{E}$ and $\mathbf{A}_{uv} = 0$ otherwise. Moreover, $\mathbf{X}$ the feature vector matrix of the graph $\mathcal{G}$ . The Laplacian matrix is given by $\mathbf{L} = \mathbf{D} - \mathbf{A}$ , where $\mathbf{D}$ is the degree matrix. The unitary matrix $\mathbf{U}$ is composed of the eigenvectors of $\mathbf{L}$ . To distinguish between local and global properties, we introduce the following notation: the symbol $i$ represents local properties or entities, whereas $g$ denotes global properties or entities.
68
+
69
+ Definition 3.1. Personalized PageRank (PPR): The PPR matrix quantifies the influence each node has on every other node within the graph and is defined as:
70
+
71
+ $$
72
+ P = \alpha (I - (1 - \alpha) D ^ {- 1} A) ^ {- 1}. \tag {1}
73
+ $$
74
+
75
+ Here, $\alpha \in (0,1)$ is the teleportation probability, representing the probability of the random walk restarting from the source node. A typical value is 0.15, which makes the continuation probability $(1 - \alpha) = 0.85$ . $I$ is the identity matrix, $A$ is the adjacency matrix of the graph, and $D$ is the degree matrix with $D_{ii}$ denoting the degree of node $i$ .
76
+
77
+ Definition 3.2. Structure Inertia Score (SIS): The SIS quantifies the cumulative influence of the training nodes on the entire graph and is defined as:
78
+
79
+ $$
80
+ S I S (P, t) = \sum_ {i = 1} ^ {n} \max _ {j} \left(P _ {i, j} \cdot t _ {j}\right). \tag {2}
81
+ $$
82
+
83
+ Here, $P$ is the PPR matrix, and $t \in \{0,1\}^n$ is a binary vector indicating the training nodes, where $t_j = 1$ if node $j$ is part of the training set, and $t_j = 0$ otherwise. The SIS aggregates the maximum personalized PageRank values from each node to any labeled node, effectively measuring the strongest influence each node in the graph receives from the training set. A higher SIS indicates greater structural inertia, suggesting that the labels have a significant influence over the network overall graph structure.
84
+
85
+ # 4. Methodology
86
+
87
+ # 4.1. Motivation
88
+
89
+ Signal propagation over graph structures fundamentally shapes the signal transmission paradigm of GNNs. Therefore, rather than focusing solely on challenges arising from static graph structures in subgraph-FL, it is crucial to consider the dynamics of signal propagation. Correspondingly,
90
+
91
+ we conduct our analysis from both the spatial and spectral domains from the perspective of the graph signal. Specifically, the spatial domain governs the explicit passing of signals between connected nodes, while the spectral domain captures signal diffusion across different frequencies. Accordingly, we empirically validate the presence of two major challenges from the spatial and spectral perspectives: label signal disruption and spectral client drift. These phenomena respectively pose challenges of poor semantic knowledge and spectral client drift, which severely constrain the potential of subgraph-FL collaboration.
92
+
93
+ Motivation of NLIR. Graph data is fragmented across clients in subgraph-FL, which inevitably disrupts semantic signals from labeled nodes across clients. Label signal disruption undermines key pathways for propagating semantic information. This results in biased local feature representations, which ultimately degrade the performance of GNNs. For validation, we investigate the relationship between the decrease in SIS and the client scale. Specifically, the SIS exhibits a downward trend as the client scale increases, with notably lower scores in the range emphasized by mainstream subgraph-FL studies, thereby highlighting the label signal disruption phenomenon. We aim to mitigate its negative impact by preserving valuable semantic knowledge across fragmented subgraphs. Correspondingly, we propose NLIR. By selecting nodes with both structural representativeness and rich semantic information for the construction of a global repository and injecting it during local training, NLIR reduces the information loss inherent in the subgraph scenarios. Subsequently, NLIR assesses the similarity distributions between node features and all representative prototypes for both local and global GNNs during local training, thereby enabling multidimensional semantic localization of nodes. By aligning the two similarity distributions, it effectively injects semantic knowledge and enhances feature modeling semantically.
94
+
95
+ Motivation of FGMA. We reveal the challenge of spectral client drift in subgraph-FL in Fig. 1, where GNNs across different clients capture frequency information inconsistently due to graph spectral heterogeneity. This further leads to overfitting local signal propagation frequencies, which brings spectral conflicts during collaboration and compromises the generalizability of the global GNN. To address spectral client drift, we propose the Frequency-aware Graph Modeling Alignment. Specifically, FGMA reconstructs the local graph spectra with the GNN adjacency awareness by calculating the node similarity matrix. Subsequently, by projecting feature representations separately onto high- and low-frequency components of the reconstructed spectra and aligning the local and global projections, FGMA promotes the learning of a generalizable spectral signal propagation paradigm across clients, thereby reducing frequency-based discrepancies during collaboration and mitigating spectral
96
+
97
+ client drift. Consequently, our strategy effectively enhances the global generalizability spectrally.
98
+
99
+ # 4.2. Node Label Information Reinforcement
100
+
101
+ First of all, we introduce the Structure-Aware Label Centrality (SALC) metric, denoted as $\Lambda_u^{\mathrm{SALC}}$ for node $u$ . It is defined as the combination of the label influence centrality $\Lambda_u^l$ and the structural prominence score $\Lambda_u^s$ :
102
+
103
+ $$
104
+ \Lambda_ {u} ^ {\mathrm {S A L C}} = \Lambda_ {u} ^ {s} + \Lambda_ {u} ^ {l}, \tag {3}
105
+ $$
106
+
107
+ where $\Lambda_u^s$ assesses the structural representativeness of node $u$ , while $\Lambda_u^l$ quantifies the influence propagation of labels.
108
+
109
+ $$
110
+ \Lambda_ {u} ^ {s} = \max \left(\tilde {P} _ {u, v} \cdot \tau_ {v}\right), \quad \Lambda_ {u} ^ {l} = \sum_ {v \in \mathcal {V} _ {L}} \tilde {P} _ {v, u} ^ {(L)}, \tag {4}
111
+ $$
112
+
113
+ where $\tilde{P}_{u,v}$ is the $(u,v)$ -th element of the standard PPR matrix $\tilde{\mathbf{P}}$ , and $\tau_v$ represents the prior importance score of node $v$ , typically initialized to 1 for all nodes. The structural prominence score captures the maximum influence exerted by any node on node $u$ , weighted by its importance. As clarified, the PPR matrix used for computing label influence centrality is denoted as $\tilde{\mathbf{P}}^{(L)}$ , and defined as:
114
+
115
+ $$
116
+ \tilde {\mathbf {P}} ^ {(L)} = \alpha (\mathbf {I} - (1 - \alpha) \mathbf {D} ^ {- 1} \mathbf {A} ^ {\prime}) ^ {- 1}. \tag {5}
117
+ $$
118
+
119
+ Here, $\mathcal{V}_L$ denotes the set of labeled nodes, and $\tilde{P}_{v,u}^{(L)}$ represents the influence of node $v$ on node $u$ as captured by $\tilde{\mathbf{P}}^{(L)}$ . To accurately capture the influence of labeled nodes, the inclusion of self-loops in $\mathbf{A}'$ ensures that each labeled node's own label contributes to its $\Lambda_u^l$ . Compared to the intuitive approach of directly selecting labeled nodes, the SALC metric $\Lambda_{u}^{\mathrm{SALC}}$ considers both structural representativeness of the nodes and diffusion of label signals, thus avoiding biases caused by isolated labeled nodes. It is also capable of selecting unlabeled nodes that still possess rich label signals and structural advantages. This improves knowledge quality, enriches the repository, and mitigates the label signal disruption problem. After computing the SALC scores, we rank the nodes based on their $\Lambda_u^{\mathrm{SALC}}$ values and select the top $K$ nodes, where the default value of $K$ is $1/3$ of the total number of nodes. Subsequently, for each class $c$ , the local prototype $\mathbf{H}_c^i$ at each client is computed as the mean feature vector of the selected nodes belonging to class $c$ :
120
+
121
+ $$
122
+ \mathbf {H} _ {c} ^ {i} = \frac {1}{| \mathcal {V} _ {c} ^ {i} |} \sum_ {u \in \mathcal {V} _ {c} ^ {i}} \mathbf {h} _ {u} ^ {i}, \tag {6}
123
+ $$
124
+
125
+ where $\mathcal{V}_c^i$ represents the set of selected nodes categorized as class $c$ on client $i$ , and $\mathbf{h}_u^i$ is the feature vector of node $u$ on client $i$ . Once the local prototypes are computed, clients upload their prototypes to the server along with the node count. For each class $c$ , the server aggregates the
126
+
127
+ prototypes from $\alpha$ percent of the clients by weighting each local prototype according to its sample size. Four global anchor prototypes are constructed for each class. Each global prototype $\mathbf{H}_c^{g,k}$ is computed as:
128
+
129
+ $$
130
+ \mathbf {H} _ {c} ^ {g, k} = \frac {1}{\sum_ {i \in \mathcal {N} _ {c} ^ {k}} | \mathcal {V} _ {c} ^ {i} |} \sum_ {i \in \mathcal {N} _ {c} ^ {k}} | \mathcal {V} _ {c} ^ {i} | \mathbf {H} _ {c} ^ {i}, \quad \mathcal {H} = \left[ \begin{array}{c} \mathbf {H} _ {1} ^ {g, 1} \\ \mathbf {H} _ {1} ^ {g, 2} \\ \vdots \\ \mathbf {H} _ {C} ^ {g, 4} \end{array} \right], (7)
131
+ $$
132
+
133
+ where $\mathbf{H}_c^{g,k}$ represents the $k$ -th global prototype for class $c$ , $\mathcal{N}_c^k$ is the set of clients randomly selected to contribute to the $k$ -th global prototype for class $c$ , and $C$ is the number of classes. The global repository $\mathcal{H}$ contains all the global prototypes and will be broadcast back to clients. After the global knowledge repository is constructed, it is distributed to the local clients along with the model parameters. The global features $\mathbf{h}_u^g$ used in the following loss formulation refer to the frozen inference features extracted locally using the distributed global model. To regulate local training, we propose a federated knowledge distillation loss function aimed at harmonizing the semantic feature localization of the local GNN with its global counterpart, namely by aligning their similarity distributions for the representative prototypes stored in the global repository:
134
+
135
+ $$
136
+ \mathcal {L} _ {\mathrm {F K D}} = \frac {1}{| \mathcal {V} _ {i} |} \sum_ {u \in \mathcal {V} _ {i}} \operatorname {K L} \left(\sigma \left(\varphi \left(\mathbf {h} _ {u} ^ {i}, \mathcal {H}\right)\right), \sigma \left(\varphi \left(\mathbf {h} _ {u} ^ {g}, \mathcal {H}\right)\right)\right), \tag {8}
137
+ $$
138
+
139
+ where $\mathrm{KL}(\cdot ,\cdot)$ represents the Kullback-Leibler divergence, and $\sigma (\cdot)$ is the softmax function applied to similarity scores computed by the function $\varphi (\mathbf{h},\mathcal{H})$ , which returns a vector of cosine similarities between the feature and all prototypes.
140
+
141
+ # 4.3. Frequency-aware Graph Modeling Alignment
142
+
143
+ To emphasize the GNN spectral adjacency awareness and more accurately capture similarities between nodes, we leverage the feature matrix $\mathbf{h}$ to compute node similarity matrices. In the construction of the following similarity matrix, $\mathbf{h}$ denotes operations applied to both $\mathbf{h}^i$ and $\mathbf{h}^g$ . Specifically, for each node $u$ , we identify its $k_{\mathrm{sim}}$ most similar neighbors based on the cosine similarity of their feature vectors $\mathbf{h}_u$ . We then construct a sparse self-similarity matrix $\mathbf{S}'$ as:
144
+
145
+ $$
146
+ \mathbf {S} _ {u, v} ^ {\prime} = \left\{ \begin{array}{l l} \frac {\mathbf {h} _ {u} \cdot \mathbf {h} _ {v}}{\| \mathbf {h} _ {u} \| _ {2} \| \mathbf {h} _ {v} \| _ {2}} & v \text {a m o n g t h e t o p} k _ {\mathrm {s i m}} \\ 0 & \text {o t h e r w i s e} \end{array} . \right. \tag {9}
147
+ $$
148
+
149
+ Subsequently, we calculate the graph laplacian matrix $\mathbf{L}'$ based on this sparse similarity matrix $\mathbf{S}'$ as:
150
+
151
+ $$
152
+ \mathbf {L} ^ {\prime} = \mathbf {D} ^ {\prime} - \mathbf {S} ^ {\prime}, \tag {10}
153
+ $$
154
+
155
+ where $\mathbf{D}'$ is the diagonal degree matrix of $\mathbf{S}'$ . Moreover, we perform eigendecomposition on the laplacians $\mathbf{L}^{\prime i}$ and $\mathbf{L}^{\prime g}$ .
156
+
157
+ For $\mathbf{L}^{\prime i}$ , let $\{\mathbf{u}_m^{\mathrm{low},i}\}_{m = 1}^{k_{\mathrm{eig}}}$ be the eigenvectors corresponding to the smallest eigenvalues, which represents low-frequency. While $\{\mathbf{u}_m^{\mathrm{high},i}\}_{m = 1}^{k_{\mathrm{eig}}}$ denotes the largest eigenvalues, which represents high-frequency. Similarly, for $\mathbf{L}^{\prime g}$ , we obtain $\{\mathbf{u}_m^{\mathrm{low},g}\}_{m = 1}^{k_{\mathrm{eig}}}$ and $\{\mathbf{u}_m^{\mathrm{high},g}\}_{m = 1}^{k_{\mathrm{eig}}}$ . The feature matrix $\mathbf{h}$ is then projected onto each of these eigenvectors. For instance:
158
+
159
+ $$
160
+ \mathbf {Z} _ {m} ^ {\text {l o w}} = \left(\mathbf {u} _ {m} ^ {\text {l o w}} \mathbf {u} _ {m} ^ {\text {l o w} T}\right) \mathbf {h}, \quad \mathbf {Z} _ {m} ^ {\text {h i g h}} = \left(\mathbf {u} _ {m} ^ {\text {h i g h}} \mathbf {u} _ {m} ^ {\text {h i g h} T}\right) \mathbf {h}. \tag {11}
161
+ $$
162
+
163
+ Applying these projections for each $m \in \{1, \dots, k_{\mathrm{eig}}\}$ , we obtain several sets of projected feature matrices used in the loss computation. Specifically, local features $\mathbf{h}^i$ are projected onto low/high-frequency eigenvectors of the local graph, yielding $\mathbf{Z}_m^{i,\mathrm{low}}$ and $\mathbf{Z}_m^{i,\mathrm{high}}$ , respectively. Similarly, frozen global inference features $\mathbf{h}^g$ are projected onto corresponding eigenvectors from $\mathbf{L}^{\prime g}$ , yielding $\mathbf{Z}_m^{g,\mathrm{low}}$ and $\mathbf{Z}_m^{g,\mathrm{high}}$ . Consequently, loss $\mathcal{L}_{\mathrm{FGMA}}$ is then defined as the sum of MSE over all eigenvector-projected pairs:
164
+
165
+ $$
166
+ \mathcal {L} _ {\mathrm {F G M A}} = \sum_ {m = 1} ^ {k _ {\text {e i g}}} \left(\operatorname {M S E} \left(\mathbf {Z} _ {m} ^ {i, \text {l o w}}, \mathbf {Z} _ {m} ^ {g, \text {l o w}}\right) + \operatorname {M S E} \left(\mathbf {Z} _ {m} ^ {i, \text {h i g h}}, \mathbf {Z} _ {m} ^ {g, \text {h i g h}}\right)\right). \tag {12}
167
+ $$
168
+
169
+ This loss addresses spectral heterogeneity by aligning client and global signal characteristics in both spectral domains. Combining strategies Node Label Information Reinforcement Frequency-aware Graph Modeling Alignment, our framework $S^2$ FGL reinforces semantic knowledge during local modeling and mitigates spectral client drift. Ultimately, the loss for local training is:
170
+
171
+ $$
172
+ \mathcal {L} = \mathcal {L} _ {\mathrm {C E}} + \lambda_ {1} \mathcal {L} _ {\mathrm {F K D}} + \lambda_ {2} \mathcal {L} _ {\mathrm {F G M A}}, \tag {13}
173
+ $$
174
+
175
+ where $\mathcal{L}_{\mathrm{CE}}$ denotes the standard cross-entropy loss for node classification, while $\lambda_{1}$ and $\lambda_{2}$ are balancing hyperparameters for the proposed methods NLIR and FGMA.
176
+
177
+ # 5. Experiments
178
+
179
+ # 5.1. Experimental Setup
180
+
181
+ Datasets. We conducted experiments on various datasets to validate the superiority of our framework $S^2$ FGL. The homophilic graph datasets include Cora, CiteSeer, and Pubmed, while the heterophilic graph datasets comprise Texas, Wisconsin, and Minesweeper. The following provides a description of each dataset. Cora (McCallum et al., 2000) dataset consists of 2708 scientific publications classified into one of seven classes. There are 5429 edges in the network of citations. 1433 distinct words make up the dictionary. CiteSeer (Giles et al., 1998) dataset consists of 3312 scientific publications classified into one of six classes and 4732 edges. The dictionary contains 3703 unique words. Pubmed (Sen et al., 2008) dataset consists of 19717 scientific papers on diabetes that have been categorized into one of three categories in the PubMed database. The citation network has 44338 edges.
182
+
183
+ Table 1. Performance Comparison with the state-of-the-art methods on homophilic and heterophilic graph datasets. We report the node classification accuracies with the performance improvement over FedAvg. The best results are highlighted in bold.
184
+
185
+ <table><tr><td>Methods</td><td>Cora</td><td>CiteSeer</td><td>PubMed</td><td>Texas</td><td>Wisconsin</td><td>Minesweeper</td></tr><tr><td>FedAvg [ASTAT17]</td><td>81.9 ± 0.7</td><td>74.3 ± 0.4</td><td>87.3 ± 0.3</td><td>72.8 ± 2.2</td><td>77.6 ± 2.7</td><td>79.6 ± 0.1</td></tr><tr><td>FedProx [arXiv18]</td><td>82.1 ± 0.5 ↑0.2</td><td>74.4 ± 0.3 ↑0.1</td><td>87.9 ± 0.4 ↑0.6</td><td>73.5 ± 3.7 ↑0.7</td><td>77.3 ± 3.4 ↓0.3</td><td>79.7 ± 0.1 ↑0.1</td></tr><tr><td>FedNova [NeurIPS20]</td><td>81.6 ± 1.2 ↓0.3</td><td>74.4 ± 0.4 ↑0.1</td><td>88.2 ± 0.5 ↑0.9</td><td>73.0 ± 4.4 ↑0.2</td><td>77.4 ± 4.2 ↓0.2</td><td>79.9 ± 0.4 ↑0.3</td></tr><tr><td>FedFa [ICLR23]</td><td>82.7 ± 0.5 ↑0.8</td><td>74.9 ± 0.6 ↑0.6</td><td>87.8 ± 0.5 ↑0.5</td><td>73.9 ± 3.6 ↑1.1</td><td>78.1 ± 4.6 ↑0.5</td><td>80.1 ± 0.3 ↑0.5</td></tr><tr><td>FedSage+ [NeurIPS19]</td><td>82.3 ± 0.7 ↑0.4</td><td>75.2 ± 0.3 ↑0.9</td><td>88.2 ± 0.7 ↑0.9</td><td>73.7 ± 4.0 ↑0.9</td><td>79.0 ± 3.3 ↑1.4</td><td>79.9 ± 0.2 ↑0.3</td></tr><tr><td>FedStar [AAAI23]</td><td>82.6 ± 0.5 ↑0.7</td><td>74.5 ± 0.3 ↑0.2</td><td>88.1 ± 0.6 ↑0.8</td><td>74.3 ± 2.7 ↑1.5</td><td>78.3 ± 4.7 ↑0.7</td><td>79.8 ± 0.1 ↑0.2</td></tr><tr><td>FedPub [ICML23]</td><td>82.3 ± 0.8 ↑0.4</td><td>74.8 ± 0.7 ↑0.5</td><td>88.0 ± 0.4 ↑0.7</td><td>73.4 ± 3.5 ↑0.6</td><td>77.8 ± 3.1 ↑0.2</td><td>79.9 ± 0.2 ↑0.3</td></tr><tr><td>FGSSL [IJCAI23]</td><td>82.6 ± 0.4 ↑0.7</td><td>74.9 ± 0.2 ↑0.6</td><td>87.6 ± 0.7 ↑0.3</td><td>73.6 ± 4.6 ↑0.8</td><td>77.8 ± 3.8 ↑0.2</td><td>79.9 ± 0.2 ↑0.3</td></tr><tr><td>FedGTA [VLDB24]</td><td>82.4 ± 0.8 ↑0.5</td><td>75.1 ± 0.5 ↑0.8</td><td>87.7 ± 0.9 ↑0.4</td><td>72.6 ± 4.2 ↓0.2</td><td>77.8 ± 4.1 ↑0.2</td><td>80.2 ± 0.3 ↑0.6</td></tr><tr><td>FGGP [AAAI24]</td><td>82.5 ± 0.4 ↑0.6</td><td>74.7 ± 0.5 ↑0.4</td><td>87.5 ± 0.4 ↑0.2</td><td>73.6 ± 2.8 ↑0.8</td><td>78.2 ± 3.4 ↑0.6</td><td>80.4 ± 0.3 ↑0.8</td></tr><tr><td>S2FGL (ours)</td><td>83.4 ± 0.2 ↑1.5</td><td>76.0 ± 0.3 ↑1.7</td><td>88.6 ± 0.2 ↑1.3</td><td>74.8 ± 2.3 ↑2.0</td><td>79.0 ± 1.0 ↑1.4</td><td>80.5 ± 0.1 ↑0.9</td></tr></table>
186
+
187
+ Texas and Wisconsin datasets are subsets of the WebKB dataset (Craven et al., 1998). The WebKB dataset was introduced in 1998, comprising web pages from the computer science departments of various universities, including the University of Texas and the University of Wisconsin. The dataset is commonly used for tasks such as webpage classification and link prediction, serving as a benchmark for evaluating machine learning models in graph-based learning scenarios. Minesweeper (Baranovskiy et al., 2023) dataset is a synthetic graph dataset inspired by the Minesweeper game. In this dataset, the graph is structured as a regular $100 \times 100$ grid, where each node represents a cell connected to its neighboring nodes, except for edge nodes, which have fewer neighbors. The primary task is to predict which nodes contain mines. This dataset is commonly used to evaluate the performance of GNNs under heterophily.
188
+
189
+ Evaluation Metric. Following mainstream FGL research experimental practices, we utilize the accuracy of the node classification task as the evaluation metric.
190
+
191
+ Baselines. We compare $S^2$ FGL with several state-of-the-art approaches, including traditional federated learning methods such as FedAvg (McMahan et al., 2017), FedProx (Li et al., 2020), FedNova (Wang et al., 2020), and FedFa (Zhou & Konukoglu, 2023); federated graph learning approaches including FGSSL (Huang et al., 2023a) and FGGP (Wan et al., 2024a); as well as personalized federated graph learning methods such as FedSage+ (Zhang et al., 2021b), FedStar (Tan et al., 2023), FedPub (Baek et al., 2023), and FedGTA (Li et al., 2024). This comprehensive set of baseline methods spans various FL and FGL paradigms, allowing us to evaluate the performance and advantages of our proposed $S^2$ FGL across diverse scenarios.
192
+
193
+ Implement Details. Following prevalent methodologies in FGL research, we employ the Louvain community detection
194
+
195
+ algorithm to partition the graph into subgraphs assigned to different clients. For each dataset, we divide the nodes into training, validation, and testing sets with ratios of $60\%$ , $20\%$ , and $20\%$ , respectively. Additionally, we simulate various collaborative scenarios by configuring the number of clients to 10 for Cora, CiteSeer, Pubmed, and Minesweeper datasets, and 3 for the Texas and Wisconsin datasets. The primary evaluation metric is the node classification accuracy on the clients' test sets. We conduct each experiment five times and report the average accuracy from the last five communication epochs as the final performance. We conduct experiments with the ACM-GCN (Luan et al., 2022), which achieves a strong ability on both homophilic and heterophilic graph datasets.
196
+
197
+ # 5.2. Experiment Results
198
+
199
+ In this section, we comprehensively evaluate the proposed $S^2$ FGL by addressing the following questions:
200
+
201
+ - Q1: How does $S^2$ FGL perform compared to existing FL and FGL methods in subgraph-FL?
202
+ - Q2: What is the impact of each component of $S^2$ FGL on the overall performance?
203
+ Q3: Does $S^2$ FGL maintain consistent performance across different hyperparameter and client scales?
204
+ Q4: Do NLIR and FGMA mitigate the effects of label signal disruption and spectral heterogeneity?
205
+
206
+ # Q1: How does $S^2$ FGL perform compared to existing FL and FGL methods in subgraph-FL?
207
+
208
+ We present the results of node classification tasks across various FGL scenarios using multiple graph datasets, and
209
+
210
+ we summarize the final average test accuracy in Tab. 1. It demonstrates that our proposed $S^2$ FGL consistently outperforms all baseline approaches across all six datasets. This superiority highlights the effectiveness of $S^2$ FGL.
211
+
212
+ # Q2: What is the impact of each component of $S^2$ FGL on the overall performance?
213
+
214
+ To evaluate the individual contributions of NLIR and FGMA strategies within the $S^2$ FGL framework, we conducted ablation experiments on the Cora and Citeseer datasets. In this study, we removed each component to assess its impact on the overall performance. The results are presented in Tab. 2, which demonstrate that both NLIR and FGMA independently contribute to the overall performance.
215
+
216
+ <table><tr><td rowspan="2">NLIR</td><td rowspan="2">FGMA</td><td colspan="2">Dataset</td></tr><tr><td>Cora</td><td>CiteSeer</td></tr><tr><td>X</td><td>X</td><td>81.9 ± 0.7</td><td>74.3 ± 0.4</td></tr><tr><td>✓</td><td>X</td><td>83.2 ± 0.4</td><td>75.6 ± 0.3</td></tr><tr><td>X</td><td>✓</td><td>82.6 ± 0.3</td><td>75.0 ± 0.2</td></tr><tr><td>✓</td><td>✓</td><td>83.4 ± 0.2</td><td>76.0 ± 0.3</td></tr></table>
217
+
218
+ Table 2. Ablation study on key components of ${S}^{2}\mathrm{{FGL}}$ .
219
+
220
+ # Q3: Does $S^2$ FGL maintain consistent performance across different hyperparameter and client scales?
221
+
222
+ We evaluated the stability and adaptability of our proposed framework $S^2$ FGL under varying hyperparameter configurations of and different client scales.
223
+
224
+ Varying Hyperparameters of NLIR and FGMA. For NLIR, we test hyperparameter sets of 100, 50, 10, and 1. For FGMA, the settings are 0.01, 0.05, 0.5, and 1. The results in Fig. 4 indicate that our method maintains consistent performance across varying hyperparameter configurations.
225
+
226
+ ![](images/cefc86a487a1a05bcc61a866ed8c05011f0d935cd119acc879e56c48b530478e.jpg)
227
+ (a) Cora
228
+
229
+ ![](images/44f0030259e2c6c587bf7d718b7b3a3ee4700cdaec5142d58a1b240cb85de575.jpg)
230
+ (b) Citeseer
231
+
232
+ Varying Client Scales. We assessed performance with different client scales: 5, 10 and 20. Specifically, we compared $S^2$ FGL with other FL and FGL baselines, including FedAvg, FedProx, and FGSSL. The results in Fig. 5 demonstrate that $S^2$ FGL consistently delivers reliable results regardless of the client scales. Overall, $S^2$ FGL exhibits strong stability
233
+
234
+ ![](images/b6677c11f49c4c9485bcd4f20eb070645e2f53f978e11dd9f3f8c2399471a9be.jpg)
235
+ (a) Cora
236
+
237
+ ![](images/0df512c6531d93e0b73f2f6f0cbde12fe38d44e4580b49c3054fe4641f118708.jpg)
238
+ (b) Citeseer
239
+ Figure 5. Analysis of performance under different client scales.
240
+
241
+ and adaptability across varying hyperparameter settings and client partition configurations on both the Cora and Cite-seer datasets. These findings confirm that $S^2$ FGL not only sustains its effectiveness under diverse conditions but also adapts seamlessly to varying client scales, demonstrating its suitability for real-world subgraph-FL scenarios.
242
+
243
+ # Q4: Do NLIR and FGMA mitigate the effects of label signal disruption and spectral heterogeneity?
244
+
245
+ In Fig. 1, our experiments demonstrate that the SIS score in subgraph scenarios declines compared to centralized training, while spectral heterogeneity exists among clients. Here, we further verify the targeted effectiveness of NILR and FGMA with respect to these two issues, respectively. First, in Fig. 6 (a), we investigate the relationship between the performance gain brought by NILR to FedAvg and the change in the SIS score. The results show that this method achieves higher performance when semantic signals are more limited, thereby confirming its effectiveness and targeted nature. Second, in Fig. 6 (b), we examine the relationship between the performance improvement of FGMA for FedAvg and spectral heterogeneity, measured by the average KL divergence between the eigenvalue distributions of different clients. Experimental results show that greater spectral heterogeneity corresponds to larger performance gains, confirming the effectiveness of our method. Specifically, green indicates the performance gain of the proposed method relative to FedAvg, blue denotes variations in SIS, and orange corresponds to spectral heterogeneity.
246
+
247
+ ![](images/6f26bd088a5d35580ec7b4f313b2fa7617944e8722361a1afdab281e0dd81e75.jpg)
248
+ Figure 4. Analysis of the performance growth between $S^2$ FGL and FedAvg under different hyperparameters of NLIR and FGMA
249
+ (a) NILR
250
+
251
+ ![](images/23e167e760ad9d618d4cbf7f540046aec3a6edb377d26ca0543ac5da883bfbca.jpg)
252
+ (b) FGMA
253
+ Figure 6. Analysis of the targeted effectiveness of NILR and FGMA. (a) The performance gain from NILR increases as the semantic signal becomes limited. (b) The performance improvement from FGMA grows with higher spectral heterogeneity.
254
+
255
+ # 6. Conclusion
256
+
257
+ In this paper, we identify and empirically demonstrate two phenomena in subgraph-FL from both spatial and spectral perspectives of graph signal propagation: label signal disruption and spectral heterogeneity. These phenomena pose challenges of poor semantic knowledge and spectral client drift. To address these challenges, we propose two key strategies: NLIR and FGMA. NLIR selects structurally and semantically representative nodes and constructs a global repository accordingly. By injecting semantic information from the repository into local training, it alleviates the poor semantic knowledge caused by label signal disruption. In addition, FGMA aligns and feature projections in both the high- and low-frequency reconstructed graph spectra, thereby promoting a generic signal propagation paradigm and mitigating client drifts under spectral heterogeneity. By integrating these strategies, $S^2$ FGL effectively tackles both spatial and spectral challenges in subgraph-FL. Extensive experiments on multiple datasets demonstrate that $S^2$ FGL significantly enhances global generalizability.
258
+
259
+ # Acknowledgement
260
+
261
+ This work is supported by the National Key Research and Development Program of China (2024YFC3308400), and National Natural Science Foundation of China under Grant (62361166629, 62176188, 62225113, 623B2080), the Wuhan University Undergraduate Innovation Research Fund Project. The supercomputing system at the Supercomputing Center of Wuhan University supported the numerical calculations in this paper.
262
+
263
+ # Impact Statement
264
+
265
+ This paper presents work whose goal is to advance the field of Machine Learning. There are many potential societal consequences of our work, none of which we feel must be specifically highlighted here.
266
+
267
+ # References
268
+
269
+ Acar, D. A. E., Zhao, Y., Matas, R., Mattina, M., Whatmough, P., and Saligrama, V. Federated learning based on dynamic regularization. In ICLR, 2021.
270
+ Baek, J., Jeong, W., Jin, J., Yoon, J., and Hwang, S. J. Personalized subgraph federated learning. In ICML, pp. 1396-1415, 2023.
271
+ Baranovskiy, D., Oseledets, I., and Babenko, A. A critical look at the evaluation of gnns under heterophily: Are we really making progress? arXiv preprint arXiv:2302.11640, 2023.
272
+ Bo, D., Fang, Y., Liu, Y., and Shi, C. Graph contrastive learn
273
+
274
+ ing with stable and scalable spectral encoding. NeurIPS, 36:45516-45532, 2023a.
275
+ Bo, D., Shi, C., Wang, L., and Liao, R. Specformer: Spectral graph neural networks meet transformers. arXiv preprint arXiv:2303.01028, 2023b.
276
+ Chen, H.-Y. and Chao, W.-L. On bridging generic and personalized federated learning for image classification. In ICLR, 2022.
277
+ Chen, M., Zhang, W., Yuan, Z., Jia, Y., and Chen, H. Fede: Embedding knowledge graphs in federated setting. In IJCKG, pp. 80-88, 2021.
278
+ Chen, Y., Huang, W., and Ye, M. Fair federated learning under domain skew with local consistency and domain diversity. In CVPR, pp. 12077-12086, 2024.
279
+ Craven, M., DiPasquo, D., Freitag, D., McCallum, A., Mitchell, T., Nigam, K., and Slattery, S. Learning to extract symbolic knowledge from the world wide web. AAAI/IAAI, pp. 2, 1998.
280
+ Defferrard, M., Bresson, X., and Vandergheynst, P. Convolutional neural networks on graphs with fast localized spectral filtering. In NeurIPS, 2016.
281
+ Ezzeldin, Y. H., Yan, S., He, C., Ferrara, E., and Avestimehr, A. S. Fairfed: Enabling group fairness in federated learning. In AAAI, 2023.
282
+ Fan, W., Ma, Y., Li, Q., Wang, J., Cai, G., Tang, J., and Yin, D. A graph neural network framework for social recommendations. TKDE, 2020.
283
+ Fang, X. and Ye, M. Robust federated learning with noisy and heterogeneous clients. In CVPR, pp. 10072-10081, 2022.
284
+ Fang, X., Easwaran, A., Genest, B., and Suganthan, P. N. Adaptive hierarchical graph cut for multi-granularity out-of-distribution detection. IEEE TAI, 2025.
285
+ Fu, X., Zhang, B., Dong, Y., Chen, C., and Li, J. Federated graph machine learning: A survey of concepts, techniques, and applications. arXiv preprint arXiv:2207.11812, 2022.
286
+ Gao, Y., Wang, X., He, X., Liu, Z., Feng, H., and Zhang, Y. Addressing heterophily in graph anomaly detection: A perspective of graph spectrum. In Proceedings of the ACM Web Conference 2023, pp. 1528-1538, 2023.
287
+ Giles, C. L., Bollacker, K. D., and Lawrence, S. Citeseer: An automatic citation indexing system. In Proceedings of the third ACM conference on Digital libraries, pp. 89-98, 1998.
288
+
289
+ Han, H., Liu, X., Ma, L., Torkamani, M., Liu, H., Tang, J., and Yamada, M. Structural fairness-aware active learning for graph neural networks. In ICLR, 2023.
290
+ He, C., Balasubramanian, K., Ceyani, E., Yang, C., Xie, H., Sun, L., He, L., Yang, L., Yu, P. S., Rong, Y., et al. Fedgraphnn: A federated learning system and benchmark for graph neural networks. In ICLR, 2021a.
291
+ He, M., Wei, Z., Xu, H., et al. Bernnet: Learning arbitrary graph spectral filters via bernstein approximation. In NeurIPS, pp. 14239-14251, 2021b.
292
+ He, M., Wei, Z., and Wen, J.-R. Convolutional neural networks on graphs with chebyshev approximation, revisited. In NeurIPS, pp. 7264-7276, 2022.
293
+ Hong, J., Wang, H., Wang, Z., and Zhou, J. Federated robustness propagation: sharing adversarial robustness in heterogeneous federated learning. In AAAI, pp. 7893-7901, 2023.
294
+ Hu, M., Yue, Z., Xie, X., Chen, C., Huang, Y., Wei, X., Lian, X., Liu, Y., and Chen, M. Is aggregation the only choice? federated learning via layer-wise model recombination. In SIGKDD, pp. 1096-1107, 2024.
295
+ Huang, W., Ye, M., and Du, B. Learn from others and be yourself in heterogeneous federated learning. In CVPR, pp. 10143-10153, 2022.
296
+ Huang, W., Wan, G., Ye, M., and Du, B. Federated graph semantic and structural learning. In Proceedings of the Thirty-Second International Joint Conference on Artificial Intelligence, pp. 3830-3838, 2023a.
297
+ Huang, W., Ye, M., Shi, Z., and Du, B. Generalizable heterogeneous federated cross-correlation and instance similarity learning. TPAMI, pp. 712-728, 2023b.
298
+ Huang, W., Ye, M., Shi, Z., Li, H., and Du, B. Rethinking federated learning with domain shift: A prototype view. In CVPR, pp. 16312-16322. IEEE, 2023c.
299
+ Huang, W., Ye, M., Shi, Z., Wan, G., Li, H., Du, B., and Yang, Q. A federated learning for generalization, robustness, fairness: A survey and benchmark. TPAMI, 2024.
300
+ Karimireddy, S. P., Kale, S., Mohri, M., Reddi, S. J., Stich, S. U., and Suresh, A. T. Scaffold: Stochastic controlled averaging for on-device federated learning. In ICML, pp. 5132-5143, 2020.
301
+ Kreuzer, D., Beaini, D., Hamilton, W., Létourneau, V., and Tossou, P. Rethinking graph transformers with spectral attention. In *NeruIPS*, pp. 21618-21629, 2021.
302
+
303
+ Lee, G., Jeong, M., Shin, Y., Bae, S., and Yun, S.-Y. Preservation of the global knowledge by not-true distillation in federated learning. In Koyejo, S., Mohamed, S., Agarwal, A., Belgrave, D., Cho, K., and Oh, A. (eds.), NeurIPS, pp. 38461-38474, 2022.
304
+ Li, T., Sahu, A. K., Zaheer, M., Sanjabi, M., Talwalkar, A., and Smith, V. Federated optimization in heterogeneous networks. MLSys, 2:429-450, 2020.
305
+ Li, X., Wu, Z., Zhang, W., Zhu, Y., Li, R.-H., and Wang, G. Fedgta: Topology-aware averaging for federated graph learning. arXiv preprint arXiv:2401.11755, 2024.
306
+ Li, X.-C., Zhan, D.-C., Shao, Y., Li, B., and Song, S. Fedphp: Federated personalization with inherited private models. In ECML, pp. 587-602, 2021.
307
+ Liao, R., Zhao, Z., Urtasun, R., and Zemel, R. S. Lanczos-net: Multi-scale deep graph convolutional networks. In ICLR, 2019.
308
+ Liu, N., Wang, X., Bo, D., Shi, C., and Pei, J. Revisiting graph contrastive learning from the perspective of graph spectrum. In NeurIPS, pp. 2972-2983, 2022.
309
+ Liu, R. and Yu, H. Federated graph neural networks: Overview, techniques and challenges. arXiv preprint arXiv:2202.07256, 2022.
310
+ Liu, Y., Bo, D., and Shi, C. Graph condensation via eigenbasis matching. arXiv preprint arXiv:2310.09202, 2023.
311
+ Liu, Z., Wan, G., Prakash, B. A., Lau, M. S., and Jin, W. A review of graph neural networks in epidemic modeling. arXiv preprint arXiv:2403.19852, 2024.
312
+ Luan, S., Hua, C., Lu, Q., Zhu, J., Zhao, M., Zhang, S., Chang, X.-W., and Precup, D. Revisiting heterophily for graph neural networks. In NeurIPS22, pp. 1362-1375, 2022.
313
+ Lv, F., Shang, X., Zhou, Y., Zhang, Y., Li, M., and Lu, Y. Personalized federated learning on heterogeneous and long-tailed data via expert collaborative learning. arXiv preprint arXiv:2408.02019, 2024.
314
+ McCallum, A. K., Nigam, K., Rennie, J., and Seymour, K. Automating the construction of internet portals with machine learning. Information Retrieval, 3(2):127-163, 2000.
315
+ McMahan, B., Moore, E., Ramage, D., Hampson, S., and y Arcas, B. A. Communication-efficient learning of deep networks from decentralized data. In AISTATS, pp. 1273-1282, 2017.
316
+
317
+ Ray Chaudhury, B., Li, L., Kang, M., Li, B., and Mehta, R. Fairness in federated learning via core-stability. In NeurIPS, pp. 5738-5750, 2022.
318
+ Sen, P., Namata, G., Bilgic, M., Getoor, L., Galligher, B., and Eliassi-Rad, T. Collective classification in network data. AI magazine, 29(3):93-93, 2008.
319
+ Shang, X., Lu, Y., Huang, G., and Wang, H. Federated learning on heterogeneous and long-tailed data via classifier re-training with federated features. In *IJCAI*, 2022.
320
+ Smith, V., Chiang, C.-K., Sanjabi, M., and Talwalkar, A. S. Federated multi-task learning. In NeurIPS, 2017.
321
+ Tan, Y., Liu, Y., Long, G., Jiang, J., Lu, Q., and Zhang, C. Federated learning on non-iid graphs via structural knowledge sharing. In AAAI, pp. 9953-9961, 2023.
322
+ Tan, Z., Wan, G., Huang, W., and Ye, M. Fedssp: Federated graph learning with spectral knowledge and personalized preference. In NeurIPS, pp. 34561-34581, 2024.
323
+ Tan, Z., Wan, G., Huang, W., Li, H., Zhang, G., Yang, C., and Ye, M. Fedspa: Generalizable federated graph learning under homophily heterogeneity. In CVPR, pp. 15464-15475, 2025.
324
+ Tang, J., Li, J., Gao, Z., and Li, J. Rethinking graph neural networks for anomaly detection. In ICML, pp. 21076-21089, 2022.
325
+ Wan, G., Huang, W., and Ye, M. Federated graph learning under domain shift with generalizable prototypes. In AAAI, pp. 15429-15437, 2024a.
326
+ Wan, G., Tian, Y., Huang, W., Chawla, N. V., and Ye, M. S3gcl: Spectral, swift, spatial graph contrastive learning. In ICML, pp. 49973-49990, 2024b.
327
+ Wan, G., Huang, Z., Zhao, W., Luo, X., Sun, Y., and Wang, W. Rethink graphode generalization within coupled dynamical system. In ICML, 2025a.
328
+ Wan, G., Shi, Z., Huang, W., Zhang, G., Tao, D., and Ye, M. Energy-based backdoor defense against federated graph learning. In ICLR, 2025b.
329
+ Wang, D., Lin, J., Cui, P., Jia, Q., Wang, Z., Fang, Y., Yu, Q., Zhou, J., Yang, S., and Qi, Y. A semi-supervised graph attentive network for financial fraud detection. In ICDM, pp. 598-607, 2019.
330
+ Wang, J., Liu, Q., Liang, H., Joshi, G., and Poor, H. V. Tackling the objective inconsistency problem in heterogeneous federated optimization. In NeurIPS, pp. 7611-7623, 2020.
331
+
332
+ Wang, X. and Zhang, M. How powerful are spectral graph neural networks. In ICML, pp. 23341-23362, 2023.
333
+ Wu, X., Liu, X., Niu, J., Zhu, G., and Tang, S. Bold but cautious: Unlocking the potential of personalized federated learning through cautiously aggressive collaboration. In ICCV, pp. 19375-19384, 2023.
334
+ Wu, Z., Pan, S., Chen, F., Long, G., Zhang, C., and Philip, S. Y. A comprehensive survey on graph neural networks. TNNLS, pp. 4-24, 2020.
335
+ Xie, H., Ma, J., Xiong, L., and Yang, C. Federated graph classification over non-iid graphs. In NerulPS, pp. 18839-18852, 2021.
336
+ Xu, C., Qu, Y., Xiang, Y., and Gao, L. Asynchronous federated learning on heterogeneous devices: A survey. Computer Science Review, 50:100595, 2023.
337
+ Xu, J., Chen, Z., Quek, T. Q., and Chong, K. F. E. Fedcorr: Multi-stage federated learning for label noise correction. In CVPR, pp. 10184-10193, 2022.
338
+ Yang, X., Huang, W., and Ye, M. Dynamic personalized federated learning with adaptive differential privacy. Advances in Neural Information Processing Systems, 36: 72181-72192, 2023.
339
+ Zhang, H., Shen, T., Wu, F., Yin, M., Yang, H., and Wu, C. Federated graph learning - a position paper. In arXiv preprint arXiv:2105.11099, 2021a.
340
+ Zhang, J., Li, Z., Li, B., Xu, J., Wu, S., Ding, S., and Wu, C. Federated learning with label distribution skew via logits calibration. In ICML, pp. 26311-26329, 2022a.
341
+ Zhang, J., Hua, Y., Cao, J., Wang, H., Song, T., XUE, Z., Ma, R., and Guan, H. Eliminating domain bias for federated learning in representation space. In NeurIPS, pp. 14204-14227, 2023a.
342
+ Zhang, J., Hua, Y., Wang, H., Song, T., Xue, Z., Ma, R., Cao, J., and Guan, H. GpfI: Simultaneously learning global and personalized feature information for personalized federated learning. In CVPR, pp. 5041-5051, 2023b.
343
+ Zhang, J., Hua, Y., Wang, H., Song, T., Xue, Z., Ma, R., and Guan, H. Fedala: Adaptive local aggregation for personalized federated learning. In AAAI, pp. 11237-11244, 2023c.
344
+ Zhang, K., Yang, C., Li, X., Sun, L., and Yiu, S. M. Subgraph federated learning with missing neighbor generation. In NeurIPS, pp. 6671-6682, 2021b.
345
+ Zhang, T., Gao, L., Lee, S., Zhang, M., and Avestimehr, S. Timelyfl: Heterogeneity-aware asynchronous federated learning with adaptive partial training. In CVPR, pp. 5064-5073, 2023d.
346
+
347
+ Zhang, Y., Gao, S., Pei, J., and Huang, H. Improving social network embedding via new second-order continuous graph neural networks. In KDD, pp. 2515-2523, 2022b.
348
+ Zhou, T. and Konukoglu, E. Fedfa: Federated feature augmentation. In ICLR, 2023.
349
+ Zhu, B., Wang, L., Pang, Q., Wang, S., Jiao, J., Song, D., and Jordan, M. I. Byzantine-robust federated learning with optimal statistical rates. In AISTATS, pp. 3151-3178, 2023.
350
+ Zhu, Y., Li, X., Wu, Z., Wu, D., Hu, M., and Li, R.-H. Fedtad: Topology-aware data-free knowledge distillation for subgraph federated learning. arXiv preprint arXiv:2404.14061, 2024.
351
+ Zhu, Z., Hong, J., and Zhou, J. Data-free knowledge distillation for heterogeneous federated learning. In ICML, pp. 12878-12889, 2021.
2025/$S^2$FGL_ Spatial Spectral Federated Graph Learning/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:32a8ebced0315e211ce3b5741176041a8e83d4ec496652365b85c8714ae2ce61
3
+ size 580786
2025/$S^2$FGL_ Spatial Spectral Federated Graph Learning/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/$_mathcalVista_mathcalDPO$_ Video Hierarchical Spatial-Temporal Direct Preference Optimization for Large Video Models/95db5337-6c04-4ac6-82a6-686d937752ac_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/$_mathcalVista_mathcalDPO$_ Video Hierarchical Spatial-Temporal Direct Preference Optimization for Large Video Models/95db5337-6c04-4ac6-82a6-686d937752ac_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/$_mathcalVista_mathcalDPO$_ Video Hierarchical Spatial-Temporal Direct Preference Optimization for Large Video Models/95db5337-6c04-4ac6-82a6-686d937752ac_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0147d4011c9200fecd08e01e91c1bbef78317b07d3310bb611bb04538740e57f
3
+ size 7774910
2025/$_mathcalVista_mathcalDPO$_ Video Hierarchical Spatial-Temporal Direct Preference Optimization for Large Video Models/full.md ADDED
@@ -0,0 +1,680 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # VistaDPO : Video Hierarchical Spatial-Temporal Direct Preference Optimization for Large Video Models
2
+
3
+ Haojian Huang\*1 Haodong Chen\*2 Shengqiong Wu3 Meng Luo3 Jinlan Fu3 Xinya Du4 Hanwang Zhang5 Hao Fei3
4
+
5
+ # Abstract
6
+
7
+ Large Video Models (LVMs) built upon Large Language Models (LLMs) have shown promise in video understanding but often suffer from misalignment with human intuition and video hallucination issues. To address these challenges, we introduce VistaDPO, a novel framework for Video Hierarchical Spatial-Temporal Direct Preference Optimization. VistaDPO enhances text-video preference alignment across three hierarchical levels: i) Instance Level, aligning overall video content with responses; ii) Temporal Level, aligning video temporal semantics with event descriptions; and iii) Perceptive Level, aligning spatial objects with language tokens. Given the lack of datasets for fine-grained video-language preference alignment, we construct VistaDPO-7k, a dataset of 7.2K QA pairs annotated with chosen and rejected responses, along with spatial-temporal grounding information such as timestamps, keyframes, and bounding boxes. Extensive experiments on benchmarks such as Video Hallucination, Video QA, and Captioning performance tasks demonstrate that VistaDPO significantly improves the performance of existing LVMs, effectively mitigating video-language misalignment and hallucination. The code and data are available at VistaDPO Repository.
8
+
9
+ # 1. Introduction
10
+
11
+ Achieving human-like reasoning capabilities for videos is a critical research topic in the field of AI. In recent years, Large Video Models (LVMs) (Li et al., 2023; Zhang et al., 2023a; Lin et al., 2023; Li et al., 2024c; Wu et al., 2024a; Cheng et al., 2024b; Fei et al., 2024b; Jin et al., 2024; Qian et al., 2024; Li et al., 2025) have garnered signifi
12
+
13
+ *Equal contribution 1The University of Hong Kong 2The Hong Kong University of Science and Technology 3National University of Singapore 4University of Texas at Dallas 5Nanyang Technological University. Correspondence to: Hao Fei <haofei37@nus.edu.sg>.
14
+
15
+ Proceedings of the $42^{nd}$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
16
+
17
+ ![](images/21923c16c58e4fb100d3257b4fa716f13b9383b8dd09bad734114f9ffab683af.jpg)
18
+ Figure 1. (a) Traditional textual DPO overlooks multimodal information, limiting video-language tasks. (b) Existing multimodal DPO methods rely on coarse alignment, missing rich temporal and perceptual details. (c&d) VistaDPO overcomes these limitations with a hierarchical spatiotemporal preference optimization framework, enabling fine-grained video-language alignment and precise reasoning over video dynamics. Here, $y_{w}$ is the preferred response over $y_{l}$ , and $v_{w}$ the visual input more likely to produce it than $v_{l}$ .
19
+
20
+ cant research attention. Built upon Large Language Models (LLMs) (Touvron et al., 2023; Bai et al., 2023; Peng et al., 2023; Dubey et al., 2024), LVMs leverage the powerful intelligence of LLMs in language, achieving unprecedented understanding of video content. However, increasing studies reveal that LVMs encounter critical issues, such as video understanding that deviates from human intuition (Zhou et al., 2024a; Fei et al., 2024a; Cheng et al., 2024a; Hu et al., 2024) or the phenomenon of video hallucination (Wang et al., 2024; Sahoo et al., 2024; Yuan et al., 2024), where the model outputs content that does not align with the input, e.g., user instructions, video content. The root of these issues lies in the inherent nature of current LVM architectures (Yan et al., 2021; Cheng et al., 2024b; Lin et al., 2023), where most LVMs integrate a video encoder (e.g., ViT) into text-
21
+
22
+ oriented LLMs through a connector to achieve video signal interpretation. Since backbone LLMs undergo extensive pre-training on large-scale language data while video encoders lack peer capability, this gap leads LLMs to produce overly confident outputs based on biased or even incorrect perceptions of video content from the encoder. While the supervised fine-tuning (SFT) with video-language pairs (Wang et al., 2024; Leng et al., 2024; Yuan et al., 2024) can partially improve the alignment between the two modalities in LVMs, fundamentally addressing the issue requires reliance on extremely large-scale data.
23
+
24
+ Recently, Direct Preference Optimization (DPO) (Rafailov et al., 2024) has been proposed as a promising alternative to SFT. It trains LLMs to prefer responses chosen by evaluators over rejected ones when presented with a user query. By identifying which response better aligns with human preferences rather than requiring precise target outputs, DPO significantly alleviates dependence on annotated data while enhancing alignment with human values and effectively addressing hallucination issues. Some follow-up studies (Xie et al., 2024; Liu et al., 2024d; Zhou et al., 2024b; Fu et al., 2025b) have extended DPO from textual to multimodal LLMs, facilitating cross-modal alignment and improving the generalization capabilities of the models. Most recently, Hound-DPO (Zhang et al., 2024b) pioneers a video DPO, demonstrating that tailored rewards through DPO can significantly enhance the performance of LVMs. Unfortunately, we find that this work straightforwardly applies the DPO strategy designed for image-text LLMs to video-language preference alignment (as shown in Figure 1), which introduces two critical limitations. First, Zhang et al. (2024b) fails to adequately consider the temporal characteristics of videos. Unlike static images, videos always require both spatial semantic understanding and dynamic temporal reasoning (Fei et al., 2024c), necessitating a comprehensive modeling of the spatial-temporal attributes of videos. Second, their work focuses solely on coarse-grained alignment between video and language (response text) at the instance level, which may lead to suboptimal preference alignment (Zeng et al., 2024; Gunjal et al., 2024). We emphasize that achieving proper alignment between two modalities requires a fine-grained preference alignment. Intuitively, dynamic videos correspond to paired text at multiple hierarchical levels.
25
+
26
+ To address these challenges, we propose a novel framework, Video Hierarchical Spatial-Temporal Direct Preference Optimization (namely VistaDPO), aiming to strengthen LVMs. VistaDPO improves text-video preference alignment across hierarchical granularities. Specifically, we design three levels of alignment (as shown in Figure 1):
27
+
28
+ $\triangleright$ Instance Level: Matching the overall video content with the most appropriate response for semantic alignment.
29
+ $\triangleright$ Temporal Level: Aligning video temporal semantics
30
+
31
+ with event descriptions, enabling temporal reasoning.
32
+
33
+ $\triangleright$ Perceptive Level: Aligning video spatial objects (i.e., regions of interest) with objective tokens or phrases in the language at a fine-grained semantic level.
34
+
35
+ To implement such fine-grained preference optimization, we construct a large-scale spatial-temporally grounded video dataset called VistaDPO-7k. We manually annotate 3,878 videos with spatial-temporal groundings in a video QA format, providing high-quality labels for hallucinated and non-hallucinated answers, along with timestamps, keyframes, and bounding boxes of relevant semantics.
36
+
37
+ We conduct extensive evaluation on benchmarks including Video Hallucination, Video QA, Captioning Tasks, by post-training existing popular LVMs with the proposed VistaDPO. The results show that VistaDPO consistently improves baseline LVMs, achieving significant average improvements of $26.42\%$ over PLLaVA and $53.92\%$ over Video-LLaVA respectively. Through in-depth analysis, we show that VistaDPO effectively and comprehensively captures the dynamic interactions between video content and texts, thanks to its hierarchical spatial-temporal alignment strategy. To summarize, this work contributes in threefold:
38
+
39
+ - Propose a novel Video Hierarchical Spatial-Temporal DPO (VistaDPO) mechanism, a more fine-grained DPO strategy to optimize the alignment between video and language in LVMs.
40
+ - Construct and release a large-scale (7.2K) high-quality annotated QA pairs dataset, which can serve as a valuable resource for follow-up video DPO research.
41
+ - Empirically, VistaDPO significantly improves the generalization capabilities of existing LVMs, effectively mitigating video-language misalignment and hallucination.
42
+
43
+ # 2. Related Work
44
+
45
+ By building on powerful LLMs and integrating various multimodal encoders, researchers have developed MLLMs (Liu et al., 2024a; Fu et al., 2025a; Yin et al., 2024; Wu et al., 2024b) and LVMs (Li et al., 2023; Zhang et al., 2023a; Lin et al., 2023; Li et al., 2024c; Cheng et al., 2024b; Jin et al., 2024; Li et al., 2025). Through necessary SFT on visual instruction-tuning data, MLLMs and LVMs have not only developed robust multimodal understanding capabilities but have also significantly enhanced human-computer interaction, making cross-modal interactions more intuitive and seamless. Unfortunately, inheriting the intrinsic hallucination issues of LLMs, LVMs also frequently suffer from hallucinations (Liu et al., 2024b; Zhang et al., 2024b; Li et al., 2024a; Sahoo et al., 2024) or fail to align their understanding of visual content with human values. Increasing the volume of multimodal SFT data has been shown to alleviate these issues to some extent (Ahn et al., 2024; Tan et al., 2024; Jiang et al., 2024; Chen et al., 2024). However, this approach is often accompanied by higher annotation
46
+
47
+ costs and computational expenses. This challenge is particularly pronounced in video scenarios, where LVMs demand significantly larger datasets and higher training costs.
48
+
49
+ Subsequently, the community has introduced the DPO technique (Rafailov et al., 2024), where preference alignment aligns LLMs with human values, reducing hallucinations by guiding the model's adjustments using pairs of preferred and rejected data. Multimodal preference alignment, as an extension of preference alignment techniques to visual and textual inputs, has been widely applied to MLLMs to improve cross-modal alignment (Liu et al., 2024d; Xie et al., 2024; Zhou et al., 2024b) as shown in Table 5. Recently, Hound-DPO, pioneered by Zhang et al. (2024b), successfully applies multimodal DPO to LVMs, improving video understanding and addressing hallucination issues. However, it overlooks the preference alignment of visual inputs. In this paper, we aim to further enhance the effectiveness of DPO in video scenarios by modeling fine-grained alignments between video and language. To achieve this, we propose a hierarchical preference optimization framework that efficiently captures dynamic spatial-temporal dependencies in video tasks.
50
+
51
+ # 3. Preliminaries
52
+
53
+ Direct Preference Optimization (DPO) (Rafailov et al., 2024) aligns language models with human preferences, removing the need for explicit reward modeling or reinforcement learning (RL). Given a model $\pi_{\theta}$ (the target model) and a reference policy $\pi_{\mathrm{ref}}$ (from supervised fine-tuning), the RL objective in reinforcement learning with human feedback (RLHF), initialized with $\pi_{\theta} = \pi_{\mathrm{ref}}$ , is expressed as:
54
+
55
+ $$
56
+ \begin{array}{l} \max _ {\pi_ {\theta}} \mathbb {E} _ {x \sim \mathcal {D}, y \sim \pi_ {\theta} (y | x)} [ r (x, y) ] \tag {1} \\ - \beta \mathbb {D} _ {\mathrm {K L}} [ \pi_ {\theta} (y \mid x) \| \pi_ {\text {r e f}} (y \mid x) ], \\ \end{array}
57
+ $$
58
+
59
+ where $r(x,y)$ denotes the reward function with $x$ as the input instruction and $y$ as the response. DPO establishes a mapping between the reward model and the optimal policy under the reverse KL divergence, obtaining a representation of the reward function concerning the policy:
60
+
61
+ $$
62
+ r (x, y) = \beta \log \frac {\pi_ {\theta} (y | x)}{\pi_ {\operatorname {r e f}} (y | x)} + \beta \log Z (x), \tag {2}
63
+ $$
64
+
65
+ where $\beta$ is a coefficient for the reverse KL divergence penalty, and $Z(x)$ is the partition function.
66
+
67
+ Given the chosen response $y_{w}$ , preferred over the rejected response $y_{l}$ , DPO aligns with human preference using the Bradley-Terry model for pairwise comparisons:
68
+
69
+ $$
70
+ P _ {\mathrm {B T}} \left(y _ {w} \succ y _ {l} \mid x\right) = \frac {\exp \left(r \left(x , y _ {w}\right)\right)}{\exp \left(r \left(x , y _ {w}\right)\right) + \exp \left(r \left(x , y _ {l}\right)\right)}. \tag {3}
71
+ $$
72
+
73
+ By substituting Eq. 2 into Eq. 3 and leveraging the negative
74
+
75
+ log-likelihood loss, DPO derives the objective function:
76
+
77
+ $$
78
+ \begin{array}{l} u (x, y _ {w}, y _ {l}) = \beta \log \frac {\pi_ {\theta} \left(y _ {w} \mid x\right)}{\pi_ {\text {r e f}} \left(y _ {w} \mid x\right)} - \beta \log \frac {\pi_ {\theta} \left(y _ {l} \mid x\right)}{\pi_ {\text {r e f}} \left(y _ {l} \mid x\right)}, \tag {4} \\ \mathcal {L} _ {\mathcal {D P O}} = - \mathbb {E} _ {(x, y _ {w}, y _ {l})} [ \log \sigma (u (x, y _ {w}, y _ {l})) ], \\ \end{array}
79
+ $$
80
+
81
+ where the action score with $y_{i}$ denotes the $i$ -th token of the response $y$ can be formulated as:
82
+
83
+ $$
84
+ \log \pi (y | x) = \sum_ {y _ {i} \in y} \log p \left(y _ {i} \mid x, y _ {< i}\right). \tag {5}
85
+ $$
86
+
87
+ # 4. VistaDPO-7k: A Spatial-temporal Grounded Video DPO Dataset
88
+
89
+ Existing LVMs often suffer from limited spatial-temporal perception, leading to video-language misalignment and hallucination issues (Lan et al., 2024). We propose VistaDPO with spatial-temporal DPO to achieve fine-grained alignment between video and language modalities. To support this, we construct a spatial-temporal grounded dataset, VistaDPO-7k, by integrating data from 14 prevalent video datasets and systematically designing QA pairs to evaluate and mitigate hallucinations. These hallucinations are categorized into two major dimensions: Perception (e.g., Object, Static/Dynamic Attribute, Static Relation, OCR) and Temporal (e.g., Action, Dynamic Relation, Sequence), covering both static and dynamic aspects of video understanding. The dataset provides chosen and rejected responses, along with fine-grained temporal dependencies that include key timestamps, frames, and bounding boxes, enabling models to better capture spatial-temporal interactions, as can be shown in Figure 2(a). VistaDPO-7k supports multilevel preference optimization across Temporal, Perceptive, and Instance levels, offering a robust benchmark to reduce hallucinations and enhance the spatial-temporal reasoning capabilities of LVMs. Please refer to Appendix §B for more details on dataset construction and specifications.
90
+
91
+ # 5. Methodology
92
+
93
+ To tackle the spatiotemporal complexities in video-language tasks, we propose VistaDPO, which implements hierarchical preference optimization across three aspects: (i) Instance-wise Semantic Preference Optimization, aligning preferences at response and video levels; (ii) Temporal Action-Event Preference Optimization, capturing overlooked temporal dynamics; and (iii) Perceptive Spatial-Object Preference Optimization, enabling fine-grained alignment between tokens and objects. Figure 2(b) illustrates the overall architecture of VistaDPO.
94
+
95
+ # 5.1. Instance-wise Semantic Preference Optimization
96
+
97
+ Effective video-language alignment hinges on distinguishing preferred (chosen) from non-preferred (rejected) responses while capturing global video content. To address hallucinations and misalignments caused by spatiotempo
98
+
99
+ ![](images/91e42226c3675db61c18377add9b7da889759febf9166747396c8f8ca12f6bc4.jpg)
100
+ (a) Metadata of VistaDPO-7k
101
+ Figure 2. (a) The metadata of VistaDPO-7k highlights its focus on fine-grained video-language tasks, emphasizing temporal $(44\%)$ and perceptual $(56\%)$ reasoning. $y_{l}^{ir}$ and $y_{l}^{re}$ denote the irrelevant and relevant non-preferred responses respectively. (b) VistaDPO introduces a hierarchical spatiotemporal preference optimization framework. Instance $(v^{v})$ and perceptive $(v^{f})$ levels align global-to-local semantics with spatial visual features, leveraging both text-relevant and irrelevant rejected responses for robust cross-modal interaction. Temporal $(v^{c})$ level aligns clip-level semantics with temporal dynamics, enabling precise reasoning across spatial and temporal dimensions.
102
+
103
+ ![](images/0b7e2964cd4798793bb130b459cb485a996255dcb5d64c51ee6a0160daed0bea.jpg)
104
+ (b) Illustration of VistaDPO
105
+
106
+ ral complexities and over-reliance on text, we propose response-level alignment to refine preference differentiation and video-level alignment to enhance instance-wise semantic understanding.
107
+
108
+ Response-Level Alignment. LVMs often face challenges in maintaining global consistency when generating responses. While these models effectively capture the general context of video input $v$ and prompt $x$ , they frequently struggle to distinguish user-preferred responses $y_{w}$ from non-preferred responses $y_{l}$ at the response level, leading to suboptimal alignment with user intent. To promote overall consistency by encouraging the model to align its response-level preferences with human expectations, the objective function can be formulated as:
109
+
110
+ $$
111
+ \mathcal {L} _ {\mathcal {D P O} _ {r}} = - \mathbb {E} _ {(v, x, y _ {w}, y _ {l})} \left[ \log \sigma \left(u _ {r} (v, x, y _ {w}, y _ {l})\right) \right], \tag {6}
112
+ $$
113
+
114
+ where
115
+
116
+ $$
117
+ u _ {r} = \beta \log \frac {\pi_ {\theta} \left(y _ {w} | v , x\right)}{\pi_ {\text {r e f}} \left(y _ {w} | v , x\right)} - \beta \log \frac {\pi_ {\theta} \left(y _ {l} | v , x\right)}{\pi_ {\text {r e f}} \left(y _ {l} | v , x\right)}. \tag {7}
118
+ $$
119
+
120
+ Here, $\log \pi (y|v,x)$ is defined as:
121
+
122
+ $$
123
+ \log \pi (y | v, x) = \sum_ {y _ {i} \in y} \log p \left(y _ {i} | v, x, y _ {< i}\right). \tag {8}
124
+ $$
125
+
126
+ The existing method of Hound-DPO (Zhang et al., 2024b) directly adopts the above approach, focusing solely on aligning the chosen response with the prompt. Nevertheless, the complex spatial-temporal dependencies in rejected responses are completely neglected. Intuitively, intrinsic hallucinations in generative models typically arise from: 1) erroneously inferring content that does not exist in the video;
127
+
128
+ 2) failing to capture the fine-grained spatial-temporal dependencies of the correct content in the video. To mitigate this, we further introduce two types of non-preferred responses into the optimization process:
129
+
130
+ $$
131
+ \log \frac {\pi_ {\theta} \left(y _ {l} \mid v , x\right)}{\pi_ {\mathrm {r e f}} \left(y _ {l} \mid v , x\right)} \leftarrow \sum_ {i \in \{r e, i r \}} \beta_ {i} \log \frac {\pi_ {\theta} \left(y _ {l} ^ {i} \mid v , x\right)}{\pi_ {\mathrm {r e f}} \left(y _ {l} ^ {i} \mid v , x\right)}, \tag {9}
132
+ $$
133
+
134
+ where $y_{l}^{re}$ denotes the relevant non-preferred for these are semantically relevant to the video content but contain spatial or temporal inconsistencies, e.g., incorrect temporal ordering, wrong actions, or misinterpreted spatial locations. In contrast, $y_{l}^{ir}$ denotes the irrelevant non-preferred responses, which are entirely unrelated to the video content, introducing noise by hallucinating events or objects with no connection to the actual video.
135
+
136
+ Video-Level Alignment. Unlike most prior DPO works, which focus exclusively on textual optimization, we introduce video-level preference optimization for the first time to reduce LVMs' overreliance on language. At the video level, the model needs to understand the preference relationships of the entire video as a coherent semantic unit. However, since LVMs are prone to hallucinations involving irrelevant video content, we optimize the model to recognize global discrepancies among videos. To this end, we construct video-level preferred and non-preferred sample pairs, denoted as $v_{w}^{v}$ and $v_{l}^{v}$ . Thus $u_{v}(v_{w}^{v}, v_{l}^{v}, x, y_{w})$ within $\mathcal{L}_{\mathcal{DPO}_v}$ can be formulated as:
137
+
138
+ $$
139
+ u _ {v} = \beta \log \frac {\pi_ {\theta} \left(y _ {w} \mid v _ {w} ^ {v} , x\right)}{\pi_ {\text {r e f}} \left(y _ {w} \mid v _ {w} ^ {v} , x\right)} - \beta \log \frac {\pi_ {\theta} \left(y _ {l} \mid v _ {l} ^ {v} , x\right)}{\pi_ {\text {r e f}} \left(y _ {l} \mid v _ {l} ^ {v} , x\right)}, \tag {10}
140
+ $$
141
+
142
+ where $v_{l}^{v}$ is sampled from the mini-batch that is unrelated
143
+
144
+ to the query $x$ in this work.
145
+
146
+ # 5.2. Temporal Semantic Preference Optimization
147
+
148
+ Clip-Level Alignment. While previous multimodal DPO methods have mainly focused on the spatial aspects of visual samples (as shown in Table 5), unlike static images, videos require both spatial semantic understanding and dynamic temporal reasoning. This necessitates a comprehensive modeling of the spatial-temporal attributes of videos.
149
+
150
+ At the temporal level, the model must distinguish between time segments in the video that are relevant to the prompt and those that are irrelevant. To align video temporal semantics with event descriptions provided in the prompt, we treat time segments related to the prompt as preferred clips $v_{w}^{c}$ and time segments unrelated to the prompt as non-preferred clips $v_{l}^{c}$ , as shown in Figure 2. Following Eq. (10), the clip-level objective function can be defined as:
151
+
152
+ $$
153
+ \mathcal {L} _ {\mathcal {D P O} _ {c}} \sim \log \sigma \left(u _ {c} \left(v _ {w} ^ {c}, v _ {l} ^ {c}, x, y _ {w}\right)\right). \tag {11}
154
+ $$
155
+
156
+ # 5.3. Perceptive Spatial-Object Preference Optimization
157
+
158
+ While instance-wise alignment captures global semantics, fine-grained perceptual alignment is crucial for precise video-language interaction. Videos inherently involve complex spatial relationships, where objects, actions, and regions dynamically interact over time. Language, in turn, encodes these interactions through specific tokens, making it essential to establish detailed alignment between spatial objects and their corresponding linguistic references.
159
+
160
+ Object-Level Spatial Alignment. At the spatial level, the model needs to capture the key locations and states of objects within the video. However, LVMs are often prone to hallucinations in spatial layouts, leading to incorrect object placements or misinterpretations of scene context. To address this, we strengthen the model's understanding of spatial information through object-level preferred and non-preferred sample design. Specifically, we select the keyframe relevant to the prompt $x$ as the preferred instance $v_{w}^{f}$ as shown in Figure. 2. For the non-preferred sample $v_{l}^{f}$ , we further apply a masking operation to the key regions within the selected frame, thereby focusing the model's attention on the relevant spatial content while reducing the influence of irrelevant regions. Accordingly, the object-level loss $\mathcal{L}_{\mathcal{DPO}_o}$ can be defined in a manner similar to Eq. (11).
161
+
162
+ Token-Level Alignment. While response-level optimization enhances global consistency, it lacks the granularity required to address token-specific errors, such as misattributed objects or incorrect temporal markers (e.g., "after" vs. "before"). Token-level optimization ensures that the model aligns its preferences at a finer granularity, thereby reducing hallucinations in object-action relationships. Inspired by TDPO (Zeng et al., 2024), we implement token-level optimization to evaluate preferences for individual tokens and
163
+
164
+ align them coherently to form a consistent response. The sequential KL divergence can be defined as:
165
+
166
+ $$
167
+ \begin{array}{l} \mathcal {L} _ {D P O _ {t}} = s g \left(\beta D _ {\text {S e q K L}} \left(x, v _ {w} ^ {f}, y _ {w}; \pi_ {\text {r e f}} \right\| \pi_ {\theta})\right) \tag {12} \\ - \beta D _ {\text {S e q K L}} (x, v _ {w} ^ {f}, y _ {l}; \pi_ {\text {r e f}} \| \pi_ {\theta}), \\ \end{array}
168
+ $$
169
+
170
+ where $sg$ represents the stop-gradient operator, ensuring that gradients are not propagated through the reference policy $\pi_{\mathrm{ref}}$ , and $D_{\mathrm{SeqKL}}$ is the sequence-level KL divergence:
171
+
172
+ $$
173
+ D _ {\text {S e q K L}} = \sum_ {t = 1} ^ {T} D _ {\mathrm {K L}} \left(\pi_ {\text {r e f}} \left(y | x, y _ {< t}\right) \| \pi_ {\theta} \left(y | x, y _ {< t}\right)\right). \tag {13}
174
+ $$
175
+
176
+ Overall, after incorporating instance-wise, temporal, and perceptive-level preference optimization, the overall loss function for VistaDPO is formulated as follows:
177
+
178
+ $$
179
+ \begin{array}{l} \mathcal {L} _ {V i s t a D P O} = \underbrace {\mathcal {L} _ {D P O _ {v}} + \mathcal {L} _ {D P O _ {r}}} _ {\text {I n s t a n c e}} \tag {14} \\ + \underbrace {\lambda \mathcal {L} _ {D P O _ {c}}} _ {\text {T e m p o r a l}} + \underbrace {\mu \mathcal {L} _ {D P O _ {o}} + \rho \mathcal {L} _ {D P O _ {t}}} _ {\text {P e r c e p t i v e}}, \\ \end{array}
180
+ $$
181
+
182
+ where $\lambda, \mu$ , and $\rho$ represent the loss weights.
183
+
184
+ # 6. Experiments
185
+
186
+ In this section, we empirically investigate the effectiveness of VistaDPO in reducing hallucinations.
187
+
188
+ # 6.1. Experimental Settings
189
+
190
+ Baselines. We apply VistaDPO to two different 7B-size LVMs: Video-LLaVA (Lin et al., 2023) and PLLaVA (Xu et al., 2024). For Video-LLaVA, it employs Language-Bind (Zhu et al., 2023) encoder for visual inputs, and Vicuna-7B v1.5 (Chiang et al., 2023) as the LLM backbone. For PLLaVA, the visual input is processed through ViT-L (Radford et al., 2021) and MM projector, with Vicuna as the LLM backbone. While other LVMs cannot be directly compared due to differences in base models, preference data, and alignment strategies, we provide these results for reference: VideoChatGPT (Maaz et al., 2023), VideoChat2 (Li et al., 2024c), LLaMA-VID (Li et al., 2025), LLaMA-Adapter (Zhang et al., 2023b), and Video-LLaMA (Zhang et al., 2023a).
191
+
192
+ **Evaluations.** To evaluate the effectiveness of VistaDPO, we adopt benchmarks for three aspects: (1) Video Hallucination: VideoHallucer (Wang et al., 2024) and EventHallusion (Zhang et al., 2024a); (2) General Video QA: MSVDQA (Xu et al., 2017), MSR-VTT-QA (Xu et al., 2017), TGIF-QA (Jang et al., 2017), and ActivityNet-QA (Yu et al., 2019); and (3) Captioning Performance: VideoChatGPT-Bench (Maaz et al., 2023). For ablation studies and analysis, we mainly employ our VistaDPO on Video-LLaVA.
193
+
194
+ Implementation Details. We train the Video-LLaVA 7B (Lin et al., 2023) and PLLaVA 7B (Xu et al., 2024) with VistaDPO for 3 epochs, with a learning rate of $5e - 7$ and a
195
+
196
+ Table 1. Main results on video hallucination benchmarks. Bold values indicate the best performance and $\Delta$ denotes the corresponding improvement percentages over the baselines (i.e. PLLaVA and Video-LLaVA). "↑" denotes higher is better.
197
+
198
+ <table><tr><td rowspan="3">Models</td><td colspan="3">VideoHallucer</td><td colspan="7">EventHallusion</td></tr><tr><td rowspan="2">Basic↑</td><td rowspan="2">Hallucinated↑</td><td rowspan="2">Overall↑</td><td colspan="2">Entire</td><td colspan="2">Mix</td><td colspan="2">Misleading</td><td>Overall</td></tr><tr><td>Binary↑</td><td>Desc.↑</td><td>Binary↑</td><td>Desc.↑</td><td>Binary↑</td><td>Binary↑</td><td>Desc.↑</td></tr><tr><td>VideoChatGPT (Maaz et al., 2023)</td><td>92.8</td><td>10.4</td><td>6.4</td><td>14.9</td><td>5.5</td><td>57.0</td><td>3.6</td><td>21.6</td><td>36.4</td><td>4.3</td></tr><tr><td>VideoChat2 (Li et al., 2024c)</td><td>29.7</td><td>25.8</td><td>7.8</td><td>16.7</td><td>4.6</td><td>12.4</td><td>1.6</td><td>22.6</td><td>16.1</td><td>2.6</td></tr><tr><td>LLaMA-VID (Li et al., 2025)</td><td>89.9</td><td>26.6</td><td>21.0</td><td>30.7</td><td>16.5</td><td>73.6</td><td>7.8</td><td>43.1</td><td>54.0</td><td>10.9</td></tr><tr><td>PLLaVA (Xu et al., 2024)</td><td>75.1</td><td>55.5</td><td>38.1</td><td>45.6</td><td>16.5</td><td>58.5</td><td>3.1</td><td>81.4</td><td>60.6</td><td>6.1</td></tr><tr><td>+ Hound-DPO (Zhang et al., 2024b)</td><td>69.3</td><td>58.1</td><td>36.2</td><td>47.4</td><td>19.3</td><td>24.9</td><td>4.1</td><td>83.3</td><td>45.7</td><td>9.8</td></tr><tr><td>+ VistaDPO (Ours)</td><td>82.5</td><td>72.1</td><td>57.8</td><td>55.3</td><td>23.6</td><td>62.2</td><td>6.2</td><td>97.1</td><td>68.9</td><td>12.7</td></tr><tr><td>Δ%</td><td>9.9</td><td>29.9</td><td>51.7</td><td>21.3</td><td>42.7</td><td>6.3</td><td>100.0</td><td>19.3</td><td>13.7</td><td>108.2</td></tr><tr><td>Video-LLaVA (Lin et al., 2023)</td><td>95.1</td><td>20.3</td><td>17.8</td><td>30.7</td><td>8.3</td><td>57.5</td><td>7.3</td><td>41.2</td><td>45.9</td><td>7.6</td></tr><tr><td>+ Hound-DPO (Zhang et al., 2024b)</td><td>83.4</td><td>43.0</td><td>29.5</td><td>35.9</td><td>9.8</td><td>15.5</td><td>9.3</td><td>63.7</td><td>33.3</td><td>9.5</td></tr><tr><td>+ VistaDPO (Ours)</td><td>98.2</td><td>64.4</td><td>54.3</td><td>50.9</td><td>14.9</td><td>62.2</td><td>10.4</td><td>95.1</td><td>67.2</td><td>12.1</td></tr><tr><td>Δ%</td><td>3.3</td><td>217.2</td><td>205.1</td><td>65.8</td><td>79.5</td><td>8.2</td><td>42.5</td><td>130.8</td><td>46.4</td><td>59.2</td></tr></table>
199
+
200
+ Table 2. Main results on video QA and captioning benchmarks. Symbols follow the definitions in Table 1.
201
+
202
+ <table><tr><td rowspan="2">Models</td><td colspan="4">Question-Answer</td><td colspan="5">Captioning</td></tr><tr><td>MSVD↑</td><td>MSR-VTT↑</td><td>TGIF↑</td><td>Act.Net↑</td><td>Correct↑</td><td>Detail↑</td><td>Context↑</td><td>Temporal↑</td><td>Consist↑</td></tr><tr><td>VideoChatGPT (Maaz et al., 2023)</td><td>64.9</td><td>49.3</td><td>51.4</td><td>35.2</td><td>2.4</td><td>2.5</td><td>2.6</td><td>2.0</td><td>2.4</td></tr><tr><td>LLaMA-Adapter (Zhang et al., 2023b)</td><td>54.9</td><td>43.8</td><td>-</td><td>34.2</td><td>2.0</td><td>2.3</td><td>2.3</td><td>2.0</td><td>2.2</td></tr><tr><td>Video-LLaMA (Zhang et al., 2023a)</td><td>51.6</td><td>29.6</td><td>-</td><td>12.4</td><td>2.0</td><td>2.2</td><td>2.2</td><td>1.8</td><td>1.8</td></tr><tr><td>PLLaVA (Xu et al., 2024)</td><td>76.6</td><td>62.0</td><td>77.5</td><td>56.3</td><td>3.2</td><td>2.9</td><td>3.6</td><td>2.3</td><td>2.9</td></tr><tr><td>+ Hound-DPO (Zhang et al., 2024b)</td><td>82.3</td><td>73.1</td><td>79.9</td><td>54.7</td><td>3.2</td><td>2.8</td><td>3.4</td><td>2.4</td><td>2.7</td></tr><tr><td>+ VistaDPO (Ours)</td><td>86.4</td><td>80.2</td><td>84.3</td><td>59.1</td><td>3.5</td><td>3.0</td><td>3.9</td><td>2.8</td><td>2.9</td></tr><tr><td>Δ%</td><td>12.8</td><td>29.4</td><td>8.8</td><td>5.0</td><td>9.4</td><td>3.5</td><td>8.3</td><td>21.7</td><td>0.0</td></tr><tr><td>Video-LLaVA (Lin et al., 2023)</td><td>71.8</td><td>59.0</td><td>48.4</td><td>45.3</td><td>2.8</td><td>2.9</td><td>3.4</td><td>2.5</td><td>2.6</td></tr><tr><td>+ Hound-DPO (Zhang et al., 2024b)</td><td>80.7</td><td>70.2</td><td>61.4</td><td>40.9</td><td>3.0</td><td>2.7</td><td>3.3</td><td>2.0</td><td>2.6</td></tr><tr><td>+ VistaDPO (Ours)</td><td>85.3</td><td>76.9</td><td>74.1</td><td>55.0</td><td>3.4</td><td>2.9</td><td>3.6</td><td>2.6</td><td>2.9</td></tr><tr><td>Δ%</td><td>18.8</td><td>30.3</td><td>53.1</td><td>21.5</td><td>21.4</td><td>0.0</td><td>5.9</td><td>4.0</td><td>11.5</td></tr></table>
203
+
204
+ Table 3. Ablation study of level losses on VideoHallucer. HoundDPO (Zhang et al., 2024b) employs the same strategy as DPO (Rafailov et al., 2024), but based on its own constructed dataset.
205
+
206
+ <table><tr><td>Methods</td><td>Basic↑</td><td>Hallu.↑</td><td>Over.↑</td></tr><tr><td>VistaDPO</td><td>98.2</td><td>64.4</td><td>54.3</td></tr><tr><td>w/o LDPOc</td><td>97.8</td><td>62.3</td><td>53.0</td></tr><tr><td>w/o LDPOo</td><td>98.1</td><td>62.0</td><td>52.8</td></tr><tr><td>w/o LDPOo, LDPOt</td><td>97.6</td><td>61.5</td><td>49.4</td></tr><tr><td>w/o LDPOo, LDPOt, LDPOc</td><td>97.2</td><td>60.1</td><td>46.6</td></tr><tr><td>only w/ LDPOr</td><td>95.8</td><td>52.3</td><td>39.8</td></tr><tr><td>Vanilla DPO w/ VistaDPO-7K</td><td>95.4</td><td>50.8</td><td>38.1</td></tr><tr><td>Hound-DPO</td><td>83.4</td><td>43.0</td><td>29.5</td></tr></table>
207
+
208
+ batch size of 8 on H100 GPUs. For training, we followed Zhang et al. (2024b) to set the hyperparameter $\beta = 0.1$ and followed Zeng et al. (2024) to set $\rho = 0.1$ for $\mathcal{L}_{DPO_t}$ . As for hyperparameters of $\mathcal{L}_{DPO_c}$ and $\mathcal{L}_{DPO_o}$ , we set $\lambda = 0.4$ and $\mu = 0.2$ respectively. Moreover, we set $\beta_{re} = 0.7$ and $\beta_{ir} = 0.3$ for the relevant and irrelevant non-preferred responses respectively for $\mathcal{L}_{DPO_r}$ .
209
+
210
+ # 6.2. Main Results
211
+
212
+ We compare VistaDPO with Hound-DPO (Zhang et al., 2024b) on video hallucination, video QA, and captioning benchmarks to verify the effectiveness of our approach.
213
+
214
+ Video Hallucination. To benchmark VistaDPO, we focused on the model hallucination problem that DPO posttraining aims to mitigate and compared its performance
215
+
216
+ against the previous video DPO strategy, specifically Hound-DPO, based on LVMs PLLaVA (Xu et al., 2024) and VideoLLaVA (Lin et al., 2023). As shown in Table 1, we adopted two video hallucination benchmarks, VideoHallucer (Wang et al., 2024) and EventHallusion (Zhang et al., 2024a). The results indicate that VistaDPO significantly alleviates hallucination issues compared to Hound-DPO. Notably, while Hound-DPO improved hallucination-related performance, they introduced undesirable trade-offs, such as reduced accuracy in addressing fundamental categories like the "Basic" class in VideoHallucer. Furthermore, Hound-DPO led to a decline in the model's descriptive capabilities and accuracy, as observed in the "Desc. (Descriptive)" category of EventHallusion. These limitations highlight the shortcomings of prior methods and underscore the superiority of our VistaDPO framework and the accompanying VistaDPO-7K dataset. To provide a comprehensive assessment of LVMs' performance post-training, we evaluate both their general and captioning capabilities in the following sections.
217
+
218
+ Video Question-Answering. In addition to assessing the effectiveness of our VistaDPO in addressing hallucination issues, evaluating the model's general performance is equally critical. To this end, we conducted evaluations on four commonly used open-ended general question-answering benchmarks in a zero-shot setting, as illustrated on the left side of Table 2. VistaDPO consistently outperforms HoundDPO
219
+
220
+ ![](images/97e4623f135930bac6c1d60770de6c6170e5132024c2395e0cf5c37fcaadeac3.jpg)
221
+ Figure 3. Ablation study of hyperparameters on EventHallusion.
222
+
223
+ ![](images/f90364c5e7e325d454fc13dd307b7df0cf5811d9d8f288d1a5375827d78ce8c6.jpg)
224
+ Figure 4. T-SNE visualization of representation. (a) Video-LLaVA shows substantial overlap between hallucinated (orange) and non-hallucinated (green) representations. (b) With Hound-DPO, there is no distinct improvement in the separation of the two clusters. (c) With VistaDPO, the representations achieve clear clustering, highlighting its superior discriminative capability.
225
+
226
+ and demonstrates significant performance improvements on both base models. These results indicate that VistaDPO not only mitigates hallucination issues to a large extent but also enhances its ability to comprehend video content and generate accurate responses to questions.
227
+
228
+ Captioning Capability. We further evaluate the captioning capabilities of the model using the video-based text generation benchmark proposed by Maaz et al. (2023), which assesses five critical dimensions: Correctness, Detail Orientation, Contextual Understanding, Temporal Understanding, and Consistency. As shown on the right of Table 2, VistaDPO consistently outperforms Hound-DPO across all dimensions on two base models. These results highlight VistaDPO's ability to generate contextually relevant, detailed, and temporally accurate text from video inputs. Moreover, the findings demonstrate that the post-training process with VistaDPO-7K preserves the model's captioning capabilities, avoiding the degradation observed in Hound-DPO.
229
+
230
+ # 6.3. Ablation Studies
231
+
232
+ To evaluate the contributions of each level and their combinations, we conduct ablation studies on VistaDPO using VideoLLaVA (Table 3). The key findings are as follows: 1 Effectiveness of Hierarchical Preference Optimization. The hierarchical optimization strategy significantly improves performance, demonstrating its effectiveness in capturing multilevel preferences for better learning and task alignment. 2 Importance of Spatial-Temporal Dependencies. Spatial-temporal preference optimization, both explicit and implicit, plays a critical role in enhancing DPO performance: (i)
233
+
234
+ VistaDPO explicitly captures spatial-temporal dependencies through object-level $(\mathcal{L}_{DPO_o})$ and clip-level $(\mathcal{L}_{DPO_c})$ optimization, enabling the model to better understand localized temporal and spatial relationships. (ii) Implicitly, it encodes spatial-temporal information via response-level $(\mathcal{L}_{DPO_r})$ preference alignment, which incorporates both relevant $(y_l^{re})$ and irrelevant $(y_l^{ir})$ non-preferred responses. These results highlight the importance of fine-grained spatial-temporal dependencies in video understanding, enabling more robust and effective video-language alignment. ③ Impact of a Comprehensive High-quality Dataset. Under the vanilla DPO strategy, post-training with VistaDPO-7K outperforms Hound-DPO, which uses a less comprehensive dataset. This demonstrates that a richer and higher-quality dataset improves generalization, enhances performance, and effectively mitigates hallucinations. ④ Impact of Hyperparameters. Additionally, we conduct hyperparameter ablation study (i.e. Figure 3). Specifically, we analyzed the impact of two hyperparameter sets on VistaDPO performance: ① Loss Weights: The optimal weights for all three levels balance the model's ability to capture temporal (clip-level $\lambda$ ), spatial (object-level $\mu$ ), and fine-grained token dependencies (token-level $\rho$ ). Too low a weight for any level weakens the model's ability to capture relevant dependencies, while excessively high weights disrupt the balance, leading to overfitting to specific details and loss of broader context. ② Weights for Relevant/Irrelevant Responses: The combined weight for both non-preferred samples $(y_l^{re}, y_l^{ir})$ helps the model capture spatial-temporal relationships at the textual level, which also highlights the need for careful hyperparameter tuning to effectively capture spatial-temporal relationships.
235
+
236
+ # 7. Analyses and Discussions
237
+
238
+ We now take one step further, providing comprehensive analyses to demonstrate VistaDPO's superiority.
239
+
240
+ # 7.1. Enhanced Video-Language Representation
241
+
242
+ To empirically demonstrate the effectiveness of VistaDPO, we conduct an analysis from a representational perspective, as illustrated in Figure 4. Specifically using 95 samples (video, non-hallucinated captions, and hallucinated captions) from the "misleading" subset of EventHallusion (Zhang et al., 2024a), we evaluated the alignment of visual and textual embeddings. Video-LLaVA exhibits overlapping features and weak modality alignment, struggling
243
+
244
+ ![](images/0727ab913da5c8c702166a611de37792a7062e98d128d3b5513449a9e46c2467.jpg)
245
+ Figure 5. Ablation study of visual non-preferred samples on two video hallucination benchmarks.
246
+
247
+ ![](images/6c0b90cae51980f2db20bdc7c266aa77ae03b42580ddb25bd81fd5b31c32a442.jpg)
248
+ Figure 6. Adversarial temporal testing on VideoHallucer. The gray regions indicate the performance drop under adversarial scenarios for each method.
249
+
250
+ to distinguish hallucinated from non-hallucinated captions. With Hound-DPO, this issue is partially mitigated through vanilla DPO, but a significant gap between textual and video embeddings remains. In contrast, with VistaDPO, which incorporates hierarchical fine-grained preference modeling, the alignment is significantly improved by narrowing the distance between visual and textual modalities and distinctly separating hallucinated from non-hallucinated captions. These results underscore VistaDPO's superior capability to unify modalities and effectively reduce hallucination.
251
+
252
+ # 7.2. Analysis of Visual Non-preferred Samples
253
+
254
+ The quality of preference samples depends on the rejection visual samples and the gap between rejection and chosen samples. We explore strategies for constructing rejection samples at the video, clip, and object levels, while keeping the chosen samples (original video, event segment, and keyframe) unchanged for each level as shown in Figure 5.
255
+
256
+ - Video-level: (i) Randomness: Select a random sample from the minibatch. (ii) Blackness: Set all RGB values of the chosen sample to 0. (iii) Reverse: Reverse the order of all frames in the chosen sample. (iv) Random Mask: Mask half the frames in the chosen sample.
257
+ - Clip-level: (i) Randomness. (ii) Blackness. (iii) Reverse. (iv) Random Mask. (v) Relevant Segments: Use segments where the event does not occur.
258
+ - Object-level: (i) Randomness. (ii) Blackness. (iii) ROI Mask: Mask the key object in the chosen sample. (iv) ROI Move: Move the key object to disrupt its original spatial relationships.
259
+
260
+ As demonstrated in Figure 5, we observe the following performance trends: Figure 5 demonstrates the impact of different negative sample construction strategies across video,
261
+
262
+ ![](images/3d83f0dc428e25f13eccf22b6199cf12bc7cd1f4d5cf052715ba5a162548e2de.jpg)
263
+ Figure 7. Kernel Density Estimation (KDE) of log-likelihood differences in adversarial masking experiments. The log-likelihood difference measures the separation between original and adversarial distributions, with the shift representing the mean difference. Larger shifts indicate greater model robustness.
264
+
265
+ clip, and object levels on model performance. At the video level, the Reverse method achieves the highest overall accuracy (67.2%), significantly outperforming Randomness (54.3%), Blackness (50.2%), and Random Mask (52.1%). This suggests that disrupting temporal order provides more informative negative samples compared to random sampling or masking strategies, which fail to introduce sufficient semantic contrast. At the clip level, Relevant Segments yields the best performance (64.8%), surpassing Randomness (53.1%), Blackness (52.9%), Reverse (61.1%), and Random Mask (62.6%). This highlights that using event-irrelevant segments as negatives more effectively challenges the model to focus on event-specific semantics, whereas random or blackened clips lack meaningful contrast. At the object level, ROI Move achieves the highest accuracy (66.0%), outperforming ROI Mask (64.3%), Randomness (54.3%), and Blackness (53.7%). This indicates that spatially disrupting key objects introduces more challenging and informative negative samples compared to masking or random sampling. Overall, these results emphasize that well-designed, semantically targeted negative samples—such as those disrupting temporal order, leveraging event irrelevance, or altering spatial relationships—are crucial for enhancing the model's ability to distinguish fine-grained video-language alignments.
266
+
267
+ # 7.3. Adversarial Temporal Testing
268
+
269
+ To evaluate the robustness of VistaDPO, we conducted adversarial temporal testing using the "Temporal" subset of VideoHallucer (Wang et al., 2024), which includes three cat
270
+
271
+ ![](images/38eee0ff216789bc7353efb8456474aa55bfc2548f4e342a9bbd399835c98bb9.jpg)
272
+ (a) Temporal adversarial testing demonstration
273
+
274
+ ![](images/74b6c97bab0a1f1fca4a2e055ceeda6d177c4e46f1042e6a0420a80575f940ee.jpg)
275
+ (b) Spatial adversarial testing demonstration
276
+
277
+ ![](images/7c2480112c319d8a0939f1e84963b49517a6e4c04ca2da7d1d0027a85cbd2cba.jpg)
278
+ (c) Token adversarial testing demonstration
279
+ Figure 8. Case Studies of Adversarial Testing for VistaDPO: We conduct case studies from three perspectives: (a) Temporal adversarial testing, which examines whether the model can infer the correct sequence of events by introducing reversed temporal order through video playback. (b) Spatial adversarial testing, which evaluates the model's ability to understand subject-object interactions by masking frames or pixels related to the target object. (c) Token adversarial testing, which tests the model's sensitivity to subtle linguistic differences by introducing similar action descriptions (e.g., contrasting "run" with "stand" and "walk"). Each test compares VistaDPO with baselines (i.e., Video-LLaVA and Hound-DPO) and corresponding ablated versions to assess the impact of key components.
280
+
281
+ egories of video-based QA tasks: (i) Temporal Absolute, focusing on when an event occurs; (ii) Temporal Relative, addressing the order of two events; and (iii) Length Relative, comparing the duration of two events. For adversarial testing, we reversed all videos and adjusted answers to align with the reversed timeline (as shown in Figure 8(a). As shown in Figure 6, the base model (Video-LLaVA) and prior work (Hound-DPO) suffer significant performance drops across all three adversarial scenarios, revealing their inability to effectively model temporal hallucinations and vulnerability to timeline modifications. In contrast, VistaDPO shows minor degradation, demonstrating better temporal awareness and robustness against adversarial challenges.
282
+
283
+ # 7.4. Adversarial Spatial Testing
284
+
285
+ To evaluate spatial adversarial robustness, we test with a video and the question, "Does the girl play with her pet in the video?" As shown in Figure 8(b), all models correctly respond to the original video (upper side). However, in the adversarial version (lower side), where frames are masked to ensure the girl and pet never appear together, only VistaDPO correctly identifies the absence of interaction. To further assess adversarial discriminative capability, we use Kernel Density Estimation (KDE) on the VideoHallucer dataset to visualize how model representations shift when reasoning over noisy (adversarial) samples (see Figure 7). Video-LLaVA achieves a shift value of 1.86, showing limited ability to distinguish between original and adversarial samples. Adding Hound-DPO slightly reduces the shift to 1.26, indicating no improvement. VistaDPO achieves the highest shift value of 3.85, significantly outperforming other models. Removing $\mathcal{L}_{DPO_o}$ reduces the shift to 2.42,
286
+
287
+ highlighting the importance of the proposed spatial-object preference optimization. These show VistaDPO's superior ability to capture subtle semantic differences and enhance adversarial robustness.
288
+
289
+ # 7.5. Adversarial Token Testing
290
+
291
+ As shown in Figure 8(c), we conduct adversarial token testing to evaluate model robustness. For the original question, "Does a dog run right a person in the video?", all models answered correctly. When "run" was replaced with "stand" (a significant semantic shift), most models maintained accurate responses. However, with an adversarial sample replacing "run" with "walk" (a subtle semantic change), only VistaDPO correctly captured the nuanced difference. This underscores VistaDPO's robust token-level understanding, capturing fine-grained semantic shifts and ensuring precise video-language alignment under adversarial conditions.
292
+
293
+ # 8. Conclusion
294
+
295
+ In this paper, we propose VistaDPO, a novel framework for Video Hierarchical Spatial-Temporal Direct Preference Optimization, which enhances the alignment between text and video preferences across three hierarchical levels: instance, temporal, and perceptive. To support fine-grained preference alignment, we introduce VistaDPO-7k, a dataset of 7.2K QA pairs with annotations for chosen/rejected responses and spatial-temporal groundings. Extensive evaluations on tasks, i.e., Video Hallucination, Video QA, and Captioning benchmarks demonstrate that VistaDPO significantly improves existing LVMs, addressing video-language misalignment and hallucination issues.
296
+
297
+ # Impact Statement
298
+
299
+ This paper presents work whose goal is to advance the field of Machine Learning, particularly in the domain of videolanguage alignment and large video models (LVMs). By introducing VistaDPO, a framework for hierarchical spatial-temporal direct preference optimization, and constructing the VistaDPO-7k dataset, we aim to improve the alignment between video content and human preferences, mitigating issues such as hallucination and misalignment in video-language tasks.
300
+
301
+ The potential societal impact of this work includes enhancing the robustness and reliability of AI systems in applications such as video analysis, autonomous systems, and multimedia content understanding. While these advancements could contribute positively to fields like education, accessibility, and entertainment, they also raise ethical considerations, including potential misuse in surveillance or biased decision-making if the models are not carefully evaluated for fairness and accountability.
302
+
303
+ We have taken steps to ensure that the dataset and methodology are designed to reduce biases and hallucinations, and we encourage future researchers to apply these methods responsibly. Beyond these considerations, there are no immediate societal consequences of this work that require specific attention.
304
+
305
+ # References
306
+
307
+ Ahn, D., Choi, Y., Yu, Y., Kang, D., and Choi, J. Tuning large multimodal models for videos using reinforcement learning from ai feedback. arXiv preprint arXiv:2402.03746, 2024.
308
+ Azar, M. G., Guo, Z. D., Piot, B., Munos, R., Rowland, M., Valko, M., and Calandriello, D. A general theoretical paradigm to understand learning from human preferences. In International Conference on Artificial Intelligence and Statistics, pp. 4447-4455. PMLR, 2024.
309
+ Bai, J., Bai, S., Chu, Y., Cui, Z., Dang, K., Deng, X., Fan, Y., Ge, W., Han, Y., Huang, F., et al. Qwen technical report. arXiv preprint arXiv:2309.16609, 2023.
310
+ Chen, D. and Dolan, W. B. Collecting highly parallel data for paraphrase evaluation. In Proceedings of the 49th annual meeting of the association for computational linguistics: human language technologies, pp. 190-200, 2011.
311
+ Chen, H., Huang, H., Dong, J., Zheng, M., and Shao, D. Finecliper: Multi-modal fine-grained clip for dynamic facial expression recognition with adapters. In Proceedings of the 32nd ACM International Conference on Multimedia, pp. 2301-2310, 2024.
312
+
313
+ Cheng, S., Fang, K., Yu, Y., Zhou, S., Li, B., Tian, Y., Li, T., Han, L., and Liu, Y. Videogthink: Assessing egocentric video understanding capabilities for embodied ai. arXiv preprint arXiv:2410.11623, 2024a.
314
+ Cheng, Z., Leng, S., Zhang, H., Xin, Y., Li, X., Chen, G., Zhu, Y., Zhang, W., Luo, Z., Zhao, D., et al. Videollama 2: Advancing spatial-temporal modeling and audio understanding in video-llms. arXiv preprint arXiv:2406.07476, 2024b.
315
+ Chiang, W.-L., Li, Z., Lin, Z., Sheng, Y., Wu, Z., Zhang, H., Zheng, L., Zhuang, S., Zhuang, Y., Gonzalez, J. E., et al. Vicuna: An open-source chatbot impressing gpt-4 with $90\%$ chatgpt quality. See https://vicuna.lmsys.org (accessed 14 April 2023), 2(3):6, 2023.
316
+ Dubey, A., Jauhri, A., Pandey, A., Kadian, A., Al-Dahle, A., Letman, A., Mathur, A., Schelten, A., Yang, A., Fan, A., et al. The llama 3 herd of models. arXiv preprint arXiv:2407.21783, 2024.
317
+ Ethayarajh, K., Xu, W., Muennighoff, N., Jurafsky, D., and Kiela, D. Kto: Model alignment as prospect theoretic optimization. arXiv preprint arXiv:2402.01306, 2024.
318
+ Fei, H., Wu, S., Ji, W., Zhang, H., Zhang, M., Lee, M.-L., and Hsu, W. Video-of-thought: Step-by-step video reasoning from perception to cognition. In *Forty-first International Conference on Machine Learning*, 2024a.
319
+ Fei, H., Wu, S., Zhang, H., Chua, T.-S., and Yan, S. Vitron: A unified pixel-level vision llm for understanding, generating, segmenting, editing. 2024b.
320
+ Fei, H., Wu, S., Zhang, M., Zhang, M., Chua, T.-S., and Yan, S. Enhancing video-language representations with structural spatio-temporal alignment. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2024c.
321
+ Fu, C., Dai, Y., Luo, Y., Li, L., Ren, S., Zhang, R., Wang, Z., Zhou, C., Shen, Y., Zhang, M., et al. Video-mme: The first-ever comprehensive evaluation benchmark of multi-modal llms in video analysis. arXiv preprint arXiv:2405.21075, 2024.
322
+ Fu, C., Lin, H., Wang, X., Zhang, Y.-F., Shen, Y., Liu, X., Li, Y., Long, Z., Gao, H., Li, K., et al. Vita-1.5: Towards gpt-4o level real-time vision and speech interaction. arXiv preprint arXiv:2501.01957, 2025a.
323
+ Fu, J., Huangfu, S., Fei, H., Shen, X., Hooi, B., Qiu, X., and Ng, S.-K. Chip: Cross-modal hierarchical direct preference optimization for multimodal llms. arXiv preprint arXiv:2501.16629, 2025b.
324
+ Gunjal, A., Yin, J., and Bas, E. Detecting and preventing hallucinations in large vision language models. In
325
+
326
+ Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pp. 18135-18143, 2024.
327
+ Hu, G., Xin, Y., Lyu, W., Huang, H., Sun, C., Zhu, Z., Gui, L., Cai, R., Cambria, E., and Seifi, H. Recent trends of multimodal affective computing: A survey from nlp perspective. arXiv preprint arXiv:2409.07388, 2024.
328
+ Jang, Y., Song, Y., Yu, Y., Kim, Y., and Kim, G. Tgif-qa: Toward spatio-temporal reasoning in visual question answering. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2758-2766, 2017.
329
+ Jiang, X., Ge, Y., Ge, Y., Shi, D., Yuan, C., and Shan, Y. Supervised fine-tuning in turn improves visual foundation models. arXiv preprint arXiv:2401.10222, 2024.
330
+ Jin, P., Takanobu, R., Zhang, W., Cao, X., and Yuan, L. Chat-univi: Unified visual representation empowers large language models with image and video understanding. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 13700-13710, 2024.
331
+ Lan, W., Chen, W., Chen, Q., Pan, S., Zhou, H., and Pan, Y. A survey of hallucination in large visual language models. arXiv preprint arXiv:2410.15359, 2024.
332
+ Leng, S., Xing, Y., Cheng, Z., Zhou, Y., Zhang, H., Li, X., Zhao, D., Lu, S., Miao, C., and Bing, L. The curse of multi-modalities: Evaluating hallucinations of large multimodal models across language, visual, and audio. arXiv preprint arXiv:2410.12787, 2024.
333
+ Li, C., Im, E. W., and Fazli, P. Vidhalluc: Evaluating temporal hallucinations in multimodal large language models for video understanding. arXiv preprint arXiv:2412.03735, 2024a.
334
+ Li, F., Zhang, R., Zhang, H., Zhang, Y., Li, B., Li, W., Ma, Z., and Li, C. Llava next-Interleave: Tackling multi-image, video, and 3d in large multimodal models. arXiv preprint arXiv:2407.07895, 2024b.
335
+ Li, K., He, Y., Wang, Y., Li, Y., Wang, W., Luo, P., Wang, Y., Wang, L., and Qiao, Y. Videochat: Chat-centric video understanding. arXiv preprint arXiv:2305.06355, 2023.
336
+ Li, K., Wang, Y., He, Y., Li, Y., Wang, Y., Liu, Y., Wang, Z., Xu, J., Chen, G., Luo, P., et al. Mvbench: A comprehensive multi-modal video understanding benchmark. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 22195-22206, 2024c.
337
+ Li, Y., Wang, C., and Jia, J. Llama-vid: An image is worth 2 tokens in large language models. In European Conference on Computer Vision, pp. 323-340. Springer, 2025.
338
+
339
+ Lin, B., Ye, Y., Zhu, B., Cui, J., Ning, M., Jin, P., and Yuan, L. Video-llava: Learning united visual representation by alignment before projection. arXiv preprint arXiv:2311.10122, 2023.
340
+ Liu, H., Li, C., Wu, Q., and Lee, Y. J. Visual instruction tuning. Advances in neural information processing systems, 36, 2024a.
341
+ Liu, H., Xue, W., Chen, Y., Chen, D., Zhao, X., Wang, K., Hou, L., Li, R., and Peng, W. A survey on hallucination in large vision-language models. arXiv preprint arXiv:2402.00253, 2024b.
342
+ Liu, Y., Li, S., Liu, Y., Wang, Y., Ren, S., Li, L., Chen, S., Sun, X., and Hou, L. Tempcompass: Do video llms really understand videos? arXiv preprint arXiv:2403.00476, 2024c.
343
+ Liu, Z., Zang, Y., Dong, X., Zhang, P., Cao, Y., Duan, H., He, C., Xiong, Y., Lin, D., and Wang, J. Miadpo: Multi-image augmented direct preference optimization for large vision-language models. arXiv preprint arXiv:2410.17637, 2024d.
344
+ Lu, J., Li, J., An, S., Zhao, M., He, Y., Yin, D., and Sun, X. Eliminating biased length reliance of direct preference optimization via down-sampled k1 divergence. arXiv preprint arXiv:2406.10957, 2024.
345
+ Maaz, M., Rasheed, H., Khan, S., and Khan, F. S. Video-chatgpt: Towards detailed video understanding via large vision and language models. arXiv preprint arXiv:2306.05424, 2023.
346
+ Maaz, M., Rasheed, H., Khan, S., and Khan, F. Videogpt+: Integrating image and video encoders for enhanced video understanding. arXiv preprint arXiv:2406.09418, 2024.
347
+ Mosig, J. E., Mehri, S., and Kober, T. Star: A schemaguided dialog dataset for transfer learning. arXiv preprint arXiv:2010.11853, 2020.
348
+ Park, R., Rafailov, R., Ermon, S., and Finn, C. Disentangling length from quality in direct preference optimization. arXiv preprint arXiv:2403.19159, 2024.
349
+ Peng, B., Li, C., He, P., Galley, M., and Gao, J. Instruction tuning with gpt-4. arXiv preprint arXiv:2304.03277, 2023.
350
+ Pi, R., Han, T., Xiong, W., Zhang, J., Liu, R., Pan, R., and Zhang, T. Strengthening multimodal large language model with bootstrapped preference optimization. In European Conference on Computer Vision, pp. 382-398. Springer, 2025.
351
+
352
+ Qian, L., Li, J., Wu, Y., Ye, Y., Fei, H., Chua, T.-S., Zhuang, Y., and Tang, S. Momentor: Advancing video large language model with fine-grained temporal reasoning. arXiv preprint arXiv:2402.11435, 2024.
353
+ Radford, A., Kim, J. W., Hallacy, C., Ramesh, A., Goh, G., Agarwal, S., Sastry, G., Askell, A., Mishkin, P., Clark, J., et al. Learning transferable visual models from natural language supervision. In International conference on machine learning, pp. 8748-8763. PMLR, 2021.
354
+ Rafailov, R., Sharma, A., Mitchell, E., Manning, C. D., Ermon, S., and Finn, C. Direct preference optimization: Your language model is secretly a reward model. Advances in Neural Information Processing Systems, 36, 2024.
355
+ Sahoo, P., Meharia, P., Ghosh, A., Saha, S., Jain, V., and Chadha, A. A comprehensive survey of hallucination in large language, image, video and audio foundation models. Findings of the Association for Computational Linguistics: EMNLP 2024, pp. 11709-11724, 2024.
356
+ Sarkar, P., Ebrahimi, S., Etemad, A., Beirami, A., Ark, S. Ö., and Pfister, T. Mitigating object hallucination via data augmented contrastive tuning. arXiv preprint arXiv:2405.18654, 2024.
357
+ Shangguan, Z., Li, C., Ding, Y., Zheng, Y., Zhao, Y., Fitzgerald, T., and Cohan, A. Tomato: Assessing visual temporal reasoning capabilities in multimodal foundation models. arXiv preprint arXiv:2410.23266, 2024.
358
+ Tan, Z., Yang, X., Qin, L., Yang, M., Zhang, C., and Li, H. Evalalign: Supervised fine-tuning multimodal llms with human-aligned data for evaluating text-to-image models. arXiv preprint arXiv:2406.16562, 2024.
359
+ Tom, G., Mathew, M., Garcia-Bordils, S., Karatzas, D., and Jawahar, C. Reading between the lanes: Text videoqa on the road. In International Conference on Document Analysis and Recognition, pp. 137-154. Springer, 2023.
360
+ Touvron, H., Lavril, T., Izacard, G., Martinet, X., Lachaux, M.-A., Lacroix, T., Rozière, B., Goyal, N., Hambro, E., Azhar, F., et al. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023.
361
+ Wang, X., Wu, J., Chen, J., Li, L., Wang, Y.-F., and Wang, W. Y. Vatex: A large-scale, high-quality multilingual dataset for video-and-language research. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 4581-4591, 2019.
362
+ Wang, Y., Wang, Y., Zhao, D., Xie, C., and Zheng, Z. Videohallucer: Evaluating intrinsic and extrinsic hallucinations in large video-language models. arXiv preprint arXiv:2406.16338, 2024.
363
+
364
+ Wu, S., Fei, H., Qu, L., Ji, W., and Chua, T.-S. NExT-GPT: Any-to-any multimodal LLM. In Proceedings of the International Conference on Machine Learning, pp. 53366-53397, 2024a.
365
+ Wu, Z., Chen, X., Pan, Z., Liu, X., Liu, W., Dai, D., Gao, H., Ma, Y., Wu, C., Wang, B., et al. Deepseek-vl2: Mixture-of-experts vision-language models for advanced multimodal understanding. arXiv preprint arXiv:2412.10302, 2024b.
366
+ Xiao, J., Shang, X., Yao, A., and Chua, T.-S. Next-qa: Next phase of question-answering to explaining temporal actions. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 9777-9786, 2021.
367
+ Xie, Y., Li, G., Xu, X., and Kan, M.-Y. V-dpo: Mitigating hallucination in large vision language models via vision-guided direct preference optimization. arXiv preprint arXiv:2411.02712, 2024.
368
+ Xu, D., Zhao, Z., Xiao, J., Wu, F., Zhang, H., He, X., and Zhuang, Y. Video question answering via gradually refined attention over appearance and motion. In Proceedings of the 25th ACM international conference on Multimedia, pp. 1645-1653, 2017.
369
+ Xu, J., Mei, T., Yao, T., and Rui, Y. Msr-vtt: A large video description dataset for bridging video and language. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 5288-5296, 2016.
370
+ Xu, L., Zhao, Y., Zhou, D., Lin, Z., Ng, S. K., and Feng, J. Pllava: Parameter-free llava extension from images to videos for video dense captioning. arXiv preprint arXiv:2404.16994, 2024.
371
+ Yan, W., Zhang, Y., Abbeel, P., and Srinivas, A. Videogpt: Video generation using vq-vae and transformers. arXiv preprint arXiv:2104.10157, 2021.
372
+ Yang, K., Liu, Z., Xie, Q., Huang, J., Min, E., and Ananiadou, S. Selective preference optimization via token-level reward function estimation. arXiv preprint arXiv:2408.13518, 2024.
373
+ Yi, K., Gan, C., Li, Y., Kohli, P., Wu, J., Torralba, A., and Tenenbaum, J. B. Clevrer: Collision events for video representation and reasoning. arXiv preprint arXiv:1910.01442, 2019.
374
+ Yin, S., Fu, C., Zhao, S., Xu, T., Wang, H., Sui, D., Shen, Y., Li, K., Sun, X., and Chen, E. Woodpecker: Hallucination correction for multimodal large language models. Science China Information Sciences, 67(12):220105, 2024.
375
+
376
+ Yu, Z., Xu, D., Yu, J., Yu, T., Zhao, Z., Zhuang, Y., and Tao, D. Activitynet-qa: A dataset for understanding complex web videos via question answering. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 9127–9134, 2019.
377
+ Yuan, Y., Zhang, H., Li, W., Cheng, Z., Zhang, B., Li, L., Li, X., Zhao, D., Zhang, W., Zhuang, Y., et al. Videorefer suite: Advancing spatial-temporal object understanding with video llm. arXiv preprint arXiv:2501.00599, 2024.
378
+ Zeng, Y., Liu, G., Ma, W., Yang, N., Zhang, H., and Wang, J. Token-level direct preference optimization. arXiv preprint arXiv:2404.11999, 2024.
379
+ Zhang, H., Li, X., and Bing, L. Video-llama: An instruction-tuned audio-visual language model for video understanding. arXiv preprint arXiv:2306.02858, 2023a.
380
+ Zhang, J., Jiao, Y., Chen, S., Chen, J., and Jiang, Y.-G. Eventhallusion: Diagnosing event hallucinations in video llms. arXiv preprint arXiv:2409.16597, 2024a.
381
+ Zhang, R., Han, J., Liu, C., Gao, P., Zhou, A., Hu, X., Yan, S., Lu, P., Li, H., and Qiao, Y. Llama-adapter: Efficient fine-tuning of language models with zero-init attention. arXiv preprint arXiv:2303.16199, 2023b.
382
+ Zhang, R., Gui, L., Sun, Z., Feng, Y., Xu, K., Zhang, Y., Fu, D., Li, C., Hauptmann, A., Bisk, Y., et al. Direct preference optimization of video large multimodal models from language model reward. arXiv preprint arXiv:2404.01258, 2024b.
383
+ Zhao, M., Li, B., Wang, J., Li, W., Zhou, W., Zhang, L., Xuyang, S., Yu, Z., Yu, X., Li, G., et al. Towards video text visual question answering: Benchmark and baseline. Advances in Neural Information Processing Systems, 35: 35549-35562, 2022.
384
+ Zhao, Z., Wang, B., Ouyang, L., Dong, X., Wang, J., and He, C. Beyond hallucinations: Enhancing lvlms through hallucination-aware direct preference optimization. arXiv preprint arXiv:2311.16839, 2023.
385
+ Zhou, L., Xu, C., and Corso, J. Towards automatic learning of procedures from web instructional videos. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018.
386
+ Zhou, T., Chen, D., Jiao, Q., Ding, B., Li, Y., and Shen, Y. Humanbench: Exploring human-centric video understanding capabilities of mllms with synthetic benchmark data. arXiv preprint arXiv:2412.17574, 2024a.
387
+ Zhou, Y., Cui, C., Rafailov, R., Finn, C., and Yao, H. Aligning modalities in vision large language models via preference fine-tuning. arXiv preprint arXiv:2402.11411, 2024b.
388
+
389
+ Zhu, B., Lin, B., Ning, M., Yan, Y., Cui, J., Wang, H., Pang, Y., Jiang, W., Zhang, J., Li, Z., et al. Language-bind: Extending video-language pretraining to n-modality by language-based semantic alignment. arXiv preprint arXiv:2310.01852, 2023.
390
+
391
+ # A. Limitation and Future Work
392
+
393
+ While VistaDPO excels at aligning video and language with fine-grained precision, its performance on long-duration videos with complex temporal dependencies leaves room for improvement. Such scenarios pose unique challenges for any alignment framework. Building on our strong spatial-temporal modeling foundation, future work could explore hierarchical architectures or memory-augmented mechanisms to further enhance the ability to capture long-term interactions, extending the reach of our method to even more complex video-language tasks.
394
+
395
+ # B. More Details of Data Annotation
396
+
397
+ Table 4. Summary of Hallucination Types, Sample Counts, and Data Sources.
398
+
399
+ <table><tr><td>Hallucination Type</td><td>Sample Count</td><td>Data Source</td></tr><tr><td>Object</td><td>1,200</td><td>MSR-VTT, STAR, VATEX</td></tr><tr><td>Number</td><td>500</td><td>ActivityNet-QA, MSR-VTT, NExT-QA, VATEX</td></tr><tr><td>Location</td><td>500</td><td>MSR-VTT, NExT-QA, VATEX</td></tr><tr><td>Color</td><td>500</td><td>ActivityNet-QA, CLEVRR, MSR-VTT, VATEX</td></tr><tr><td>Static Relation</td><td>800</td><td>ActivityNet-QA, MSR-VTT, VATEX</td></tr><tr><td>OCR</td><td>500</td><td>RoadTextVQA, ViteVQA</td></tr><tr><td>Action</td><td>1,200</td><td>MSR-VTT, MSVD, STAR, VATEX</td></tr><tr><td>Dynamic Attribute</td><td>300</td><td>TempCompass, Tomato</td></tr><tr><td>Dynamic Relation</td><td>1,500</td><td>MSR-VTT, NExT-QA, STAR, VATEX, VCGBench-Diverse</td></tr><tr><td>Sequence</td><td>200</td><td>Video-MME, YouCook2</td></tr></table>
400
+
401
+ Datasets Sources. We constructed a dataset by sampling from the validation sets of 14 existing datasets in Table 4, specifically MSR-VTT (Xu et al., 2016), STAR (Mosig et al., 2020), VATEX (Wang et al., 2019), ActivityNet-QA (Yu et al., 2019), NExT-QA (Xiao et al., 2021), CLEVRER (Yi et al., 2019), RoadTextVQA (Tom et al., 2023), ViteVQA (Zhao et al., 2022), MSVD (Chen & Dolan, 2011), TempCompass (Liu et al., 2024c), Tomato (Shangguan et al., 2024), VCGBench-Diverse (Maaz et al., 2024), Video-MME (Fu et al., 2024), and YouCook2 (Zhou et al., 2018), encompassing tasks such as binary QA, multiple-choice QA, and captioning-QA. To define hallucination within the context of video-based QA, we categorized it into two dimensions: Perception and Temporal, and generated corresponding chosen and rejected responses.
402
+
403
+ Specifically, the Perception dimension evaluates the model's ability to recognize static information in videos. This includes object recognition, identifying static attributes (e.g., number, color, position), understanding spatial relationships between objects, and extracting other elements such as OCR. In contrast, the Temporal dimension assesses the model's ability
404
+
405
+ ![](images/a21f6eac760f34e8e9420a464d6964bec9409c34e25208e40a197f1b03b2ee90.jpg)
406
+ Figure 9. Illustration of dataset pipeline for constructing augmented video-language QA pairs. (a) Original QA pairs are extracted from existing prevalent datasets, providing basic QA pairs. (b) These pairs are augmented by introducing chosen and rejected answers, where rejected answers include both irrelevant responses (e.g., "shopping cart") and relevant but incorrect ones (e.g., "table"). (c) To enhance spatiotemporal understanding, manual annotations are added, specifying object appearances, spatial coordinates (e.g., bounding boxes), and temporal dynamics (e.g., appearance and disappearance timestamps). This pipeline ensures richer, more nuanced data for hierarchical preference optimization in video-language tasks.
407
+
408
+ to comprehend dynamic temporal information, such as recognizing actions, identifying subtle dynamic attributes (e.g., movement direction, speed, shape), understanding event relationships, and perceiving action sequences within the video. By leveraging the prompt structure illustrated in Figure 9, we expanded the original QA data into a dataset suitable for DPO training with chosen and rejected responses. During the construction of rejected response, we carefully considered whether the core semantics of the question were present in the video, generating both relevant and irrelevant rejected responses. This approach aims to enhance the model's global understanding and robustness at the response level.
409
+
410
+ To explicitly strengthen the model's spatiotemporal perception capabilities, we first identified all objects involved in the video. Subsequently, we manually annotated keyframes in which at least $30\%$ of the object's contours appeared or disappeared in the frame, as well as any keyframes directly relevant to answering the question. For each annotated keyframe, we labeled the bounding box coordinates (i.e., $(x,y,w,h)$ ) of the objects.
411
+
412
+ Quality Control. To ensure annotation quality, all annotators were PhD students from universities who underwent standardized training and utilized a unified annotation tool. Each video was annotated independently by two annotators, and cross-validation was performed. Samples with annotation discrepancies were discarded to maintain high data quality.
413
+
414
+ # C. More Discussions on Related Work
415
+
416
+ Table 5. Comparison among different DPO strategies.
417
+
418
+ <table><tr><td rowspan="2">Method</td><td rowspan="2">LLM</td><td rowspan="2">Base Model (7B, if not specified)</td><td colspan="3">DPO</td><td rowspan="2">Textual Granularity</td><td rowspan="2">Visual Dimension</td></tr><tr><td>Text</td><td>Image</td><td>Video</td></tr><tr><td>DPO (Rafailov et al., 2024)</td><td>Text</td><td>Pythia-2.8B</td><td>✓</td><td>X</td><td>X</td><td>Sentence</td><td></td></tr><tr><td>IPO (Azar et al., 2024)</td><td>Text</td><td>Pythia-2.8B</td><td>✓</td><td>X</td><td>X</td><td>Sentence</td><td></td></tr><tr><td>KTO (Ethayarajh et al., 2024)</td><td>Text</td><td>Llama-3-8B &amp; Qwen-3B-Instruct</td><td>✓</td><td>X</td><td>X</td><td>Sentence</td><td></td></tr><tr><td>R-DPO (Park et al., 2024)</td><td>Text</td><td>Pythia-2.8B</td><td>✓</td><td>X</td><td>X</td><td>Sentence</td><td></td></tr><tr><td>SamPO (Lu et al., 2024)</td><td>Text</td><td>Tulu2-13B-SFT &amp; Llama3-8B-Instruct</td><td>✓</td><td>X</td><td>X</td><td>Sentence</td><td></td></tr><tr><td>SePO (Yang et al., 2024)</td><td>Text</td><td>LLaMA2-Chat &amp; Pythia-SFT-6.9B</td><td>✓</td><td>X</td><td>X</td><td>Sentence &amp; Token</td><td></td></tr><tr><td>TDPO (Zeng et al., 2024)</td><td>Text</td><td>GPT-2-Large</td><td>✓</td><td>X</td><td>X</td><td>Sentence &amp; Token</td><td></td></tr><tr><td>HA-DPO (Zhao et al., 2023)</td><td>Image</td><td>LLaVA-v1.5 &amp; MiniGPT-4</td><td>✓</td><td>X</td><td>X</td><td>Sentence</td><td></td></tr><tr><td>BPO (Pi et al., 2025)</td><td>Image</td><td>LLaVA-v1.5</td><td>✓</td><td>X</td><td>X</td><td>Sentence</td><td></td></tr><tr><td>FDPO (Gunjal et al., 2024)</td><td>Image</td><td>InstructBLIP-13B</td><td>✓</td><td>X</td><td>X</td><td>Sentence</td><td></td></tr><tr><td>HALVA (Sarkar et al., 2024)</td><td>Image</td><td>LLaVA-v1.5</td><td>✓</td><td>X</td><td>X</td><td>Sentence &amp; Token</td><td></td></tr><tr><td>POVID (Zhou et al., 2024b)</td><td>Image</td><td>LLaVA-v1.5</td><td>✓</td><td>✓</td><td>X</td><td>Sentence</td><td>Spatial</td></tr><tr><td>MIA-DPO (Liu et al., 2024d)</td><td>Image</td><td>LLaVA-v1.5 &amp; InternLM-XC2.5</td><td>✓</td><td>✓</td><td>X</td><td>Sentence</td><td>Spatial</td></tr><tr><td>V-DPO (Xie et al., 2024)</td><td>Image</td><td>LLaVA-v1.5</td><td>✓</td><td>✓</td><td>X</td><td>Sentence</td><td>Spatial</td></tr><tr><td>Next-DPO (Li et al., 2024b)</td><td>Video</td><td>LLaVA-Next</td><td>✓</td><td>X</td><td>X</td><td>Sentence</td><td></td></tr><tr><td>Hound-DPO (Zhang et al., 2024b)</td><td>Video</td><td>Video-LLaVA</td><td>✓</td><td>X</td><td>X</td><td>Sentence</td><td></td></tr><tr><td>VistaDPO (Ours)</td><td>Video</td><td>Video-LLaVA &amp; PLLaVA</td><td>✓</td><td>✓</td><td>✓</td><td>Sentence &amp; Token</td><td>Spatial &amp; Temporal</td></tr></table>
419
+
420
+ To highlight our contributions, we detail in Table 5 how our proposed VistaDPO differs from previous DPO strategies. Two critical distinctions are summarized as follows:
421
+
422
+ - Spatial-Temporal Video Preference Optimization: Previous DPO methods predominantly focused on language-level alignment. With advancements in the field, the focus gradually shifted from language models to vision-language models. While some works incorporated image-level visual alignment, these approaches remained limited to static images. Recent works like LLaVA-Next-DPO (Li et al., 2024b) and LLaVA-Hound-DPO (Zhang et al., 2024b) extended DPO strategies to video-language models. However, these methods only applied vanilla DPO strategies, optimizing alignment exclusively at the language level, with no explicit focus on visual modeling. In contrast, VistaDPO uniquely emphasizes optimizing spatial-temporal preferences in videos. By explicitly modeling both spatial and temporal preferences, VistaDPO bridges the gap between video content and textual understanding. This dual-layer spatial-temporal optimization enables our framework to address the complexities of video-language tasks comprehensively.
423
+ - Hierarchical Finer Granularity: Most existing DPO approaches operate at a coarse granularity, typically limited to sentence-level alignment for text and holistic-level alignment for visuals. Advanced methods explore token-level textual alignment but still overlook hierarchical visual structures, which are crucial for video understanding. VistaDPO introduces a hierarchical granularity approach, incorporating both sentence- and token-level granularity for textual alignment and spatial- (object-) and temporal- (clip-) level granularity for visual alignment. By structuring alignment hierarchically across multiple layers—spanning from fine-grained token and object representations to coarse-grained sentence and video-level relationships—VistaDPO achieves a robust and precise preference optimization. This hierarchical approach
424
+
425
+ empowers our framework to capture intricate cross-modal dependencies, ensuring superior performance in challenging scenarios such as adversarial testing and hallucination reduction.
426
+
427
+ # D. Extended Details of Methodology: Formulas and Prompts
428
+
429
+ This section details the core methodology used in VistaDPO, including the mathematical formulations and prompts employed during training. Key formulas for DPO are provided, along with the specific prompt templates used for generating and refining QA pairs. These details aim to provide a comprehensive understanding of the technical implementation.
430
+
431
+ # D.1. Formulations of Token-Level Preference Optimization.
432
+
433
+ Token-Level Preference Optimization (TLPO) is a fine-grained optimization framework designed to align model outputs with human preferences by leveraging token-wise feedback. Unlike response-level optimization, TLPO avoids the cancellation of policies that may occur at the sentence level by focusing on sequential KL divergence at the token level.
434
+
435
+ Human Preference Modeling. We employ the Bradley-Terry model to represent the probability of human preferences for a winning response $y_{w}$ over a losing response $y_{l}$ , given the input $x$ and auxiliary video context $v_{w}^{f}$ . The preference probability is defined as:
436
+
437
+ $$
438
+ P _ {\mathrm {B T}} (y _ {w} \succ y _ {l} | x, v _ {w} ^ {f}) = \sigma \big (\lambda (x, v _ {w} ^ {f}, y _ {w}, y _ {l}) - \delta (x, v _ {w} ^ {f}, y _ {w}, y _ {l}) \big),
439
+ $$
440
+
441
+ where $\sigma (\cdot)$ is the sigmoid function, $\lambda (x,v_w^f,y_w,y_l)$ represents the difference in rewards, and $\delta (x,v_w^f,y_w,y_l)$ is the difference in sequential KL divergence between the preference pairs. These terms are defined as follows:
442
+
443
+ $$
444
+ \lambda (x, v _ {w} ^ {f}, y _ {w}, y _ {l}) = \beta \log \frac {\pi_ {\theta} (y _ {w} | x , v _ {w} ^ {f})}{\pi_ {\mathrm {r e f}} (y _ {w} | x , v _ {w} ^ {f})} - \beta \log \frac {\pi_ {\theta} (y _ {l} | x , v _ {w} ^ {f})}{\pi_ {\mathrm {r e f}} (y _ {l} | x , v _ {w} ^ {f})},
445
+ $$
446
+
447
+ $$
448
+ \delta (x, v _ {w} ^ {f}, y _ {w}, y _ {l}) = \beta D _ {\mathrm {S e q K L}} (x, v _ {w} ^ {f}, y _ {w}; \pi_ {\mathrm {r e f}} | | \pi_ {\theta}) - \beta D _ {\mathrm {S e q K L}} (x, v _ {w} ^ {f}, y _ {l}; \pi_ {\mathrm {r e f}} | | \pi_ {\theta}).
449
+ $$
450
+
451
+ Sequential KL Divergence. The sequential KL divergence $D_{\mathrm{SeqKL}}$ is defined as the sum of token-level KL divergences across the sequence:
452
+
453
+ $$
454
+ D _ {\mathrm {S e q K L}} (x, v _ {w} ^ {f}, y; \pi_ {\mathrm {r e f}} | | \pi_ {\theta}) = \sum_ {t = 1} ^ {T} D _ {\mathrm {K L}} (\pi_ {\mathrm {r e f}} (y ^ {t} | x, v _ {w} ^ {f}, y ^ {< t}) | | \pi_ {\theta} (y ^ {t} | x, v _ {w} ^ {f}, y ^ {< t})),
455
+ $$
456
+
457
+ where $T$ is the length of the sequence $y$ , and $y^{<t}$ denotes the tokens generated up to step $t - 1$ .
458
+
459
+ Loss Function for TLPO. Combining the Bradley-Terry model and the sequential KL divergence, the loss function for TLPO is expressed as:
460
+
461
+ $$
462
+ \mathcal {L} _ {\mathrm {T L P O}} = - \mathbb {E} _ {(x, v _ {w} ^ {f}, y _ {w}, y _ {l})} \left[ \log \sigma \left(\lambda (x, v _ {w} ^ {f}, y _ {w}, y _ {l}) - \delta (x, v _ {w} ^ {f}, y _ {w}, y _ {l})\right) \right].
463
+ $$
464
+
465
+ Substituting $\lambda (x,v_w^f,y_w,y_l)$ and $\delta (x,v_w^f,y_w,y_l)$ , the loss function can be rewritten as:
466
+
467
+ $$
468
+ \begin{array}{l} \mathcal {L} _ {\mathrm {T L P O}} = - \mathbb {E} _ {(x, v _ {w} ^ {f}, y _ {w}, y _ {l})} \left[ \log \sigma \left(\beta \log \frac {\pi_ {\theta} \left(y _ {w} \mid x , v _ {w} ^ {f}\right)}{\pi_ {\text {r e f}} \left(y _ {w} \mid x , v _ {w} ^ {f}\right)} - \beta \log \frac {\pi_ {\theta} \left(y _ {l} \mid x , v _ {w} ^ {f}\right)}{\pi_ {\text {r e f}} \left(y _ {l} \mid x , v _ {w} ^ {f}\right)} \right. \right. \tag {15} \\ \left. \left. - \alpha \left(D _ {\operatorname {S e q K L}} \left(x, v _ {w} ^ {f}, y _ {w}; \pi_ {\mathrm {r e f}} \right| | \pi_ {\theta}\right) - \operatorname {s g} \left(D _ {\operatorname {S e q K L}} \left(x, v _ {w} ^ {f}, y _ {l}; \pi_ {\mathrm {r e f}} \right| | \pi_ {\theta}\right)\right)\right) \Bigg ]. \\ \end{array}
469
+ $$
470
+
471
+ where $\alpha$ is a hyperparameter controlling the weight of the sequential KL divergence difference, and $\mathrm{sg}(\cdot)$ represents the stop-gradient operator.
472
+
473
+ Final Formulation. The optimization term for TLPO, denoted as $\mathcal{L}_{DPO_t}$ , focuses solely on the sequential KL divergence difference:
474
+
475
+ $$
476
+ \mathcal {L} _ {D P O _ {t}} = \operatorname {s g} \left(\beta D _ {\operatorname {S e q K L}} \left(x, v _ {w} ^ {f}, y _ {w}; \pi_ {\text {r e f}} \right\| \pi_ {\theta})\right) - \beta D _ {\operatorname {S e q K L}} \left(x, v _ {w} ^ {f}, y _ {l}; \pi_ {\text {r e f}} \right\| \pi_ {\theta}).
477
+ $$
478
+
479
+ This term ensures that the learned policy $\pi_{\theta}$ aligns closely with the winning sequence $y_{w}$ while diverging from the losing sequence $y_{l}$ , effectively capturing human preferences at the token level.
480
+
481
+ # D.2. Prompt templates for Generating QA pairs.
482
+
483
+ To adapt the existing dataset for fine-grained DPO training, we employed a template-based approach, as illustrated in Figure 10, and processed it using GPT-4. Specifically, we demonstrate the details of the prompt design using a multiple-choice dataset as an example.
484
+
485
+ ![](images/f2a265d36641dab723622bb87295a9c94c99be78d0ae906191e986914f35a635.jpg)
486
+ Figure 10. A prompt template designed for generating hallucinated responses in multimodal models is presented. The template transforms original video QA pairs into a "chosen response" (a rephrased correct answer) and two "rejected responses" (one contextually relevant but incorrect, and one entirely unrelated). This framework supports preference optimization by providing plausible yet inaccurate alternatives for training and evaluation. An example illustrates the process, highlighting the generation of both coherent and unrelated hallucinated responses.
487
+
488
+ # System Prompt
489
+
490
+ You are an expert in generating hallucinated sentences multiple-choice questions.
491
+
492
+ ![](images/d29aee8068dafa8536d45b8eb95f3a78d8d0f2a4a2d2641174a4e4ac26556a23.jpg)
493
+
494
+ # User Prompt
495
+
496
+ [Definition]
497
+
498
+ {Hallucination} in multimodal models refers to generating responses that are inconsistent with the actual visual content. A specific subtype of hallucination is {HALLUCINATION_TYPE}, where the model generates responses based on incorrect or imagined information.
499
+
500
+ [Task]
501
+
502
+ Based on the input {video QA}, take the original correct answer and modify it into plausible but wrong sentences (rejected responses) that fit the context but do not match the video. Then generate:
503
+
504
+ A{chosen response} (correct answer, rephrased naturally).
505
+
506
+ Two{rejected responses}
507
+
508
+ -One modified from the original correct answer to be relevant but incorrect (full sentence).
509
+ -One completely unrelated (full sentence).
510
+
511
+ [Example]
512
+
513
+ Input: (Original Video QA):
514
+
515
+ {Prompt}: What type of car is featured in the video?
516
+
517
+ {Correct Answer}: A Porsche 911 GT3.
518
+
519
+ Output:
520
+
521
+ {Prompt}: What type of car is featured in the video?
522
+
523
+ {Chosen}: The car shown is a Porsche 911 GT3 with carbon fiber detailing.
524
+
525
+ {Rejected-1}: The video features a Ferrari 488 Spider, which looks similar to a Porsche.
526
+
527
+ {Rejected-2}: The video shows a train passing through a rural area.
528
+
529
+ # E. More Comparison on MVBench
530
+
531
+ To more comprehensively evaluate VistaDPO, we conduct tests on MVBench (Li et al., 2024c), which contains 4,000 QA pairs across 11 video datasets covering a wide range of scenes, ranging from first-person to third-person and from indoor to outdoor environments. These tasks are categorized into 20 fine-grained temporal understanding tasks. The results in Table 6 shown an overall improvement of $2.7\%$ and $3.3\%$ compared to base model PLLaVA and Video-LLaVA, respectively. Notably, VistaDPO excels in Object Existence $(8.5\%)$ and $7.5\%$ , Object Interaction $(5.0\%)$ and $6.5\%$ , Moving Direction $(2.5\%)$ and $7.0\%$ , Action Localization $(9.5\%)$ and $6.0\%$ , and Fine-grained Pose $(6.5\%)$ and $6.0\%$ , demonstrating the effectiveness of our spatial-temporal and fine-grained modeling approach.
532
+
533
+ # F. Exhibition Board
534
+
535
+ Qualitative Demonstration. We show some unselected video QA cases in Figure 11, which are sourced from VideoHallucer (Wang et al., 2024) and EventHallusion (Zhang et al., 2024a).
536
+
537
+ VistaDPO-7K Sample Demonstration. We show examples of constructed VistaDPO-7K from temporal samples in Figure 12 and perception samples in Figure 13.
538
+
539
+ Table 6. Comparisons on MVBench. Bold values indicate the best performance achieved on the corresponding base model, while underlined values represent the second-best performance. The results of VideoChat, VideoChatGPT, Video-LLaMA, and VideoChat2 are included as references, but they are not directly related to the contributions of this paper.
540
+
541
+ <table><tr><td>Models</td><td>Avg.</td><td>AS</td><td>AP</td><td>AA</td><td>FA</td><td>UA</td><td>OE</td><td>OI</td><td>OS</td><td>MD</td><td>AL</td><td>ST</td><td>AC</td><td>MC</td><td>MA</td><td>SC</td><td>FP</td><td>CO</td><td>EN</td><td>ER</td><td>CI</td></tr><tr><td>VideoChat (Li et al., 2023)</td><td>35.5</td><td>33.5</td><td>26.5</td><td>56.0</td><td>33.5</td><td>40.5</td><td>53.0</td><td>40.5</td><td>30.0</td><td>25.5</td><td>27.0</td><td>48.5</td><td>35.0</td><td>20.5</td><td>42.5</td><td>46.0</td><td>26.5</td><td>41.0</td><td>23.5</td><td>23.5</td><td>36.0</td></tr><tr><td>VideoChatGPT (Maaz et al., 2023)</td><td>32.7</td><td>23.5</td><td>26.0</td><td>62.0</td><td>22.5</td><td>26.5</td><td>54.0</td><td>28.0</td><td>40.0</td><td>23.0</td><td>20.0</td><td>31.0</td><td>30.5</td><td>25.5</td><td>39.5</td><td>48.5</td><td>29.0</td><td>33.0</td><td>29.5</td><td>26.0</td><td>35.5</td></tr><tr><td>Video-LLaMA (Zhang et al., 2023a)</td><td>34.1</td><td>27.5</td><td>25.5</td><td>51.0</td><td>29.0</td><td>39.0</td><td>48.0</td><td>40.5</td><td>38.0</td><td>22.5</td><td>22.5</td><td>43.0</td><td>34.0</td><td>22.5</td><td>32.5</td><td>45.5</td><td>32.5</td><td>40.0</td><td>30.0</td><td>21.0</td><td>37.0</td></tr><tr><td>VideoChat2 (Li et al., 2024c)</td><td>51.1</td><td>66.0</td><td>47.5</td><td>83.5</td><td>49.5</td><td>60.0</td><td>58.0</td><td>71.5</td><td>42.5</td><td>23.0</td><td>23.0</td><td>88.5</td><td>39.0</td><td>42.0</td><td>58.5</td><td>44.0</td><td>49.0</td><td>36.5</td><td>35.0</td><td>40.5</td><td>65.5</td></tr><tr><td>PLLaVA (Xu et al., 2024)</td><td>46.6</td><td>58.0</td><td>49.0</td><td>55.5</td><td>41.0</td><td>61.0</td><td>56.0</td><td>61.0</td><td>36.0</td><td>23.5</td><td>26.0</td><td>82.0</td><td>39.5</td><td>42.0</td><td>52.0</td><td>45.0</td><td>42.0</td><td>53.5</td><td>30.5</td><td>48.0</td><td>31.0</td></tr><tr><td>+ Hound-DPO (Zhang et al., 2024b)</td><td>45.3</td><td>54.0</td><td>46.0</td><td>57.0</td><td>37.5</td><td>59.5</td><td>54.5</td><td>62.0</td><td>31.5</td><td>23.5</td><td>26.5</td><td>83.5</td><td>38.0</td><td>41.5</td><td>50.0</td><td>41.0</td><td>39.5</td><td>50.5</td><td>32.0</td><td>46.0</td><td>32.5</td></tr><tr><td>+ VistaDPO (Ours)</td><td>49.3</td><td>59.5</td><td>51.0</td><td>60.0</td><td>41.5</td><td>59.0</td><td>64.5</td><td>66.0</td><td>35.0</td><td>27.0</td><td>35.5</td><td>82.5</td><td>40.0</td><td>45.5</td><td>51.5</td><td>48.0</td><td>48.5</td><td>54.0</td><td>31.0</td><td>50.0</td><td>35.0</td></tr><tr><td>Video-LLaVA (Lin et al., 2023)</td><td>43.0</td><td>46.0</td><td>42.5</td><td>56.5</td><td>39.0</td><td>53.5</td><td>53.0</td><td>48.0</td><td>41.0</td><td>29.0</td><td>31.5</td><td>82.5</td><td>45.0</td><td>26.0</td><td>53.0</td><td>41.5</td><td>33.5</td><td>41.5</td><td>27.5</td><td>38.5</td><td>31.5</td></tr><tr><td>+ Hound-DPO (Zhang et al., 2024b)</td><td>43.3</td><td>44.5</td><td>40.0</td><td>59.0</td><td>39.0</td><td>52.5</td><td>53.5</td><td>49.5</td><td>36.5</td><td>32.0</td><td>33.5</td><td>79.0</td><td>43.0</td><td>28.0</td><td>55.5</td><td>42.0</td><td>30.0</td><td>43.0</td><td>31.0</td><td>39.0</td><td>35.0</td></tr><tr><td>+ VistaDPO (Ours)</td><td>46.3</td><td>47.5</td><td>45.0</td><td>58.5</td><td>42.0</td><td>51.5</td><td>60.5</td><td>54.5</td><td>39.5</td><td>36.0</td><td>37.5</td><td>82.5</td><td>49.0</td><td>28.5</td><td>51.0</td><td>49.0</td><td>39.5</td><td>44.0</td><td>29.0</td><td>42.0</td><td>38.5</td></tr></table>
542
+
543
+ Note: Action: Action Sequence (AS), Action Prediction (AP), Action Antonym (AA), Fine-grained Action (FA), Unexpected Action (UA); Object: Object Existence (OE), Object Interaction (OI), Object Shuffle (OS); Position: Moving Direction (MD), Action Localization (AL); Scene: Scene Transition (ST); Count: Action Count (AC), Moving Count (MC); Attribute: Moving Attribute (MA), State Change (SC); Pose: Fine-grained Pose (FP); Character: Character Order (CO); Cognition: Egocentric Navigation (EN), Episodic Reasoning (ER), Counterfactual Inference (CI).
544
+
545
+ ![](images/ae10a5244a4a9c6ccd5906cedba24ebd6d57da1f6fab7b00ea49fd79d5fd5a18.jpg)
546
+
547
+ ![](images/22fd46685639794c19bd36313c8c5d3c86ef6910acc84f3e749e988b9d8246e1.jpg)
548
+
549
+ Does the car in the video move forward?
550
+
551
+ ![](images/10cb878d51474ff97caba1a5628a40f2568f0eb817a1583c6f01177463b3790e.jpg)
552
+
553
+ Yes, the car in the video moves forward.
554
+
555
+ Hound-DPO
556
+
557
+ Yes, the car does move forward in the video.
558
+
559
+ +VistaDPO
560
+
561
+ No, the car in the video remains stationary, but the video shows kids with school bags moving forward.
562
+
563
+ ![](images/761bf08937bdfaec6550c583735db82a795749f713cd4bc4c5b3034e741ec56b.jpg)
564
+ Figure 11. Cases of VistaDPO in video understanding.
565
+
566
+ ![](images/6fe2a81702734a5e29ed14711fa129c7b21755962c1fc73d59425160c706bee8.jpg)
567
+
568
+ Is the person with a yellow helmet in the video sitting on a bicycle and riding it?
569
+
570
+ ![](images/a6a6a5c9a71a5280e0bf5cafdf47740ab589a2f91989e24bf432cf76663f834d.jpg)
571
+
572
+ Yes, the person in the yellow helmet is sitting on the bike and riding it.
573
+
574
+ Hound-DPO
575
+
576
+ Yes, the person with a yellow helmet sits on a bicycle and rides it.
577
+
578
+ +VistaDPO
579
+
580
+ No, the person in the yellow helmet is not riding but repairing the bicycle.
581
+
582
+ ![](images/c68651b4c894bcb890e027992417dece15cbe747d057fee38df9bc4bd02b0ec4.jpg)
583
+
584
+ ![](images/df2dda215cdacaa98326ad4ed1520a8ab136483fd0c855e95d01ef5bcf4dd9c4.jpg)
585
+
586
+ Does the person in the video touch his hair?
587
+
588
+ ![](images/afdacfafef319efe159a0bbe8752ccf947873c4688a8b378291e9137f2d8dd1a.jpg)
589
+
590
+ Yes, the person in the video touches his hair while talking to the camera.
591
+
592
+ +Hound-DPO
593
+
594
+ Yes, the person in the video touches his hair in some of frames.
595
+
596
+ +VistaDPO
597
+
598
+ No, the person in the video does not touch his hair, but focuses on what looks like a drawing board object in front of him.
599
+
600
+ ![](images/df06b792a2b9164ca8a85ee2dae2f5d84b0db66625a618800889f197ada606bd.jpg)
601
+
602
+ ![](images/bc74ef6ba13e27061255817f26896952d43e93e12f069c299bed6239fd7cdf47.jpg)
603
+
604
+ Did any accident or anything unexpected happen in the video?
605
+
606
+ ![](images/b26214f3b40a6b119e983490ab8a1b479c895b75442f930b68fa5d938d713808.jpg)
607
+
608
+ No, the athlete is performing gymnastics with a balance beam without accident.
609
+
610
+ +Hound-DPC
611
+
612
+ No, no accidents or any unexpected happen in the video.
613
+
614
+ +VistaDPO
615
+
616
+ Yes, the athlete fell in an accident while doing gymnastics on the balance beam.
617
+
618
+ ![](images/b2cd55120a7b052f07ac797b45aa1262b2fa1177b8c310a63f393b5fda0047ee.jpg)
619
+
620
+ Question: What does the baby do after picking up a red toy at the start?
621
+
622
+ Chosen: After picking up the red toy, the baby walks towards a woman dressed in jeans. "is_in_video": true
623
+
624
+ Reject1: The baby smiles before turning its head to look directly into the camera lens. "is_in_video": true
625
+
626
+ Reject2: The baby stands up and begins to rotate a small ball in its hand. "is_in_video": false
627
+
628
+ Spatial-Temporal Grounding Information: {Obiect-(t, x, y, w, h)}
629
+
630
+ red toy: (10.58, 145.2908, 309.6, 104.4653, 94.8), (15.48, 314.5966, 136.8, 105.6660, 76.8), (16.18, 255.7598, 265.2, 76.8480, 74.4), (19.02, 280.9756, 120.0, 70.8443, 91.2), (19.69, 283.3771, 91.2, 52.8330, 84.0), (21.59, 347.0169, 129.6, 66.0413, 64.8), (24.26, 315.7974, 158.4, 82.8518, 76.8), (44.64, 154.8968, 156.0, 48.0300, 54.0), (46.61, 208.9306, 268.8, 103.2645, 111.6),
631
+
632
+ baby: (12.88, 181.3133, 164.4, 297.7861, 234.0), (16.35, 255.7598, 62.4, 220.9381, 375.6), (19.85, 195.7223, 63.6, 189.7186, 294.0), (21.76, 217.3358, 75.6, 133.2833, 216.0), (25.99, 224.5403, 109.2, 132.0826, 182.4), (50.78, 51.6323, 134.4, 139.2871, 192.0)
633
+
634
+ ![](images/333fefa9263b841dc006c45e2ad41b06a7328b2bd644139f0c3a8cdf5848019c.jpg)
635
+
636
+ Question: What does the lady do after opening the bottle?
637
+
638
+ Chosen: After opening the bottle, the lady takes a sip directly from it. "is_in(video": true
639
+
640
+ Reject1: She carefully places the bottle back on the table without taking a single drink. "is_in Video": true
641
+
642
+ Reject2: Instead of drinking it, she pours the contents into a glass. "is_in Video": false
643
+
644
+ Spatial-Temporal Grounding Information: {Object-(t, x, y, w, h)}
645
+
646
+ bottle: (12.34, 420.2627, 244.8, 105.6660, 87.6). (14.56, 419.0619, 152.4, 75.6473, 88.8), (15.78, 318.1989, 271.2, 68.4428, 110.4).
647
+
648
+ ![](images/773eb4d6359b2d55e59afe9756efebaad2fc85730feb1b72a9664614af837967.jpg)
649
+ Figure 12. Temporal data samples of VistaDPO-7K.
650
+
651
+ Question: What did the person pour into the container during the video?
652
+
653
+ Chosen: The person poured juice into the container during the video. "is_in_video": true
654
+
655
+ Reject1: The person poured the contents of the bag into the container during the video. "is_in Video": true
656
+
657
+ Reject2: The person used an umbrella to cover the container during the video. "is_in Video": false
658
+
659
+ Spatial-Temporal Grounding Information: {Obejct-(t, x, y, w, h)}
660
+
661
+ person: (3.04, 3.0, 5.0, 315.0, 355.0), (13.11, 4.0, 123.0, 283.0, 237.0), (53.65, 329.0, 22.0, 151.0, 339.0)
662
+
663
+ juice: (0.57, 304.0, 65.0, 47.0, 74.0), (13.11, 40.0, 171.0, 126.0, 78.0), (20.05, 296.0, 292.0, 70.0, 67.0).
664
+
665
+ ![](images/8800547ee7a4fbf7123bba4ae987f3855d6d64828d1a901b7ffa6c2128e23ea9.jpg)
666
+ Figure 13. Perception data samples of VistaDPO-7K.
667
+
668
+ Question: What is on the left of the river?
669
+
670
+ Chosen: On the left side of the river, there is a tall tree providing shade over the bank. "is_in_video": true
671
+
672
+ Reject1: To the left of the river, you can see a striking fountain that adds a splash of color to the scene. "is_in_video": flase
673
+
674
+ Reject2: On the opposite side of the river, there's a simple wooden bench for people to rest. "is_in_video": false
675
+
676
+ Spatial-Temporal Grounding Information: {Obiect-(t, x, y, w, h)}
677
+
678
+ tree: (0.08, 16.0, 12.7811, 1539.2, 408.9941), (170.68, 6.4, 12.7811, 1913.6, 731.7160), (171.12, 9.6, 22.3669, 1932.8, 702.9586)
679
+
680
+ river: (0.12, 6.4, 415.3846, 1900.8, 664.6154), (113.68, 35.2, 619.8817, 1849.6, 447.3373), (170.0, 32.0, 610.2959, 1891.2, 456.9231)
2025/$_mathcalVista_mathcalDPO$_ Video Hierarchical Spatial-Temporal Direct Preference Optimization for Large Video Models/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:118b778790304af94ff14d733d8967deffbd8305660c54e42f888854543e1993
3
+ size 1538950
2025/$_mathcalVista_mathcalDPO$_ Video Hierarchical Spatial-Temporal Direct Preference Optimization for Large Video Models/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/$_mathrmμ$nit Scaling_ Simple and Scalable FP8 LLM Training/1b23a01c-8312-4db1-9bf6-0617c15708db_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/$_mathrmμ$nit Scaling_ Simple and Scalable FP8 LLM Training/1b23a01c-8312-4db1-9bf6-0617c15708db_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/$_mathrmμ$nit Scaling_ Simple and Scalable FP8 LLM Training/1b23a01c-8312-4db1-9bf6-0617c15708db_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2759c1660f6548008c1757ff16d5defe36dcf7c6dcbcb127d8148458a8dd7ef
3
+ size 6881335
2025/$_mathrmμ$nit Scaling_ Simple and Scalable FP8 LLM Training/full.md ADDED
@@ -0,0 +1,489 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Unit Scaling: Simple and Scalable FP8 LLM Training
2
+
3
+ Saaketh Narayan<sup>1</sup> Abhay Gupta<sup>2</sup> Mansheej Paul<sup>1</sup> Davis Blalock<sup>2</sup>
4
+
5
+ # Abstract
6
+
7
+ Large language model training with 8-bit floating point (FP8) formats promises significant efficiency improvements, but reduced numerical precision makes training challenging. It is currently possible to train in FP8 only if one is willing to tune various hyperparameters, reduce model scale, or accept the overhead of computing dynamic scale factors. We demonstrate simple, scalable FP8 training that requires no dynamic scaling factors or special hyperparameters, even at large model sizes. Our method, unit Scaling $(\mu S)$ , also enables simple hyperparameter transfer across model widths, matched numerics across training and inference, and other desirable properties. Unit Scaling is straightforward to implement, consisting of a set of minimal interventions based on a first-principles analysis of transformer operations. We validate our method by training models with parameters ranging from 1B to 13B, performing all hidden linear layer computations in FP8. We achieve quality equal to higher-precision baselines while also training up to $33\%$ faster.
8
+
9
+ # 1. Introduction
10
+
11
+ Because LLM training is computationally expensive, low-precision training provides large compute savings. Modern LLMs are typically trained in mixed-precision bfloat16 (BF16), where most computation occurs in BF16, but some components requiring higher precision (such as accumulators and master weights) use FP32 (Micikevicius et al., 2018). Thanks to increased hardware support for FP8 formats, mixed precision training using FP8 computation promises even greater training efficiency (Micikevicius et al., 2022). However, the reduced range and resolution of FP8 make LLM training challenging. In this work, we demon
12
+
13
+ <sup>1</sup>Work done while at Databricks Mosaic Research <sup>2</sup>Databricks Mosaic Research, San Francisco, CA. Correspondence to: Saaketh Narayan <narayan.saaketh@gmail.com>, Davis Blalock <davis.blalock@databricks.com>.
14
+
15
+ Proceedings of the $42^{nd}$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
16
+
17
+ strate a simple, scalable FP8 training method with straightforward hyperparameter transfer on large LLMs, called "unit Scaling" ( $\mu$ S).
18
+
19
+ Our unit Scaling method builds on Unit Scaling (Blake et al., 2023), which aims to maintain unit variance in weights, activations, and gradients. To ensure this, it scales neural network operations with static constants and initializes network parameters to have unit variance. If all tensors used in training can maintain unit variance, they are representable with sufficient range and resolution by low-precision formats like FP16 and FP8. However, preserving high-quality tensor representations in low-precision formats is challenging for large models.
20
+
21
+ Besides faster training, several other properties are desirable in a low-precision training scheme. Examples include minimizing extra hyperparameters, avoiding dynamic scale factor overhead, and allowing optimal hyperparameters from small models to transfer to large models. As summarized in Fig. 1, $\mu S$ is the only method that provides these benefits. We elaborate on each of these properties below.
22
+
23
+ Straightforward hyperparameter transfer Tuning hyperparameters for large LLMs is expensive. A promising way to reduce this cost is to tune the hyperparameters for smaller LLMs and "transfer" them to large ones, either by using them directly or by applying a model-size-based formula as explored in $\mu$ -Parametrization ( $\mu\mathrm{P}$ ) (Yang et al., 2021; 2024a;b). However, applying hyperparameter transfer techniques in practice to low-precision training can be challenging; frequent divergences due to numerical issues may require training in higher precisions like FP32 (Yang et al., 2021). To address this, Blake et al. (2024) introduced u- $\mu$ P, which combines Unit Scaling (Blake et al., 2023) and $\mu$ P to enable hyperparameter transfer in low precision. Unfortunately, compared to conventional BF16 mixed precision training (henceforth termed "standard parametrized" (SP) models), both $\mu$ P and u- $\mu$ P have many more hyperparameters to sweep over (see Table 3), diminishing realized compute savings and increasing complexity. Specific implementation intricacies, such as zero-initialized queries in $\mu$ P or LR scaling for embeddings by fan-out in u- $\mu$ P, make these schemes harder to use in practice than SP. In contrast, our unit Scaling ( $\mu$ S) scheme combines $\mu$ P and Unit Scaling in a greatly simplified way, making it easier to use and more
24
+
25
+ <table><tr><td>Method</td><td>Uses FP8</td><td>Hparam transfer</td><td>Number of Hparams</td><td>No dynamic scaling factors</td><td>Scales stably to large models</td><td>Training-Inference precision match</td><td>Efficient distributed training</td></tr><tr><td>BF16 mixed precision (SP)</td><td>No</td><td>No</td><td>3</td><td>Yes</td><td>Yes</td><td>No</td><td>Yes</td></tr><tr><td>Maximal Update Parametrization (μP)</td><td>No</td><td>Yes</td><td>6</td><td>Yes</td><td>Yes</td><td>No</td><td>Yes</td></tr><tr><td>Unit Scaling / u-μP</td><td>Partially</td><td>Yes (u-μP)</td><td>7</td><td>Yes</td><td>Partially</td><td>Partially</td><td>Partially</td></tr><tr><td>Dynamically Scaled FP8 (SP), e.g. TE</td><td>Yes</td><td>No</td><td>3</td><td>No</td><td>Partially</td><td>Yes</td><td>Yes</td></tr><tr><td>μinit Scaling (ours)</td><td>Yes</td><td>Yes</td><td>3</td><td>Yes</td><td>Yes</td><td>Yes</td><td>Yes</td></tr></table>
26
+
27
+ Figure 1. Comparison of low-precision training methods. Our proposed method, unit Scaling (μS, bottom row), enables FP8 training and hyperparameter transfer at scale. Unlike existing methods, it does not use dynamic scaling, requires only a small set of hyperparameters, permits FP8 computation for all hidden layers, and makes the model more easily quantizable for inference.
28
+
29
+ cost-effective. We demonstrate hyperparameter transfer of learning rate $(\eta)$ and weight decay $(\lambda)$ to models of up to $20\mathrm{x}$ larger widths.
30
+
31
+ No Dynamic Scaling With dynamic scaling, one calculates per-tensor scaling factors for each weight, activation, and gradient tensor in training. These scales shift BF16 tensors into the representable ranges of FP8 formats in each forward and backward pass. Typically, one also decouples the forward and backward formats, using e4m3 for weights and activations and e5m2 for gradients (Sun et al., 2019). NVIDIA's TransformerEngine is a notable example of an FP8 training library that uses dynamic scaling (NVIDIA, 2023). Calculating scaling factors dynamically adds training and inference overhead and complicates large-scale distributed training and checkpointing.
32
+
33
+ Apply to All Linear Layers Existing work on applying Unit Scaling at larger scales requires certain "critical mat-muls" (attention out projection, FFN down projection) to stay in BF16 (Blake et al., 2024). Assuming a transformer model with conventional multiheaded attention and an MLP with an expansion ratio of 4, this means $41.7\%$ of all hidden linear layer FLOPs are not in FP8. In contrast, $\mu S$ ensures that, regardless of scale, all hidden layers use FP8.
34
+
35
+ Match Inference-Time Quantization For efficient inference, LLMs are often quantized to FP8 or INT8 for faster computation and reduced memory footprints (Khudia et al., 2021; Dettmers et al., 2022). Since training typically occurs in higher bitwidths (e.g., BF16), a mismatch in precisions at training time and inference time means that some level of quantization error is unavoidable, degrading model quality. Training with $\mu \mathrm{S}$ avoids this mismatch—since the LLM has already been trained in FP8, it is immediately ready for inference in FP8 for both weights and activations (W8A8).
36
+
37
+ # 1.1. Contributions
38
+
39
+ Our work makes the following contributions:
40
+
41
+ - Identifying root causes for poor numerics in conventional transformer blocks—for example, explaining diminishing variance in self-attention outputs with increasing sequence position.
42
+ - Introducing a simple method for fixing these issues that enables FP8 training in all hidden linear layers and with less overhead than existing methods. It also achieves desirable properties such as improved training efficiency and matched numerics at training and inference time.
43
+
44
+ # 2. Methods
45
+
46
+ In this section, we detail the components of our proposed method, unit Scaling $(\mu S)$ . The modifications to the standard transformer training scheme that $\mu S$ requires are summarized in Table 1. We elaborate on novel components such as our handling of self-attention numerics, residual modifications, and hyperparameter transfer below.
47
+
48
+ # 2.1. Self-attention Numerics
49
+
50
+ The causal self-attention mechanism at the core of decoder layers in LLMs is not variance-preserving, making low-precision training challenging.
51
+
52
+ Recall that standard self-attention is defined as:
53
+
54
+ $$
55
+ \operatorname {A t t e n t i o n} (\mathbf {Q}, \mathbf {K}, \mathbf {V}) = \operatorname {s o f t m a x} \left(\frac {\mathbf {Q} \mathbf {K} ^ {T}}{\sqrt {d}}\right) \mathbf {V} \tag {1}
56
+ $$
57
+
58
+ Proposition 2.1. Suppose we have $\mathbf{x} \in \mathbb{R}^k$ and $\mathbf{V} \in \mathbb{R}^{k \times m}$ . Define $\mathbf{s} \triangleq \mathrm{softmax}(\mathbf{x})$ , $\mathbf{a} \triangleq \mathbf{s}^T \mathbf{V}$ , and $\sigma_{\mathbf{a}}^2 \triangleq \mathrm{Var}[\mathbf{a}]$ . Assume that each element $x_i \stackrel{iid}{\sim} \mathcal{N}(0,1)$ , and that entries $V_{ij}$ are independent and distributed with $\mu_{\mathbf{V}} \triangleq E[\mathbf{V}] = 0$ , $\sigma_{\mathbf{V}}^2 \triangleq \mathrm{Var}[\mathbf{V}] = 1$ . Then, up to a first-order Taylor approximation, $\sigma_{\mathbf{a}}^2 \propto \frac{1}{k}$ for $k \gg 1$ .
59
+
60
+ Proof. Recall that by the definition of the softmax function,
61
+
62
+ Table 1. Components of the μS training scheme. μS makes the following modifications to standard decoder-only transformer training practices. A deeper explanation of these modifications is provided in Appendix A.1.
63
+
64
+ <table><tr><td>Modification</td><td>Description</td></tr><tr><td>Linear layer scaling factors</td><td>1/√fan_in static scaling factor applied in both forward and backward pass. The final LM head uses a multiplier of 1/fan_in instead, in line with μP.</td></tr><tr><td>Res-Post-LayerNorm</td><td>LayerNorm is the last operation in each residual branch instead of the first.</td></tr><tr><td>“Fixed” residual modification</td><td>Use a fixed constant τ to make residuals variance-preserving, according to Eq. 11.</td></tr><tr><td>Unit variance initialization</td><td>All linear layer weights initialized with variance 1.</td></tr><tr><td>FP8 hidden layers</td><td>Use FP8E4M3 for weights and activations, FP8E5M2 for gradients. Before casting, clip BF16 values to FP8 dtype max. Keep embedding table and LM head in BF16.</td></tr><tr><td>Learning rate (η) scaling</td><td>Optimal η stays constant for input and output layers, but is scaled by √d_base / √d_model for all hidden layers, when transferring from a base model with width d_base</td></tr><tr><td>Weight decay (λ) scaling</td><td>With fully decoupled weight decay, optimal λ stays constant for all layers with increasing width.</td></tr></table>
65
+
66
+ $s_i = \mathrm{softmax}(\mathbf{x})_i = \frac{e^{x_i}}{\sum_{j=1}^k e^{x_j}}$ . Denote the vector of elements' numerators $e^{x_i}$ as $\mathbf{n}$ and the vector of denominators $\sum_{j=1}^k e^{x_j}$ as $\mathbf{d}$ , such that $\mathbf{s} = \frac{\mathbf{n}}{\mathbf{d}}$ . Since $x_i \stackrel{\mathrm{iid}}{\sim} \mathcal{N}(0,1)$ , $\mathbf{n}$ is log-normally distributed and $\mathbf{d}$ is a sum of log-normals. This implies that:
67
+
68
+ $$
69
+ \mu_ {\mathbf {n}} = e ^ {1 / 2}, \quad \sigma_ {\mathbf {n}} ^ {2} = e (e - 1)
70
+ $$
71
+
72
+ $$
73
+ \mu_ {\mathbf {d}} = k e ^ {1 / 2}, \quad \sigma_ {\mathbf {d}} ^ {2} = k e (e - 1) \tag {2}
74
+ $$
75
+
76
+ $$
77
+ \operatorname {C o v} [ \mathbf {n}, \mathbf {d} ] = \sigma_ {\mathbf {n}} ^ {2} = e (e - 1)
78
+ $$
79
+
80
+ We can then use first-order Taylor approximations to estimate the moments of $s$ as the ratio $\frac{n}{d}$ , as shown in Casella & Berger (2002), to obtain:
81
+
82
+ $$
83
+ \mu_ {\mathbf {s}} = \operatorname {E} \left[ \frac {\mathbf {n}}{\mathbf {d}} \right] = \frac {\mu_ {\mathbf {n}}}{\mu_ {\mathbf {d}}} = \frac {1}{k} \tag {3}
84
+ $$
85
+
86
+ $$
87
+ \begin{array}{l} \sigma_ {\mathbf {s}} ^ {2} = \operatorname {V a r} \left[ \frac {\mathbf {n}}{\mathbf {d}} \right] \approx \frac {\sigma_ {\mathbf {n}} ^ {2}}{\mu_ {\mathbf {d}} ^ {2}} + \frac {\mu_ {\mathbf {n}} ^ {2} \sigma_ {\mathbf {d}} ^ {2}}{\mu_ {\mathbf {d}} ^ {4}} - 2 \frac {\mu_ {\mathbf {n}} \operatorname {C o v} [ \mathbf {n} , \mathbf {d} ]}{\mu_ {\mathbf {d}} ^ {3}} \tag {4} \\ = \frac {e - 1}{k ^ {2}} - \frac {e - 1}{k ^ {3}} \\ \end{array}
88
+ $$
89
+
90
+ Note that Eq. 3 holds exactly from the fact that all $k$ entries in $\mathbf{s}$ are positive and must sum to 1. Now, because each element $a_{j} = \sum_{i = 1}^{k}s_{i}V_{ij}$ , with independent entries $V_{ij}$ and with the fact that $\mu_{\mathbf{V}} = 0$ and $\sigma_{\mathbf{V}}^2 = 1$ , the mean and variance of a can be determined as:
91
+
92
+ $$
93
+ \mu_ {\mathbf {a}} = \sum_ {i = 1} ^ {k} \mu_ {\mathbf {s}} \mu_ {\mathbf {V}} = 0 \tag {5}
94
+ $$
95
+
96
+ $$
97
+ \sigma_ {\mathbf {a}} ^ {2} = \sum_ {i = 1} ^ {k} \sigma_ {\mathbf {s}} ^ {2} \sigma_ {\mathbf {V}} ^ {2} + \sigma_ {\mathbf {s}} ^ {2} \mu_ {\mathbf {V}} ^ {2} + \sigma_ {\mathbf {V}} ^ {2} \mu_ {\mathbf {s}} ^ {2} = \frac {e}{k} - \frac {e - 1}{k ^ {2}} \tag {6}
98
+ $$
99
+
100
+ The first term dominates for large $k$ and so $\sigma_{\mathbf{a}}^2\sim \frac{1}{k}$
101
+
102
+ In the causal self-attention operation shown in Eq. 1, the attention logits matrix $\frac{\mathbf{Q}\mathbf{K}^T}{\sqrt{d}}$ is causally masked such that the row of logits for a token at sequence position $k$ has length $k$ . For a given token, by Prop. 2.1, the output of the self-attention operation will therefore have variance inversely related to that token's sequence position $k$ . This causes tokens that appear later in the sequence to have much smaller variance than those that appear earlier, as shown in Fig. 2.
103
+
104
+ To address this issue, we make use of a basic property of the variance of linear combinations of independent random variables. With $\mathbf{a}(k)$ denoting the outputs of self-attention applied over a sequence of length $k$ , the variance of $\mathbf{a}(k)$ (denoted $\sigma_{\mathbf{a}(k)}^2$ ) is the variance of a sum of $k$ random variables $\{X_i,\ldots ,X_k\}$ with coefficients $\mathbf{c} \in \mathbb{R}^k$ :
105
+
106
+ $$
107
+ \operatorname {V a r} \left[ \sum_ {i = 1} ^ {k} c _ {i} X _ {i} \right] = \sum_ {i} c _ {i} ^ {2} \operatorname {V a r} [ X _ {i} ] = \mathbf {c} ^ {T} \mathbf {v}, \tag {7}
108
+ $$
109
+
110
+ where $v_{i} \triangleq \operatorname{Var}[X_{i}]$ , and the equality holds if all $X_{i}$ are independent. If $\forall i$ : $v_{i} = 1$ , we further have $\sigma_{\mathbf{a}(k)}^{2} = \| \mathbf{c}\|_{2}$ .
111
+
112
+ Now recall that the softmax operation outputs positive coefficients $s$ that sum to 1. This means that if we simply set coefficients $c_{i} = \sqrt{s_{i}}$ , we obtain:
113
+
114
+ $$
115
+ \sigma_ {\mathbf {a} (k)} ^ {2} = \| \mathbf {c} \| _ {2} = \sqrt {\sum_ {i} c _ {i} ^ {2}} = \sqrt {\sum_ {i} s _ {i}} = 1. \tag {8}
116
+ $$
117
+
118
+ That is, by taking the square root of attention scores, attention can be made variance-preserving for independent value tokens. This modification, which we term "Square-Root Softmax attention", is shown in Eq. 9. Square-Root Softmax attention is also easily implemented via modern
119
+
120
+ attention kernels like Flex-Attention (Dong et al., 2024).
121
+
122
+ $$
123
+ \operatorname {A t t e n t i o n} (\mathbf {Q}, \mathbf {K}, \mathbf {V}) = \sqrt {\operatorname {s o f t m a x} \left(\frac {\mathbf {Q} \mathbf {K} ^ {T}}{\sqrt {d _ {k}}}\right)} \mathbf {V} \tag {9}
124
+ $$
125
+
126
+ In practice, standard self-attention does have diminishing $\sigma$ as sequence position increases; however, the observed variance is consistently higher than predicted by the above analysis of independent elements. This same effect is observed even when using Square-Root Softmax attention, causing observed $\sigma$ to increase over sequence position instead (Fig. 2).
127
+
128
+ ![](images/49f123e4c3b3ae9678957ab836c1aabb87852031b1878ceeb92c210c9eff9e2b.jpg)
129
+ Figure 2. Attention output variance changes over sequence length. For standard attention, $\sigma$ decreases over sequence position both when simulated with iid value tokens (light red) and when observed in training (red). Taking the square root of attention scores keeps $\sigma$ constant when simulated with iid value tokens (light blue), but during training (blue), causes $\sigma$ to increase with sequence position. In practice, neither attention variant provides a consistent scale across outputs.
130
+
131
+ We provide a mechanistic explanation for this phenomenon: this increase in attention variance is an unavoidable consequence of the statistics of natural data. If all value tokens are truly independent, then Square-Root Softmax attention keeps $\sigma_{\mathbf{a}}$ constant. However, due to a high number of repeated tokens in real text data, value tokens are often highly correlated (Fig. 3). Due to this correlation, $\sigma_{\mathbf{a}}$ will be higher than predicted, and in the case of standard self-attention, diminish more slowly with respect to the token position.
132
+
133
+ To address this inconsistency in attention output variance, we use Res-Post-LayerNorm placement, as shown in Fig. 4(a). This architecture change consists of moving the normalization operation from the start of each residual branch to the end, and was first proposed in Liu et al. (2022) for training stability. Res-Post-LayerNorm ensures consistent $\sigma$ for all tokens in the residual stream, regardless of sequence position, correlation with other tokens, or the distribution of attention scores. A convergence test on 100-layer models validating the Res-Post-LayerNorm transformer against the standard Pre-LayerNorm transformer is
134
+
135
+ ![](images/5e85258892faa2b82ae4179d45301a2f23bfd6102636d4a7c2257bc678a7d028.jpg)
136
+ Figure 3. Value tokens in text are highly correlated. Comparison of cosine similarity between observed value tokens in a text data distribution versus value tokens $\stackrel{iid}{\sim} \mathcal{N}(0,1)$ . Repeated tokens in the value matrix, an unavoidable result of token frequency in real text data, lead to higher-than-random $\sigma$ as sequence position increases (cf. Fig. 2).
137
+
138
+ shown in Fig. 4(b). All $\mu$ S models we train use Res-Post-LayerNorm.
139
+
140
+ # 2.2. Residual Modification Schemes
141
+
142
+ Every skip connection in a neural network adds another tensor to the residual stream. Summing all these tensors tends to increase the variance of the residual stream deeper in the network. To make residual connections variance-preserving instead, Blake et al. (2023) proposed replacing simple summation with weighted summation, where the weights $a$ and $b$ of the skip connection and residual branch satisfy $a^2 + b^2 = 1$ . They proposed two methods for setting these coefficients: fixed and running-mean, which are shown in Eq. 11 and Eq. 12, respectively. The former uses a constant coefficient $\tau$ , while the latter uses coefficients that are a function of the layer index $l$ . The standard residual layer modification is shown in Eq. 10.
143
+
144
+ $$
145
+ \text {s t a n d a r d}: x _ {l + 1} = x _ {l} + f \left(x _ {l}\right) \tag {10}
146
+ $$
147
+
148
+ $$
149
+ \operatorname {f i x e d} (\tau): x _ {l + 1} = \sqrt {1 - \tau} \cdot x _ {l} + \sqrt {\tau} \cdot f (x _ {l}) \tag {11}
150
+ $$
151
+
152
+ $$
153
+ \text {r u n n i n g - m e a n}: x _ {l + 1} = \sqrt {\frac {l}{l + 1}} \cdot x _ {l} + \sqrt {\frac {1}{l + 1}} \cdot f (x _ {l}) \tag {12}
154
+ $$
155
+
156
+ As shown in Fig. 5, we found that using either modification is better than the standard approach, with the fixed scheme providing better convergence than the running-mean scheme. All $\mu \mathrm{S}$ models we train therefore use the fixed scheme. We set the coefficient $\tau$ based on the depth using the results in Appendix A.3.
157
+
158
+ # 2.3. Hyperparameter Transfer with $\mu$ unit Scaling
159
+
160
+ Zero-shot hyperparameter transfer allows hyperparameters to be tuned on a small proxy network, then directly used
161
+
162
+ ![](images/eba275f896ad09e8a9eefdf30943b68b46f4de850def6227f2e52bd7499a7c07.jpg)
163
+ Figure 5. Residual modification schemes affect unit Scaled model convergence. The fixed residual modification (green, Eq. 11) achieves better training convergence for deep transformers than the running-mean residual modification (blue, Eq. 12). The fixed residual coefficient for this model is $\tau = 0.1$ . Both of these settings outperform the standard residual layer modification (red, Eq. 10).
164
+
165
+ ![](images/14603ee513975eb002196384c327c1654a65a18b0164c6438fcb387b5fe1aab5.jpg)
166
+
167
+ ![](images/78c5f8cd7cd0f21b8d194b9643ba805abe56e745d9dffefff347febd64c14754.jpg)
168
+
169
+ ![](images/dba91f776387334e2e8e7522eba77c6ff050d247377c1e2596f27fb628c97b3e.jpg)
170
+ Figure 4. Res-Post-LayerNorm. (a) Pre-LayerNorm transformer architecture versus Res-Post-LayerNorm architecture. Res-Post-LayerNorm moves the LayerNorm operation from the start of each residual branch to the end (Liu et al., 2022). This ensures consistent variance across tokens when added to the residual stream. In contrast, Pre-LayerNorm networks permit unnormalized representations with inconsistent variance to be added to the residual stream, as shown with self-attention outputs in Fig. 2. (b) Convergence test loss curves with 100-layer models show that $\mu S$ with Res-Post-LayerNorm achieves nearly identical convergence versus SP with Pre-LayerNorm. (c) Additional convergence tests with 100-layer models show that Res-Post-LayerNorm achieves better convergence over Pre-LayerNorm with $\mu S$ .
171
+
172
+ ![](images/01a3c6a4933bb6b4a0b0eec6b865d61a2c770f2eb7a120bc6a2c9f2630086dc8.jpg)
173
+ 100 layer model convergence, Residual modification
174
+
175
+ on much larger networks without any further tuning (Yang et al., 2021). The width of the small proxy network is typically referred to as the "base width", or $d_{\mathrm{base}}$ . Because it eliminates the need to sweep hyperparameters at a large scale, such hyperparameter transfer yields massive compute savings.
176
+
177
+ Hyperparameter transfer with $\mu$ unit Scaling follows from neural network equivalences set forth in Yang et al. (2021, Appendix J.2.1), reproduced below for convenience. As detailed in Blake et al. (2024), Equations 13, 14, and 15 define the hidden layer in a model undergoing training. All hidden layers are initialized with weights $\mathbf{W}_0$ drawn from a normal distribution with variance $b^2$ , use a learning rate of $c$ , and have an output multiplier $a$ . $\mathbf{X}$ and $\mathbf{Y}$ denote input and output activation matrices respectively; $t$ is the training time step; and $\Phi_t(\nabla \mathcal{L}_0, \dots, \nabla \mathcal{L}_t)$ denotes the weight update for time step $t$ using prior loss gradients.
178
+
179
+ $$
180
+ \mathbf {W} _ {0} \sim \mathcal {N} (0, b ^ {2}) \tag {13}
181
+ $$
182
+
183
+ $$
184
+ \mathbf {Y} = a \cdot \mathbf {X} \mathbf {W} _ {t} \tag {14}
185
+ $$
186
+
187
+ $$
188
+ \mathbf {W} _ {t + 1} = \mathbf {W} _ {t} + c \cdot \Phi_ {t} (\nabla \mathcal {L} _ {0}, \dots , \nabla \mathcal {L} _ {t}) \tag {15}
189
+ $$
190
+
191
+ Under Adam-like optimizers, the output of this hidden layer is invariant to any scale factor $\theta > 0$ that changes $a, b, c$ as:
192
+
193
+ $$
194
+ a \leftarrow a \theta , \quad b \leftarrow b / \theta , \quad c \leftarrow c / \theta \tag {16}
195
+ $$
196
+
197
+ Under $\mu \mathrm{P}$ , $a = 1$ , $b = \frac{1}{\sqrt{\mathrm{fan\_in}}}$ , and $c = \frac{1}{\mathrm{fan\_in}}$ . If we instead set $\theta = \frac{1}{\sqrt{\mathrm{fan\_in}}}$ , we obtain:
198
+
199
+ $$
200
+ a = \frac {1}{\sqrt {\text {f a n} _ {-} \text {i n}}}, \quad b = 1, \quad c = \frac {1}{\sqrt {\text {f a n} _ {-} \text {i n}}} \tag {17}
201
+ $$
202
+
203
+ Notice that $a = \frac{1}{\sqrt{\text{fan\_in}}}$ and $b = 1$ are exactly the output multiplier and unit initialization that Unit Scaling requires.
204
+
205
+ Therefore, the learning rate for hidden layers should scale as $\frac{1}{\sqrt{\text{fan\_in}}}$ for Unit Scaled models. This leads to the $\mu \text{S}$ hyperparameter transfer scheme in Table 2.
206
+
207
+ In practice, given a base model with a width $d_{\mathrm{base}}$ , a new model with a width $d_{\mathrm{new}}$ , and optimal base model learning rate $\eta_{\mathrm{base}}^{*}$ , $\mu \mathrm{S}$ keeps $\eta_{\mathrm{new}}^{*}$ constant for the embedding table, all LayerNorm parameters, and the LM head. The learning rate only changes for hidden layers, with $\eta_{\mathrm{new}}^{*} = \eta_{\mathrm{base}}^{*}\frac{\sqrt{d_{\mathrm{base}}}}{\sqrt{d_{\mathrm{new}}}}$
208
+
209
+ Table 2. $\mu$ S scaling rules. To transfer hyperparameters across model widths with $\mu$ S, initialize layers, scale their outputs, and modify their learning rates as shown here.
210
+
211
+ <table><tr><td></td><td colspan="3">Weight Type</td></tr><tr><td></td><td>Input Layer</td><td>Final Layer</td><td>Hidden Layers</td></tr><tr><td>Init. Var.</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Output Mult.</td><td>1</td><td>1/fan_in</td><td>1/√fan_in</td></tr><tr><td>Adam-like LR</td><td>1</td><td>1</td><td>1/√fan_in</td></tr></table>
212
+
213
+ In addition to enabling hyperparameter transfer, $\mu S$ also requires sweeping over a much smaller set of hyperparameters than existing schemes (Table 3).
214
+
215
+ Table 3. Required hyperparameters in transfer schemes. Hyperparameters used in practice to train transformer models under various schemes. While $\mu \mathrm{P}$ and related schemes provide better hyperparameter transfer than SP, they require sweeping over more hyperparameters to get reasonable model quality. In contrast, $\mu \mathrm{S}$ provides hyperparameter transfer and model quality with a much smaller set of hyperparameters. This makes the implementation simple and makes hyperparameter sweeps less expensive.
216
+
217
+ <table><tr><td>Scheme</td><td># Hparams</td><td>Hparams</td></tr><tr><td>μS (ours)</td><td>3</td><td>η,λ,τ</td></tr><tr><td>SP</td><td>3</td><td>η,λ,σinit</td></tr><tr><td>μP</td><td>6</td><td>η,λ,σinit,
218
+ αres, αattn, αout</td></tr><tr><td>u-μP</td><td>7</td><td>η,λ,αffn-act, αattn-softmax,
219
+ αres, αres-attn-ratio, αloss-softmax</td></tr></table>
220
+
221
+ # 3. Results
222
+
223
+ # 3.1. Successful Hyperparameter Transfer
224
+
225
+ Setup: To evaluate hyperparameter transfer, we first train four-layer decoder-only LLMs with widths of 256 through 8192 using Standard Parametrization (SP) and $\mu$ unit Scaling ( $\mu$ S). We begin with these small models since doing so allows us to collect ground truth optimal hyperparameters. All models use multi-headed attention (Vaswani et al., 2017) and were trained for 10,000 training steps with a
226
+
227
+ global batch size of 64 and sequence length of 1024 (i.e., 655M total tokens). SP models use Pre-LayerNorm placement and are trained in both BF16 and FP8 (using TransformerEngine). $\mu$ S models were trained in both BF16 and FP8 and use Res-Post-LayerNorm placement (Fig. 4). $\mu$ S used base models of width 256. For all models described in this and subsequent sections, we used the Lion optimizer (Chen et al., 2023) with fully decoupled weight decay and a cosine learning rate schedule decaying to $10\%$ of the maximum learning rate. For details on why Lion is an Adam-like optimizer for hyperparameter transfer, please refer to Appendix A.4. All models were trained on Nvidia H100 GPUs using the Databricks MosaicML LLMFoundry (MosaicML, 2022a),Composer (MosaicML, 2021), and Streaming (MosaicML, 2022b) libraries.
228
+
229
+ Hyperparameters: We evaluate hyperparameter transfer over learning rate $(\eta)$ and weight decay $(\lambda)$ . While $\mu \mathrm{P}$ Yang et al. (2021) does not give a theoretical basis for $\lambda$ transfer over width, we evaluate its transfer empirically because of its practical importance. Prior work by Lingle (2024) has shown that $\mu \mathrm{P}$ does not admit transfer of $\lambda$ with AdamW. However, Wang & Aitchison (2024) found that optimal $\lambda$ should scale with model size. To elucidate how $\lambda$ scales with model width, we jointly sweep over both $\eta$ and $\lambda$ . We use fully decoupled weight decay, motivated by findings from Wortsman et al. (2024) that doing so results in more stable training. $\eta$ and $\lambda$ are swept over powers of 2. Based on the relationship between the residual coefficient $\tau$ and depth in Appendix A.3, the residual coefficient $\tau$ is 0.4 for these four-layer models.
230
+
231
+ As shown in Fig. 6, $\mu \mathrm{S}$ models have stable optimal learning rate $(\eta^{*})$ and weight decay $(\lambda^{*})$ from width 256 up to width 8192. Mirroring previous findings, $\eta^{*}$ for SP models decreases as the inverse of the width. $\lambda^{*}$ transfer across widths is relatively stable for both model types, with $\mu \mathrm{S}$ showing the most consistency.
232
+
233
+ # 3.2. FP8 Training at Scale
234
+
235
+ The previous section demonstrated hyperparameter transfer for small, shallow models. However, the real test of utility is scaling up to multi-billion-parameter models. This section demonstrates that $\mu S$ allows us to train in FP8 while transferring hyperparameters for realistic model sizes. We also validate that our method is compatible with efficient distributed training.
236
+
237
+ Setup: We train 1B, 3B, 7B, and 13B parameter LLMs on approximately compute-optimal token budgets ( $\sim$ 20x token-to-parameter ratio) using SP and $\mu S$ , and in both BF16 and FP8, resulting in 4 individual models for each model size. The training configurations are detailed in Table 4. Based on the previous sections' hyperparameter transfer results (Fig. 6), we sweep $\eta$ and $\lambda$ on small models with a base
238
+
239
+ Table 4. Large model training configurations. Model training configurations for 1B, 3B, 7B, and 13B models. Only $\mu \mathrm{S}$ models use the residual coefficient $\tau$ , which is dictated by model depth using results in Appendix A.3.
240
+
241
+ <table><tr><td>Model</td><td>Params</td><td>Tokens</td><td>TPR</td><td>Steps</td><td>Batch Sz.</td><td>Seq. Len.</td><td>Width</td><td>Depth</td><td># Heads</td><td>τ</td></tr><tr><td>1B</td><td>1.6B</td><td>31.5B</td><td>19.4</td><td>7.5k</td><td>1024</td><td>4096</td><td>2048</td><td>24</td><td>16</td><td>0.3</td></tr><tr><td>3B</td><td>3.0B</td><td>62.9B</td><td>20.8</td><td>15k</td><td>1024</td><td>4096</td><td>2560</td><td>32</td><td>20</td><td>0.3</td></tr><tr><td>7B</td><td>7.3B</td><td>140.0B</td><td>19.3</td><td>16.7k</td><td>2048</td><td>4096</td><td>4096</td><td>32</td><td>32</td><td>0.3</td></tr><tr><td>13B</td><td>13.6B</td><td>260.1B</td><td>19.1</td><td>31k</td><td>2048</td><td>4096</td><td>5120</td><td>40</td><td>40</td><td>0.2</td></tr></table>
242
+
243
+ ![](images/142b2906e7b21ec12b0812f1032f10c576b07edfa42adee97f3309e049fc08ce.jpg)
244
+ Optimal Learning Rate and Weight Decay for SP, $\mu S$
245
+ Figure 6. With $\mu$ S, optimal learning rate $(\eta^{*})$ and weight decay $(\lambda^{*})$ are stable across widths. Optimal $\eta$ (left column) and $\lambda$ (right column) are shown across a range of model widths for models trained with SP (top row) and $\mu$ S (bottom row). For each curve, the other hyperparameter is fixed at its optimal value. The base model width is 256. $\mu$ S models have stable optimal $\eta$ and $\lambda$ , even when width increases 32x to 8192. As expected, $\eta^{*}$ for SP models decreases with width. $\lambda^{*}$ is relatively stable as the width increases across both model types.
246
+
247
+ width of $d_{\mathrm{base}} = 256$ , then transfer optimal hyperparameters to large models with width $d_{\mathrm{new}}$ , as shown below.
248
+
249
+ - SP: all layers: $\eta_{\mathrm{new}}^{*} = \eta_{\mathrm{base}}^{*}\frac{d_{\mathrm{base}}}{d_{\mathrm{new}}}$ , $\lambda_{\mathrm{new}}^{*} = 0.5\lambda_{\mathrm{base}}^{*}$
250
+ - $\mu \mathbf{S}$ : hidden layers: $\eta_{\mathrm{new}}^{*} = \eta_{\mathrm{base}}^{*}\frac{\sqrt{d_{\mathrm{base}}}}{\sqrt{d_{\mathrm{new}}}}$ , $\lambda_{\mathrm{new}}^{*} = \lambda_{\mathrm{base}}^{*}$ other layers: $\eta_{\mathrm{new}}^{*} = \eta_{\mathrm{base}}^{*}$ , $\lambda_{\mathrm{new}}^{*} = \lambda_{\mathrm{base}}^{*}$
251
+
252
+ Evaluation: We use the Databricks Model Gauntlet to evaluate the quality of all models on specific tasks (Dohmann, 2023; Barton, 2024). These results are shown in Table 5.
253
+
254
+ We also compare model convergence via the final training cross-entropy loss averaged over the last 41.9M tokens (cor
255
+
256
+ responding to 10 steps for 1B and 3B models and 5 steps for 7B and 13B models). Training loss curves are shown in Fig. 7.
257
+
258
+ As shown in Fig. 7, $\mu \mathrm{S}$ models train stably with FP8 even as the model size increases. We successfully transfer hyperparameters from a narrow base model with a width of 256 to models with widths up to 5120, demonstrating $20\mathrm{x}$ width transfer ( $\sim 400\mathrm{x}$ fewer FLOPs per run) in realistic, practical LLM training scenarios. This validates zero-shot hyperparameter transfer using $\mu \mathrm{S}$ . Evaluation results in Table 5 show that $\mu \mathrm{S}$ models achieve equal or better quality than SP models. These models demonstrate that $\mu \mathrm{S}$ successfully combines FP8 training with zero-shot hyperparameter transfer. To emphasize, all hidden layers use FP8 computation, and there are no dynamic scaling factors.
259
+
260
+ We also note that at the 13B scale, we attempted to remedy the divergence of the SP FP8 model by using multiple different values of $\lambda$ , but this did not mitigate the frequent loss spikes and eventual divergence. $\mu$ S models, by contrast, train stably. We also show the instability in training with Unit Scaling (US) at larger scales in Appendix A.5, motivating runs only with SP and $\mu$ S for our final results.
261
+
262
+ # 3.3. FP8 Training Efficiency
263
+
264
+ To achieve state-of-the-art FP8 distributed training efficiency with $\mu$ unit Scaling, we make use of operator fusion and static scaling. As shown in Fig. 8, FP8 training with $\mu$ S is $25 - 33\%$ faster than in BF16, and $1 - 6\%$ faster than FP8 training with TransformerEngine (TE) (NVIDIA, 2023). All models were benchmarked on 64 NVIDIA H100 GPUs, and characteristics such as batch size and distributed training configuration were held constant. While TransformerEngine has fused modules such as LayerNorm-Linear or LayerNorm-MLP, we did not use those modules in order to make an equal comparison between $\mu$ S and TE.
265
+
266
+ By relying on dynamic scaling, FP8 training with libraries like TE imposes additional overhead that is eliminated in $\mu \mathrm{S}$ . Calculating the absolute max of both the weight and activation tensors (or storing and reading past absolute max values in a delayed scaling approach) are operations that can be completely discarded in $\mu \mathrm{S}$ . Weights, activations, and gradients can be directly cast to FP8 formats, with a
267
+
268
+ ![](images/7665463a16fa66db72521be196df093649bd8fe98ef0dae111719dfbcaec10b5.jpg)
269
+ Figure 7. $\mu$ S models successfully train in FP8 at scale. Comparison of training loss curves for standard parametrized (SP) and unit scaled ( $\mu$ S) models in both FP8 and BF16, across 1B, 3B, 7B, and 13B parameter models. $\mu$ S models successfully train in FP8 and converge to similar train loss values as their BF16 and SP counterparts. SP FP8 models are trained with TransformerEngine (TE). In our experiments at the 13B scale, SP models trained in FP8 with TE experienced frequent loss spikes and did not properly converge. We achieve state-of-the-art FP8 training efficiency via $\mu$ S, with further details in Appendix 3.3.
270
+
271
+ Table 5. Large model evaluation results. We evaluate SP and $\mu S$ models in FP8 and BF16 on a variety of tasks, with best results per eval and model size in bold. Final train loss (avg. over last $\sim 40\mathrm{M}$ tokens) is also shown. $\mu S$ models have equal or better quality than SP models, and maintain this quality even when training in FP8 as model size increases. Note that 13B SP FP8 models failed to properly converge, denoted by an asterisk.
272
+
273
+ <table><tr><td rowspan="3"></td><td colspan="4">1B</td><td colspan="4">3B</td><td colspan="4">7B</td><td colspan="4">13B</td></tr><tr><td colspan="2">SP</td><td colspan="2">μS</td><td colspan="2">SP</td><td colspan="2">μS</td><td colspan="2">SP</td><td colspan="2">μS</td><td colspan="2">SP</td><td colspan="2">μS</td></tr><tr><td>BF16</td><td>FP8</td><td>BF16</td><td>FP8</td><td>BF16</td><td>FP8</td><td>BF16</td><td>FP8</td><td>BF16</td><td>FP8</td><td>BF16</td><td>FP8</td><td>BF16</td><td>FP8*</td><td>BF16</td><td>FP8</td></tr><tr><td>Final Train Loss</td><td>2.590</td><td>2.588</td><td>2.580</td><td>2.590</td><td>2.399</td><td>2.400</td><td>2.381</td><td>2.390</td><td>2.228</td><td>2.231</td><td>2.216</td><td>2.226</td><td>2.112</td><td>2.211</td><td>2.108</td><td>2.119</td></tr><tr><td>ARC Easy (3-shot)</td><td>52.1%</td><td>52.4%</td><td>53.4%</td><td>53.3%</td><td>60.7%</td><td>60.8%</td><td>61.9%</td><td>60.8%</td><td>67.2%</td><td>65.6%</td><td>67.1%</td><td>68.0%</td><td>72.3%</td><td>35.7%</td><td>71.8%</td><td>69.7%</td></tr><tr><td>Jeopardy (3-shot)</td><td>4.1%</td><td>4.3%</td><td>4.5%</td><td>3.5%</td><td>13.4%</td><td>11.3%</td><td>16.8%</td><td>16.6%</td><td>27.3%</td><td>27.4%</td><td>32.7%</td><td>30.6%</td><td>40.2%</td><td>0.2%</td><td>43.1%</td><td>41.7%</td></tr><tr><td>SQAD (3-shot)</td><td>32.6%</td><td>33.2%</td><td>30.9%</td><td>31.3%</td><td>42.3%</td><td>45.3%</td><td>47.9%</td><td>47.8%</td><td>53.9%</td><td>50.0%</td><td>57.1%</td><td>55.1%</td><td>52.9%</td><td>1.5%</td><td>62.8%</td><td>61.6%</td></tr><tr><td>HellaSwag (0-shot)</td><td>47.2%</td><td>47.5%</td><td>48.3%</td><td>47.4%</td><td>57.1%</td><td>57.7%</td><td>59.6%</td><td>59.5%</td><td>66.8%</td><td>66.5%</td><td>69.2%</td><td>68.2%</td><td>73.9%</td><td>29.7%</td><td>74.6%</td><td>74.3%</td></tr><tr><td>BIG-bench Wikidata QA (3-shot)</td><td>47.3%</td><td>48.6%</td><td>49.3%</td><td>50.2%</td><td>53.0%</td><td>55.0%</td><td>56.2%</td><td>57.5%</td><td>60.4%</td><td>60.0%</td><td>60.0%</td><td>59.9%</td><td>66.9%</td><td>4.0%</td><td>66.1%</td><td>62.9%</td></tr><tr><td>WinoGrande (5-shot)</td><td>55.0%</td><td>52.6%</td><td>51.1%</td><td>52.0%</td><td>58.8%</td><td>54.9%</td><td>59.5%</td><td>58.6%</td><td>62.8%</td><td>64.1%</td><td>65.7%</td><td>65.3%</td><td>70.3%</td><td>57.8%</td><td>71.1%</td><td>70.5%</td></tr><tr><td>OpenBookQA (10-shot)</td><td>32.8%</td><td>32.4%</td><td>32.0%</td><td>32.4%</td><td>37.8%</td><td>38.2%</td><td>38.8%</td><td>36.2%</td><td>42.4%</td><td>42.0%</td><td>44.0%</td><td>41.8%</td><td>45.2%</td><td>26.6%</td><td>45.8%</td><td>46.6%</td></tr><tr><td>PIQA (0-shot)</td><td>70.7%</td><td>71.1%</td><td>71.5%</td><td>71.2%</td><td>74.5%</td><td>75.2%</td><td>74.3%</td><td>74.3%</td><td>77.2%</td><td>77.0%</td><td>76.7%</td><td>76.5%</td><td>78.7%</td><td>54.5%</td><td>80.1%</td><td>79.4%</td></tr><tr><td>TriviaQA (3-shot)</td><td>9.7%</td><td>10.5%</td><td>10.8%</td><td>9.7%</td><td>17.8%</td><td>17.7%</td><td>20.4%</td><td>18.7%</td><td>30.2%</td><td>29.1%</td><td>32.5%</td><td>33.8%</td><td>42.4%</td><td>0.5%</td><td>44.3%</td><td>44.8%</td></tr><tr><td>Winograd (3-shot)</td><td>64.5%</td><td>69.6%</td><td>67.0%</td><td>68.9%</td><td>73.3%</td><td>74.0%</td><td>75.8%</td><td>76.6%</td><td>78.8%</td><td>80.6%</td><td>80.6%</td><td>80.6%</td><td>83.9%</td><td>62.6%</td><td>86.1%</td><td>82.8%</td></tr><tr><td>LAMBADA (0-shot)</td><td>44.8%</td><td>44.5%</td><td>43.6%</td><td>41.3%</td><td>52.8%</td><td>54.2%</td><td>55.9%</td><td>57.4%</td><td>60.3%</td><td>60.7%</td><td>63.0%</td><td>64.6%</td><td>65.7%</td><td>34.8%</td><td>61.6%</td><td>64.3%</td></tr><tr><td>CoQA (0-shot)</td><td>19.3%</td><td>21.3%</td><td>20.8%</td><td>20.0%</td><td>26.2%</td><td>25.4%</td><td>27.9%</td><td>28.6%</td><td>28.2%</td><td>32.0%</td><td>33.3%</td><td>35.0%</td><td>39.8%</td><td>13.2%</td><td>44.4%</td><td>44.6%</td></tr><tr><td>ARC Challenge (3-shot)</td><td>25.4%</td><td>26.0%</td><td>27.8%</td><td>25.0%</td><td>30.3%</td><td>30.1%</td><td>31.8%</td><td>30.9%</td><td>36.1%</td><td>35.7%</td><td>38.3%</td><td>39.0%</td><td>42.0%</td><td>27.6%</td><td>42.2%</td><td>41.5%</td></tr><tr><td>COPA (0-shot)</td><td>65.0%</td><td>68.0%</td><td>64.0%</td><td>70.0%</td><td>69.0%</td><td>68.0%</td><td>68.0%</td><td>71.0%</td><td>76.0%</td><td>76.0%</td><td>78.0%</td><td>80.0%</td><td>83.0%</td><td>62.0%</td><td>84.0%</td><td>78.0%</td></tr><tr><td>BIG-bench Operators (3-shot)</td><td>12.4%</td><td>12.9%</td><td>13.8%</td><td>14.3%</td><td>19.5%</td><td>17.1%</td><td>17.1%</td><td>18.6%</td><td>21.4%</td><td>20.0%</td><td>20.0%</td><td>23.3%</td><td>31.4%</td><td>24.3%</td><td>37.6%</td><td>37.1%</td></tr><tr><td>GSM8K (0-shot)</td><td>2.4%</td><td>2.6%</td><td>2.4%</td><td>2.4%</td><td>3.7%</td><td>1.7%</td><td>2.3%</td><td>2.0%</td><td>3.9%</td><td>5.0%</td><td>4.0%</td><td>3.9%</td><td>8.7%</td><td>0.0%</td><td>9.3%</td><td>10.9%</td></tr></table>
274
+
275
+ constant $\alpha = \frac{1}{\sqrt{\mathrm{fan\_in}}}$ scaling factor used in the hidden linear layers' GEMM calls, where a GEMM is defined as:
276
+
277
+ $$
278
+ \mathbf {C} \leftarrow \alpha \mathbf {A B} + \beta \mathbf {C} \tag {18}
279
+ $$
280
+
281
+ NVIDIA's H100 GPUs support FP8 GEMMs through the cublasLtMatmul() operation (NVIDIA Corporation, 2024).
282
+
283
+ To maximize training speed and mirror TransformerEngine NVIDIA (2023), we fuse clipping to the FP8 range, casting to FP8, and transposing into a single Triton (Tillet et al., 2019) kernel. A transpose is necessary because H100s only support one layout ("TN") with FP8, but the forward and backward passes use different layouts (thanks to using $\mathbf{W}$ vs $\mathbf{W}^T$ ).
284
+
285
+ # 4. Conclusion
286
+
287
+ This work presents $\mu$ unit Scaling ( $\mu$ S), an LLM training method enabling both statically-scaled FP8 computation and zero-shot hyperparameter transfer at scale. $\mu$ unit Scaling consists of a set of principled model and optimization modifications, including Res-Post-LayerNorm, variance-preserving skip connections, unit-variance initialization, and straightforward scaling of optimization hyperparameters with model width. Compared to alternatives, $\mu$ unit Scaling is simpler, faster, more stable across model scales, and has fewer hyperparameters. We demonstrate successful FP8 training with hyperparameter transfer at scale with high-quality $\mu$ unit Scaled LLMs at 1B, 3B, 7B, and 13B sizes.
288
+
289
+ ![](images/43a8e8cc47d9d9a1a9b7e569f8e998ebfe36de68539d49d889c6315371fa3da2.jpg)
290
+ Figure 8. Training in FP8 with $\mu$ S achieves state-of-the-art efficiency. FP8 training with $\mu$ unit Scaling provides $25 - 33\%$ higher throughput than BF16 training and $1 - 6\%$ higher throughput than FP8 training with TransformerEngine (TE), over 1B, 3B, 7B, and 13B model sizes. Models are configured as specified in Table 4 and benchmarked on 64 NVIDIA H100 GPUs. Static scaling, operator fusion, and simplifications to Unit Scaling make this efficiency possible.
291
+
292
+ # Impact Statement
293
+
294
+ This paper introduces unit Scaling ( $\mu$ S), a method designed to enhance the efficiency of Large Language Model (LLM) training through scalable FP8 computation and straightforward hyperparameter transfer. The advancements provided by $\mu$ S could reduce both the computational and environmental costs associated with training large-scale models, potentially democratizing access to high-performance machine learning by lowering resource requirements. While this work's primary goal is advancing training efficiency, we acknowledge that, as with all machine learning technologies, continued attention to ethical considerations and societal implications remains important.
295
+
296
+ # References
297
+
298
+ Anonymous. Scaling FP8 training to trillion-token LLMs. In Submitted to The Thirteenth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=E1EHO0imOb. under review.
299
+ Barton, T. Calibrating the Mosaic evaluation Gauntlet, 4 2024. URL https://www.databricks.com/blog/calibrating-mosaic-evaluation-gauntlet.
300
+ Blake, C., Orr, D., and Luschi, C. Unit scaling: Out-of-the-box low-precision training. 2023. URL https://arxiv.org/abs/2303.11257.
301
+ Blake, C., Eichenberg, C., Dean, J., Balles, L., Prince, L. Y., Deiseroth, B., Cruz-Salinas, A. F., Luschi, C., Weinbach, S., and Orr, D. u-µp: The unit-scaled maximal update parametrization. In 2nd Workshop on Advancing Neural Network Training: Computational Efficiency, Scalabil
302
+
303
+ ity, and Resource Optimization (WANT@ICML 2024), 2024. URL https://openreview.net/forum? id=44NKKzz1n5.
304
+ Casella, G. and Berger, R. L. Statistical Inference. Duxbury, Pacific Grove, CA, 2nd edition, 2002. ISBN 978-0-534-24312-8. URL https://pages.stat.wisc.edu/~shao/stat610/Casella_Berger_Statistical_Inference.pdf.
305
+ Chen, X., Liang, C., Huang, D., Real, E., Wang, K., Pham, H., Dong, X., Luong, T., Hsieh, C.-J., Lu, Y., and Le, Q. V. Symbolic discovery of optimization algorithms. In Thirty-seventh Conference on Neural Information Processing Systems, 2023. URL https://openreview.net/forum?id=ne6zeqLFCZ.
306
+ Dettmers, T., Lewis, M., Belkada, Y., and Zettlemoyer, L. LLM.int8(): 8-bit matrix multiplication for transformers at scale. In Oh, A. H., Agarwal, A., Belgrave, D., and Cho, K. (eds.), Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum?id=dXiGWqBoxaD.
307
+ Dohmann, J. Blazingly fast LLM evaluation for in-context learning, 2 2023. URL https://www.databricks.com/blog/llm-evaluation-for-icl.
308
+ Dong, J., Feng, B., Guessous, D., Liang, Y., and He, H. Flex attention: A programming model for generating optimized attention kernels, 2024. URL https://arxiv.org/abs/2412.05496.
309
+ Khudia, D., Huang, J., Basu, P., Deng, S., Liu, H., Park, J., and Smelyanskiy, M. Fbgemm: Enabling high-performance low-precision deep learning inference, 2021. URL https://arxiv.org/abs/2101.05615.
310
+ Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization, 2017. URL https://arxiv.org/abs/1412.6980.
311
+ Lingle, L. A large-scale exploration of $\mu$ -transfer, 2024. URL https://arxiv.org/abs/2404.05728.
312
+ Liu, Z., Hu, H., Lin, Y., Yao, Z., Xie, Z., Wei, Y., Ning, J., Cao, Y., Zhang, Z., Dong, L., Wei, F., and Guo, B. Swin transformer v2: Scaling up capacity and resolution. In CVPR, pp. 11999-12009, 2022. URL https://doi.org/10.1109/CVPR52688.2022.01170.
313
+ Micikevicius, P., Narang, S., Alben, J., Diamos, G., Elsen, E., Garcia, D., Ginsburg, B., Houston, M., Kuchaiev, O., Venkatesh, G., and Wu, H. Mixed precision training. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=r1gs9JgRZ.
314
+
315
+ Micikevicius, P., Stosic, D., Burgess, N., Cornea, M., Dubey, P., Grisenthwaite, R., Ha, S., Heinecke, A., Judd, P., Kamalu, J., Mellempudi, N., Oberman, S., Shoeybi, M., Siu, M., and Wu, H. Fp8 formats for deep learning. 2022. URL https://arxiv.org/abs/2209.05433.
316
+ Mirzadeh, S. I., Alizadeh-Vahid, K., Mehta, S., del Mundo, C. C., Tuzel, O., Samei, G., Rastegari, M., and Farajtabar, M. ReLU strikes back: Exploiting activation sparsity in large language models. In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=osowxy8q2E.
317
+ MosaicML.Composer.https://github.com/ mosaicml/composer/,2021.
318
+ MosaicML. LLM Foundry. <https://github.com/mosaicml/11m-foundry/>. 2022a.
319
+ MosaicML Streaming. <https://github.com/mosaicml/streaming/>. 2022b.
320
+ NVIDIA. Asynchronous multiply-and-accumulate instruction: wgmma.mma $a$ sync. URL.
321
+ NVIDIA. TransformerEngine, 2023. URL https://github.com/NVIDIA/TransformerEngine.
322
+ NVIDIA Corporation. cuBLAS: cublasLtMatmul(). NVIDIA, 2024. URL https://docs.nvidia.com/cuda/cublas/#cublasltmatmul.
323
+ OLMo, T., Walsh, P., Soldaini, L., Groeneveld, D., Lo, K., Arora, S., Bhagia, A., Gu, Y., Huang, S., Jordan, M., et al. 2 olmo 2 furious. arXiv preprint arXiv:2501.00656, 2024.
324
+ Sun, X., Choi, J., Chen, C.-Y., Wang, N., Venkataramani, S., Srinivasan, V. V., Cui, X., Zhang, W., and Gopalakrishnan, K. Hybrid 8-bit floating point (hfp8) training and inference for deep neural networks. In Wallach, H., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. URL https://proceedings.neurips.cc/paper_files/paper/2019/file/65fc9fb4897a89789352e211ca2d398f-Paper.pdf.
325
+ Tillet, P., Kung, H. T., and Cox, D. Triton: an intermediate language and compiler for tiled neural network computations. In Proceedings of the 3rd ACM SIGPLAN International Workshop on Machine Learning and Programming Languages, MAPL 2019, pp. 10-19, New York, NY, USA, 2019. Association for Computing Machinery. ISBN 9781450367196. 10.1145/3315508.3329973. URL https://doi.org/10.1145/3315508.3329973.
326
+
327
+ Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L. u., and Polosukhin, I. Attention is all you need. In Guyon, I., Luxburg, U. V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. URL https://proceedings.neurips.cc/paper_files/paper/2017/file/3f5ee243547dee91fdb053c1c4a845aa-Paper.pdf.
328
+ Wang, X. and Aitchison, L. How to set AdamW's weight decay as you scale model and dataset size, 2024. URL https://arxiv.org/abs/2405.13698.
329
+ Wortsman, M., Liu, P. J., Xiao, L., Everett, K. E., Alemi, A. A., Adlam, B., Co-Reyes, J. D., Gur, I., Kumar, A., Novak, R., Pennington, J., Sohl-Dickstein, J., Xu, K., Lee, J., Gilmer, J., and Kornblith, S. Small-scale proxies for large-scale transformer training instabilities. In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=d8w0pmvXbZ.
330
+ Yang, G., Hu, E. J., Babuschkin, I., Sidor, S., Liu, X., Farhi, D., Ryder, N., Pachocki, J., Chen, W., and Gao, J. Tuning large neural networks via zero-shot hyperparameter transfer. In Beygelzimer, A., Dauphin, Y., Liang, P., and Vaughan, J. W. (eds.), Advances in Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id=Bx6qKuBM2AD.
331
+ Yang, G., Simon, J. B., and Bernstein, J. A spectral condition for feature learning. 2024a. URL https://arxiv.org/abs/2310.17813.
332
+ Yang, G., Yu, D., Zhu, C., and Hayou, S. Tensor programs VI: Feature learning in infinite depth neural networks. In The Twelfth International Conference on Learning Representations, 2024b. URL https://openreview.net/forum?id=17pVDnpwwl.
333
+
334
+ # A. Appendix
335
+
336
+ # A.1. Why these modifications?
337
+
338
+ Table 1 contains a number of modifications to standard bf16 training setups. Where did these come from? Are they simply a result of trying ideas until something worked? Or are they the result of more principled analysis and ablations?
339
+
340
+ While we do explain the basis for each modification over the course of the main text, this section summarizes how we arrived at each of them. We can group the origins of these changes into three categories: simple math, adhering to prior art, and ablation experiments.
341
+
342
+ # A.1.1. SIMPLE MATH
343
+
344
+ Recall that, in order to ensure stable training and consistent hyperparameter meanings, we wish to ensure that all weight and activation tensors have unit variance. Enforcing unit variance is difficult because the weights are constantly being modified throughout training. To enforce exact unit variance everywhere would require significant overhead in the form of added normalization operations. We therefore relax the constraint to the following:
345
+
346
+ 1. Each residual branch must have exactly unit variance
347
+ 2. Weight tensors must have unit variance at initialization
348
+ 3. Linear layer outputs have unit variance at initialization, assuming the inputs are iid with unit variance.
349
+ 4. Weight updates should attempt to preserve the weight and activation variances to the extent that this is possible without significant overhead.
350
+
351
+ The last three requirements mirror Blake et al. (2023) while the first is stronger.
352
+
353
+ Our core modifications follow immediately from these requirements and a bit of math.
354
+
355
+ Unit variance initialization, linear layer scaling factors. Suppose we initialize our weights with unit variance to achieve requirement (2). Given iid standard normal input elements, our outputs will be $\chi^2$ random variables with $k$ degrees of freedom, where $k$ is the contraction dimension. This has a mean and variance of fan_in and variance of $2 * \text{fan_in}$ , which are nowhere near 1 and so violate requirement (3). The typical solution to this is scaling down the initialization by a factor of $\sqrt{\text{fan_in}}$ , but this violates requirement (2). As observed in (Blake et al., 2023), we can reconcile both by scaling down the outputs by $\sqrt{\text{fan_in}}$ at runtime as part of the GEMM call. This one extra multiply per output element is essentially free, and in fact fused into instructions such as the NVIDIA Hopper architecture's wgmma (NVIDIA). See Blake et al. (2023) for further discussion.
356
+
357
+ Learning rate scaling. Recall from (Yang et al., 2021) and Section 2.3 that one can scale weight initialization variance, learning rate, and linear layer output arbitrarily as long as all three are scaled according to a precise relationship. Since we have fixed the weight initialization variance to 1 and the output scaling to $\text{fan\_in}^{-\frac{1}{2}}$ , our learning rate scale of $\text{fan\_in}^{-\frac{1}{2}}$ is uniquely determined. Further, when changing fan in from $d_{base}$ to $d_{new}$ , this implies scaling the learning rate by $\frac{\sqrt{d_{base}}}{\sqrt{d_{new}}}$ .
358
+
359
+ # A.1.2. ADHERING TO BEST PRACTICES.
360
+
361
+ Some aspects of our training recipe are crucial but already common (though not universal) practices. These include:
362
+
363
+ Weight decay $(\lambda)$ scaling. Recall that decoupled weight decay amounts to multiplying weights by a constant $1 - \lambda, 0 < = \lambda < 1$ during each update. This operation already has the same semantics across model widths.
364
+
365
+ FP8 hidden layers. Using e4m3 weights and activations along with e5m2 gradients is a common practice (NVIDIA, 2023; Micikevicius et al., 2022) Clipping instead of overflowing prevents NaN/Inf values. Keeping the first and last layers in higher precision is also common.
366
+
367
+ # A.1.3. ABLATION EXPERIMENTS.
368
+
369
+ Two modifications in our recipe can be implemented in multiple ways, so we chose the details based on smaller-scale experimental results.
370
+
371
+ Table 6. Comparing μS with other schemes μS components have commonalities and differences with existing training schemes. It is the only one which combines scalable, complete FP8 LLM training with hyperparameter transfer; see Figure 1 for a comparison of features of low-precision training methods.
372
+
373
+ <table><tr><td>μS Component</td><td>μP</td><td>Unit Scaling</td><td>u-μP</td></tr><tr><td>Linear layer scaling factors</td><td>Not used</td><td>Used, but can be different in forward and backward pass.</td><td>Used</td></tr><tr><td>Res-Post-LayerNorm</td><td>Not used</td><td>Not used</td><td>Not used</td></tr><tr><td>“Fixed” residual modification</td><td>Not used</td><td>Proposed</td><td>Not used</td></tr><tr><td>Unit variance initialization</td><td>Not used</td><td>Used</td><td>Used</td></tr><tr><td>FP8 hidden layers</td><td>Not used</td><td>Used, but not at scale</td><td>Used, but restricted only to some layers</td></tr><tr><td>Learning rate (η) scaling</td><td>Used</td><td>Not used</td><td>Used</td></tr><tr><td>Weight decay (λ) scaling</td><td>Not used</td><td>Not used</td><td>Used</td></tr></table>
374
+
375
+ Fixed residual modification. In order to satisfy our design goal of having a fixed-variance residual stream, we need to combine the previous residual stream tensor and the latest residual branch output in some manner that preserves variance. As discussed in the paper, this can be done by replacing summation with weighted summation. However, we are left with a degree of freedom in setting the weighting coefficient. To keep the search space small, we consider only the two schemes from (Blake et al., 2023) and decide between them based on the experiments in Section A.3.
376
+
377
+ Res-Post-LayerNorm. As we show in Section 2.1, the variance of token representations tends to collapse later in the sequence. If a closed-form correction could exactly undo this effect, we could apply such a correction and avoid modifying the architecture. However, as shown in Figures 2 and 3, the pattern of variance collapse is input-dependent and deviates greatly from what iid assumptions would lead one to expect. In order to satisfy our requirement that residual streams have unit variance, we therefore must resort to a blunt instrument: imposing normalization at runtime. We could normalize the residual stream itself, add a normalization op at the end of each residual branch, or move the normalization in a Pre-LN transformer from the start of the branch to the end. We decided to go with the last option because it adds no extra operations, normalizes both the residual stream token embeddings and their updates, is consistent with previous work (Liu et al., 2022; OLMo et al., 2024), and worked well in our ablation experiments (Fig 4b).
378
+
379
+ # A.1.4. COMPARISON TO EXISTING SCHEMES
380
+
381
+ As a supplement to Table 1 which enumerates the components of $\mu S$ compared to standard practice (SP), Table 6 compares these components with $\mu P$ , Unit Scaling, and u- $\mu \mathrm{P}$
382
+
383
+ # A.2. Covariance of softmax numerator and denominator
384
+
385
+ In the proof for Prop. 2.1, we state that $\mathrm{Cov}[\mathbf{n},\mathbf{d}] = \sigma_{\mathbf{n}}^2$ . Here we derive this result. Just as in Sec. 2.1, define $\mathbf{s}$ as the output of the softmax function applied to a vector of $k$ independent elements $\mathbf{x}$ . The softmax function is defined as $s_i = \mathrm{softmax}(\mathbf{x})_i = \frac{\mathrm{e}^{x_i}}{\sum_{j=1}^k \mathrm{e}^{x_j}}$ . As shown previously, we denote the vector of elements containing numerators of elements of $\mathbf{s}$ as $\mathbf{n}$ and denominators of elements of $\mathbf{s}$ as $\mathbf{d}$ , such that $\mathbf{s} = \frac{\mathbf{n}}{\mathbf{d}}$ . By the definition of covariance:
386
+
387
+ $$
388
+ \operatorname {C o v} [ \mathbf {n}, \mathbf {d} ] = \operatorname {E} \left[ \left(n _ {i} - \mu_ {\mathbf {n}}\right) \left(d _ {i} - \mu_ {\mathbf {d}}\right) \right] \tag {19}
389
+ $$
390
+
391
+ By the definition of softmax, $d_{i} = \sum_{i=1}^{k} n_{i}$ , and by linearity of expectation, $\mu_{\mathbf{d}} = k \mu_{\mathbf{n}}$ . Using this, we obtain:
392
+
393
+ $$
394
+ \operatorname {C o v} [ \mathbf {n}, \mathbf {d} ] = \operatorname {E} \left[ \left(n _ {i} - \mu_ {\mathbf {n}}\right) \left(n _ {1} + n _ {2} + \dots + n _ {i} + \dots + n _ {k} - k \mu_ {\mathbf {n}}\right) \right] \tag {20}
395
+ $$
396
+
397
+ Expanding this expression:
398
+
399
+ $$
400
+ \operatorname {C o v} [ \mathbf {n}, \mathbf {d} ] = \operatorname {E} \left[ \left(n _ {i} - \mu_ {\mathbf {n}}\right) \left(\left(n _ {1} - \mu_ {\mathbf {n}}\right) + \left(n _ {2} - \mu_ {\mathbf {n}}\right) + \dots + \left(n _ {i} - \mu_ {\mathbf {n}}\right) + \dots + \left(n _ {k} - \mu_ {\mathbf {n}}\right)\right) \right] \tag {21}
401
+ $$
402
+
403
+ By linearity of expectation:
404
+
405
+ $$
406
+ \operatorname {C o v} [ \mathbf {n}, \mathbf {d} ] = \operatorname {E} \left[ \left(n _ {i} - \mu_ {\mathbf {n}}\right) ^ {2} \right] + \sum_ {j \neq i} \operatorname {E} \left[ \left(n _ {i} - \mu_ {\mathbf {n}}\right) \left(n _ {j} - \mu_ {\mathbf {n}}\right) \right] \tag {22}
407
+ $$
408
+
409
+ Because elements of the softmax input $\mathbf{x}$ are independent, and $n_i = \mathrm{e}^{x_i}$ , elements of $\mathbf{n}$ are also independent. Therefore $\operatorname{E}[(n_i - \mu_{\mathbf{n}})(n_j - \mu_{\mathbf{n}})] = 0$ for $j \neq i$ . Then by the definition of variance as $\operatorname{Var}[\mathbf{n}] = \operatorname{E}[(n_i - \mu_{\mathbf{n}})^2]$ , we obtain:
410
+
411
+ $$
412
+ \operatorname {C o v} [ \mathbf {n}, \mathbf {d} ] = \operatorname {V a r} [ \mathbf {n} ] \tag {23}
413
+ $$
414
+
415
+ # A.3. Modifying Residual Connections with $\tau$
416
+
417
+ To make skip connections variance-preserving, we use the fixed residual modification scheme, as shown in Eq. 11, with coefficients based on the hyperparameter $\tau$ (Blake et al., 2023). To understand the relationship of the optimal residual coefficient $\tau^{*}$ with network depth, we swept over various values of $\tau$ for models of different widths (256, 512, 1024, 2048) and depths (20, 40, 60, 80, 100). In order to assess potential confounding effects between $\tau^{*}$ and $\eta^{*}$ and $\lambda^{*}$ , we tuned those two hyperparameters as well. We trained each model for 10.5B tokens with a global batch size of 256 and sequence length of 4096. We define the optimal subset of models as those which had a final cross-entropy loss within $0.25\%$ of the optimum (with loss averaged over the last 10 steps, i.e. 10.5M tokens). As shown in Fig. 9, $\tau^{*}$ (for the optimal subset of models) decreases as network depth increases. Since the contribution of each residual branch exponentially decays with depth, a lower $\tau$ ensures a lower rate of decay, likely useful as networks get deeper. This relationship between $\tau^{*}$ and depth is consistent even as model width increases. In our experiments, $\tau$ can be coarsely swept. We use the results shown in Fig. 9, to directly choose $\tau^{*}$ for all $\mu$ S model training.
418
+
419
+ ![](images/3fe0d9676a8d8590c1ba66d860bcf676e49a955d0231c6d174498e9033ba0c02.jpg)
420
+ Optimal Residual Coefficient $(\tau^{*})$ vs. Network Depth
421
+ Figure 9. Optimal residual coefficient $\tau^{*}$ decreases with depth. The 3 hyperparameters of $\tau$ , $\eta$ , and $\lambda$ are swept for models of varying widths (256, 512, 1024, 2048) and depths (20, 40, 60, 80, 100). The mean and standard error of $\tau$ is shown for the optimal subset of models from each hyperparameter sweep, where a model is included in the optimal subset if it had final cross-entropy loss within $0.25\%$ of the sweep optimum. $\tau^{*}$ , which controls the decay rate of residual branch contributions in the residual stream, decreases as network depth increases.
422
+
423
+ # A.4. Lion Optimizer and Hyperparameter Transfer
424
+
425
+ Here, we show why Lion Chen et al. (2023) is an "Adam-like" optimizer, so the $\mu \mathrm{P}$ rules for hyperparameter transfer with Adam (Kingma & Ba, 2017) are applicable to Lion as well. Because Adam and Lion are both adaptive optimizers that normalize gradients coordinatewise before updating parameters, the nonlinear tensor product matrix results obtained in Yang et al. (2021, Appendix J.1.3) apply to both optimizers. One can see that Lion differs from Adam only in that it has a different second moment estimate. Under both optimizers, with gradient $g_{t}$ , a parameter $\theta$ is updated as:
426
+
427
+ $$
428
+ \theta_ {t + 1} = \theta_ {t} - \eta \frac {\beta_ {1} m _ {t} + (1 - \beta_ {1}) g _ {t}}{\sqrt {s _ {t}}} \tag {24}
429
+ $$
430
+
431
+ For Lion, this follows by expressing $\mathrm{sign}(c_t)$ as $c_{t} / c_{t}^{2}$ . Then, the second moment estimate $s_t$ for Adam (Eq. 25) and Lion (Eq. 26) are below.
432
+
433
+ $$
434
+ s _ {t} ^ {\mathrm {A d a m}} = \beta_ {2} v _ {t} + (1 - \beta_ {2}) g _ {t} ^ {2} + \epsilon \tag {25}
435
+ $$
436
+
437
+ $$
438
+ s _ {t} ^ {\text {L i o n}} = c _ {t} ^ {2} = \beta_ {1} ^ {2} m _ {t} ^ {2} + 2 \beta_ {1} (1 - \beta_ {1}) m _ {t} g _ {t} + \left(1 - \beta_ {1}\right) ^ {2} g _ {t} ^ {2} \tag {26}
439
+ $$
440
+
441
+ This justifies why Lion is an Adam-like optimizer for the purposes of hyperparameter transfer. We use Lion for its reduced memory footprint in all our experiments.
442
+
443
+ # A.5. unit Scaling vs Unit Scaling for larger model training
444
+
445
+ We test the unit scaling (US) and $\mu$ unit scaling $(\mu S)$ methods at the 7B model scale with FP8 training. Figure 10 shows that unit scaling models diverge very early in training, while $\mu$ unit scaling runs converge smoothly. Based on this experiment, we did not conduct final model runs at different model scales with unit scaling (1B-13B).
446
+
447
+ ![](images/aa3fb270beb29297997946b5ca70dce01228065e3be41a9317538ea43de14389.jpg)
448
+ Figure 10. Unit Scaling (US) vs unit Scaling $(\mu \mathbf{S})$ for 7B models. Convergence test loss curves at 7B model scale show that $\mu \mathrm{S}$ converges smoothly while US training diverges early in training.
449
+
450
+ # A.6. Activation Outliers
451
+
452
+ We analyze activation distributions taken over 32,768 tokens at every 10 layers for all FP8 models trained according to Table 4, with results shown in Fig. 13. These figures show the distribution of activation values for attention and FFN block inputs and outputs in the final 1B, 3B, 7B, and 13B FP8 models. While SP models consistently have outliers in the attention block and FFN block inputs at all model scales, $\mu S$ models do not have these outliers in block inputs. This may make $\mu S$ models more easily quantizable. It is important to note, however, that in SP models, the Pre-LayerNorm placement means that activations from the residual stream are first normalized before subsequent operations.
453
+
454
+ While we do not identify the exact mechanism by which these outliers arise in the residual stream in SP models, we show their absence in $\mu \mathrm{S}$ models here, with activation distributions that may be more conducive to quantization. An activation distribution with fewer outliers requires fewer bits to represent it.
455
+
456
+ # A.7. Activation Function Choice
457
+
458
+ The choice of activation function can have a significant impact on activation underflow when training in FP8. For example, recent work by (Anonymous, 2024) identifies outlier amplification from SwiGLU as a challenge for FP8 LLM training. Nearly all state-of-the-art LLMs today use either SiLU or GELU as their activation function, but when training in FP8, this may lead to underflow in activations during training. This is because these functions asymptotically approach zero as inputs $x \to -\infty$ . We define the FP8 underflow fraction, or the fraction of elements flushed to 0 from a BF16 to FP8 cast, as a metric to evaluate various activation functions. As shown in Fig. 11, this can cause many activations to underflow.
459
+
460
+ To better understand how activation function choice influences FP8 underflow when training with $\mu$ unit scaling, we train small 4 layer models with GELU, SiLU, and ReLU. Our findings, detailed in Fig. 12 that during unit scaled model training, the choice of activation function drastically impacts the FP8 underflow rate for activation outputs. GELU greatly degrades
461
+
462
+ ![](images/071d99d8c7138d78e0a994f1aed7c748256929755b0adeca2fa1a7513ad5985f.jpg)
463
+ Figure 11. Different activation functions cause different amounts of FP8 underflow. When casting $\mathcal{N}(0,1)$ or Unif(-128, 128) values from BF16 to FP8 (e4m3), GELU, SiLU, and ReLU (green) erroneously round to zero (underflow) with different probabilities. GELU and SiLU experience significant FP8 underflow because they slowly approach 0 for increasingly negative inputs. SiLU approaches 0 more slowly than GELU and so underflows for a wider range of inputs. ReLU simply maps all negative values to 0, regardless of the numerical format.
464
+
465
+ ![](images/d735ef82228594d70cd4276f842b8cc1b6daf23054e3798c774d77e68ebfe149.jpg)
466
+ Figure 12. Activation function choice impacts FP8 underflow and low-precision convergence error. FP8 underflow of activation function outputs for each block in a 4 layer transformer model during training is shown for GELU, SiLU, and ReLU. Low precision convergence error, defined as the percent difference in final cross entropy loss between an FP8 model and its BF16 counterpart, is shown in the rightmost chart. GELU and SiLU cause significant underflow over the course of training, and models trained with these activation functions have twice as much low precision convergence error as with ReLU. ReLU greatly reduces this FP8 underflow by multiple orders of magnitude.
467
+
468
+ the representation of FFN down projection inputs, reaching up to $30\%$ underflow during training. SiLU causes similar degradation, but at a lower rate, reaching up to $7\%$ during training. In contrast, ReLU does not suffer from this problem, with a maximum of $0.04\%$ FP8 underflow during training. As a result, FP8 unit scaled models trained with ReLU have smaller low-precision convergence error (defined as the percent difference between the final cross entropy loss and FP8 model and its BF16 counterpart). Based on these observations and results, ReLU minimizes FP8 underflow and low-precision convergence error. ReLU also has the added benefit of sparsifying activations, a property which enables significant inference-time optimizations (Mirzadeh et al., 2024). However, using GELU results in models with lower final training loss. For this reason, we use GELU when training all $\mu \mathrm{S}$ models. Additional investigations into activation functions more suitable for FP8 training can help mitigate underflow while also providing improved convergence.
469
+
470
+ ![](images/f51931462709dc22041ea4552cc321c68ddb84c28ea99d0b2a5e5b44cd9b940d.jpg)
471
+
472
+ ![](images/37bd7607afbe8f5b3ebd2d5fc10f51443925efe46fb825c7ef4e660141c84637.jpg)
473
+
474
+ ![](images/9764cd3f034a055ab18c8d54d80280fb200979184fdc0334af4d255029f3d307.jpg)
475
+
476
+ ![](images/c082406410031244e132bfdb7528d1c6f83cbaee7749aeb9edd2a278e8c21325.jpg)
477
+
478
+ ![](images/4339f563e57aef6439e94672b7f7ba6dc173442f3b34900362dcb2d80f02ba29.jpg)
479
+ (e) 7B SP FP8 model activation distributions.
480
+
481
+ ![](images/bd118c1de34d3c1ed1cd2d9caf947816d4a681466f84d194fbea4da9a55f966c.jpg)
482
+ (f) 7B $\mu$ S FP8 model activation distributions.
483
+
484
+ ![](images/4650504f389f8072465414a578f1ea8c5325407241ca7c42a3ee30c5e8ff1015.jpg)
485
+ (g) 13B SP FP8 model activation distributions.
486
+
487
+ ![](images/40cf8fafedc296abe6ba75efe5fc9762fcc2a33b36f4aaff4e1ad22cd5149df8.jpg)
488
+ (h) $13\mathrm{B}\mu \mathrm{S}$ FP8 model activation distributions.
489
+ Figure 13. Activation distributions of $\mu S$ and SP models. Activation distributions for attention and FFN block inputs and outputs are shown for 1B, 3B, 7B, and 13B FP8 models at every 10th layer. $\mu S$ models lack the notable right tail of activation outliers in block inputs that SP models suffer from. This may make them easier to quantize.
2025/$_mathrmμ$nit Scaling_ Simple and Scalable FP8 LLM Training/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6b0439409e9e9753540e68fe71f34d4d7197ea878f58d41aec3e7407e76a03a0
3
+ size 1578493
2025/$_mathrmμ$nit Scaling_ Simple and Scalable FP8 LLM Training/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/$_textttI$^2$MoE$_ Interpretable Multimodal Interaction-aware Mixture-of-Experts/432bdcf8-db80-4266-af20-ab0a1059e8db_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/$_textttI$^2$MoE$_ Interpretable Multimodal Interaction-aware Mixture-of-Experts/432bdcf8-db80-4266-af20-ab0a1059e8db_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/$_textttI$^2$MoE$_ Interpretable Multimodal Interaction-aware Mixture-of-Experts/432bdcf8-db80-4266-af20-ab0a1059e8db_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f8b6d9c32fe9b5f67066578e80b6c7912c67de71aa08c3354b7ef794ead07149
3
+ size 8464242
2025/$_textttI$^2$MoE$_ Interpretable Multimodal Interaction-aware Mixture-of-Experts/full.md ADDED
@@ -0,0 +1,563 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # $\mathbf{I}^{2}\mathbf{M}\circ \mathbf{E}$ : Interpretable Multimodal Interaction-aware Mixture-of-Experts
2
+
3
+ Jiayi Xin<sup>1</sup> Sukwon Yun<sup>2</sup> Jie Peng<sup>3</sup> Inyoung Choi<sup>1</sup> Jenna L. Ballard<sup>1</sup> Tianlong Chen<sup>2</sup> Qi Long<sup>1</sup>
4
+
5
+ # Abstract
6
+
7
+ Modality fusion is a cornerstone of multimodal learning, enabling information integration from diverse data sources. However, vanilla fusion methods are limited by (1) inability to account for heterogeneous interactions between modalities and (2) lack of interpretability in uncovering the multimodal interactions inherent in the data. To this end, we propose $\mathsf{I}^2\mathsf{MoE}$ (Interpretable Multimodal Interaction-aware Mixture of Experts), an end-to-end MoE framework designed to enhance modality fusion by explicitly modeling diverse multimodal interactions, as well as providing interpretation on a local and global level. First, $\mathsf{I}^2\mathsf{MoE}$ utilizes different interaction experts with weakly supervised interaction losses to learn multimodal interactions in a data-driven way. Second, $\mathsf{I}^2\mathsf{MoE}$ deploys a reweighting model that assigns importance scores for the output of each interaction expert, which offers sample-level and dataset-level interpretation. Extensive evaluation of medical and general multimodal datasets shows that $\mathsf{I}^2\mathsf{MoE}$ is flexible enough to be combined with different fusion techniques, consistently improves task performance, and provides interpretation across various real-world scenarios. Code is available at https://github.com/Raina-Xin/I2MoE.
8
+
9
+ # 1. Introduction
10
+
11
+ A core challenge in multimodal learning is modality fusion—the integration of information from multiple modalities to improve predictive performance (Baltrusaitis et al., 2019; Barnum et al., 2020; Lv et al., 2021). By leveraging
12
+
13
+ <sup>1</sup>University of Pennsylvania, PA, USA <sup>2</sup>University of North Carolina at Chapel Hill, NC, USA <sup>3</sup>University of Science and Technology of China, Anhui, China. Correspondence to: Qi Long <qlong@upenn.edu>, Tianlong Chen <tianlong@cs.unc.edu>, Jiayi Xin <jiayixin@seas.upenn.edu>.
14
+
15
+ Proceedings of the $42^{nd}$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
16
+
17
+ ![](images/5b4df49cf3760fc91a0e029c5ec9d72d1b84f56a8e17b356dd84adcac416b4b3.jpg)
18
+ Figure 1. An illustrative example of modality interaction. The poster and plot are taken from the IMDB dataset.
19
+
20
+ ing diverse data sources such as text, images, audio, and sensor data, modality fusion enables the capture of intricate relationships across modalities, which is especially crucial in fields like healthcare, where accurate decision-making relies on multimodal insights (Liang et al., 2022b; Kline et al., 2022; Teoh et al., 2024). Although recent advancements in neural architectures, such as transformers (Vaswani et al., 2017; Tsai et al., 2019) and sparse mixture-of-experts (Shazeer et al., 2017; Fedus et al., 2022; Jin et al., 2024), have significantly improved the modeling of modality interactions, an important yet underexplored area is the systematic understanding of how modalities influence one another—whether they provide complementary, supplementary, or even conflicting information (Baltrusaitis et al., 2019; Liang et al., 2022b; 2023).
21
+
22
+ Understanding modality interaction is essential for advancing multimodal machine learning (Baltrusaitis et al., 2019; Liang et al., 2022b). An information-theoretic framework called Partial Information Decomposition (PID) (Wollstadt et al., 2023; Liang et al., 2023) offers a theoretical foundation for understanding modality interactions. PID decomposes information into four distinct types: uniqueness for the first modality (information specific to modality 1), uniqueness for the second modality (information specific to modality 2), synergy (emergent information arising from the combination of two modalities), and redundancy (shared information across two modalities).
23
+
24
+ Figure 1 illustrates the importance of carefully modeling different types of multimodal interactions. For instance, the unique information provided by the image modality
25
+
26
+ $(\mathbf{m}_{\mathrm{img}})$ contributes to predicting the Horror genre through distinct visual cues absent in the language modality $(\mathbf{m}_{\mathrm{lang}})$ while the unique information from the language modality offers critical textual context for identifying the Romance genre. Redundant information refers to shared information present in both modalities, such as recognizing the Fantasy genre through the blurry figure in the poster and mentioning a "sorcerer" in the plot. Accurately classifying the movie as Drama, however, requires modeling synergistic information between the two modalities: visual elements such as clothing and facial expressions in $\mathbf{m}_{\mathrm{img}}$ complement the narrative details from $\mathbf{m}_{\mathrm{lang}}$ . From this example, systematic modeling of multimodal interactions is needed to make accurate predictions.
27
+
28
+ While the PID framework provides valuable theoretical insights into the proportions of different modality interactions within a dataset, its practical application is limited, lacking integration into end-to-end and interpretable deep learning frameworks. Most existing multimodal fusion methods do not explicitly model multimodal interactions (Liu et al., 2018; Tsai et al., 2019; Xue & Marculescu, 2023). Notable efforts to address this gap, such as (Wörtwein et al., 2022; Yu et al., 2024; Dufumier et al., 2024), exhibit key limitations: they either focus exclusively on pairwise modality interactions (Wörtwein et al., 2022), require separate estimates for each interaction type (Yu et al., 2024), or lack sufficient interpretability (Dufumier et al., 2024). The opportunity to directly leverage PID for improving both task performance and model interpretability within multimodal fusion frameworks remains largely unexplored.
29
+
30
+ In contrast to earlier works, we propose $\mathsf{I}^2\mathsf{M}\circ \mathsf{E}$ , an end-to-end mixture-of-experts (MoE) framework designed to enhance task performance while improving interpretability. Our approach incorporates separate parameters and weakly-supervised interaction losses, enabling the mixture of interaction experts to effectively model diverse interactions between modalities. To further enhance interpretability, we introduce a re-weighting model that assigns importance scores to each interaction expert, providing insights into decision-making at both local (sample-level) and global (dataset-level) scales. $\mathsf{I}^2\mathsf{M}\circ \mathsf{E}$ is backbone-agnostic and can be seamlessly integrated with any modality fusion approach. We evaluate the effectiveness of $\mathsf{I}^2\mathsf{M}\circ \mathsf{E}$ on two medical datasets and three real-world multimodal datasets, demonstrating its ability to consistently improve performance while offering interpretable insights into the model's decision-making process for individual samples.
31
+
32
+ Our contributions are summarized as follows:
33
+
34
+ $\star$ We introduce $\mathsf{I}^{2}\mathsf{MoE}$ , a novel mixture-of-experts framework designed to explicitly model diverse modality interactions through specialized parameters and weakly-supervised interaction losses, enabling a more
35
+
36
+ nuanced understanding of multimodal data.
37
+
38
+ $\star$ We enhance interpretability by providing both sample-level and dataset-level insights into model decisions, offering a deeper understanding of how interaction experts contribute to predictions.
39
+ $\star$ $\mathsf{I}^{2}\mathsf{MOE}$ is highly flexible and can be seamlessly integrated with existing modality fusion methods, demonstrating its versatility in improving vanilla multimodal fusion backbones.
40
+ $\star$ Extensive experiments on five diverse real-world multimodal datasets validate the efficacy of $\mathsf{I}^2\mathsf{M}\mathsf{O}\mathsf{E}$ , showcasing significant performance improvements (up to $5.5\%$ in accuracy) and interpretability benefits over vanilla modality fusion methods.
41
+
42
+ # 2. Related Work
43
+
44
+ Modality Interaction is theoretically grounded in the Partial Information Decomposition (PID) framework (Liang et al., 2023), which analyzes heterogeneous interactions but lacks an end-to-end learning framework. Prior works attempt to model interactions but are either restricted to specific interaction types (Zhang et al., 2023; Kim et al.), fail to quantify interactions in the data (Wörtwein et al., 2024; Liang et al., 2024; Long et al., 2024; Dufumier et al., 2024), or are limited to only two modalities (Wörtwein et al., 2022; Fan et al., 2024). Our approach bridges this gap by directly modeling and quantifying modality interactions within a unified MoE-based fusion architecture, enabling effective and interpretable multimodal learning.
45
+
46
+ Multimodal Fusion integrates data from multiple sources to enhance prediction tasks. Existing methods often rely on concatenating input modalities using off-the-shelf architectures (Liu et al., 2018; Tsai et al., 2019; Xue & Marculescu, 2023; Shazeer et al., 2017; Fedus et al., 2022). Mixture-of-Experts (MoE) offers a natural architecture for modeling interactions via expert specialization (Jacobs et al., 1991; Chen et al., 1999; Yuksel et al., 2012). Several recent works (Mustafa et al., 2022; Lin et al., 2024; Yu et al., 2024) explore MoE for multimodal learning. Among them, only MMoE (Yu et al., 2024) explicitly models different types of modality interactions by using a mixture of interaction experts on sentiment analysis. However, MMoE treats modality interaction modeling as a preprocessing step rather than integrating it into an end-to-end learning framework, limiting flexibility and interpretability.
47
+
48
+ Multimodal Interpretation has gained traction as researchers seek to explain decision-making in multimodal AI systems. Prior studies either focus on isolating the effect of individual modalities while overlooking inter-modal interactions (Ismail et al., 2022; Ghosh et al., 2023; Swamy et al., 2024b), provide human-interpretable rationales but
49
+
50
+ fail to quantify interaction contributions (Park et al., 2018; Zadeh et al., 2018; Dominici et al., 2023), or lack explicit categorization of interaction types (Tsai et al., 2020; Chefer et al., 2021; Lyu et al., 2022; Liang et al., 2022a; Wenderoth et al., 2024). As no prior work has explored interpretation from a modality interaction perspective, our contribution is to systematically quantify multimodal interactions while maintaining interpretability.
51
+
52
+ # 3. Interpretable Multimodal Interaction-aware Mixture-of-Experts
53
+
54
+ # 3.1. Preliminary and Notation
55
+
56
+ Problem Setup. Let $\mathcal{M} = \{\mathbf{m}_1, \mathbf{m}_2, \dots, \mathbf{m}_n\}$ denote a set of $n$ input data modalities, and let $\mathbf{y}$ represent the target variable for a given task. For classification tasks, $\mathbf{y}$ is expressed as a one-hot encoded vector corresponding to the class label. For regression tasks, $\mathbf{y}$ is a real-valued scalar. The objective is twofold: (1) to improve the performance of predicting the ground truth target $\mathbf{y}$ by effectively modeling the interactions between modalities in $\mathcal{M}$ , and (2) to provide meaningful interpretations of these multimodal interactions.
57
+
58
+ Vanilla multimodal fusion (Figure 2(a)) utilizes modality-specific encoders $\mathcal{E} = \{\mathrm{E}_1,\mathrm{E}_2,\dots ,\mathrm{E}_n\}$ to process $\mathcal{M}$ and obtain latent embeddings $\mathcal{L} = \{\mathbf{e}_1,\mathbf{e}_2,\ldots ,\mathbf{e}_n\}$ , where each embedding is computed as $\mathbf{e}_i = \mathrm{E}_i(\mathbf{m}_i)$ for $i\in \{1,\dots ,n\}$ . We define the fusion method as F, which operates on the set of latent embeddings $\mathcal{L}$ and produces a fused embedding $\mathbf{x}$ , expressed as: $\mathrm{F}(\mathcal{L}) = \mathbf{x}$ . A prediction head H maps the fused embedding to the final prediction, expressed as: $\mathrm{H}(\mathbf{x}) = \hat{y}$ . However, this naive modality fusion approach does not explicitly account for the heterogeneous interactions present between $\mathcal{M}$ .
59
+
60
+ # 3.2. Algorithm Overview of $\mathsf{I}^2\mathsf{MoE}$ Framework
61
+
62
+ $\mathsf{I}^{2}\mathsf{M}\circ \mathsf{E}$ is a mixture of interaction experts, where each expert specializes in modeling a specific type of multimodal interaction. The predictions from individual interaction experts are weighted by a re-weighting model to produce the final prediction. During the training phase, we first perform a forward pass using the intact input of all modalities to estimate the multimodal prediction. Next, additional forward passes are conducted, where one modality is replaced by a random vector in each pass. These perturbed inputs serve as weak supervision signals to help train the interaction experts to specialize in different types of modality interactions. We designed a dual-objective loss, encouraging the interaction experts to specialize effectively without degrading task performance. The task loss is calculated using the re-weighted output from the interaction experts with the complete modality input, while the interaction loss is computed from the outputs generated with the perturbed
63
+
64
+ modality inputs. During inference, a single forward pass is performed using the complete modality input. The final output is a weighted sum of the interaction expert prediction with the weights produced by the re-weighting model (Equation 1). We provide a detailed explanation of $\mathrm{I}^{2}\mathrm{MOE}$ with two input modalities in Section 3.3, describe its extension to a higher number of modalities in Section 3.4, and explain how to obtain multimodal interaction interpretation in Section 3.5.
65
+
66
+ # 3.3. $\mathbf{I}^2\mathbf{M}\mathbf{o}\mathbf{E}$ with Two Input Modalities
67
+
68
+ # 3.3.1. $\mathsf{I}^2\mathsf{MOE}$ ARCHITECTURE
69
+
70
+ Figure 2(b) illustrates the $\mathbb{T}^{2}\mathrm{MoE}$ architecture for modeling different types of modality interactions in two input modalities. We employ a MoE comprising four fusion models, referred to as interaction experts: $\mathrm{F}_{\mathrm{uni1}}$ , $\mathrm{F}_{\mathrm{uni2}}$ , $\mathrm{F}_{\mathrm{syn}}$ , and $\mathrm{F}_{\mathrm{red}}$ . Each interaction expert specializes in capturing a specific type of interaction: $\mathrm{F}_{\mathrm{uni1}}$ models the unique information contained in modality $\mathbf{m}_1$ ; $\mathrm{F}_{\mathrm{uni2}}$ models the unique information contained in modality $\mathbf{m}_2$ ; $\mathrm{F}_{\mathrm{syn}}$ captures the synergistic information between $\mathbf{m}_1$ and $\mathbf{m}_2$ ; and $\mathrm{F}_{\mathrm{red}}$ models the redundant information between $\mathbf{m}_1$ and $\mathbf{m}_2$ .
71
+
72
+ Each interaction expert processes the latent embeddings of the two modalities, $\mathbf{e}_1$ and $\mathbf{e}_2$ , and produces fused embeddings, represented as $\mathbf{x}_i = \mathrm{F}_i(\mathbf{e}_1,\mathbf{e}_2)$ , where $i \in \{\mathrm{uni}1,\mathrm{uni}2,\mathrm{syn},\mathrm{red}\}$ . These fused embeddings are then passed through a prediction head within each interaction expert, generating predictions for the corresponding interaction type as $\hat{\mathbf{y}}_i = \mathrm{H}_i(\mathbf{x}_i)$ , where $i \in \{\mathrm{uni}1,\mathrm{uni}2,\mathrm{syn},\mathrm{red}\}$ . To combine the predictions from the four interaction experts, we introduce a re-weighting model W, which assigns importance scores to the predictions of each expert. The model W takes the latent embeddings $\mathbf{e}_1$ and $\mathbf{e}_2$ as inputs and outputs a set of soft weights: $\mathrm{W}(\mathbf{e}_1,\mathbf{e}_2) = [w_{\mathrm{uni}1},w_{\mathrm{uni}2},w_{\mathrm{syn}},w_{\mathrm{red}}]$ . The final prediction is obtained by combining the predictions from all experts using these weights, expressed as:
73
+
74
+ $$
75
+ \hat {\mathbf {y}} = \sum_ {i} w _ {i} \cdot \hat {\mathbf {y}} _ {i}, \quad i \in \{\text {u n i 1 , u n i 2 , s y n , r e d} \}. \tag {1}
76
+ $$
77
+
78
+ # 3.3.2. $\mathsf{I}^2\mathsf{MOE}$ LEARNING OBJECTIVE
79
+
80
+ The loss function consists of two components. The first component is the task loss, which encourages the predictions of $\mathsf{I}^2\mathsf{MoE}$ , $\hat{\mathbf{y}}$ , to closely match the ground truth target $\mathbf{y}$ . The second component, termed the interaction loss, ensures that the initially identical fusion models within $\mathsf{I}^2\mathsf{MoE}$ specialize into interaction experts by capturing diverse interactions in the dataset.
81
+
82
+ Following Yu et al. (2024), we characterize interaction types by comparing unimodal and multimodal predictions: predictions made using only the first modality $(\mathbf{y}_1)$ , predictions
83
+
84
+ ![](images/a088d397f293e217ad81f1ae44ca720551e71727b0da27b56ba0839d63ad949d.jpg)
85
+ Figure 2. Comparison between vanilla modality fusion and $\mathbb{I}^{2}\mathsf{M}\mathsf{O}\mathsf{E}$ in the case of movie genre classification with two input modalities. Left: Existing modality fusion approaches typically use the same parameters to model all types of interactions between the two modalities. Right: In contrast, we design a mixture-of-experts framework that employs four different interaction experts and a re-weighting model to explicitly capture heterogeneous interactions between the two input modalities.
86
+
87
+ made using only the second modality $(\mathbf{y}_2)$ , and predictions made using both modalities $(\mathbf{y}_{12})$ . For interactions emphasizing the uniqueness of the first modality, the relationships are defined as $\mathbf{y}_{12} = \mathbf{y}_1$ and $\mathbf{y}_{12} \neq \mathbf{y}_2$ . Similarly, for interactions emphasizing the uniqueness of the second modality, we have $\mathbf{y}_{12} = \mathbf{y}_2$ and $\mathbf{y}_{12} \neq \mathbf{y}_1$ . For synergistic interactions, the condition is $\mathbf{y}_{12} \neq \mathbf{y}_1$ and $\mathbf{y}_{12} \neq \mathbf{y}_2$ . For redundant interactions, the relationship is $\mathbf{y}_{12} = \mathbf{y}_1 = \mathbf{y}_2$ .
88
+
89
+ To approximate the interaction loss, we simulate the unimodal scenario by replacing one of the modalities with a random vector. For each interaction expert, a unimodal prediction using only the first modality can be obtained by replacing the latent embedding of the second modality with a random vector $\mathbf{r}$ , represented as:
90
+
91
+ $$
92
+ \hat {\mathbf {y}} _ {- 2, i} = \mathrm {H} _ {i} \left(\mathrm {F} _ {i} \left(\mathrm {E} _ {1} \left(\mathbf {x} _ {1}\right), \mathbf {r}\right)\right), \tag {2}
93
+ $$
94
+
95
+ where $i \in \{\mathrm{uni1}, \mathrm{uni2}, \mathrm{syn}, \mathrm{red}\}$ . Similarly, a unimodal prediction using only the second modality can be generated by replacing the latent embedding of the first modality with $\mathbf{r}$ , expressed as:
96
+
97
+ $$
98
+ \hat {\mathbf {y}} _ {- 1, i} = \mathrm {H} _ {i} \left(\mathrm {F} _ {i} (\mathbf {r}, \mathrm {E} _ {2} (\mathbf {x} _ {2}))\right), \tag {3}
99
+ $$
100
+
101
+ where $i\in \{\mathrm{uni1, uni2, syn, red}\}$
102
+
103
+ We designed a general framework to approximate different types of modality interactions. In all cases, the output using the complete multimodal input, $\hat{\mathbf{y}}_{12}$ , serves as the anchor. For the $\mathrm{F}_{\mathrm{uni}1}$ , the output with modality 2 masked, $\hat{\mathbf{y}}_{-2}$ , is
104
+
105
+ treated as a positive example, while the output with modality 1 masked, $\hat{\mathbf{y}}_{-1}$ , is treated as a negative example. The objective is to encourage $\hat{\mathbf{y}}_{12}$ to be maximally similar to $\hat{\mathbf{y}}_{-2}$ and maximally different from $\hat{\mathbf{y}}_{-1}$ , since $\mathrm{F}_{\mathrm{uni}1}$ models the uniqueness information presented in $\mathbf{m}_1$ . For the $\mathrm{F}_{\mathrm{uni}2}$ , $\hat{\mathbf{y}}_{-2}$ is treated as a negative example, while $\hat{\mathbf{y}}_{-1}$ is treated as a positive example. Here, the objective is to encourage $\hat{\mathbf{y}}_{12}$ to be maximally similar to $\hat{\mathbf{y}}_{-1}$ and maximally different from $\hat{\mathbf{y}}_{-2}$ , since $\mathrm{F}_{\mathrm{uni}2}$ models the uniqueness information presented in $\mathbf{m}_2$ . For the $\mathrm{F}_{\mathrm{syn}}$ , $\hat{\mathbf{y}}_{-1}$ and $\hat{\mathbf{y}}_{-2}$ are both treated as negative examples. The objective is to ensure that $\hat{\mathbf{y}}_{12}$ is maximally different from both $\hat{\mathbf{y}}_{-2}$ and $\hat{\mathbf{y}}_{-1}$ , capturing interactions that require the combination of both modalities. For the $\mathrm{F}_{\mathrm{red}}$ , $\hat{\mathbf{y}}_{-1}$ , and $\hat{\mathbf{y}}_{-2}$ are treated as positive examples. The goal is to encourage $\hat{\mathbf{y}}_{12}$ , $\hat{\mathbf{y}}_{-2}$ , and $\hat{\mathbf{y}}_{-1}$ to be as similar as possible, modeling information shared between the modalities. We discuss the connection between the proposed interaction loss and the PID formulation in Appendix A and present empirical evidence supporting the design choice of random vector masking, in Appendix B.
106
+
107
+ # 3.4. Extend $\mathbf{I}^2\mathbf{MoE}$ to Higher Number of Modalities
108
+
109
+ Increase Uniqueness Interaction Experts. To extend $\mathsf{I}^2\mathsf{MoE}$ to support more than two input modalities, we increase the number of interaction experts to the $|\mathcal{M}| + 2$ . Instead of a combinatorial explosion in the number of interaction experts, as the number of input modalities grows, we define $m$ uniqueness interaction experts, one for each input
110
+
111
+ Algorithm 1 Training and Inference of $\mathsf{I}^2\mathsf{M}\mathsf{O}\mathsf{E}$
112
+ Require: Modalities $X_{1},\ldots ,X_{n}$ , label $T$
113
+ Require: Modality-specific Encoders $\{\mathrm{Enc}_i\}_{i = 1}^n$
114
+ Require: Experts $\{F_i\}_{i = 1}^E$ , reweighting module $W$
115
+ Require: Expert loss functions $\{\mathrm{InteractionLoss}_i\}_{i = 1}^E$ // Training with masked modality input
116
+ 1: Encode modalities: $Z_{i}\gets \mathrm{Enc}_{i}(X_{i})$ for $i = 1,\dots ,n$
117
+ 2: for $i = 1$ to $E$ do
118
+ 3: $[\hat{y}_i^{(0)},\dots ,\hat{y}_i^{(n)}]\gets F_i^{\mathrm{multi}}(Z_1,\dots ,Z_n)$
119
+ 4: $L_{\mathrm{int}}^i\gets \mathrm{InteractionLoss}_i(\hat{y}_i^{(0)},\hat{y}_i^{(1:n)})$
120
+ 5: end for
121
+ 6: $[w_{1},\dots ,w_{E}]\gets W(Z_{1},\dots ,Z_{n})$
122
+ 7: $\hat{y}\gets \sum_{i = 1}^{E}w_{i}\cdot \hat{y}_{i}^{(0)}$
123
+ 8: $L_{\mathrm{task}}\gets \ell (\hat{y},T)$
124
+ 9: $L_{\mathrm{total}}\gets L_{\mathrm{task}} + \frac{\lambda_{\mathrm{int}}}{E}\sum_{i = 1}^{E}L_{\mathrm{int}}^{i}$
125
+ 10: Update model parameters to minimize $L_{\mathrm{total}}$
126
+ 11: procedure INFERENCE
127
+ 12: Encode modalities: $Z_{i}\gets \mathrm{Enc}_{i}(X_{i})$ for $i = 1,\dots ,n$
128
+ 13: $\hat{y}_i^{(0)}\gets F_i(Z_1,\dots ,Z_n)$ for $i = 1,\dots ,E$
129
+ 14: $[w_1,\dots ,w_E]\gets W(Z_1,\dots ,Z_n)$
130
+ 15: $\hat{y}\gets \sum_{i = 1}^{E}w_{i}\cdot \hat{y}_{i}^{(0)}$
131
+ 16: Store $\{\hat{y}_i\}$ w, and prediction $\hat{y}$
132
+ 17: end procedure
133
+
134
+ modality, along with a single synergy expert and a single redundancy expert. Each uniqueness expert, $\mathrm{F}_{\mathrm{uni},i}$ , is responsible for capturing the unique information specific to its corresponding modality, $\mathbf{m}_i \in \mathcal{M}$ , where $i \in \{1, \dots, n\}$ . The synergy expert, $\mathrm{F}_{\mathrm{syn}}$ , focuses on modeling global synergistic interactions across all modalities, while the redundancy expert, $\mathrm{F}_{\mathrm{red}}$ , captures globally redundant information shared among the modalities.
135
+
136
+ Modify Interaction loss. For uniqueness expert $i$ , we consider the output of the complete modality as the anchor. The masked modality $i$ serves as a negative example, while all other perturbed inputs are treated as positive examples. This is because the unique information of modality $i$ is lost when the modality embedding is replaced by random vectors. For the synergy interaction loss, we treat all the output of the perturbed modality as negative examples, as input modality perturbations damage the synergistic information. For the redundancy interaction loss, we consider the output of the perturbed modality as a positive example because redundant information remains available even when one modality is masked. For classification tasks, we employed Triplet Margin Loss to model uniqueness interactions. For synergy and redundancy interactions, we utilized Cosine Similarity to capture the relationships between modality outputs. For regression tasks, we used the Mean Squared Error (MSE) Loss to measure differences in predictions.
137
+
138
+ $\mathsf{I}^2\mathsf{MoE}$ Algorithm and Complete Objective. We present the training and inference pipeline of $\mathsf{I}^2\mathsf{MoE}$ in Algorithm 1. The complete learning objective is provided in Appendix C. We analyze computational overhead and scalability in
139
+
140
+ Appendix D.
141
+
142
+ # 3.5. Local and Global Interpretation from $\mathbf{I}^2\mathbf{MoE}$
143
+
144
+ Local interpretation provides insight into the extent to which different interactions contribute to the final prediction for each individual sample, while global interpretation highlights the average trends of interaction importance across the entire dataset. For $\mathbb{I}^{2}\mathrm{MoE}$ , decisions are made locally for each specific input sample by analyzing the prediction, $\hat{\mathbf{y}}_i$ , from each interaction expert $\mathbf{F}_i$ , and the importance coefficients, $\mathbf{w}_i$ , assigned by the MLP-based re-weighting model W. Global interpretation for $\mathbb{I}^{2}\mathrm{MoE}$ can be achieved by calculating the statistics of the importance weights $\mathbf{w}_i$ assigned to each interaction expert across all samples in the test set, thereby capturing the overall trends in feature contributions.
145
+
146
+ # 4. Experiment Setup
147
+
148
+ Data Collection and Datasets. We evaluate our method on five multimodal datasets, using all available modalities while discarding samples with missing data. Two Medical Multimodal Datasets: ADNI (Weiner et al., 2010; 2017) consists of 2,380 samples for Alzheimer's Disease classification (Dementia, Cognitively Normal, or Mild Cognitive Impairment). It includes four modalities: Image ( $\mathcal{I}$ ), Genetic ( $\mathcal{G}$ ), Clinical ( $\mathcal{C}$ ), and Biospecimen ( $\mathcal{B}$ ). MIMIC-IV (Johnson et al., 2023) is a critical care dataset with 9,003 patient records for one-year mortality prediction (binary classification), utilizing three modalities: Lab ( $\mathcal{L}$ ), Notes ( $\mathcal{N}$ ), and Code ( $\mathcal{C}$ ). Three General Multimodal Datasets: IMDB (Arevalo et al., 2017) includes 25,959 movies for multi-label genre classification across 23 genres, leveraging Image ( $\mathcal{I}$ ) and Language ( $\mathcal{L}$ ) modalities. MOSI (Zadeh et al., 2016) comprises 2,199 annotated YouTube clips for sentiment analysis (regression with scores $\in$ [-3,3] and then map to binary classification), incorporating Vision ( $\mathcal{V}$ ), Audio ( $\mathcal{A}$ ), and Text ( $\mathcal{T}$ ) modalities. ENRICO (Leiva et al., 2020) contains 1,460 Android app screens for UI design classification into 20 categories, featuring two modalities: Screenshot ( $\mathcal{S}$ ) and Wireframe ( $\mathcal{W}$ ). Detailed dataset preprocessing is provided in Appendix E.
149
+
150
+ Modality-Specific Encoders and Prediction Heads. The primary objective of our experiments is to evaluate whether the proposed mixture-of-experts framework improves modality fusion. To ensure a fair comparison, we control for variations in modality-specific encoders (E) and prediction models (H) by using the same E and H for both vanilla multimodal fusion and $\mathsf{I}^{2}\mathsf{M}\circ \mathsf{E}$ . For further details on the encoder and classification head configurations, please refer to Appendix F.
151
+
152
+ Baseline Fusion Methods. To validate the effectiveness of $\mathsf{I}^2\mathsf{MoE}$ in enhancing multimodal learning, we compare it to various widely used fusion techniques. We begin with fundamental approaches, including early fusion (EF) (Baltrusaitis et al., 2019), late fusion (LF) (Baltrusaitis et al., 2019), low-rank multimodal fusion (LRMF) (Liu et al., 2018), and multimodal transformers (MulT) (Tsai et al., 2019). We then implement more advanced fusion methods, including interpretable conditional computation (InterpretCC) (Swamy et al., 2024a), the Switch Transformer (SwitchGate) (Fedus et al., 2022), and sparse mixture-of-experts $(\mathrm{MoE}++)$ (Jin et al., 2024). In both SwitchGate and $\mathrm{MoE}++$ , the MLP layer in MulT is replaced with a sparse MoE layer that incorporates the respective routing function.
153
+
154
+ **Implementations.** The dataset is partitioned into training, validation, and testing sets, with $70\%$ allocated for training, $15\%$ for validation, and the remaining $15\%$ for testing. Each experiment is run three times with different random seeds and the results are averaged. To ensure a fair comparison with other baselines, we utilize the optimal hyperparameter settings provided in the original studies. If a dataset does not have reported optimal parameters, we perform a grid search over the key hyperparameters of the baseline methods. The re-weighting model (W) is implemented as a multilayer perceptron (MLP). For a detailed description of the hyperparameter settings, we refer the reader to Appendix G.
155
+
156
+ # 5. Performance and Interpretability of $\mathbf{I}^2\mathbf{MoE}$
157
+
158
+ # 5.1. $\mathbb{I}^2\mathsf{MoE}$ Demonstrates Superior Task Performance
159
+
160
+ In Table 1, we compared the performance of $\mathsf{I}^2\mathsf{MoE}$ combining with MulT ( $\mathsf{I}^2\mathsf{MoE}-\mathsf{MulT}$ ) with other vanilla fusion methods across five datasets: 1 Compared to vanilla MulT, $\mathsf{I}^2\mathsf{MoE}$ yields a significant accuracy improvement of $5.5\%$ for ADNI and $3\%$ for MOSI, demonstrating its ability to enhance the performance of existing transformers.
161
+
162
+ $\Theta$ Across all datasets, $\mathrm{I}^{2}\mathrm{MoE}$ outperforms advanced baselines such as SwitchGate and $\mathrm{MoE}++$ , with a notable gain of $2.5\%$ accuracy, $1.5\%$ AUROC on ADNI, and $1.4\%$ improvement in Macro F1 for IMDB. These results illustrate the benefit of $\mathrm{I}^{2}\mathrm{MoE}$ in tackling the challenges of modality interaction to achieve superior task performance.
163
+
164
+ # 5.2. Generalization Across Different Fusion Methods
165
+
166
+ To evaluate the generalizability of $\mathsf{I}^2\mathsf{M}\mathsf{O}\mathsf{E}$ across various fusion backbones, we integrate it with three fusion architectures, including MoE++, SwitchGate, and Interpret-CC, and assess the combined models on all datasets (Table 2):
167
+
168
+ For the ADNI dataset, $\mathsf{I}^{2}\mathsf{MoE}$ yields significant performance gains, with up to $5.23\%$ improvement in accuracy and $2.12\%$ in AUROC when combined with SwitchGate.
169
+
170
+ On the MIMIC dataset, $\mathsf{I}^{2}\mathsf{M}\mathsf{O}\mathsf{E}$ achieves notable AUROC improvements of $4.43\%$ when combined with Interpret-CC, highlighting its ability to capture complex interaction in multimodal patient data. However, accuracy decreases (- $0.56\%$ to $-11.82\%$ ) are observed, which can be attributed to dataset imbalance. In such cases, the model becomes less overfitted to the majority class, leading to a decrease in accuracy but a corresponding increase in AUROC, reflecting improved performance in distinguishing between classes overall. $\bullet$ $\mathsf{I}^{2}\mathsf{M}\mathsf{O}\mathsf{E}$ consistently enhances multimodal learning, achieving improvements in Micro F1 on IMDB $(2.45\%)$ , sentiment analysis accuracy on MOSI $(4.76\%)$ , and design classification accuracy on ENRICO $(5.14\%)$ when integrated with MoE++ and SwitchGate. Results with different fusion backbones emphasize the generalizability and effectiveness of $\mathsf{I}^{2}\mathsf{M}\mathsf{O}\mathsf{E}$ .
171
+
172
+ # 5.3. $\mathbb{I}^2\mathsf{MoE}$ Offers Local Interpretation
173
+
174
+ To illustrate the interpretability provided by $\mathsf{I}^{2}\mathsf{MoE}$ on the individual sample level, we present a qualitative example from the IMDB test set where $\mathsf{I}^{2}\mathsf{MoE}-\mathsf{MulT}$ makes a correct prediction (Figure 3). This example showcases how different interaction experts contribute to the final prediction through visualized logits and assigned weights, offering a clear decomposition of the decision-making process. The ground truth genres of this movie include Animation. In Figure 3(a), the logits produced by each interaction expert are shown. Notably, the uniqueness expert for the image modality and the redundancy expert generate positive logits, while the synergy expert yields a negative logit. This aligns with the visual content of the image, which features cartoon characters uniquely contributing to the prediction in Figure 3(d). Figure 3(b) depicts the weights assigned by the reweighting mechanism. Higher weights are given to the uniqueness expert for the image modality and the redundancy expert. As shown in Figure 3(c), the final weighted logits for the Animation genre become positive, enabling the correct prediction. This example demonstrates how $\mathsf{I}^{2}\mathsf{MoE}$ leverages different interaction patterns to make accurate predictions. We provide human evaluation of local interpretation in Appendix H and additional qualitative examples in Appendix I.
175
+
176
+ # 5.4. $\mathbf{I}^2\mathbf{M}\mathbf{o}\mathbf{E}$ Enables Global Interpretation
177
+
178
+ We analyze the weight assigned by the reweighting model to each interaction expert across all test samples. Figure 4 illustrates the weight variation across datasets, offering insights into dataset-level interaction patterns. The reweighting model demonstrates the ability to adaptively assign distinct weights to interaction experts, reflecting its capacity to capture dataset-specific nuances. In the ADNI dataset, weights are relatively uniform, with a subtle bias toward certain experts, indicating balanced contributions from all inter
179
+
180
+ Table 1. Comparison of Accuracy, AUROC, and F1 scores across different fusion methods and datasets. The upper panel lists vanilla fusion methods, while the last row presents the proposed $I^{2}MOE$ framework combined with MulT fusion method.
181
+
182
+ <table><tr><td>Dataset</td><td colspan="2">ADNI</td><td colspan="2">MIMIC</td><td colspan="2">IMDB</td><td>MOSI</td><td>ENRICO</td></tr><tr><td>Metrics</td><td>Accuracy</td><td>AUROC</td><td>Accuracy</td><td>AUROC</td><td>Micro F1</td><td>Macro F1</td><td>Accuracy</td><td>Accuracy</td></tr><tr><td>EF</td><td>52.01±0.92</td><td>65.69±1.81</td><td>67.63±1.66</td><td>67.75±0.93</td><td>56.10±0.27</td><td>41.12±1.08</td><td>72.16±0.66</td><td>42.35±0.81</td></tr><tr><td>LF</td><td>50.79±3.11</td><td>68.60±3.77</td><td>67.11±1.06</td><td>67.58±0.88</td><td>56.22±0.03</td><td>45.27±0.64</td><td>70.51±1.14</td><td>44.20±1.64</td></tr><tr><td>LRMF</td><td>50.79±2.20</td><td>69.37±3.13</td><td>70.17±1.79</td><td>65.45±6.31</td><td>56.22±0.03</td><td>45.27±0.64</td><td>76.63±0.18</td><td>46.12±1.06</td></tr><tr><td>InterpretCC</td><td>54.53±3.43</td><td>72.18±1.70</td><td>72.34±4.48</td><td>61.93±2.53</td><td>58.00±0.23</td><td>48.68±0.11</td><td>75.85±0.07</td><td>47.60±1.56</td></tr><tr><td>SwitchGate</td><td>62.28±1.17</td><td>79.70±0.20</td><td>70.98±0.83</td><td>68.26±3.25</td><td>55.92±0.07</td><td>47.33±0.47</td><td>72.35±0.27</td><td>43.95±2.83</td></tr><tr><td>MoE++</td><td>58.08±2.52</td><td>75.18±1.95</td><td>72.51±2.09</td><td>68.50±2.13</td><td>58.15±0.32</td><td>50.49±0.25</td><td>70.85±0.83</td><td>47.83±1.86</td></tr><tr><td>MulT</td><td>59.57±0.66</td><td>77.21±0.51</td><td>72.42±2.53</td><td>68.79±3.34</td><td>59.68±0.19</td><td>51.41±0.04</td><td>68.80±0.78</td><td>47.37±1.82</td></tr><tr><td>I2MoE-MulT</td><td>65.08±1.52</td><td>81.09±0.02</td><td>69.78±0.91</td><td>68.81±0.99</td><td>61.00±0.44</td><td>52.38±0.48</td><td>71.91±2.20</td><td>48.22±1.61</td></tr></table>
183
+
184
+ Table 2. Comparison of metrics across datasets using different fusion methods for ${\mathrm{I}}^{2}\mathrm{{MoE}}$ . Performance improvements are indicated in blue, and decreases are indicated in red.
185
+
186
+ <table><tr><td>Dataset</td><td>i2MoE-</td><td>SwitchGate</td><td>InterpretCC</td><td>MoE++</td></tr><tr><td rowspan="2">ADNI</td><td>Accuracy</td><td>67.51 (5.23)</td><td>56.02 (1.49)</td><td>59.01 (0.93)</td></tr><tr><td>AUROC</td><td>81.82 (2.12)</td><td>73.36 (1.18)</td><td>75.69 (0.51)</td></tr><tr><td rowspan="2">MIMIC</td><td>Accuracy</td><td>70.42 (-0.56)</td><td>69.85 (-2.49)</td><td>60.69 (-11.82)</td></tr><tr><td>AUROC</td><td>69.08 (0.82)</td><td>66.36 (4.43)</td><td>69.15 (0.65)</td></tr><tr><td rowspan="2">IMDB</td><td>Micro F1</td><td>57.43 (1.51)</td><td>58.32 (0.32)</td><td>60.60 (2.45)</td></tr><tr><td>Macro F1</td><td>47.77 (0.44)</td><td>49.21 (0.53)</td><td>50.73 (0.24)</td></tr><tr><td>MOSI</td><td>Accuracy</td><td>73.86 (1.51)</td><td>76.14 (0.29)</td><td>75.61 (4.76)</td></tr><tr><td>ENRICO</td><td>Accuracy</td><td>49.09 (5.14)</td><td>49.09 (1.49)</td><td>47.83 (0)</td></tr></table>
187
+
188
+ ![](images/6b1117bba3c0788fda36e33a28e60ebc932bda9f867cb350aae164a715b53da4.jpg)
189
+ (a)
190
+
191
+ ![](images/0de38ec636ee8950da72791d0cd96a1dbb0febe418dec9fe06cea46bfadadb7c.jpg)
192
+ (b)
193
+
194
+ ![](images/054c66a9e8f69fe2e205760ed9597f89b8259735496927ac86a203aab4855e5e.jpg)
195
+ (c)
196
+ Figure 3. Qualitative example of local interpretation on the IMDB dataset provided by $\mathrm{I}^2\mathrm{MoE}$ -MulT. Ground truth labels are Comedy, Adventure, Fantasy, Family, and Animation. (a) Logits output by different interaction experts. (b) Weighting assigned by the reweighting model. (c) Contribution of each interaction expert to the final weighted logit. (d) Raw image and language modalities used for prediction.
197
+
198
+ ![](images/b074ea5a539d0763287fa7a401e30328ab9777a5eda6c3da7b73488b37b52976.jpg)
199
+ "When a green ogre named Shrek discovers his swamp has been 'swamped' with all sorts of fairy tale creatures by the scheming Lord Farquad, Shrek sets out with a very loud donkey by his side to persuade Farquad to give Shrek his swamp back..."
200
+ (d)
201
+
202
+ action experts to the model's performance. Conversely, the MIMIC dataset displays pronounced variability in weight assignments, emphasizing $\mathrm{I}^{2}\mathrm{MoE}$ 's reliance on reweighting
203
+
204
+ model to address variance among individual patients. For the IMDB dataset, the weight variation is less pronounced compared to MIMIC, aligning with its more homogeneous characteristics. The MOSI dataset shows evenly distributed weights, reflecting equal contributions from all interaction experts. Finally, the ENRICO dataset demonstrates a concentrated weight distribution with dominant experts for the screenshot modality.
205
+
206
+ # 6. In-depth Analysis of $\mathbf{I}^2\mathbf{MoE}$
207
+
208
+ # 6.1. Accuracy of Individual Experts
209
+
210
+ To further analyze the effectiveness of $\mathsf{I}^{2}\mathsf{M}\circ \mathsf{E}$ , we compare its task performance against individual interaction experts across different datasets, as shown in Figure 5. The results highlight the following insights: $①$ Across all datasets, the overall performance of $\mathsf{I}^{2}\mathsf{M}\circ \mathsf{E}$ -MulT (red horizontal line) consistently surpasses that of any individual interaction expert expert, with performance gains of $2.2\%$ $1.3\%$ $7.1\%$ $0.6\%$ and $2.6\%$ for ADNI, MIMIC, IMDB, MOSI, and ENRICO, respectively. $\triangleright$ This underscores the advantage of leveraging a mixture-of-experts approach over single-expert methods. $②$ The proposed method exhibits the largest performance gains in datasets with high interaction importance distribution variability, such as MIMIC and ENRICO. While for more uniform datasets like MOSI, the performance of individual experts is closer to that of the overall model, indicating that the ensemble effect may be less pronounced in these cases. $\triangleright$ This suggests that the fusion of multiple experts becomes particularly beneficial in datasets with complex and heterogeneous multimodal interactions.
211
+
212
+ # 6.2. Interaction Expert Diversification
213
+
214
+ To analyze the diversification of different interaction experts, we evaluate the ratio of expert agreement to disagreement and assess the corresponding accuracy of $\mathsf{I}^{2}\mathsf{MOE}$ . A
215
+
216
+ ![](images/a6dbbc853668a1f5b36d141dfaf5a6c95585ae3f50a91c258e2094b5cf4a79aa.jpg)
217
+ Figure 4. Visualization of interaction weight distributions across all test samples for five datasets. Black bars indicate the median, mean, and extreme values.
218
+
219
+ ![](images/74b7455c25fd40c0780ad92c48178d1f8a527093a52d7e8fac369662402f0fd9.jpg)
220
+
221
+ ![](images/ee9ecf82ebf557479a8f8a572fd71cef39458da14189be14dc365a1aa0a7ad6b.jpg)
222
+
223
+ ![](images/b39b8170a8cd3e7cf92b130478f1ecd751739251f3eb45112b7a4eeee5dedb2c.jpg)
224
+
225
+ ![](images/bc5fb7ee8ca76984cf70f68537413bd971f6dd8b1502d33a73fcb7651be9b73a.jpg)
226
+
227
+ ![](images/6c87174f60f7d62c0b7f57d1f37b3953dadf0dea8e045e845330a8733cfc5439.jpg)
228
+ Figure 5. Comparison between the task performance of $\mathrm{I}^2\mathrm{MoE}-\mathrm{MulT}$ (red horizontal line) and each individual interaction expert across different datasets.
229
+
230
+ ![](images/6b5042359c7aee49e02d76abc949b1c3db8887fd110ee8aef87db410b42a82b4.jpg)
231
+
232
+ ![](images/50227b82f0d9776ced193bb879735d7c02f75ffeec941637d1691c4f54a3c1ac.jpg)
233
+
234
+ ![](images/a23f9785c5ae0cad321da304aef51fd8fda533fbcd1b120e1dfd46f9db2ecd20.jpg)
235
+
236
+ ![](images/0810d21899fd82a76cb708775ab1c10aea459fe15700a6b6bbee5d7d61292285.jpg)
237
+
238
+ high proportion of disagreement among experts indicates greater diversity, which is essential for capturing distinct interaction patterns. Furthermore, when experts disagree, we expect $\mathbb{I}^{2}\mathrm{MoE}$ to still maintain a high level of accuracy, demonstrating its ability to leverage diverse expert opinions effectively.
239
+
240
+ Table 3 presents the proportion of cases where experts disagree or agree, along with the corresponding accuracy of $\mathsf{I}^2\mathsf{MoE}$ across five datasets: 1 For ADNI and MIMIC datasets, the proportion of disagreement among experts is relatively high (81% and 85%, respectively), while $\mathsf{I}^2\mathsf{MoE}$ achieves correct predictions in a substantial portion of these cases. 2 On the IMDB and ENRICO datasets, the proportion of disagreement is very high (99.99% and 98%), yet $\mathsf{I}^2\mathsf{MoE}$ achieves significantly fewer correct predictions when experts disagree (15.85% Correct, 84.14% Wrong and 46.85% Correct, 51.44% Wrong). 3 For the MOSI dataset, the disagreement proportions (59%) highlight moderate diversity among experts. Notably, $\mathsf{I}^2\mathsf{MoE}$ maintains relatively high accuracy when experts disagree (37.80% Correct for MOSI). These results indicate a potential need for better handling of disagreement in complex datasets, and how dataset characteristics influence the diversification and effectiveness of interaction experts.
241
+
242
+ # 7. Ablation Studies
243
+
244
+ To validate the effectiveness of $\mathsf{I}^2\mathsf{MoE}$ , we perform extensive ablation studies by systematically removing or modifying key components of the model. Each variant is designed to assess the contribution of specific design choices to the overall performance: (1) No-Interaction: The
245
+
246
+ Table 3. Interaction experts agreement analysis on test set for all datasets. "Disagree" or "Agree" indicates whether all expert prediction is the same. $\checkmark$ ("Correct") or $X$ ("Incorrect") refers to the correctness of ${\mathrm{I}}^{2}\mathrm{{MoE}}$ ’s prediction.
247
+
248
+ <table><tr><td>% of Data</td><td>ADNI</td><td>MIMIC</td><td>IMDB</td><td>MOSI</td><td>ENRICO</td></tr><tr><td>Disagree, √</td><td>48.74</td><td>63.51</td><td>15.85</td><td>37.80</td><td>46.85</td></tr><tr><td>Disagree,✗</td><td>32.40</td><td>21.39</td><td>84.14</td><td>21.97</td><td>51.44</td></tr><tr><td>Agree, √</td><td>16.34</td><td>6.37</td><td>0.00</td><td>34.11</td><td>1.37</td></tr><tr><td>Agree,✗</td><td>2.52</td><td>8.73</td><td>0.01</td><td>6.12</td><td>0.34</td></tr></table>
249
+
250
+ interaction loss is removed, resulting in a simple mixture-of-experts model without explicit encouragement for learning diverse multimodal interaction among experts. (2) Latent-Contrastive: The interaction loss is applied directly to the latent embeddings produced by each interaction expert instead of their outputs. (3) Simple-Weight: The MLP-based reweighting model is replaced by a shared, learnable global weight that does not adapt to individual samples. (4) Less-Forward: Perturbation is reduced by randomly masking only two modalities per sample instead of perturbing all modalities. (5) Synergy-Redundancy: Only synergy and redundancy experts are included, omitting uniqueness experts.
251
+
252
+ From Table 7: $①$ No-Interaction: Removing the interaction loss results in significant performance degradation across all datasets (e.g., $-6.35\%$ accuracy on ADNI and $-3.99\%$ AUROC), confirming that explicitly encouraging diversity among experts is crucial for capturing complementary modality interactions. $②$ Latent-Contrastive: Applying the interaction loss to latent embeddings instead of expert outputs causes a noticeable performance drop (e.g., $-6.91\%$ accuracy on ADNI). This highlights the importance of applying the interaction loss at the output level to di
253
+
254
+ Table 4. Ablation study results on three datasets (ADNI, MOSI, ENRICO), showing the impact of removing or modifying key components of $\mathsf{I}^2\mathsf{M}\circ \mathsf{E}$ . Each row corresponds to a variant of the model with a specific component ablated. Performance drops (in red) are reported relative to the full model.
255
+
256
+ <table><tr><td>Dataset</td><td colspan="2">ADNI</td><td>MOSI</td><td>ENRICO</td></tr><tr><td>Ablation</td><td>Accuracy</td><td>AUROC</td><td>Accuracy</td><td>Accuracy</td></tr><tr><td>(1)</td><td>58.73 (-6.35)</td><td>77.10 (-3.99)</td><td>69.49 (-2.42)</td><td>47.63 (-0.59)</td></tr><tr><td>(2)</td><td>58.17 (-6.91)</td><td>75.40 (-5.69)</td><td>69.68 (-2.23)</td><td>47.50 (-0.72)</td></tr><tr><td>(3)</td><td>59.29 (-5.79)</td><td>74.55 (-6.54)</td><td>68.46 (-3.45)</td><td>47.49 (-0.73)</td></tr><tr><td>(4)</td><td>59.76 (-5.32)</td><td>76.81 (-4.28)</td><td>69.89 (-2.02)</td><td>46.92 (-1.30)</td></tr><tr><td>(5)</td><td>56.77 (-8.31)</td><td>74.30 (-6.79)</td><td>70.12 (-1.79)</td><td>47.49 (-0.73)</td></tr></table>
257
+
258
+ Replacing the sample-specific reweighting model with a global weight reduces performance (e.g., $-5.32\%$ accuracy on ADNI and $-1.30\%$ on ENRICO), demonstrating the value of adaptive reweighting for leveraging diverse expert outputs effectively. Less-Forward: Reducing modality perturbations leads to reduced accuracy (e.g., $-5.79\%$ on ADNI and $-3.45\%$ on MOSI). This suggests that generating sufficient negative examples through extensive perturbation is essential for capturing diverse interactions. Synergy-Redundancy: Limiting the experts to only synergy and redundancy results in the largest performance drop (e.g., $-8.31\%$ accuracy on ADNI). This emphasizes the importance of uniqueness experts in modeling comprehensive modality interactions. The ablation study demonstrates that each component of $\mathsf{I}^2\mathsf{M}\circ \mathsf{E}$ is vital for its success.
259
+
260
+ # 8. Conclusion
261
+
262
+ We introduced $\mathsf{I}^2\mathsf{MoE}$ , a novel MoE framework designed to enhance multimodal task performance and interpretability by explicitly capturing heterogeneous modality interactions. Extensive experiments on five real-world datasets demonstrated the superiority of $\mathsf{I}^2\mathsf{MoE}$ in improving performance across diverse multimodal scenarios. By leveraging a mixture-of-experts design with adaptive reweighting and specialized interaction losses, our approach systematically models and quantifies modality interactions. Additionally, we analyzed the distribution of interaction weights, providing meaningful insights at both the sample and dataset levels, which enhances the interpretability of the model's predictions. We also conducted ablation studies to evaluate the impact of each design component and demonstrated the flexibility of $\mathsf{I}^2\mathsf{MoE}$ to generalize across various fusion methods. For future work, alternative forms of interaction loss could be explored to further improve performance. Additionally, integrating feature attribution methods to analyze the contributions of individual features within interaction experts can offer deeper interpretable insights.
263
+
264
+ # Acknowledgements
265
+
266
+ This work was supported in part by NIH grants, RF1AG063481, R01AG071174, and U01CA274576. The content is solely the responsibility of the authors and does not necessarily represent the official views of the NIH. We would like to thank the anonymous reviewers for their insightful feedback.
267
+
268
+ # Impact Statement
269
+
270
+ This paper presents work whose goal is to advance the field of Machine Learning. There are many potential societal consequences of our work, none of which we feel must be specifically highlighted here.
271
+
272
+ # References
273
+
274
+ Arevalo, J., Solorio, T., Montes-y Gómez, M., and González, F. A. Gated multimodal units for information fusion. arXiv preprint arXiv:1702.01992, 2017.
275
+ Baltrusaitis, T., Ahuja, C., and Morency, L.-P. Multimodal machine learning: A survey and taxonomy. IEEE Transactions on Pattern Analysis and Machine Intelligence, 41(2):423-443, 2019. URL https://ieeexplore.ieee.org/document/8269806.
276
+ Barnum, G., Talukder, S., and Yue, Y. On the benefits of early fusion in multimodal representation learning, 2020. URL https://arxiv.org/abs/2011.07191.
277
+ Bertschinger, N., Rauh, J., Olbrich, E., Jost, J., and Ay, N. Quantifying unique information. Entropy, 16(4):2161-2183, 2014.
278
+ Chefer, H., Gur, S., and Wolf, L. Generic attention-model explainability for interpreting bi-modal and encoder-decoder transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 397-406, 2021.
279
+ Chen, K., Xu, L., and Chi, H. Improved learning algorithms for mixture of experts in multiclass classification. Neural networks, 12(9):1229-1252, 1999.
280
+ Dominici, G., Barbiero, P., Magister, L. C., Lio, P., and Simidjievski, N. Sharcs: Shared concept space for explainable multimodal learning. arXiv preprint arXiv:2307.00316, 2023.
281
+ Doshi, J., Erus, G., Ou, Y., Resnick, S. M., Gur, R. C., Gur, R. E., Satterthwaite, T. D., Furth, S., Davatzikos, C., Initiative, A. N., et al. Muse: Multi-atlas region segmentation utilizing ensembles of registration algorithms and parameters, and locally optimal atlas selection. Neuroimage, 127:186-195, 2016.
282
+
283
+ Dufumier, B., Castillo-Navarro, J., Tuia, D., and Thiran, J.-P. What to align in multimodal contrastive learning? arXiv preprint arXiv:2409.07402, 2024.
284
+ Esmaeilzadeh, S., Belivanis, D. I., Pohl, K. M., and Adeli, E. End-to-end alzheimer's disease diagnosis and biomarker identification. In Machine Learning in Medical Imaging: 9th International Workshop, MLMI 2018, Held in conjunction with MICCAI 2018, Granada, Spain, September 16, 2018, Proceedings 9, pp. 337-345. Springer, 2018.
285
+ Fan, C., Zhu, K., Tao, J., Yi, G., Xue, J., and Lv, Z. Multilevel contrastive learning: Hierarchical alleviation of heterogeneity in multimodal sentiment analysis. IEEE Transactions on Affective Computing, 2024.
286
+ Fedus, W., Zoph, B., and Shazeer, N. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. Journal of Machine Learning Research, 23(120):1-39, 2022.
287
+ Ghosh, S., Yu, K., Arabshahi, F., and Batmanghelich, K. Dividing and conquering a blackbox to a mixture of interpretable models: route, interpret, repeat. In Proceedings of the... International Conference on Machine Learning. International Conference on Machine Learning, volume 202, pp. 11360, 2023.
288
+ Goldberger, A. L., Amaral, L. A., Glass, L., Hausdorff, J. M., Ivanov, P. C., Mark, R. G., Mietus, J. E., Moody, G. B., Peng, C.-K., and Stanley, H. E. Physiobank, physi toolkit, and physionet: components of a new research resource for complex physiologic signals. circulation, 101(23): e215-e220, 2000.
289
+ Ismail, A. A., Arik, S. Ö., Yoon, J., Taly, A., Feizi, S., and Pfister, T. Interpretable mixture of experts for structured data. arXiv preprint arXiv:2206.02107, 2022.
290
+ Jacobs, R. A., Jordan, M. I., Nowlan, S. J., and Hinton, G. E. Adaptive mixtures of local experts. Neural computation, 3(1):79-87, 1991.
291
+ Jin, P., Zhu, B., Yuan, L., and Yan, S. Moe++: Accelerating mixture-of-experts methods with zero-computation experts. arXiv preprint arXiv:2410.07348, 2024.
292
+ Johnson, A., Bulgarelli, L., Pollard, T., Gow, B., Moody, B., Horng, S., Celi, L., and Mark, R. Mimic-iv (version 3.1). physionet, 2024.
293
+ Johnson, A. E., Bulgarelli, L., Shen, L., Gayles, A., Shammout, A., Horng, S., Pollard, T. J., Hao, S., Moody, B., Gow, B., et al. Mimic-iv, a freely accessible electronic health record dataset. Scientific data, 10(1):1, 2023.
294
+ Kim, C., van der Schaar, M., and Lee, C. Discovering features with synergistic interactions in multiple views. In
295
+
296
+ Forty-first International Conference on Machine Learning.
297
+ Kline, A., Wang, H., Li, Y., Dennis, S., Hutch, M., Xu, Z., Wang, F., Cheng, F., and Luo, Y. Multimodal machine learning in precision health: A scoping review. npj Digital Medicine, 5(1):171, 2022.
298
+ Leiva, L. A., Hota, A., and Oulasvirta, A. Enrico: A dataset for topic modeling of mobile ui designs. In 22nd International Conference on Human-Computer Interaction with Mobile Devices and Services, pp. 1-4, 2020.
299
+ Liang, P. P., Lyu, Y., Fan, X., Wu, Z., Cheng, Y., Wu, J., Chen, L. Y., Wu, P., Lee, M. A., Zhu, Y., et al. Multibench: Multiscale benchmarks for multimodal representation learning. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 1), 2021.
300
+ Liang, P. P., Lyu, Y., Chhablani, G., Jain, N., Deng, Z., Wang, X., Morency, L.-P., and Salakhutdinov, R. Multiviz: Towards visualizing and understanding multimodal models. arXiv preprint arXiv:2207.00056, 2022a.
301
+ Liang, P. P., Zadeh, A., and Morency, L.-P. Foundations and trends in multimodal machine learning: Principles, challenges, and open questions. arXiv preprint arXiv:2209.03430, 2022b. URL https://arxiv.org/abs/2209.03430.
302
+ Liang, P. P., Cheng, Y., Fan, X., Ling, C. K., Nie, S., Chen, R., Deng, Z., Allen, N., Auerbach, R., Mahmood, F., Salakhutdinov, R., and Morency, L.-P. Quantifying & modeling multimodal interactions: An information decomposition framework. arXiv preprint arXiv:2302.12247, 2023. URL https://arxiv.org/abs/2302.12247.
303
+ Liang, P. P., Deng, Z., Ma, M. Q., Zou, J. Y., Morency, L.-P., and Salakhutdinov, R. Factorized contrastive learning: Going beyond multi-view redundancy. Advances in Neural Information Processing Systems, 36, 2024.
304
+ Lin, X. V., Shrivastava, A., Luo, L., Iyer, S., Lewis, M., Ghosh, G., Zettlemoyer, L., and Aghajanyan, A. Moma: Efficient early-fusion pre-training with mixture of modality-aware experts. arXiv preprint arXiv:2407.21770, 2024.
305
+ Liu, Z., Shen, Y., Lakshminarasimhan, V. B., Liang, P. P., Zadeh, A., and Morency, L.-P. Efficient low-rank multimodal fusion with modality-specific factors. arXiv preprint arXiv:1806.00064, 2018.
306
+ Long, L., Cui, J., Zeng, P., Li, Y., Liu, Y., and Wang, Y. Mugi: Multi-granularity interactions of heterogeneous biomedical data for survival prediction. In International
307
+
308
+ Conference on Medical Image Computing and Computer-Assisted Intervention, pp. 490-500. Springer, 2024.
309
+ Lv, F., Chen, X., Huang, Y., Duan, L., and Lin, G. Progressive modality reinforcement for human multimodal emotion recognition from unaligned multimodal sequences. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2554-2562, June 2021.
310
+ Lyu, Y., Liang, P. P., Deng, Z., Salakhutdinov, R., and Morency, L.-P. Dime: Fine-grained interpretations of multimodal models via disentangled local explanations. In Proceedings of the 2022 AAAI/ACM Conference on AI, Ethics, and Society, pp. 455-467, 2022.
311
+ Mustafa, B., Riquelme, C., Puigcerver, J., Jenatton, R., and Houlsby, N. Multimodal contrastive learning with limoe: the language-image mixture of experts. Advances in Neural Information Processing Systems, 35:9564-9576, 2022.
312
+ Park, D. H., Hendricks, L. A., Akata, Z., Rohrbach, A., Schiele, B., Darrell, T., and Rohrbach, M. Multimodal explanations: Justifying decisions and pointing to the evidence. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 8779-8788, 2018.
313
+ Shazeer, N., Mirhoseini, A., Maziarz, K., Davis, A., Le, Q., Hinton, G., and Dean, J. Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. arXiv preprint arXiv:1701.06538, 2017.
314
+ Swamy, V., Montariol, S., Blackwell, J., Frej, J. A., Jaggi, M., and Käser, T. Interpretcc: Intrinsic user-centric interpretability through global mixture of experts. arXiv preprint arXiv:2402.02933, 2024a.
315
+ Swamy, V., Satayeva, M., Frej, J., Bossy, T., Vogels, T., Jaggi, M., Käser, T., and Hartley, M.-A. Multimodn—multimodal, multi-task, interpretable modular networks. Advances in Neural Information Processing Systems, 36, 2024b.
316
+ Teoh, J. R., Dong, J., Zuo, X., Lai, K. W., Hasikin, K., and Wu, X. Advancing healthcare through multimodal data fusion: a comprehensive review of techniques and applications. PeerJ Computer Science, 10:e2298, 2024.
317
+ Tsai, Y.-H. H., Bai, S., Liang, P. P., Kolter, J. Z., Morency, L.-P., and Salakhutdinov, R. Multimodal transformer for unaligned multimodal language sequences. In Proceedings of the conference. Association for computational linguistics. Meeting, volume 2019, pp. 6558. NIH Public Access, 2019.
318
+
319
+ Tsai, Y.-H. H., Ma, M. Q., Yang, M., Salakhutdinov, R., and Morency, L.-P. Multimodal routing: Improving local and global interpretability of multimodal language analysis. In Proceedings of the Conference on Empirical Methods in Natural Language Processing. Conference on Empirical Methods in Natural Language Processing, volume 2020, pp. 1823. NIH Public Access, 2020.
320
+ Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., and Polosukhin, I. Attention is all you need. nips'17. In Proceedings of the 31st International Conference on Neural Information Processing Systems December, pp. 6000-6010, 2017.
321
+ Weiner, M. W., Aisen, P. S., Jack Jr, C. R., Jagust, W. J., Trojanowski, J. Q., Shaw, L., Saykin, A. J., Morris, J. C., Cairns, N., Beckett, L. A., et al. The alzheimer's disease neuroimaging initiative: progress report and future plans. Alzheimer's & Dementia, 6(3):202-211, 2010.
322
+ Weiner, M. W., Veitch, D. P., Aisen, P. S., Beckett, L. A., Cairns, N. J., Green, R. C., Harvey, D., Jack Jr, C. R., Jagust, W., Morris, J. C., et al. The alzheimer's disease neuroimaging initiative 3: Continued innovation for clinical trial improvement. Alzheimer's & Dementia, 13(5): 561-571, 2017.
323
+ Wenderoth, L., Hemker, K., Simidjievski, N., and Jamnik, M. Measuring cross-modal interactions in multimodal models. arXiv preprint arXiv:2412.15828, 2024.
324
+ Wibral, M., Priesemann, V., Kay, J. W., Lizier, J. T., and Phillips, W. A. Partial information decomposition as a unified approach to the specification of neural goal functions. *Brain and cognition*, 112:25–38, 2017.
325
+ Williams, P. L. and Beer, R. D. Nonnegative decomposition of multivariate information. arXiv preprint arXiv:1004.2515, 2010.
326
+ Wollstadt, P., Schmitt, S., and Wibral, M. A rigorous information-theoretic definition of redundancy and relevancy in feature selection based on (partial) information decomposition. Journal of Machine Learning Research, 24(131):1-44, 2023.
327
+ Wörtwein, T., Sheeber, L., Allen, N., Cohn, J., and Morency, L.-P. Beyond additive fusion: Learning non-additive multimodal interactions. In Findings of the Association for Computational Linguistics: EMNLP 2022, pp. 4681-4696, 2022.
328
+ Wörtwein, T., Allen, N. B., Cohn, J. F., and Morency, L.-P. Smurf: Statistical modality uniqueness and redundancy factorization. In Proceedings of the 26th International Conference on Multimodal Interaction, pp. 339-349, 2024.
329
+
330
+ Xue, Z. and Marculescu, R. Dynamic multimodal fusion, 2023. URL https://arxiv.org/abs/2204.00102.
331
+ Yu, H., Qi, Z., Jang, L., Salakhutdinov, R., Morency, L.-P., and Liang, P. P. Mmoe: Enhancing multimodal models with mixtures of multimodal interaction experts. In Proceedings of the 2024 Conference on Empirical Methods in Natural Language Processing, pp. 10006-10030, 2024.
332
+ Yuksel, S. E., Wilson, J. N., and Gader, P. D. Twenty years of mixture of experts. IEEE Transactions on Neural Networks and Learning Systems, 23(8):1177-1193, 2012. doi: 10.1109/TNNLS.2012.2200299.
333
+ Yun, S., Choi, I., Peng, J., Wu, Y., Bao, J., Zhang, Q., Xin, J., Long, Q., and Chen, T. Flex-moe: Modeling arbitrary modality combination via the flexible mixture-of-experts. arXiv preprint arXiv:2410.08245, 2024.
334
+ Zadeh, A., Zellers, R., Pincus, E., and Morency, L.-P. Mosi: multimodal corpus of sentiment intensity and subjectivity analysis in online opinion videos. arXiv preprint arXiv:1606.06259, 2016.
335
+ Zadeh, A. B., Liang, P. P., Poria, S., Cambria, E., and Morency, L.-P. Multimodal language analysis in the wild: Cmu-mosei dataset and interpretable dynamic fusion graph. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 2236-2246, 2018.
336
+ Zhang, Y., Doughty, H., and Snoek, C. Learning unseen modality interaction. Advances in Neural Information Processing Systems, 36:54716-54726, 2023.
337
+
338
+ # A. The Connection between Interaction Loss and PID
339
+
340
+ We link our perturbation-based losses to components in Partial Information Decomposition (PID), following Bertschinger et al. (2014):
341
+
342
+ $$
343
+ I (T; X _ {1}, X _ {2}) = \operatorname {R e d} (T; X _ {1}, X _ {2}) + \operatorname {U n q} (T; X _ {1} \backslash X _ {2}) + \operatorname {U n q} (T; X _ {2} \backslash X _ {1}) + \operatorname {S y n} (T; X _ {1}, X _ {2}) \tag {4}
344
+ $$
345
+
346
+ In the two-modality scenario, our model learns four experts, each trained to specialize in a PID component using corrupted modality inputs.
347
+
348
+ Unique Information. Experts $F_{\mathrm{uni1}}$ and $F_{\mathrm{uni2}}$ are trained on inputs where the other modality is replaced with noise:
349
+
350
+ $$
351
+ \mathcal {L} _ {\mathrm {u n i} 1} = \left\| F _ {\mathrm {u n i} 1} \left(X _ {1}, \tilde {X} _ {2}\right) - T \right\|, \quad \mathcal {L} _ {\mathrm {u n i} 2} = \left\| F _ {\mathrm {u n i} 2} \left(\tilde {X} _ {1}, X _ {2}\right) - T \right\| \tag {5}
352
+ $$
353
+
354
+ Assuming $\tilde{X}_i$ contains no task-relevant information, these losses approximate:
355
+
356
+ $$
357
+ \mathcal {L} _ {\mathrm {u n i 1}} \propto \operatorname {U n q} (T; X _ {1} \backslash X _ {2}), \quad \mathcal {L} _ {\mathrm {u n i 2}} \propto \operatorname {U n q} (T; X _ {2} \backslash X _ {1}) \tag {6}
358
+ $$
359
+
360
+ This aligns with unique information as defined by conditional information under fixed marginals (Bertschinger et al., 2014; Wollstadt et al., 2023).
361
+
362
+ Redundant Information. Expert $F_{\mathrm{red}}$ is trained to match predictions from either single-modality input:
363
+
364
+ $$
365
+ \mathcal {L} _ {\mathrm {r e d}} = \frac {1}{2} \left(\| F _ {\mathrm {r e d}} \left(X _ {1}, \tilde {X} _ {2}\right) - T \| + \| F _ {\mathrm {r e d}} \left(\tilde {X} _ {1}, X _ {2}\right) - T \|\right) \tag {7}
366
+ $$
367
+
368
+ This loss encourages $F_{\mathrm{red}}$ to extract information shared by both $X_{1}$ and $X_{2}$ , approximating:
369
+
370
+ $$
371
+ \mathcal {L} _ {\text {r e d}} \propto \operatorname {R e d} (T; X _ {1}, X _ {2}) \tag {8}
372
+ $$
373
+
374
+ It aligns with redundancy defined via shared informativeness (Williams & Beer, 2010; Wollstadt et al., 2023).
375
+
376
+ Synergistic Information. Expert $F_{\mathrm{syn}}$ is trained to rely on both modalities jointly. It is penalized for performing well on any partial view:
377
+
378
+ $$
379
+ \mathcal {L} _ {\mathrm {s y n}} = \frac {1}{2} \left(\| F _ {\mathrm {s y n}} \left(X _ {1}, X _ {2}\right) - T \| - \| F _ {\mathrm {s y n}} \left(\tilde {X} _ {1}, X _ {2}\right) - T \| - \| F _ {\mathrm {s y n}} \left(X _ {1}, \tilde {X} _ {2}\right) - T \|\right) \tag {9}
380
+ $$
381
+
382
+ This loss isolates information that emerges only through joint modality interaction:
383
+
384
+ $$
385
+ \mathcal {L} _ {\text {s y n}} \propto \operatorname {S y n} (T; X _ {1}, X _ {2}) \tag {10}
386
+ $$
387
+
388
+ This formulation reflects the formal synergy component as defined in Williams & Beer (2010); Wibral et al. (2017).
389
+
390
+ By explicitly constructing perturbed input views that suppress or preserve specific modality contributions, each expert is trained to model a distinct PID component. This forms a contrastive approximation to the constrained information projections discussed in prior work (Bertschinger et al., 2014; Williams & Beer, 2010).
391
+
392
+ # B. Empirical Evidence for the Random Vector Masking
393
+
394
+ The use of random vector replacement for modality dropout may appear ad hoc. However, our design is motivated by the need to fully suppress information from the dropped modality during interaction supervision. In contrast, alternatives such as mean or zero vector replacement risk preserving residual signals, which can undermine disentanglement of unique and redundant information pathways.
395
+
396
+ This decision is further supported by findings from CoMM (Dufumier et al., 2024), which highlight the regularization benefits and improved robustness of full modality dropout.
397
+
398
+ To assess this empirically, we conducted an ablation comparing three masking strategies—random, mean, and zero vector replacements—across five datasets. The results (Table 5) show that random vector masking consistently yields stronger performance on most metrics and tasks.
399
+
400
+ Table 5. Performance comparison across different modality masking strategies (Random, Mean, Zero). Metrics: Accuracy (Acc), AUROC, Micro/Macro F1. Numbers are reported as mean ± standard deviation.
401
+
402
+ <table><tr><td>Dataset</td><td colspan="2">ADNI</td><td colspan="2">MIMIC</td><td colspan="2">IMDB</td><td>MOSI</td><td>ENRICO</td></tr><tr><td>Metric</td><td>Acc (3)</td><td>AUROC</td><td>Acc (2)</td><td>AUROC</td><td>Micro F1 (23)</td><td>Macro F1 (23)</td><td>Acc (2)</td><td>Acc (20)</td></tr><tr><td>Random</td><td>65.08 ± 1.52</td><td>81.09 ± 0.02</td><td>69.78 ± 0.91</td><td>68.81 ± 0.99</td><td>61.00 ± 0.44</td><td>52.38 ± 0.48</td><td>71.91 ± 2.20</td><td>48.22 ± 1.61</td></tr><tr><td>Mean</td><td>59.85 ± 3.52</td><td>76.40 ± 2.84</td><td>70.00 ± 1.27</td><td>67.96 ± 1.43</td><td>59.36 ± 0.14</td><td>50.82 ± 0.46</td><td>68.95 ± 2.37</td><td>50.00 ± 1.94</td></tr><tr><td>Zero</td><td>59.48 ± 1.61</td><td>77.06 ± 0.60</td><td>69.80 ± 0.97</td><td>64.62 ± 1.39</td><td>60.57 ± 0.07</td><td>51.16 ± 0.76</td><td>70.41 ± 0.66</td><td>48.63 ± 1.28</td></tr></table>
403
+
404
+ These results support our use of random vector masking as a more effective strategy for isolating and supervising interaction-specific information flow in multimodal learning.
405
+
406
+ # C. Complete Training Objective
407
+
408
+ Let $\{F_i\}_{i=1}^B$ denote the $B = n + 2$ interaction experts: $n$ uniqueness experts, one synergy expert, and one redundancy expert. For each expert $F_i$ , we obtain outputs from $(1 + n)$ forward passes (one full input and one for each modality replaced):
409
+
410
+ $$
411
+ [ \hat {y} _ {i} ^ {(0)}, \hat {y} _ {i} ^ {(1)}, \dots , \hat {y} _ {i} ^ {(n)} ] = F _ {i}. \mathrm {f o r w a r d m u l t i p l e} (X _ {1}, \dots , X _ {n})
412
+ $$
413
+
414
+ The main prediction is computed as:
415
+
416
+ $$
417
+ \hat {y} = \sum_ {i = 1} ^ {B} w _ {i} \cdot \hat {y} _ {i} ^ {(0)}, \quad \text {w h e r e} [ w _ {1}, \dots , w _ {B} ] = \mathrm {M L P R e W e i g h t} (X _ {1}, \dots , X _ {n})
418
+ $$
419
+
420
+ The task loss is defined as:
421
+
422
+ $$
423
+ \mathcal {L} _ {\text {t a s k}} = \ell (\hat {y}, T)
424
+ $$
425
+
426
+ We define the expert-specific interaction losses as follows:
427
+
428
+ Uniqueness loss for each $F_{i}$ $(i = 1,\dots ,n)$
429
+
430
+ $$
431
+ \mathcal {L} _ {\mathrm {i n t}} ^ {(i)} = \frac {1}{n - 1} \sum_ {j \neq i} \mathrm {T r i p l e t L o s s} \left(\hat {y} _ {i} ^ {(0)}, \hat {y} _ {i} ^ {(j)}, \hat {y} _ {i} ^ {(i)}\right)
432
+ $$
433
+
434
+ Synergy loss $(F_{n + 1})$
435
+
436
+ $$
437
+ \mathcal {L} _ {\mathrm {i n t}} ^ {(n + 1)} = \frac {1}{n} \sum_ {j = 1} ^ {n} \operatorname {C o s S i m} \left(\operatorname {n o r m a l i z e} \left(\hat {y} _ {n + 1} ^ {(0)}\right), \operatorname {n o r m a l i z e} \left(\hat {y} _ {n + 1} ^ {(j)}\right)\right)
438
+ $$
439
+
440
+ Redundancy loss $(F_{n + 2})$ :
441
+
442
+ $$
443
+ \mathcal {L} _ {\mathrm {i n t}} ^ {(n + 2)} = \frac {1}{n} \sum_ {j = 1} ^ {n} \left(1 - \operatorname {C o s S i m} \left(\operatorname {n o r m a l i z e} \left(\hat {y} _ {n + 2} ^ {(0)}\right), \operatorname {n o r m a l i z e} \left(\hat {y} _ {n + 2} ^ {(j)}\right)\right)\right)
444
+ $$
445
+
446
+ We then average the interaction loss over all experts:
447
+
448
+ $$
449
+ \mathcal {L} _ {\mathrm {i n t}} = \frac {1}{B} \sum_ {i = 1} ^ {B} \mathcal {L} _ {\mathrm {i n t}} ^ {(i)}
450
+ $$
451
+
452
+ The final training objective is:
453
+
454
+ $$
455
+ \mathcal {L} _ {\text {t o t a l}} = \mathcal {L} _ {\text {t a s k}} + \lambda_ {\text {i n t}} \cdot \mathcal {L} _ {\text {i n t}}
456
+ $$
457
+
458
+ Model parameters are updated to minimize $\mathcal{L}_{\mathrm{total}}$
459
+
460
+ # D. Computational Overhead and Scalability
461
+
462
+ In theory, $\mathbb{I}^{2}\mathrm{MOE}$ scales linearly with the number of input modalities. Specifically, the fusion overhead increases by approximately (Numer of modalities $+2$ ) times, corresponding to one uniqueness expert per modality, plus one redundancy and one synergy expert.
463
+
464
+ To quantify the overhead of our method, we compare $\mathsf{I}^{2}\mathsf{M}\mathsf{O}\mathsf{E}-\mathsf{M}\mathsf{u}\mathsf{T}$ with the MulT baseline across three key metrics: training time per epoch (in seconds), inference latency (in seconds), and parameter count. As shown in Table 6, $\mathsf{I}^{2}\mathsf{M}\mathsf{O}\mathsf{E}$ introduces moderate increases in compute—roughly proportional to the number of modalities plus two (accounting for synergy and redundancy experts). All experiments were run on a single NVIDIA A100 GPU. Despite this additional cost, the model yields consistent improvements in interpretability and predictive performance, justifying the added overhead.
465
+
466
+ Table 6. Comparison of MulT and ${\mathrm{I}}^{2}\mathrm{{MoE}} - \mathrm{{MulT}}$ on training time,inference latency,and model size across datasets.
467
+
468
+ <table><tr><td></td><td></td><td colspan="2">Train / epoch (s)</td><td colspan="2">Inference (s)</td><td colspan="2"># Params</td></tr><tr><td>Dataset</td><td>Modalities</td><td>MulT</td><td>I2MoE-MulT</td><td>MulT</td><td>I2MoE-MulT</td><td>MulT</td><td>I2MoE-MulT</td></tr><tr><td>ADNI</td><td>I, G, C, B</td><td>8.98 ± 0.04</td><td>16.82 ± 0.02</td><td>1.34 ± 0.00</td><td>2.29 ± 0.00</td><td>1,072,131</td><td>6,696,728</td></tr><tr><td>MIMIC</td><td>L, N, C</td><td>2.24 ± 0.01</td><td>33.67 ± 0.67</td><td>0.15 ± 0.00</td><td>0.91 ± 0.00</td><td>268,034</td><td>1,390,095</td></tr><tr><td>IMDB</td><td>L, I</td><td>3.62 ± 0.00</td><td>44.20 ± 0.59</td><td>0.53 ± 0.00</td><td>3.23 ± 0.00</td><td>1,068,567</td><td>4,423,008</td></tr><tr><td>MOSI</td><td>V, A, T</td><td>0.70 ± 0.00</td><td>4.47 ± 0.01</td><td>0.09 ± 0.00</td><td>0.48 ± 0.00</td><td>134,402</td><td>673,935</td></tr><tr><td>ENRICO</td><td>S, W</td><td>1.38 ± 0.02</td><td>6.17 ± 0.03</td><td>0.20 ± 0.00</td><td>0.44 ± 0.00</td><td>538,644</td><td>2,352,724</td></tr></table>
469
+
470
+ # E. Details for Dataset Preprocessing
471
+
472
+ We followed the same preprocessing procedure of the ADNI dataset and MIMIC dataset, as described in Flex-MoE (Yun et al., 2024).
473
+
474
+ # E.1. Detailed Data Preprocessing in ADNI
475
+
476
+ Imaging, Genetic, Biospecimen, Clinical Modalities. The Alzheimer's Disease Initiative (ADNI) is a longitudinal multicenter observational study containing multi-modal data from subjects diagnosed as cognitively normal (CN), mild cognitive impairment (MCI), and Alzheimer's dementia (AD) (Weiner et al., 2010; 2017). In our experiments, we utilized imaging, genetic, biospecimen, and clinical modalities. The imaging data consisted of magnetic resonance images (MRIs) which were preprocessed using field intensity inhomogeneity correction, gray tissue matter segmentation via MUSE (Multiatlas Region Segmentation Utilizing Ensembles of Registration Algorithms and Parameters) (Doshi et al., 2016), and voxel-wise volumetric mapping of tissue regions. The genetic data consisted of SNP (single nucleotide polymorphisms) data from the ADNI 1, GO/2, and 3 studies. These were preprocessed via alignment to a unified reference, followed by aligning strands based on the 1000 Genome Project phase 3, linkage disequilibrium (LD) pruning, and imputation. The resulting data consisted of 144, 746 SNPs. The biospecimen modality included CSF A $\beta$ 1-42 and A $\beta$ 1-40, Total Tau and Phosphorylated Tau, Plasma Neurofilament Light Chain, and ApoE genotype. Clinical data included medical history, neurological exams, patient demographics, medications, and vital signs. Data columns directly containing Alzheimer's Disease diagnosis information were excluded. For both biospecimen and clinical data, numerical data was scaled using a MinMax scalar to a range of -1 to 1, while categorical data was one-hot encoded. Missing values, were imputed using the mean for numerical fields and the mode for categorical fields.
477
+
478
+ # E.2. Detailed Data Preprocessing in MIMIC
479
+
480
+ Lab, Notes, Codes Modalities. The MIMIC dataset was extracted from the Medical Information Mart for Intensive Care IV (MIMIC-IV) database, which contains de-identified health data for patients who were admitted to either the emergency
481
+
482
+ department or stayed in critical care units of the Beth Israel Deaconess Medical Center in Boston, Massachusetts (Johnson et al., 2024; 2023; Goldberger et al., 2000). MIMIC-IV excludes patients under 18 years of age. We take a subset of the MIMIC-IV data, where each patient has at least more than 1 visit in the dataset as this subset corresponds to patients who likely have more serious health conditions. For each datapoint, we extract ICD-9 codes, clinical text, and labs and vital values. Using this data, we perform binary classification on one-year mortality. We drop visits that occur at the same time as the patient's death.
483
+
484
+ # F. Details for Modality-specific Encoder and Classification Head
485
+
486
+ ADNI Dataset: For the image modality, we employed a customized 3D-CNN (Esmaeilzadeh et al., 2018) with a hidden dimension of 256 as the encoder. For the genomics, clinical, and biospecimen modalities, we used a one-hidden-layer MLP with a hidden dimension of 256 as the encoder.
487
+ MIMIC Dataset: For all lab, note, and code modalities, we utilized an LSTM with a hidden dimension of 256 as the encoder.
488
+ $\bullet$ MOSI Dataset: A Gated Recurrent Unit (GRU) with a hidden dimension of 256 was used as the encoder for the vision, audio, and text modalities.
489
+ ENRICO Dataset: For both the screenshot image and wireframe image modalities, we used VGG11 from the torchvision library with a hidden dimension size of 16 as the encoder.
490
+ $\Theta$ IMDB Dataset: For the image modality, a VGG-16 model was applied as the feature extractor. For the language modality, features were extracted using the pretrained Google Word2vec model. Additionally, we employed VGG11 from the torchvision library with a hidden dimension size of 16 as the encoder and used MaxoutLinear unimodal encoders, following current work (Liang et al., 2021).
491
+ $\triangleright$ Classification Head: For all models and all datasets, we use a linear classification head to output the corresponding prediction.
492
+
493
+ # G. Details for Hyperparameter Setting
494
+
495
+ To improve reproducibility, the tables below provide a summary of the hyperparameters used in our experiments. For hyperparameters of other baseline fusion methods, please refer to the scripts in the GitHub repository at https://github.com/Raina-Xin/I2MoE/tree/main/scripts/trainScripts.
496
+
497
+ Table 7. Hyperparameter Configuration for ${\mathrm{I}}^{2}\mathrm{{MoE}} - \mathrm{{MulT}}$ on Different Datasets
498
+
499
+ <table><tr><td>Hyperparameter</td><td>ADNI</td><td>MIMIC</td><td>IMDB</td><td>MOSI</td><td>ENRICO</td></tr><tr><td>Learning Rate (1r)</td><td>0.0001</td><td>0.0001</td><td>0.0001</td><td>0.0001</td><td>0.0001</td></tr><tr><td>Temperature for Reweighting (temperature_rw)</td><td>1</td><td>2</td><td>2.0</td><td>2.0</td><td>2.0</td></tr><tr><td>Hidden Dimension for Reweighting (hidden_dim_rw)</td><td>256</td><td>128</td><td>256</td><td>256</td><td>256</td></tr><tr><td>Number of Layers in Reweighting (num_layer_rw)</td><td>2</td><td>2</td><td>3</td><td>3</td><td>3</td></tr><tr><td>Interaction Loss Weight (interaction_loss_weight)</td><td>0.5</td><td>0.01</td><td>0.5</td><td>0.005</td><td>0.5</td></tr><tr><td>Modality (modality)</td><td>IGCB</td><td>LNC</td><td>LI</td><td>TVA</td><td>SW</td></tr><tr><td>Training Epochs (train_epochs)</td><td>50</td><td>30</td><td>40</td><td>30</td><td>50</td></tr><tr><td>Batch Size (batch_size)</td><td>32</td><td>32</td><td>32</td><td>32</td><td>32</td></tr><tr><td>Number of Experts (num_experts)</td><td>8</td><td>4</td><td>4</td><td>4</td><td>4</td></tr><tr><td>Number of Layers in Encoder (num_layers_enc)</td><td>1</td><td>1</td><td>1</td><td>1</td><td>2</td></tr><tr><td>Number of Layers in Fusion (num_layers_fus)</td><td>2</td><td>2</td><td>2</td><td>1</td><td>2</td></tr><tr><td>Number of Layers in Prediction (num_layers_pred)</td><td>2</td><td>2</td><td>2</td><td>1</td><td>2</td></tr><tr><td>Number of Attention Heads (num_heads)</td><td>4</td><td>1</td><td>4</td><td>1</td><td>4</td></tr><tr><td>Hidden Dimension (hidden_dim)</td><td>256</td><td>128</td><td>256</td><td>256</td><td>256</td></tr><tr><td>Number of Patches (num_patches)</td><td>16</td><td>8</td><td>4</td><td>4</td><td>8</td></tr></table>
500
+
501
+ Table 8. Hyperparameter Configuration for ${\mathrm{I}}^{2}\mathrm{{MoE}}$ -SwitchGate on Different Datasets
502
+
503
+ <table><tr><td>Hyperparameter</td><td>ADNI</td><td>MIMIC</td><td>IMDB</td><td>MOSI</td><td>ENRICO</td></tr><tr><td>Learning Rate (1r)</td><td>0.0001</td><td>0.0001</td><td>0.0001</td><td>0.0001</td><td>0.0001</td></tr><tr><td>Temperature for Reweighting (temperature_rw)</td><td>2</td><td>2</td><td>2.0</td><td>2.0</td><td>1</td></tr><tr><td>Hidden Dimension for Reweighting (hidden_dim_rw)</td><td>256</td><td>256</td><td>256</td><td>128</td><td>128</td></tr><tr><td>Number of Layers in Reweighting (num_layer_rw)</td><td>2</td><td>2</td><td>2</td><td>1</td><td>3</td></tr><tr><td>Interaction Loss Weight (interaction_loss_weight)</td><td>0.01</td><td>0.5</td><td>0.5</td><td>0.001</td><td>0.01</td></tr><tr><td>Modality (modality)</td><td>IGCB</td><td>LNC</td><td>LI</td><td>TVA</td><td>SW</td></tr><tr><td>Training Epochs (train_epochs)</td><td>30</td><td>30</td><td>40</td><td>50</td><td>30</td></tr><tr><td>Batch Size (batch_size)</td><td>8</td><td>64</td><td>64</td><td>32</td><td>8</td></tr><tr><td>Number of Experts (num_experts)</td><td>16</td><td>16</td><td>16</td><td>4</td><td>4</td></tr><tr><td>Number of Layers in Encoder (num_layers_enc)</td><td>2</td><td>2</td><td>2</td><td>1</td><td>1</td></tr><tr><td>Number of Layers in Fusion (num_layers_fus)</td><td>2</td><td>2</td><td>2</td><td>1</td><td>1</td></tr><tr><td>Number of Layers in Prediction (num_layers_pred)</td><td>2</td><td>2</td><td>2</td><td>1</td><td>1</td></tr><tr><td>Number of Attention Heads (num_heads)</td><td>4</td><td>4</td><td>4</td><td>4</td><td>2</td></tr><tr><td>Hidden Dimension (hidden_dim)</td><td>128</td><td>256</td><td>128</td><td>128</td><td>128</td></tr><tr><td>Number of Patches (num_patches)</td><td>8</td><td>16</td><td>4</td><td>16</td><td>4</td></tr></table>
504
+
505
+ Table 9. Hyperparameter Configuration for ${\mathrm{I}}^{2}\mathrm{{MoE}}$ -InterpretCC on Different Datasets
506
+
507
+ <table><tr><td>Hyperparameter</td><td>ADNI</td><td>MIMIC</td><td>IMDB</td><td>MOSI</td><td>ENRICO</td></tr><tr><td>Learning Rate (1r)</td><td>0.0001</td><td>0.0001</td><td>0.0001</td><td>0.0001</td><td>0.0001</td></tr><tr><td>Temperature for Reweighting (temperature_rw)</td><td>2</td><td>2</td><td>2.0</td><td>1.5</td><td>4.0</td></tr><tr><td>Hidden Dimension for Reweighting (hidden_dim_rw)</td><td>128</td><td>128</td><td>256</td><td>256</td><td>256</td></tr><tr><td>Number of Layers in Reweighting (num_layer_rw)</td><td>2</td><td>2</td><td>3</td><td>2</td><td>2</td></tr><tr><td>Interaction Loss Weight (interaction_loss_weight)</td><td>0.5</td><td>0.1</td><td>0.01</td><td>0.001</td><td>0.5</td></tr><tr><td>Modality (modality)</td><td>IGCB</td><td>LNC</td><td>LI</td><td>TVA</td><td>SW</td></tr><tr><td>Tau (τ)</td><td>1.0</td><td>0.7</td><td>1.0</td><td>1.0</td><td>0.5</td></tr><tr><td>Threshold (threshold)</td><td>0.5</td><td>0.5</td><td>0.6</td><td>0.6</td><td>0.4</td></tr><tr><td>Train Epochs (train_epochs)</td><td>30</td><td>50</td><td>40</td><td>50</td><td>60</td></tr><tr><td>Batch Size (batch_size)</td><td>32</td><td>128</td><td>32</td><td>32</td><td>64</td></tr><tr><td>Hidden Dimension (hidden_dim)</td><td>128</td><td>256</td><td>256</td><td>128</td><td>256</td></tr><tr><td>Hard (hard)</td><td>True</td><td>True</td><td>True</td><td>True</td><td>True</td></tr></table>
508
+
509
+ Table 10. Hyperparameter Configuration for ${\mathrm{I}}^{2}\mathrm{{MoE}} - \mathrm{{MoE}} + +$ on Different Datasets
510
+
511
+ <table><tr><td>Hyperparameter</td><td>ADNI</td><td>MIMIC</td><td>IMDB</td><td>MOSI</td><td>ENRICO</td></tr><tr><td>Learning Rate (1r)</td><td>0.0001</td><td>0.0001</td><td>0.0001</td><td>0.0001</td><td>0.0001</td></tr><tr><td>Temperature for Reweighting (temperature_rw)</td><td>2</td><td>1</td><td>1.0</td><td>2</td><td>1</td></tr><tr><td>Hidden Dimension for Reweighting (hidden_dim_rw)</td><td>256</td><td>256</td><td>256</td><td>128</td><td>256</td></tr><tr><td>Number of Layers in Reweighting (num_layer_rw)</td><td>3</td><td>2</td><td>2</td><td>2</td><td>2</td></tr><tr><td>Interaction Loss Weight (interaction_loss_weight)</td><td>0.5</td><td>0.5</td><td>0.5</td><td>0.001</td><td>0.5</td></tr><tr><td>Modality (modality)</td><td>IGCB</td><td>LNC</td><td>LI</td><td>TVA</td><td>SW</td></tr><tr><td>Training Epochs (train_epochs)</td><td>50</td><td>30</td><td>40</td><td>50</td><td>50</td></tr><tr><td>Batch Size (batch_size)</td><td>64</td><td>32</td><td>32</td><td>32</td><td>32</td></tr><tr><td>Number of Experts (num_experts)</td><td>8</td><td>4</td><td>4</td><td>8</td><td>8</td></tr><tr><td>Number of Layers in Encoder (num_layers_enc)</td><td>2</td><td>2</td><td>2</td><td>2</td><td>2</td></tr><tr><td>Number of Layers in Fusion (num_layers_fus)</td><td>2</td><td>2</td><td>2</td><td>1</td><td>2</td></tr><tr><td>Number of Layers in Prediction (num_layers_pred)</td><td>2</td><td>2</td><td>2</td><td>2</td><td>2</td></tr><tr><td>Number of Attention Heads (num_heads)</td><td>4</td><td>4</td><td>4</td><td>4</td><td>4</td></tr><tr><td>Hidden Dimension (hidden_dim)</td><td>256</td><td>128</td><td>256</td><td>64</td><td>64</td></tr><tr><td>Number of Patches (num_patches)</td><td>8</td><td>4</td><td>8</td><td>4</td><td>4</td></tr></table>
512
+
513
+ # H. Human Evaluation for Local Interpretation
514
+
515
+ To strengthen evidence for the local interpretability of our model, we conducted a human evaluation study involving 15 participants. Each participant was shown 20 movie examples, resulting in a total of 300 interaction expert weight evaluations. Participants were asked to assess how reasonable the model's assigned expert weights were, choosing from a 5-point Likert scale: "Completely makes sense," "Mostly makes sense," "Neutral," "Makes little sense," and "Makes no sense at all."
516
+
517
+ Overall, $70.4\%$ of responses were positive (i.e., "Mostly makes sense" or "Completely makes sense"), while only $9\%$ were negative. Notably, just $0.7\%$ of ratings selected the lowest option. These results suggest that the model's expert weight assignments are broadly viewed as reasonable and interpretable by human evaluators.
518
+
519
+ The questionnaire and de-identified responses are available at https://github.com/Raina-Xin/I2MoE/tree/main/ assets/human_eval
520
+
521
+ Table 11. Distribution of human ratings for local interaction expert weights ( $n = 300$ ).
522
+
523
+ <table><tr><td>Response Option</td><td>Percentage of Responses</td></tr><tr><td>Completely makes sense</td><td>19.4%</td></tr><tr><td>Mostly makes sense</td><td>51.0%</td></tr><tr><td>Neutral</td><td>19.7%</td></tr><tr><td>Makes little sense</td><td>9.0%</td></tr><tr><td>Makes no sense at all</td><td>0.7%</td></tr></table>
524
+
525
+ # I. More Qualitative Examples for Local Interpretation
526
+
527
+ We present a comprehensive visualization of all 23 classes in the IMDB dataset, illustrating local interpretability for individual examples. All examples are correctly predicted by $\mathsf{I}^{2}\mathsf{M}\circ \mathsf{E}$
528
+
529
+ ![](images/bfb58dff1944a36151e0a2817a199bf1275da86ad1d6cac1923cb05c83017e51.jpg)
530
+
531
+ ![](images/4d8c88be8c347160221474323a2d283f0890a28732907f33d88d7b3430ad8624.jpg)
532
+ The Care Bears live in a country high in the clouds, where they have a lot of fun together. But they also do care for the human children on Earth, who they watch through huge telescopes from the sky, and come to help whenever there is need. Nikolas, a magician's apprentice, is in danger of getting under the influence of a bad spirit, which resides in an ancient spell book. The siblings Kim and Jason don't trust anyone anymore after being disappointed once too often. The Care Bears take them into their wonderland where they experience exciting and dangerous adventures together and quickly become good friends.
533
+
534
+ ![](images/babf048ff8626e744c03a74a7cf7c600ebc2293ff1ef64fd205471a8ef71e17a.jpg)
535
+
536
+ ![](images/f5d432fce5d35696a56b300347916a44a2a5936596972479aca3777030a40e02.jpg)
537
+ Figure 6. IMDB example (ID: 0088885).
538
+
539
+ ![](images/349c3d48e5efa1784a807ae875fc352bd25aae15e17ee51245d97fcbcb538280.jpg)
540
+
541
+ ![](images/898d0eb8662c396810fca1c634d3d5cf1ce204e006a57796e22288b8260d6820.jpg)
542
+
543
+ ![](images/18459fd30214490b865a30b5213d7492230b72a4e55257a3dc881297305733e1.jpg)
544
+ The history of the first victim of modern artillery and its moving agony, amidst conspiracies and betrayals of the powerful. Life and death of Giovanni De' Medici, a young brave captain in the war of Charles V against the Pope, in the first half of 1500.
545
+
546
+ ![](images/4940ca5b779eb737d485aaa55be8282a483ae7249581cf85276a763e7511d13b.jpg)
547
+
548
+ ![](images/75be291ef3d32f4e48139821e7b9bfb7d39d4f4c4d851be8bb9dba4e6a688c21.jpg)
549
+ Figure 7. IMDB example (ID: 0245276).
550
+
551
+ ![](images/3f505e65c7f99251aaa10ed38b11b07dfc7d34632d013365842f6d49c7d2be28.jpg)
552
+
553
+ ![](images/ee7e90d72b1422dac62c5a526b277da790cdacf1178320e74cd1dabe09c55990.jpg)
554
+
555
+ ![](images/646ce9306d510c6ccd0737a7cede70f2457910c0059fd57ae946d95d46daf087.jpg)
556
+ When Haseem arrives at Aladdin's home pretending to be his lost uncle, he brings the boy to a magical place which hides the entrance to a dangerous underground cave. There, Haseem asks of Aladdin to find but one simple oil lamp which contains a genie. As stubborn as he is, Aladdin refuses to come outside of the cave with the lamp and eventually discovers its secret. A genie inside the lamp then helps his life change and marry his true love.
557
+
558
+ ![](images/d6ee4752b45c7ab92f1ff732a4d237556914847bee3af189dbf6be2eb99fd166.jpg)
559
+
560
+ ![](images/ac8e3535c3179f578932ba44337ebe7e13b09a58536079792325c36633e3d0d8.jpg)
561
+ Figure 8. IMDB example (ID: 0827990).
562
+
563
+ ![](images/a406f2c5ff4ce24b08a141e42178fcb7ca6f4a434696db9f5e62ba1bded1a740.jpg)
2025/$_textttI$^2$MoE$_ Interpretable Multimodal Interaction-aware Mixture-of-Experts/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1135f624d22f58fbd60b21cf3f1b753d0612201a205ad1dc24e39326ba074a5b
3
+ size 1343529
2025/$_textttI$^2$MoE$_ Interpretable Multimodal Interaction-aware Mixture-of-Experts/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/$∞$-Video_ A Training-Free Approach to Long Video Understanding via Continuous-Time Memory Consolidation/280d515d-d106-42b4-8125-041403c18d40_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/$∞$-Video_ A Training-Free Approach to Long Video Understanding via Continuous-Time Memory Consolidation/280d515d-d106-42b4-8125-041403c18d40_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/$∞$-Video_ A Training-Free Approach to Long Video Understanding via Continuous-Time Memory Consolidation/280d515d-d106-42b4-8125-041403c18d40_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1eb55b86d08fa732302a054617c78673d059502de064db26f9043436df61b535
3
+ size 1877008
2025/$∞$-Video_ A Training-Free Approach to Long Video Understanding via Continuous-Time Memory Consolidation/full.md ADDED
@@ -0,0 +1,571 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # $\infty$ -VIDEO: A Training-Free Approach to Long Video Understanding via Continuous-Time Memory Consolidation
2
+
3
+ Saul Santos $^{12}$ António Farinhas $^{12}$ Daniel C. McNamee $^{3}$ André F. T. Martins $^{1245}$
4
+
5
+ # Abstract
6
+
7
+ Current video-language models struggle with long-video understanding due to limited context lengths and reliance on sparse frame subsampling, often leading to information loss. This paper introduces $\infty$ -VIDEO, which can process arbitrarily long videos through a continuous-time long-term memory (LTM) consolidation mechanism. Our framework augments video Q-formers by allowing them to process unbounded video contexts efficiently and without requiring additional training. Through continuous attention, our approach dynamically allocates higher granularity to the most relevant video segments, forming "sticky" memories that evolve over time. Experiments with Video-LLaMA and VideoChat2 demonstrate improved performance in video question-answering tasks, showcasing the potential of continuous-time LTM mechanisms to enable scalable and training-free comprehension of long videos.
8
+
9
+ # 1. Introduction
10
+
11
+ Multimodal large language models have driven progress in video-language tasks through the integration of pretrained visual encoders with powerful text-based models (Li et al., 2023b; Zhang et al., 2023b; Cheng et al., 2024; Li et al., 2024). However, current video models are constrained by short context lengths (Li et al., 2023b; Maaz et al., 2024; Liu et al., 2023) and often rely on sparse frame subsampling for longer sequences, which limits their ability to fully process and understand long videos. This contrasts with the high-capacity persistence of human memory (Brady et al., 2008) and the cognitive principles by which humans store information over long timescales, which involve consoli-
12
+
13
+ $^{1}$ Instituto de Telecomunicações $^{2}$ Instituto Superior Técnico, Universidade de Lisboa $^{3}$ Champalimaud Research $^{4}$ ELLIS Unit Lisbon $^{5}$ Unbabel. Correspondence to: Saul Santos <saul.r.santos@tecnico.ulisboa.pt>.
14
+
15
+ Proceedings of the $42^{nd}$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
16
+
17
+ dition processes adaptively integrating important episodic events into long-term memory (McGaug, 2013; Cowan et al., 2021). How can we ensure models are able to fully understand and grasp information from arbitrarily long videos while they process them without losing critical details?
18
+
19
+ Transformers offer significant potential for extracting spatiotemporal features from videos (Zhang et al., 2023b; Li et al., 2024). While recent video-language models have prioritized simpler methods such as projection layers (Li et al., 2023d; Liu et al., 2023; Li et al., 2023b; Liu et al., 2024c; Ye et al., 2024) and temporal pooling (Luo et al., 2023; Maaz et al., 2024) for the sake of efficiency and scalability, these approaches often sacrifice transformer's representational depth. Additionally, training video-language models presents significant difficulties, whereas traditional approaches mainly focus on scaling model parameters (Liu et al., 2024c; Cheng et al., 2024; Li et al., 2024), which requires substantial computational resources. A recent alternative explored the usage of additional computation during inference (Zhang et al., 2023a; Wang et al., 2024a;c). However, these methods assume that the spatio-temporal module is intrinsic to the LLM, which limits their ability to effectively specialize in capturing spatio-temporal content. Furthermore, these methods often rely on subsampling and are designed to process the entire video whenever they need to answer a question.
20
+
21
+ In this paper, we take an alternative approach inspired by human cognition, where memory consolidation processes enable the retention and efficient handling of long-term dependencies (Frankland & Bontempi, 2005; Preston & Eichenbaum, 2013; Song et al., 2023; 2024; Balazevic et al., 2024). Namely, we develop a new framework with continuous-time visual memory representations. Our framework adapts the $\infty$ -former architecture previously developed for textual data (Martins et al., 2020; 2022b), which we leverage to extend the capabilities of pre-trained short-context multimodal LLMs, making them able to process unbounded video contexts in a training-free manner. Shifting from a discrete to a continuous attention framework parallels the recent evolution in theories of human working memory mediated by prefrontal cortex—from the discrete "slot-based" model to the continuous "shared resource" approach (Ma et al., 2014). Consequently, our method aims to cultivate
22
+
23
+ ![](images/62f9a4adfd328ab26d2ef920e26254e1b372b8a14699724cd47cb2f4c03cf6c6.jpg)
24
+ Figure 1. (Left) Overview of $\infty$ -VIDEO (our approach) using Video LLaMA (Zhang et al., 2023b, gray arrows), which uses an additional spatial Q-former module, and VideoChat2 (Li et al., 2024, black arrows). We split the video into frame chunks and apply these models to each chunk. The Video Q-former module combines a weighted average of the STM, which is the attention for an individual chunk, with a continuous LTM that takes into account previous chunks. The outputs of the Video Q-Former are projected and then averaged. The LLM takes as input visual tokens, generated by our modified video Q-former, alongside the corresponding question to obtain the answer. (Right) Examples of $\infty$ -Video LLaMA answers, equipped with our LTM, with uniform sampling and sticky memories for short and ultra-long videos. Italicized corresponds to the correct answer, while underlined corresponds to a wrong answer or hallucination.
25
+
26
+ ![](images/a439a0a3438a70508d3fc70b7796966536c9d3508ef279291ae15954009bc185.jpg)
27
+
28
+ similar insights within the realm of episodic memory processing, where dynamic handling of memory is essential. This leads to $\infty$ -VIDEO models (Fig. 1), which are able to process and organize information as it comes, with only one pass over the video. Our main contributions are:
29
+
30
+ - We equip the current attention mechanism of video Q-formers (short-term memory, STM) with a continuous-time LTM that consolidates video information by dynamically allocating higher granularity to the most relevant parts of a video.
31
+ - We develop a new continuous-time attention mechanism which is more powerful than the Gaussian model of Martins et al. (2022b) by considering the Gibbs density based on the continuous query-key similarity function.
32
+ - We show that architectures with spatio-temporal feature extractors designed for short videos can generalize to long-video understanding in a simple, training-free manner without requiring task-specific fine-tuning or training on
33
+
34
+ long-video datasets.
35
+
36
+ - We validate our approach using the Video-LLaMA (Zhang et al., 2023b) and VideoChat2 (Li et al., 2024) models by processing a stream of video frames with a single pass, where the STM considers one chunk at the time, and the LTM maintains global information from past chunks. Our proposed model shows improved performance on video question-answering tasks when using the LTM and competitive results with other training-free models.
37
+
38
+ # 2. Background
39
+
40
+ # 2.1. Discrete Attention
41
+
42
+ Attention mechanisms (Bahdanau et al., 2015) act as a memory component in modern neural networks, enabling them to dynamically focus on key parts of the input and capture long-range dependencies, improving performance across various tasks (Vaswani et al., 2017; Dosovitskiy et al., 2021).
43
+
44
+ Consider two sequences $\mathbf{X} \in \mathbb{R}^{L \times e}$ and $\mathbf{Y} \in \mathbb{R}^{R \times e}$ , where $L$ and $R$ are the sequence lengths and $e$ is the embedding size. A vanilla attention mechanism in a transformer works
45
+
46
+ as follows. First, we obtain queries $(Q)$ , keys $(K)$ , and values $(V)$ by linearly projecting $X$ and $Y$ for each attention head $h$ :
47
+
48
+ $$
49
+ \boldsymbol {Q} ^ {h} = \boldsymbol {Y} \boldsymbol {W} _ {Q} ^ {h}, \quad \boldsymbol {K} ^ {h} = \boldsymbol {X} \boldsymbol {W} _ {K} ^ {h}, \quad \boldsymbol {V} ^ {h} = \boldsymbol {X} \boldsymbol {W} _ {V} ^ {h}, \tag {1}
50
+ $$
51
+
52
+ where $W_{Q}^{h}\in \mathbb{R}^{e\times d}$ , $W_{K}^{h}\in \mathbb{R}^{e\times d}$ , and $W_{V}^{h}\in \mathbb{R}^{e\times d}$ are head-specific learnable projection matrices, $d = e / |h|$ , and $|h|$ is the number of attention heads. For each head, the context representation $\pmb{Z}^{h}\in \mathbb{R}^{L\times d}$ is computed as:
53
+
54
+ $$
55
+ \boldsymbol {Z} ^ {h} = \operatorname {s o f t m a x} \left(\frac {\boldsymbol {Q} ^ {h} \left(\boldsymbol {K} ^ {h}\right) ^ {\top}}{\sqrt {d}}\right) \boldsymbol {V} ^ {h}. \tag {2}
56
+ $$
57
+
58
+ The outputs from all heads are then concatenated to obtain the final context representation $\mathbf{Z} \in \mathbb{R}^{L \times e}$ :
59
+
60
+ $$
61
+ \boldsymbol {Z} = \left[ \begin{array}{l l l l} \boldsymbol {Z} ^ {1} & \boldsymbol {Z} ^ {2} & \dots & \boldsymbol {Z} ^ {| h |} \end{array} \right] \boldsymbol {W} _ {Z}, \tag {3}
62
+ $$
63
+
64
+ where $\mathbf{W}_Z \in \mathbb{R}^{e \times e}$ is another learnable projection matrix.
65
+
66
+ # 2.2. Continuous Attention
67
+
68
+ Instead of splitting the input object into a finite set of pieces (e.g., tokens in text or pixels in images), continuous attention mechanisms (Martins et al., 2020) assume an underlying continuous domain, suitable for arbitrarily long temporal signals, such as audio or video data. This is done by replacing the attention probability mass function by a probability density function (PDF) over a continuous signal.
69
+
70
+ In continuous attention, the input is assumed to be a continuous signal $\pmb{x}(t)$ . Although video data is "continuous-time" in nature, it comes as a stream of $L$ discrete frames $\mathbf{X} = [x_1^\top, \dots, x_L^\top] \in \mathbb{R}^{L \times e}$ , and therefore it is necessary to convert this sequence into a smooth continuous signal. This can be done by expressing the continuous signal $\pmb{x}(t) \in \mathbb{R}^e$ as a linear combination of $N$ basis functions $\psi(t) \in \mathbb{R}^N$ :
71
+
72
+ $$
73
+ \boldsymbol {x} (t) = \boldsymbol {B} ^ {\top} \boldsymbol {\psi} (t), \tag {4}
74
+ $$
75
+
76
+ where $\pmb{B} \in \mathbb{R}^{N \times e}$ is a coefficient matrix. For compression, it is appealing to use a smaller number of basis functions than frames, $N \ll L$ . $\pmb{B}$ can be computed with multivariate ridge regression (Brown & Zidek, 1980), where we set the domain of the continuous-time signal to the unit interval [0, 1]. Frames are associated with time instants in this unit interval, $t_1 \leq t_2 \leq \ldots \leq t_L$ , with each $t_\ell \in [0,1]$ , and we set our design matrix as $\pmb{F} = [\psi(t_1), \dots, \psi(t_L)] \in \mathbb{R}^{N \times L}$ . The coefficients $\pmb{B}$ are computed such that $\pmb{x}(t_\ell) \approx \pmb{x}_\ell$ for each frame $\ell \in \{1, \dots, L\}$ , with $\lambda > 0$ , leading to:
77
+
78
+ $$
79
+ \boldsymbol {B} ^ {\top} = \boldsymbol {X} ^ {\top} \boldsymbol {F} ^ {\top} \left(\boldsymbol {F} \boldsymbol {F} ^ {\top} + \lambda \boldsymbol {I}\right) ^ {- 1}. \tag {5}
80
+ $$
81
+
82
+ The final step involves attending to $\pmb{x}(t)$ . In this approach, a PDF $p(t)$ replaces the probability mass function of the
83
+
84
+ discrete attention. The context is then computed as the expected value of the values $\pmb{v}(t) = (\pmb{W}_V)^\top \pmb{x}(t)$ :
85
+
86
+ $$
87
+ \boldsymbol {Z} = \mathbb {E} _ {p} [ \boldsymbol {v} (t) ]. \tag {6}
88
+ $$
89
+
90
+ $\infty$ -former. In a transformer with discrete attention, handling a long context (large $L$ ) becomes impractical due to excessive memory demands. The $\infty$ -former (Martins et al., 2022b) overcomes this limitation by means of an unbounded LTM leveraging continuous attention ( $\S 2.2$ ). It allows for unbounded context without increasing memory usage by trading off the number of basis functions that fit into memory with the granularity of their representations. It achieves this by sampling points within the $[0,1]$ interval, either uniformly or based on prior attention, at which $\boldsymbol{x}(t)$ is evaluated. This process, as we will see in $\S 3$ , can be seen as the memory consolidation step, allowing new information from the short-term memory $\boldsymbol{x}(t)$ to be incorporated by scaling it down with a forgetting factor $\tau$ . The past context is associated with positions in $[0,\tau]$ , while the new context is associated in $(\tau,1]$ , followed by ridge regression over the new $\boldsymbol{x}(t)$ and computation of the output context as in Eq. 6.
91
+
92
+ # 2.3. Video Q-former
93
+
94
+ A video Q-former (Zhang et al., 2023b) is a specialized variant of a transformer architecture designed to enable LLMs to process and understand video content. Developed initially to capture spatial features in images (Li et al., 2023a), its primary function is to map $L \times P$ spatial embeddings, where $P$ can be the number of patch vectors from a visual encoder, to $R$ spatio-temporal video representations. It operates by stacking layers that first apply self-attention between $R$ learned queries, followed by cross-attention between this self-attention output and the $L \times P$ spatial embeddings, leading to $R$ spatio-temporal representations.
95
+
96
+ # 3. Unbounded Memory Video Q-former
97
+
98
+ In this section, we describe our approach to endow video models with a continuous-time memory mechanism. We adapt existing video Q-former models (Zhang et al., 2023b; Li et al., 2024) by first splitting the full sequence of frames into chunks and then processing each chunk individually. Each chunk includes a discrete STM, which is the already present cross-attention in that chunk. However, building the LTM assumes continuity within the embeddings, which is not the case since each frame contains $P$ distinct embeddings. To address this, we perform average pooling over the $P$ embeddings, resulting in a discrete sequence $\mathbf{X} \in \mathbb{R}^{M \times e}$ , where $M$ denotes the number of frames in the chunk. We
99
+
100
+ introduce a global and dynamic LTM, which works with a modified, more powerful version of the continuous attention mechanism in §2.2. The LTM update enables increased granularity in memory regions with higher cumulative attention density.
101
+
102
+ # 3.1. Long-Term Memory
103
+
104
+ The first step in building our continuous LTM is to project the long-term continuous input $\pmb{x}(t) = \pmb{B}^{\top}\pmb{\psi}(t)$ , leading to the continuous keys $\pmb{k}^{h}(t) \in \mathbb{R}^{d}$ and values $\pmb{v}^{h}(t) \in \mathbb{R}^{d}$ , with the same projection matrices (1) of the STM. This allows us to perform attention over the same embedding space as the vanilla video Q-former as:
105
+
106
+ $$
107
+ \boldsymbol {k} ^ {h} (t) = \left(\boldsymbol {W} _ {K} ^ {h}\right) ^ {\top} \boldsymbol {x} (t) = \left(\boldsymbol {W} _ {K} ^ {h}\right) ^ {\top} \boldsymbol {B} ^ {\top} \psi (t), \tag {7}
108
+ $$
109
+
110
+ $$
111
+ \boldsymbol {v} ^ {h} (t) = \left(\boldsymbol {W} _ {V} ^ {h}\right) ^ {\top} \boldsymbol {x} (t) = \left(\boldsymbol {W} _ {V} ^ {h}\right) ^ {\top} \boldsymbol {B} ^ {\top} \boldsymbol {\psi} (t). \tag {8}
112
+ $$
113
+
114
+ We compute the query $\pmb{Q}^{h} = [\pmb{q}_{1}^{\top},\dots,\pmb{q}_{R}^{\top}] = \pmb{Y}\pmb{W}_{Q}^{h}$ as in (1). For each query $\pmb{q}_i\in \mathbb{R}^d$ , we compute the continuous query-key similarity $s_i^h (t)$ for each head and query as
115
+
116
+ $$
117
+ s _ {i} ^ {h} (t) = \boldsymbol {q} _ {i} ^ {\top} \boldsymbol {k} (t) = \boldsymbol {q} _ {i} ^ {\top} \left(\boldsymbol {W} _ {K} ^ {h}\right) ^ {\top} \boldsymbol {B} ^ {\top} \boldsymbol {\psi} (t), \tag {9}
118
+ $$
119
+
120
+ and compute a Gibbs PDF as
121
+
122
+ $$
123
+ p _ {i} ^ {h} (t) = \frac {\exp \left(s _ {i} ^ {h} (t)\right)}{\int \exp \left(s _ {i} ^ {h} \left(t ^ {\prime}\right)\right) d t ^ {\prime}}, \tag {10}
124
+ $$
125
+
126
+ where the integral is approximated with the trapezoidal rule. Given the value function $\pmb{v}^h(t)$ , we compute the attention-specific representation vectors as described in (6):
127
+
128
+ $$
129
+ \boldsymbol {Z} _ {i} ^ {h} = \mathbb {E} _ {p _ {i} ^ {h}} [ \boldsymbol {v} ^ {h} (t) ] = (\boldsymbol {W} _ {V} ^ {h}) ^ {\top} \boldsymbol {B} ^ {\top} \int p _ {i} ^ {h} (t) \boldsymbol {\psi} (t) d t. \tag {11}
130
+ $$
131
+
132
+ Finally, we obtain the LTM representation $Z_{\mathrm{LTM}}$ by concatenating the context heads and projecting them as in (3).
133
+
134
+ # 3.2. Continuous-Time Memory Consolidation
135
+
136
+ As we continue processing chunks, the LTM is progressively updated, as illustrated in Fig. 2. This is done by first sampling $T$ locations within the interval [0, 1] and then evaluating the continuous signal $x(t)$ , or current LTM, at these sampled points. The sampling can be performed either uniformly in [0, 1] or based on prior attendance, as we will explain in detail in §3.3. The next step involves concatenating this LTM context with the new one coming from the current chunk. To do this, we first "contract" the LTM as
137
+
138
+ $$
139
+ \boldsymbol {x} ^ {\prime} (t) = \boldsymbol {x} (t / \tau) = \boldsymbol {B} ^ {\top} \psi (t / \tau). \tag {12}
140
+ $$
141
+
142
+ We then compute $\pmb{x}(t)$ at the $T$ locations $0 \leq t_1, \dots, t_T \leq \tau$ :
143
+
144
+ $$
145
+ \boldsymbol {x} _ {i} = \boldsymbol {B} ^ {\top} \boldsymbol {\psi} \left(t _ {i} / \tau\right) \quad \forall i \in [ T ], \tag {13}
146
+ $$
147
+
148
+ ![](images/d13a46d6b4f396b45adb5e701726356a84a2c46bfcdc14ab35f3f0cd39cfe009.jpg)
149
+ Figure 2. Proposed Memory Consolidation Mechanism.
150
+
151
+ and build the matrix $\mathbf{X}_{\mathrm{past}} = [\pmb{x}_1, \pmb{x}_2, \dots, \pmb{x}_T]^\top \in \mathbb{R}^{T \times e}$ . Following this, we concatenate the current step context $\mathbf{X}_{\mathrm{new}} \in \mathbb{R}^{M \times d}$ with the previous context $\mathbf{X}_{\mathrm{past}} \in \mathbb{R}^{T \times e}$ , resulting in the combined sequence:
152
+
153
+ $$
154
+ \boldsymbol {X} = \left[ \boldsymbol {X} _ {\text {p a s t}}, \boldsymbol {X} _ {\text {n e w}} \right] ^ {\top} \in \mathbb {R} ^ {(T + M) \times e}. \tag {14}
155
+ $$
156
+
157
+ With the new and previous chunk contexts, we compute $B$ , as described in Eq. 5, where the continuous signal is approximated using a linear combination of rectangular functions. To achieve this, we first adjust the contribution of the previous context using the factor $\tau$ . Specifically, we associate $X_{\mathrm{past}}$ with positions in the interval $[0, \tau]$ and $X_{\mathrm{new}}$ with positions in $(\tau, 1]$ . This process yields a matrix $G \in \mathbb{R}^{(M + L) \times N}$ . During each step, the previous context is contracted by a factor of $\tau$ , which regulates the extent of long-term memory used for attention and induces a gradual "forgetting" process. After the computation of $B$ , continuous attention is performed as described in §3.1.
158
+
159
+ # 3.3. Sticky Memories
160
+
161
+ When extending the LTM, the signal is evaluated at $T$ locations within [0, 1], as described in §3.2. While these locations can be uniformly distributed, allocating more "memory space" to regions of higher relevance ensures that critical information is prioritized in line with continuous resource allocation conceptualizations of human memory (Ma et al., 2014). This selective allocation compresses the signal into an efficient representation whereby essential video details are retained, and less significant ones are compressed or discarded. The recurrent and adaptive nature of this process is reminiscent of memory consolidation and reconsolidation brain mechanisms for relevance-based long-term memory transformation (Hardt et al., 2010; Dudai et al., 2015).
162
+
163
+ To address this, we propose selecting the $T$ locations based
164
+
165
+ on the relevance of the signal in each region as done by Martins et al. (2022b). This process begins by constructing a histogram of the previous attention across intervals. Specifically, the signal is divided into $D$ linearly spaced bins, $\{d_1,\ldots ,d_D\}$ . The probability assigned to each bin, $p(d_j)$ for $j\in [D]$ , is computed by integrating Eq. 10 over each bin interval using the trapezoidal rule:
166
+
167
+ $$
168
+ p \left(d _ {j}\right) \propto \sum_ {h = 1} ^ {H} \sum_ {i = 1} ^ {R} \int_ {d _ {j}} p _ {i} ^ {h} (t). \tag {15}
169
+ $$
170
+
171
+ Finally, $T$ locations are sampled based on the resulting distribution, followed by the LTM update of §3.2. In our model, this sampling process is analogous to the phenomenon of non-local discontinuous "replay" in the brain whereby past experiences are reactivated for the purposes of consolidation (Carr et al., 2011; McNamee, 2024).
172
+
173
+ # 3.4. Model Architecture
174
+
175
+ We define the output context for the cross-attention layers of the video Q-former as a weighted sum of two components: the "local" vanilla video Q-former output context $Z_{\mathrm{STM}} \in \mathbb{R}^{R \times d}$ , which corresponds to the already present attention over the current chunk, and the "global" LTM context $Z_{\mathrm{LTM}}$ which takes into account information from previous chunks as described in §3.2. The overall context is computed as:
176
+
177
+ $$
178
+ \boldsymbol {Z} = \alpha \boldsymbol {Z} _ {\mathrm {S T M}} + (1 - \alpha) \boldsymbol {Z} _ {\mathrm {L T M}}, \tag {16}
179
+ $$
180
+
181
+ where $\alpha$ is a weighting factor that balances the contribution of short-term and long-term memories. The video Q-formers considered in this work were trained with the $R$ tokens (or a subset) concatenated with the prompt tokens. In our approach, where the video context is divided into frame chunks processed by the long-term mechanism, it is necessary to aggregate information from all the $C$ chunks, in $\mathbb{R}^{C\times R}$ , into a fixed set of $R$ tokens. To achieve this, we run the modified Video-LLaMA (Zhang et al., 2023b) and VideoChat2 (Li et al., 2024) models for each chunk and compute a running average of the embeddings as we process each chunk. The current video token embedding $\pmb{E}_{c}\in \mathbb{R}^{R\times d}$ , defined as $\pmb{E}_{c} = \pmb{W}_{\mathrm{proj}}\pmb{Z}_{c}$ , is updated incrementally, enabling the model to handle arbitrarily long contexts without storing all embeddings of chunks in memory. The updated embedding is calculated as:
182
+
183
+ $$
184
+ \bar {\boldsymbol {E}} _ {c} = \frac {C - 1}{C} \bar {\boldsymbol {E}} _ {c - 1} + \frac {1}{C} \boldsymbol {E} _ {c}, \tag {17}
185
+ $$
186
+
187
+ Upon reaching the final chunk, the video token embeddings $\pmb{E}$ are fed to the LLM that generates an answer. The full architecture diagram is shown in Fig. 1.
188
+
189
+ # 4. Experiments
190
+
191
+ In this section, we evaluate our proposed method on video question answering tasks, including multiple choice ques
192
+
193
+ tion answering (§4.2) and open-ended generation (§4.3).
194
+
195
+ # 4.1. Implementation Details
196
+
197
+ The Video-LLaMA (Zhang et al., 2023b) architecture that we adapt here with our LTM module was initially designed for short videos and employs a dual Q-Former architecture (Li et al., 2023a)—one for spatial and another for temporal feature extraction. We use the Video-LLaMA2-7B finetuned model, $^{3}$ leveraging EVA-CLIP's ViT-G/14 (Fang et al., 2022) as visual encoder and Vicuna 7B (Chiang et al., 2023) as our LLM.
198
+
199
+ We also adapt VideoChat2 (Li et al., 2024), a stronger short-video model equipped with a single video Q-Former and trained on extended instruction data. We use UMT-L (Li et al., 2023c), which captures both spatial and temporal dependencies but requires more memory. Thus, we use chunks with fewer frames. Finally, we follow Jiang et al. (2023) and use Mistral-7B (Jiang et al., 2023). Additional implementation details can be found in App. A.
200
+
201
+ In all our experiments, we approximate the integrals of Eqs. 10 and 11 using the trapezoidal rule with 1000 sampling points. For $\infty$ -VIDEO with Video-LLaMA, we use 8 chunks of 256 frames with 1024 basis functions, except in the case of NeXT-QA (Xiao et al., 2021), where the total number of available frames is reduced. For $\infty$ -VIDEO with VideoChat2, we use 8 chunks of 16 frames with $N = 256$ basis functions. We experiment with several values of $\alpha$ in Eq. 16. Full hyperparameters can be seen in App. A.2.
202
+
203
+ # 4.2. Multiple-Choice Question Answering
204
+
205
+ # 4.2.1. COMPARISON WITH OTHER TRAINING-FREE METHODS
206
+
207
+ We consider systems of three kinds: (1) training-free approaches leveraging a GPT-4 backbone (Zhang et al., 2023a; Wang et al., 2024a;c); (2) models most similar to ours, which share the same underlying architecture, such as VideoLLaMA (Zhang et al., 2023b) and its training-free variants like MovieChat (Song et al., 2023) and MovieChat+ (Song et al., 2024); and (3) VideoChat2 (Li et al., 2024). For (2) and (3), we test $\infty$ -VIDEO variants without LTM (corresponding to $\alpha = 1.0$ ) and those using uniform sampling and sticky memories with $\alpha = 0.9$ .
208
+
209
+ NeXT-QA. We evaluate our models in NeXT-QA (Xiao et al., 2021), a dataset with questions and 5 multiple choice options about short videos with average duration of 44 seconds. As $\infty$ -Video LLaMA can process a higher number of frames, we anticipate that using all the video information may lead to improvement over sub-sampling. For $\infty$ -Video
210
+
211
+ Table 1. Evaluation on Multiple Choice Datasets. Evaluation accuracies on NeXT-QA (NeXT) (Xiao et al., 2021) and Egoschema subset (Ego) (Mangalam et al., 2023). * denotes results obtained by running the models on both datasets. † indicates models run on Egoschema but not on NeXT-QA. ◆ highlights models trained on NExT-QA. The remaining results are from Song et al. (2024) or Wang et al. (2024c). We bold the best-performing models for each category.
212
+
213
+ <table><tr><td>Method</td><td>LLM</td><td>#Frames</td><td>NeXT</td><td>Ego</td></tr><tr><td colspan="5">Based on Proprietary LLMs</td></tr><tr><td>LLovi (Zhang et al., 2023a)</td><td>GPT-4</td><td>-</td><td>67.7</td><td>61.2</td></tr><tr><td>VideoAgent (Wang et al., 2024a)</td><td>GPT-4</td><td>-</td><td>71.3</td><td>60.2</td></tr><tr><td>VideoTree (Wang et al., 2024c)</td><td>GPT-4</td><td>-</td><td>75.6</td><td>66.2</td></tr><tr><td colspan="5">Video LLaMA-Based Models</td></tr><tr><td>Video LLaMA* (Zhang et al., 2023b)</td><td>Vicuna-7B</td><td>32</td><td>30.7</td><td>20.2</td></tr><tr><td>MovieChat† (Song et al., 2023)</td><td>Vicuna-7B</td><td>2048</td><td>34.4</td><td>41.6</td></tr><tr><td>MovieChat+† (Song et al., 2024)</td><td>Vicuna-7B</td><td>2048</td><td>35.2</td><td>37.4</td></tr><tr><td>∞-Video LLaMA (No LTM)*</td><td>Vicuna-7B</td><td>all/2048</td><td>37.6</td><td>40.8</td></tr><tr><td>∞-Video LLaMA (Uniform)*</td><td>Vicuna-7B</td><td>all/2048</td><td>37.5</td><td>42.6</td></tr><tr><td>∞-Video LLaMA (Sticky)*</td><td>Vicuna-7B</td><td>all/2048</td><td>41.1</td><td>46.8</td></tr><tr><td colspan="5">VideoChat2-Based Models</td></tr><tr><td>VideoChat2*◇ (Li et al., 2024)</td><td>Mistral-7B</td><td>16</td><td>78.7</td><td>64.2</td></tr><tr><td>∞-VideoChat2 (No LTM)*◇</td><td>Mistral-7B</td><td>128</td><td>78.1</td><td>64.6</td></tr><tr><td>∞-VideoChat2 (Uniform)*◇</td><td>Mistral-7B</td><td>128</td><td>78.1</td><td>64.4</td></tr><tr><td>∞-VideoChat2 (Sticky)*◇</td><td>Mistral-7B</td><td>128</td><td>78.1</td><td>64.8</td></tr></table>
214
+
215
+ LLaMA, we use all available frames in the videos, which we then split into chunks of up to 256 frames. In contrast, baseline models like Video-LLaMA (Zhang et al., 2023b) are limited to processing only 32 frames, while VideoChat2 achieves optimal performance for 16 frames, as shown in Li et al. (2024).
216
+
217
+ As shown in Tab. 1, $\infty$ -Video LLaMA with sticky memories outperforms other approaches. This includes MovieChat+, which employs a heuristic to merge adjacent frames, fed to the video's Q-former cross-attention with question knowledge. In contrast, our model encounters the question only within the LLM prompt. Surprisingly, our method using uniform sampling of the continuous signal performs slightly worse than $\infty$ -Video LLaMA without the LTM ( $\alpha = 1$ ). For the VideoChat2 variants, we observe no significant performance increase. We attribute this to the in-domain nature of the evaluation, where the original model is already highly optimized for the given tasks.
218
+
219
+ Egoschema. We evaluate the training-free question-answering performance of our models on EgoSchema (Mangalam et al., 2023), a medium-length benchmark for egocentric planning designed to test long-context video understanding with 3-minute videos.
220
+
221
+ Tab. 1 presents the results of our methods compared to strong parameter-free baselines. $\infty$ -Video LLaMA, equipped with the LTM module ( $\alpha = 0.9$ ) and using sticky memories, significantly outperforms both the uniform LTM variant, also for $\alpha = 0.9$ and the model without LTM ( $\alpha = 1$ ), achieving a notable accuracy improvement of +6 points over the latter. A similar trend is observed with $\infty$ -Video LLaMA.
222
+
223
+ Table 2. VideoMME results. Baseline results are taken from (Fu et al., 2024). We bold the best performing models.
224
+
225
+ <table><tr><td>Method</td><td>LLM</td><td>#Frames</td><td>Medium</td><td>Long</td><td>Avg</td></tr><tr><td>ST-LLM</td><td>Vicuna-7B</td><td>64</td><td>36.8</td><td>31.1</td><td>37.9</td></tr><tr><td>Video-LLaVA</td><td>Vicuna-7B</td><td>8</td><td>38.0</td><td>36.2</td><td>39.9</td></tr><tr><td>ShareGPT4Video 8B</td><td>-</td><td>16</td><td>36.3</td><td>35.0</td><td>39.9</td></tr><tr><td>Chat-UniVi-v1.5</td><td>Vicuna-7B</td><td>64</td><td>40.3</td><td>35.8</td><td>40.6</td></tr><tr><td>Qwen-VL-Chat</td><td>Qwen-7B</td><td>4</td><td>38.7</td><td>37.8</td><td>41.1</td></tr><tr><td>VideoChat2</td><td>Mistral-7B</td><td>32</td><td>37.9</td><td>38.0</td><td>42.1</td></tr><tr><td>∞-VideoChat2 (no LTM)</td><td>Mistral-7B</td><td>128</td><td>39.6</td><td>38.8</td><td>42.3</td></tr><tr><td>∞-VideoChat2 (uniform)</td><td>Mistral-7B</td><td>128</td><td>40.0</td><td>38.8</td><td>42.4</td></tr><tr><td>∞-VideoChat2 (sticky)</td><td>Mistral-7B</td><td>128</td><td>40.2</td><td>38.9</td><td>42.4</td></tr></table>
226
+
227
+ VideoChat2, though the improvements are less pronounced. We attribute this to the fact that VideoChat2 is inherently a stronger model, having been trained on a larger and more recent datasets, offering less room for improvement compared to the Video-LLaMA $\infty$ -variants. However, gains are observed for both uniform sampling and sticky memories, with the latter showing superior performance. Moreover, despite having significantly fewer parameters, $\infty$ -VideoChat2 demonstrates competitive results against proprietary LLMs based on ChatGPT-4.
228
+
229
+ # 4.2.2. EVALUATION ON VERY LONG VIDEOS
230
+
231
+ To emphasize the effectiveness of our approach on extended video content, we also present results on Video-MME (Fu et al., 2024), which features a diverse collection of lengthy videos, ranging up to 1 hour in duration. We compare our method against baseline models of similar size such as ST-LLM (Liu et al., 2024b), Video-LLaVA (Liu et al., 2023), ShareGPT4Video 8B (Chen et al., 2024a), Chat-UniVi-v1.5 (Jin et al., 2023) and Qwen-VL-Chat (Bai et al., 2023) as well as our $\infty$ -VIDEO variants with $\alpha = 1$ and the base architecture VideoChat2 (Li et al., 2024).
232
+
233
+ In Tab. 2, we show the results for VideoMME. Although Video-LLaMA performs well on earlier datasets, its description-focused training dataset makes the performance as good as random guessing. Including it in the evaluation would detract from more relevant models. However, for the VideoChat2 category, sticky memories outperform others, followed by uniform sampling.
234
+
235
+ # 4.3. Long-Term Open-Ended Question Answering
236
+
237
+ We now investigate the performance of our models on open-ended question answering using the MovieChat-1K dataset (Song et al., 2023), a benchmark comprising long videos with an average duration of around 8 minutes. We compare our models with other baselines based on Vicuna-7B (Chiang et al., 2023), including VideoChat (Li et al., 2023b), Video-ChatGPT (Maaz et al., 2024), MovieChat (Song et al., 2023; 2024), MovieChat+ (Song et al., 2024). Furthermore,
238
+
239
+ Table 3. MovieChat Results. Score measures the overall answer score, CI stands for correctness of information, DO stands for detail orientation, and CU stands for contextual understanding. We bold the best results and underline the best within a category. We omit the temporal and consistency metrics due to the absence of the subset specific to these metrics. Except for Moviechat+, results were taken from (Song et al., 2023).
240
+
241
+ <table><tr><td>Method</td><td>LLM</td><td>Number of Frames</td><td>Accuracy</td><td>Score</td><td>CI</td><td>DO</td><td>CU</td></tr><tr><td>Video Chat (Li et al., 2023b)</td><td>Vicuna-7B</td><td>32</td><td>61.0</td><td>3.34</td><td>3.26</td><td>3.20</td><td>3.38</td></tr><tr><td>Video-ChatGPT (Maaz et al., 2024)</td><td>Vicuna-7B</td><td>100</td><td>44.2</td><td>2.71</td><td>2.48</td><td>2.78</td><td>3.03</td></tr><tr><td colspan="8">Video LLaMA-Based Models</td></tr><tr><td>Video LLaMA (Zhang et al., 2023b)</td><td>Vicuna-7B</td><td>32</td><td>51.4</td><td>3.10</td><td>3.30</td><td>2.53</td><td>3.28</td></tr><tr><td>MovieChat (Song et al., 2023)</td><td>Vicuna-7B</td><td>2048</td><td>67.8</td><td>3.81</td><td>3.32</td><td>3.28</td><td>3.44</td></tr><tr><td>MovieChat+ (Song et al., 2024)</td><td>Vicuna-7B</td><td>2048</td><td>66.4</td><td>3.67</td><td>3.70</td><td>3.30</td><td>3.62</td></tr><tr><td>∞-Video LLaMA (no LTM)</td><td>Vicuna-7B</td><td>2048</td><td>68.0</td><td>3.76</td><td>3.72</td><td>3.33</td><td>3.71</td></tr><tr><td>∞-Video LLaMA (uniform)</td><td>Vicuna-7B</td><td>2048</td><td>66.5</td><td>3.69</td><td>3.60</td><td>3.31</td><td>3.58</td></tr><tr><td>∞-Video LLaMA (sticky)</td><td>Vicuna-7B</td><td>2048</td><td>72.2</td><td>3.88</td><td>3.89</td><td>3.47</td><td>3.79</td></tr><tr><td>∞-Video LLaMA (no STM uniform)</td><td>Vicuna-7B</td><td>2048</td><td>62.4</td><td>3.75</td><td>3.36</td><td>3.38</td><td>3.52</td></tr><tr><td>∞-Video LLaMA (no STM sticky)</td><td>Vicuna-7B</td><td>2048</td><td>59.2</td><td>3.68</td><td>3.30</td><td>3.30</td><td>3.44</td></tr><tr><td colspan="8">VideoChat2-Based Models</td></tr><tr><td>VideoChat2</td><td>Mistral-7B</td><td>16</td><td>62.2</td><td>3.72</td><td>3.46</td><td>3.60</td><td>3.69</td></tr><tr><td>∞-VideoChat2 (no LTM)</td><td>Mistral-7B</td><td>128</td><td>63.9</td><td>3.74</td><td>3.54</td><td>3.60</td><td>3.73</td></tr><tr><td>∞-VideoChat2 (uniform)</td><td>Mistral-7B</td><td>128</td><td>64.1</td><td>3.73</td><td>3.54</td><td>3.60</td><td>3.75</td></tr><tr><td>∞-VideoChat2 (sticky)</td><td>Mistral-7B</td><td>128</td><td>63.9</td><td>3.74</td><td>3.55</td><td>3.63</td><td>3.74</td></tr><tr><td>∞-VideoChat2 (no STM uniform)</td><td>Mistral-7B</td><td>128</td><td>65.7</td><td>3.78</td><td>3.65</td><td>3.60</td><td>3.84</td></tr><tr><td>∞-VideoChat2 (no STM sticky)</td><td>Mistral-7B</td><td>128</td><td>66.5</td><td>3.85</td><td>3.71</td><td>3.68</td><td>3.96</td></tr></table>
242
+
243
+ we evaluate our $\infty$ -VIDEO variants with $\alpha = 0.9$ for both uniform sampling and sticky memories, as well as with $\alpha = 0$ (i.e., without STM). Following the standard evaluation method for open-ended questions, we prompt GPT-3.5 (OpenAI et al., 2024) for a yes/no answer prediction, a confidence score (0 to 5), and other qualitative metrics. The prompts are shown in App. A.3.
244
+
245
+ As shown in Tab. 3, our $\infty$ -VIDEO LLaMA with sticky memories outperforms all models in its category, as well as VideoChat and Video-ChatGPT, across all metrics. It also surpasses MovieChat, which is designed for training-free long-context video understanding. In contrast, $\infty$ -Video LLaMA with uniform sampling performs worse than both sticky memories and the model without LTM. Additionally, using only the LTM does not improve performance, highlighting that a weighted combination of STM and LTM yields the best results for the Video-LLaMA category. The same does not apply to the VideoChat2 category, where replacing the STM with the LTM yields top results. For $\alpha$ values other than 0, the performance of $\infty$ -VIDEO with VideoChat2 remains nearly unchanged. Surprisingly, VideoChat2 underperforms compared to the Video LLaMA category despite being trained on a larger dataset. We hypothesize this is due to differences in the training datasets: Video LLaMA was trained on video descriptions with multiple sentences, encouraging more context, which increases the probability of correct predictions, while VideoChat2 was fine-tuned on concise datasets, favouring brief, open-ended predictions. Ablation studies on $\infty$ -VIDEO with Video LLaMA are presented in App. B.1.
246
+
247
+ # 4.4. Qualitative Analysis
248
+
249
+ In Fig. 3, we show the continuous attention density map over the LTM in the final layer of the video Q-Former for the last chunk of $\infty$ -VIDEO LLaMA. The example uses the Interstellar trailer, divided into 8 chunks of 256 frames each, with $\tau = 0.75$ , $N = 1024$ , and $\alpha = 0.9$ . The bottom heatmap reveals that the continuous attention favours frames after $t = \tau$ , where the sticky LTM exhibits peaks before this point. In contrast, the uniform LTM shows vanishing density as $t$ decreases, likely due to context contraction across chunks, which might explain the superior results for sticky memories.
250
+
251
+ In Fig. 4, we present the attention density as a function of the number of frames, with $\alpha = 0.9$ , $N = 256$ , and $\tau = 0.5$ , for 3 chunks of 256 frames each, spanning 3 contraction steps. We also display 6 representative frames from high-density regions by identifying the top 26 frames within each interval and selecting the 6 non-redundant frames. The selected frames appear to align with visually striking or narratively significant scenes within the trailer, which suggests that $\infty$ -VIDEO effectively might capture key moments in the video and discard irrelevant parts. For example, in the final interval, the region with the lowest attention density corresponds to the credits section of the video. We show a similar figure but for the uniform sampling in App. B.2.
252
+
253
+ # 5. Related Work
254
+
255
+ There are several recent advances in long-context video understanding (Li et al., 2023d; Liu et al., 2024a; Balazevic et al., 2024; Wang et al., 2024b; Shu et al., 2024; Ye
256
+
257
+ ![](images/673650cd63cb978e7ff1a3d61d9b768a70c32c0ddb5fa8c077a343fae24f1355.jpg)
258
+ Figure 3. (Top) LTM attention density on the $[0, \tau]$ interval for the Interstellar trailer, using sticky memories in the final chunk of the $\infty$ -Video LLaMA video Q-former's last layer. (Bottom) The same attention density map, extended over the full $t$ interval.
259
+
260
+ ![](images/2fdbc984c7b05da9493b133e28ee1eaab80838e70205965470e31eb10c7c3898.jpg)
261
+
262
+ ![](images/a34782ec88b6a17c540e0236c0535135874a797a49718673c7ede5a3cac909c3.jpg)
263
+
264
+ ![](images/c2927b362587966f594d72e94c8baaafce3d80978ed9f1d189403a9c55a3d760.jpg)
265
+
266
+ ![](images/bc8db9e2221fc9cda70955e5fb1d52f14237979e65fef9a876426c2a176d2c4f.jpg)
267
+
268
+ ![](images/591af3077bf4b6244cff0c2331e4994db03fc1b336492f3a302824e5727f49d0.jpg)
269
+ 12
270
+
271
+ ![](images/fe503d3d029b768273b54a05c7e14bfecc805729cfbef673be6de2ab35ac6e39.jpg)
272
+ 28
273
+
274
+ ![](images/90e791808ee4566b6eecf5a220d92fd950e010e0a51714a73e426145ff698a78.jpg)
275
+ 128
276
+
277
+ ![](images/92f8e13d94a37275d1782482953da7df2eda3efc193d4859110f4f8b7861fb10.jpg)
278
+ 148
279
+ Figure 4. Highest continuous attention density frames selected using sticky memories in the Interstellar trailer for $\infty$ -Video LLaMA across 3 chunks. (Left) Interval: $[0, \tau^2]$ . (Middle) Interval: $(\tau^2, \tau]$ . (Right) Interval: $(\tau, 1]$ .
280
+
281
+ ![](images/12bbc8a1747a4cb49269deef8c875eba3e2bf41affe8b6803a175849b4b0ca56.jpg)
282
+ 150
283
+
284
+ ![](images/1a43ab6468a81c4c9d1ba0c508ff416c16572d39227a8532f90f09765088e52f.jpg)
285
+ 191
286
+
287
+ ![](images/db33cdb44e3f6e7b31cc21c5366fcec7a7ccf22760d1bc20f5ed692f17ec97e9.jpg)
288
+ 311
289
+
290
+ ![](images/777d5ef8addc19c136c51590753b754ce9df3f5a918bfc7f52fce3a393d6d757.jpg)
291
+ 339
292
+
293
+ ![](images/542530e15991d5090179fd1626c18293aa9d25d73377445da6312355f00dccbc.jpg)
294
+ 400
295
+
296
+ ![](images/79ead36dfbf02f605aff91c934357955ec56befff4033bcc82112a5cf7038fd1.jpg)
297
+ 465
298
+
299
+ ![](images/14f6c15e30fdf92b3b8180a24496a4f4747b5ba8c1031899192687e550207374.jpg)
300
+ 478
301
+
302
+ ![](images/fa92e9ed0d1bc5d89258a8e9cb8e2bac49a129f96de40713dda35a0668e75a90.jpg)
303
+ 486
304
+
305
+ ![](images/30a9b6d6a0ca9ad11fd54fe93a7fed54df700ff029a4d9ddcd01ac75be4ac6f6.jpg)
306
+ 528
307
+
308
+ ![](images/4c59f4c933410aa6d7a37d6bbeee8c7de61c6b2ee78214d7b28c0d3b2e205c7a.jpg)
309
+ 544
310
+
311
+ ![](images/936fd42c665da68661fe49a245ce00382f58df4a24a111c39eafef034dfe7e70.jpg)
312
+ 545
313
+
314
+ ![](images/4f8176d0b4de449ed9f2f913ef96d4b8554f189ba76c65f3f6e4a9266e37a59b.jpg)
315
+ 553
316
+
317
+ ![](images/43d47ba96c376f08ecc04230a5f3aad462b97ca90f6ddb87d7ef8521e7e719a5.jpg)
318
+ 555
319
+
320
+ ![](images/9c5fd834303afe9bb5e5a9c7d81fb7aea5d37a3f9655c105be7224e187dd1406.jpg)
321
+ 571
322
+
323
+ et al., 2024; Chen et al., 2024b), but few adapting transformers to leverage temporal information in a training-free setting. Closest to our work is Song et al. (2023; 2024), which extends Video LLaMA with memory consolidation by using a heuristic to merge similar frames, which alters frame embedding-level information. In contrast, our method retains embedding integrity, equipping the video Q-former's cross-attention with an LTM to efficiently process an arbitrary number of frames in one single pass over the video.
324
+
325
+ Moreover, works such as Zhang et al. (2024), Shu et al. (2024), and Chen et al. (2024b) address the challenge of long video contexts. However, these approaches involve fine-tuning or training models from scratch, which can be computationally expensive and time-intensive. Our approach, in contrast, enables the seamless adaptation of short video models to arbitrary long contexts without the need for sparse subsampling or discarding important information.
326
+
327
+ Our approach builds on continuous attention mechanisms, originally proposed by Martins et al. (2020), and later applied to image, speech, and natural language processing tasks (Farinhas et al., 2021; Martins et al., 2022a;b). We extend these ideas to video data by replacing the continuous softmax with the Gibbs PDF, which better replicates the discrete softmax used in the video Q-Former attention.
328
+
329
+ # 6. Conclusions
330
+
331
+ We introduced a lightweight extension to short-video vision LLMs, enabling arbitrary-long video understanding by augmenting the video Q-former's cross-attention mechanism with a long-term memory module that consolidates global information dynamically. Our approach adapts continuous attention to perform visual memory consolidation, allocating higher granularity to the most relevant frames. This ensures an efficient and focused representation of critical moments while maintaining scalability. Additionally, our method enables the sequential processing of videos with a single pass. Despite being training-free, our approach also paves the way for scalable long-context video understanding with transformers as spatio-temporal feature extractors.
332
+
333
+ Our work takes inspiration from cognitive and mechanistic theories of memory (re)consolidation in brains (Hardt et al., 2010; Preston & Eichenbaum, 2013; Ma et al., 2014), and a deeper integration with such theories may be pursued. For example, memory reactivation or "replay" is thought to be a key component of systems consolidation in "offline" states such as sleep. Our model could be extended to incorporate such with further training and schema-driven fine-tuning for the purposes of continual learning (Cai et al., 2024). Furthermore, as a neural architecture, our model goes beyond current brain models of episodic memory processing, which focus on discrete low-dimensional sequences of static images and relatively simple functionalities such as mem
334
+
335
+ ory recall and event segmentation (Franklin et al., 2020; Chandra et al., 2025). Given our model's integration of rich and streaming visual input with flexible and sophisticated querying via text prompting, interpretability analyses of our architecture may provide insights regarding how episodic memory may be interrogated for complex inferences in the human brain (Tulving, 2002; Radvansky & Zacks, 2014).
336
+
337
+ # Impact Statement
338
+
339
+ We discuss the broader implications of our work, including ethical considerations and potential societal consequences. Our framework extends the capabilities of existing short-context multimodal language models, enabling them to process unbounded video contexts without requiring retraining. This is particularly relevant given concerns about the energy consumption of training large models (Strubell et al., 2019). However, we must also acknowledge the societal risks associated with video models, especially their potential use in privacy-violating surveillance. As our approach enables scaling to longer videos, there is a concern that it could be applied in undesirable domains. While current state-of-the-art models are often trained on datasets with documented biases, we intentionally focus on applications using standard benchmark applications, aiming to distance ourselves from harmful uses.
340
+
341
+ # Acknowledgments
342
+
343
+ We would like to thank Marcos Treviso, Giuseppe Attanasio, Sweta Agrawal, Chryssa Zerva and the SARDINE lab team for helpful discussions. This work was supported by EU's Horizon Europe Research and Innovation Actions (UTER, contract 101070631), by the project DECOLLAGE (ERC-2022-CoG 101088763), by the Portuguese Recovery and Resilience Plan through project C645008882-00000055 (Center for Responsible AI), and by FCT/MECI through national funds and when applicable co-funded EU funds under UID/50008: Instituto de Telecomunicações.
344
+
345
+ # References
346
+
347
+ Atreja, S., Ashkinaze, J., Li, L., Mendelsohn, J., and Hemphill, L. Prompt design matters for computational social science tasks but in unpredictable ways, 2024. URL https://arxiv.org/abs/2406.11980.
348
+ Bahdanau, D., Cho, K., and Bengio, Y. Neural machine translation by jointly learning to align and translate. In Proc. of International Conference on Learning Representations, 2015.
349
+ Bai, J., Bai, S., Yang, S., Wang, S., Tan, S., Wang, P., Lin, J., Zhou, C., and Zhou, J. Qwen-vl: A versatile vision
350
+
351
+ language model for understanding, localization, text reading, and beyond. arXiv preprint arXiv:2308.12966, 2023.
352
+ Balazevic, I., Shi, Y., Papalampidi, P., Chaabouni, R., Koppula, S., and Henaff, O. J. Memory consolidation enables long-context video understanding. In Salakhutdinov, R., Kolter, Z., Heller, K., Weller, A., Oliver, N., Scarlett, J., and Berkenkamp, F. (eds.), Proceedings of the 41st International Conference on Machine Learning, volume 235 of Proceedings of Machine Learning Research, pp. 2527-2542. PMLR, 21-27 Jul 2024.
353
+ Brady, T. F., Konkle, T., Alvarez, G. A., and Oliva, A. Visual long-term memory has a massive storage capacity for object details. Proceedings of the National Academy of Sciences, 105(38):14325-14329, 2008. doi: 10.1073/pnas.0803390105.
354
+ Brown, P. J. and Zidek, J. V. Adaptive multivariate ridge regression. The Annals of Statistics, 1980.
355
+ Cai, C., Wang, Z., Gao, J., Liu, W., Lu, Y., Zhang, R., and Yap, K.-H. Empowering large language model for continual video question answering with collaborative prompting, 2024. arXiv:2410.00771v2.
356
+ Carr, M. F., Jadhav, S. P., and Frank, L. M. Hippocampal replay in the awake state: A potential substrate for memory consolidation and retrieval. Nature Neuroscience, 14: 147-153, 2011.
357
+ Chandra, S., Sharma, S., Chaudhuri, R., et al. Episodic and associative memory from spatial scaffolds in the hippocampus. Nature, XX(XX):XX-XX, 2025. doi: 10.1038/s41586-024-08392-y.
358
+ Chen, L., Wei, X., Li, J., Dong, X., Zhang, P., Zang, Y., Chen, Z., Duan, H., Lin, B., Tang, Z., et al. Sharegpt4video: Improving video understanding and generation with better captions. arXiv preprint arXiv:2406.04325, 2024a.
359
+ Chen, Y., Xue, F., Li, D., Hu, Q., Zhu, L., Li, X., Fang, Y., Tang, H., Yang, S., Liu, Z., He, E., Yin, H., Molchanov, P., Kautz, J., Fan, L., Zhu, Y., Lu, Y., and Han, S. Longvila: Scaling long-context visual language models for long videos, 2024b.
360
+ Cheng, Z., Leng, S., Zhang, H., Xin, Y., Li, X., Chen, G., Zhu, Y., Zhang, W., Luo, Z., Zhao, D., and Bing, L. Videollama 2: Advancing spatial-temporal modeling and audio understanding in video-llms. arXiv preprint arXiv:2406.07476, 2024. URL https://arxiv.org/abs/2406.07476.
361
+ Chiang, W.-L., Li, Z., Lin, Z., Sheng, Y., Wu, Z., Zhang, H., Zheng, L., Zhuang, S., Zhuang, Y., Gonzalez, J. E., and et al. Vicuna: An open-source chatbot impressing gpt-4
362
+
363
+ with $90\%$ chatgpt quality. https://vicuna.lmsys.org, 2023.
364
+ Cowan, E. T., Schapiro, A. C., Dunsmoor, J. E., and Murty, V. P. Memory consolidation as an adaptive process. Psychonomic Bulletin & Review, 28:1796-1810, 2021. doi: 10.3758/s13423-021-01978-x. URL https://doi.org/10.3758/s13423-021-01978-x.
365
+ Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., Uszkoreit, J., and Houlsby, N. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021.
366
+ Dudai, Y., Karni, A., and Born, J. The consolidation and transformation of memory. Neuron, 88:20-32, 2015.
367
+ Fang, Y., Wang, W., Xie, B., Sun, Q., Wu, L., Wang, X., Huang, T., Wang, X., and Cao, Y. Eva: Exploring the limits of masked visual representation learning at scale. 2022.
368
+ Farinhas, A., Martins, A. F. T., and Aguiar, P. M. Q. Multimodal continuous visual attention mechanisms. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV) Workshops, pp. 1047-1056, October 2021.
369
+ Frankland, P. W. and Bontempi, B. The organization of recent and remote memories. Nature Reviews Neuroscience, 6(2):119-130, 2005.
370
+ Franklin, N. T., Norman, K. A., Ranganath, C., Zacks, J. M., and Gershman, S. J. Structured event memory: A neurosymbolic model of event cognition. *Psychological Review*, 127(3):327-361, 2020. doi: 10.1037/rev0000177.
371
+ Fu, C., Dai, Y., Luo, Y., Li, L., Ren, S., Zhang, R., Wang, Z., Zhou, C., Shen, Y., Zhang, M., Chen, P., Li, Y., Lin, S., Zhao, S., Li, K., Xu, T., Zheng, X., Chen, E., Ji, R., and Sun, X. Video-mme: The first-ever comprehensive evaluation benchmark of multi-modal llms in video analysis, 2024.
372
+ Hardt, O., Einarsson, E. O., and Nader, K. A bridge over troubled water: reconsolidation as a link between cognitive and neuroscientific memory research traditions. Annual Review of Psychology, 61:141-167, 2010. doi: 10.1146/annurev.psych.093008.100455.
373
+ hwchase17. Langchain, 2023. URL https://github.com/hwchase17/langchain. Accessed: 2023-12-20.
374
+ Jiang, A. Q., Sablayrolles, A., Mensch, A., Bamford, C., Chaplot, D. S., de las Casas, D., Bressand, F., Lengyel,
375
+
376
+ G., Lample, G., Saulnier, L., Lavaud, L. R., Lachaux, M.-A., Stock, P., Scao, T. L., Lavril, T., Wang, T., Lacroix, T., and Sayed, W. E. Mistral 7b, 2023.
377
+ Jin, P., Takanobu, R., Zhang, C., Cao, X., and Yuan, L. Chat-univi: Unified visual representation empowers large language models with image and video understanding. arXiv preprint arXiv:2311.08046, 2023.
378
+ Li, J., Li, D., Savarese, S., and Hoi, S. BLIP-2: Bootstrapping language-image pre-training with frozen image encoders and large language models. In Proceedings of the 40th International Conference on Machine Learning, 2023a.
379
+ Li, K., He, Y., Wang, Y., Li, Y., Wang, W., Luo, P., Wang, Y., Wang, L., and Qiao, Y. Videochat: Chat-centric video understanding. arXiv preprint arXiv:2305.06355, 2023b.
380
+ Li, K., Wang, Y., Li, Y., Wang, Y., He, Y., Wang, L., and Qiao, Y. Unmasked teacher: Towards training-efficient video foundation models. 2023 IEEE/CVF International Conference on Computer Vision (ICCV), pp. 19891-19903, 2023c.
381
+ Li, K., Wang, Y., He, Y., Li, Y., Wang, Y., Liu, Y., Wang, Z., Xu, J., Chen, G., Luo, P., Wang, L., and Qiao, Y.
382
+ Mvbench: A comprehensive multi-modal video understanding benchmark, 2024. URL https://arxiv.org/abs/2311.17005.
383
+ Li, Y., Wang, C., and Jia, J. Llama-vid: An image is worth 2 tokens in large language models, 2023d.
384
+ Liu, H., Li, C., Wu, Q., and Lee, Y. J. Visual instruction tuning, 2023.
385
+ Liu, J., Wang, Y., Ma, H., Wu, X., Ma, X., Wei, X., Jiao, J., Wu, E., and Hu, J. Kangaroo: A powerful video-language model supporting long-context video input, 2024a.
386
+ Liu, R., Li, C., Tang, H., Ge, Y., Shan, Y., and Li, G. St-llm: Large language models are effective temporal learners, 2024b.
387
+ Liu, Z., Zhu, L., Shi, B., Zhang, Z., Lou, Y., Yang, S., Xi, H., Cao, S., Gu, Y., Li, D., Li, X., Fang, Y., Chen, Y., Hsieh, C.-Y., Huang, D.-A., Cheng, A.-C., Nath, V., Hu, J., Liu, S., Krishna, R., Xu, D., Wang, X., Molchanov, P., Kautz, J., Yin, H., Han, S., and Lu, Y. Nvila: Efficient frontier visual language models, 2024c.
388
+ Luo, R., Zhao, Z., Yang, M., Dong, J., Qiu, M., Lu, P., Wang, T., and Wei, Z. Valley: Video assistant with large language model enhanced ability, 2023.
389
+ Ma, W., Husain, M., and Bays, P. Changing concepts of working memory. Nature Neuroscience, 17:347-356,
390
+
391
+ 2014. doi: 10.1038/nn.3655. URL https://doi.org/10.1038/nn.3655.
392
+ Maaz, M., Rasheed, H., Khan, S., and Khan, F. S. Videochatgpt: Towards detailed video understanding via large vision and language models. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (ACL 2024), 2024.
393
+ Mangalam, K., Akshulakov, R., and Malik, J. Egoschema: A diagnostic benchmark for very long-form video language understanding. arXiv preprint arXiv:2308.09126, 2023.
394
+ Martins, A., Farinhas, A., Treviso, M., Niculae, V., Aguiar, P., and Figueiredo, M. Sparse and continuous attention mechanisms. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M., and Lin, H. (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 20989-21001. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper_files/paper/2020/file/f0b76267fbe12b936bd65e203dc675c1-Paper.pdf.
395
+ Martins, A. F. T., Treviso, M., Farinhas, A., Aguiar, P. M. Q., Figueiredo, M. A. T., Blondel, M., and Niculae, V. Sparse continuous distributions and fenchel-young losses. Journal of Machine Learning Research, 23(257): 1-74, 2022a. URL http://jmlr.org/papers/v23/21-0879.html.
396
+ Martins, P. H., Marinho, Z., and Martins, A. F. $\infty$ -former: Infinite memory transformer. In Proc. ACL, 2022b.
397
+ McGaugh, J. Making lasting memories: Remembering the significant. Proceedings of the National Academy of Sciences of the United States of America, 110:10402-10407, 2013. doi: 10.1073/pnas.1301209110. URL https://doi.org/10.1073/pnas.1301209110.
398
+ McNamee, D. C. The generative neural microdynamics of cognitive processing. Current Opinion in Neurobiology, 85:102855, 2024. doi: 10.1016/j.conb.2024.102855. Epub 2024 Feb 29.
399
+ OpenAI, Achiam, J., Adler, S., Agarwal, S., Ahmad, L., Akkaya, I., Aleman, F. L., Almeida, D., Altenschmidt, J., Altman, S., Anadkat, S., Avila, R., Babuschkin, I., Balaji, S., Balcom, V., Baltescu, P., Bao, H., Bavarian, M., Belgium, J., Bello, I., Berdine, J., Bernadett-Shapiro, G., Berner, C., Bogdonoff, L., Boiko, O., Boyd, M., Brakman, A.-L., Brockman, G., Brooks, T., Brundage, M., Button, K., Cai, T., Campbell, R., Cann, A., Carey, B., Carlson, C., Carmichael, R., Chan, B., Chang, C., Chantzis, F., Chen, D., Chen, S., Chen, R., Chen, J., Chen, M., Chess, B., Cho, C., Chu, C., Chung, H. W., Cummings, D., Currier, J., Dai, Y., Decareaux, C., Degry, T., Deutsch, N.,
400
+
401
+ Deville, D., Dhar, A., Dohan, D., Dowling, S., Dunning, S., Ecoffet, A., Eleti, A., Eloundou, T., Farhi, D., Fedus, L., Felix, N., Fishman, S. P., Forte, J., Fulford, I., Gao, L., Georges, E., Gibson, C., Goel, V., Gogineni, T., Goh, G., Gontijo-Lopes, R., Gordon, J., Grafstein, M., Gray, S., Greene, R., Gross, J., Gu, S. S., Guo, Y., Hallacy, C., Han, J., Harris, J., He, Y., Heaton, M., Heidecke, J., Hesse, C., Hickey, A., Hickey, W., Hoeschele, P., Houghton, B., Hsu, K., Hu, S., Hu, X., Huizinga, J., Jain, S., Jain, S., Jang, J., Jiang, A., Jiang, R., Jin, H., Jin, D., Jomoto, S., Jonn, B., Jun, H., Kaftan, T., Lukasz Kaiser, Kamali, A., Kanitscheider, I., Keskar, N. S., Khan, T., Kilpatrick, L., Kim, J. W., Kim, C., Kim, Y., Kirchner, J. H., Kiros, J., Knight, M., Kokotajlo, D., Lukasz Kondraciuk, Kondrich, A., Konstantinidis, A., Kosic, K., Krueger, G., Kuo, V., Lampe, M., Lan, I., Lee, T., Leike, J., Leung, J., Levy, D., Li, C. M., Lim, R., Lin, M., Lin, S., Litwin, M., Lopez, T., Lowe, R., Lue, P., Makanju, A., Malfacini, K., Manning, S., Markov, T., Markovski, Y., Martin, B., Mayer, K., Mayne, A., McGrew, B., McKinney, S. M., McLeavey, C., McMillan, P., McNeil, J., Medina, D., Mehta, A., Menick, J., Metz, L., Mishchenko, A., Mishkin, P., Monaco, V., Morikawa, E., Mossing, D., Mu, T., Murati, M., Murk O. Melly, D. Nair A. Nakano R. Nayak R. Neelakantan A.NgoR.NohH.OuyangL.OKeefeC.Pachocki J. PainoA.PalermoJ.PantulianoA.Parascandolo G. Parish J. ParparitaE.PassosA.PavlovM.Peng A.PerelmanA.de Avila Belbute PeresF.PetrovM. de Oliveira Pinto,H.P.Michael Pokorny Pokrass,M. PongV.H. PowellT.PowerA.PowerB.ProehlE. Puri R.RadfordA.RaeJ.RameshA.RaymondC. Real,F. RimbachK.RossC.RotstedB.Roussez H.RyderN.SaltarelliM.SandersT.SanturkarS. SastryG.SchmidtH.SchnurrD.SchulmanJ.Selsam,D.Sheppard,K.Sherbakov,T.ShiehJ.Shoker S. ShyamP. Sidor,S. Sigler,E.SimensM.Sitkin J.SlamaK.SohlI.SokolowskyB.SongY.Staudacher N. Such F.P.Summers N. Sutskever I.Tang J. Tezak N.Thompson M.B.TilletP.Tootoonchian A.TsengE.TuggleP.TurleyN.TworekJ.UribeJ. F.C.ValloneA.VijayvergiyaA.VossC.Wainwright C.WangJ.J.WangA.WangB.WardJ.WeiJ. Weinmann C.WelihindaA.Welinder P.WengJ. WengL.WiethoffM.WillnerD.Winter C.Wolrich S.WongH.WorkmanL.WuS.WuJ.WuM. XiaoK.XuT.YooS.YuK.YuanQ.Zaremba W.ZellersR.ZhangC.ZhangM.ZhaoS.Zheng T.ZhuangJ.ZhukW.and ZophB.Gpt-4 technical report, 2024.
402
+ Preston, A. R. and Eichenbaum, H. The interplay of hippocampus and prefrontal cortex in memory-based decision making. Current Biology, 23(17):R764-R773, 2013.
403
+ Radvansky, G. A. and Zacks, J. M. Event Cognition. Oxford
404
+
405
+ University Press, New York, NY, 2014.
406
+ Shu, Y., Liu, Z., Zhang, P., Qin, M., Zhou, J., Liang, Z., Huang, T., and Zhao, B. Video-xl: Extra-long vision language model for hour-scale video understanding, 2024.
407
+ Song, E., Chai, W., Wang, G., Zhang, Y., Zhou, H., Wu, F., Guo, X., Ye, T., Lu, Y., Hwang, J.-N., et al. Moviechat: From dense token to sparse memory for long video understanding. arXiv preprint arXiv:2307.16449, 2023.
408
+ Song, E., Chai, W., Ye, T., Hwang, J.-N., Li, X., and Wang, G. Moviechat+: Question-aware sparse memory for long video question answering. arXiv preprint arXiv:2404.17176, 2024.
409
+ Strubell, E., Ganesh, A., and McCallum, A. Energy and policy considerations for deep learning in NLP. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 3645-3650, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1355. URL https://aclanthology.org/P19-1355.
410
+ Tulving, E. Episodic memory: From mind to brain. Annual Review of Psychology, 53:1-25, 2002. doi: 10.1146/annurev.psych.53.100901.135114. URL https://doi.org/10.1146/annurev.psych.53.100901.135114.
411
+ Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L. u., and Polosukhin, I. Attention is all you need. In Guyon, I., Luxburg, U. V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., and Garnett, R. (eds.), Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. URL https://proceedings.neurips.cc/paper_files/paper/2017/file/3f5ee243547dee91fbd053c1c4a845aa-Paper.pdf.
412
+ Wang, X., Zhang, Y., Zohar, O., and Yeung-Levy, S. Videoagent: Long-form video understanding with large language model as agent. European Conference on Computer Vision (ECCV), 2024a.
413
+ Wang, Y., Xie, C., Liu, Y., and Zheng, Z. Videollamb: Long video understanding with recurrent memory bridges. arxiv, 2024b.
414
+ Wang, Z., Yu, S., Stengel-Eskin, E., Yoon, J., Cheng, F., Bertasius, G., and Bansal, M. Videotree: Adaptive tree-based video representation for llm reasoning on long videos. arXiv preprint arXiv:2405.19209, 2024c.
415
+ Xiao, J., Shang, X., Yao, A., and Chua, T.-S. Next-qa: Next phase of question-answering to explaining temporal actions. In Proceedings of the IEEE/CVF conference on
416
+
417
+ computer vision and pattern recognition, pp. 9777-9786, 2021.
418
+ Ye, J., Xu, H., Liu, H., Hu, A., Yan, M., Qian, Q., Zhang, J., Huang, F., and Zhou, J. mplug-owl3: Towards long image-sequence understanding in multi-modal large language models, 2024.
419
+ Zhang, C., Lu, T., Islam, M. M., Wang, Z., Yu, S., Bansal, M., and Bertasius, G. A simple llm framework for long-range video question-answering, 2023a.
420
+ Zhang, H., Li, X., and Bing, L. Videollama: An instruction-tuned audio-visual language model for video understanding. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing (EMNLP 2023), 2023b.
421
+ Zhang, P., Zhang, K., Li, B., Zeng, G., Yang, J., Zhang, Y., Wang, Z., Tan, H., Li, C., and Liu, Z. Long context transfer from language to vision. arXiv preprint arXiv:2406.16852, 2024. URL https://arxiv.org/abs/2406.16852.
422
+ Zhu, D., Chen, J., Shen, X., Li, X., and Elhoseiny, M. Minigpt-4: Enhancing vision-language understanding with advanced large language models. arXiv preprint arXiv:2304.10592, 2023.
423
+
424
+ # A. Implementation Details and Hyperparameters
425
+
426
+ # A.1. Additional Implementation Details
427
+
428
+ Video LLaMA-Based Models. As discussed in §3, Video-LLaMA (Zhang et al., 2023b) serves as one of the adapted models in this work. It employs a cascade of two Q-formers—one for spatial feature extraction and the other for temporal feature extraction—with the latter enhanced by our LTM integration. The video Q-former and projection layer parameters are consistent with the Video-LLaMA-2-7B-Finetuned model (Zhang et al., 2023b), which was fine-tuned using instruction-tuning data from MiniGPT-4 (Zhu et al., 2023), LLaVA (Liu et al., 2023), and VideoChat (Li et al., 2023b). For visual feature extraction, we utilize the ViT-G/14 encoder from EVA-CLIP (Fang et al., 2022), while spatial dependency features rely on the Q-former from BLIP-2 (Li et al., 2023a). This lightweight ViT facilitates efficient processing of a large number of frames per chunk. The LLM used in this model is Vicuna-7B (Chiang et al., 2023).
429
+
430
+ Atreja et al. (2024) and our empirical validation have shown limitations in respecting the format of the multiple-choice answer asked by the prompt, influencing the accuracy of this method in multiple-choice datasets. To address this, and for these datasets we follow the approach of (Song et al., 2023; 2024) and provide our modified model, $\infty$ -Video LLaMA, exclusively with the questions in the prompt. Using LangChain (hwchase17, 2023), we calculate the similarity between $\infty$ -Video LLaMA's open-ended responses and the given options, selecting the option that best aligns with the expected answer.
431
+
432
+ VideoChat2-Based Models. Building on Video-LLaMA, we also evaluated our methods using VideoChat2 (Li et al., 2024), a more advanced short-video model. Like Video-LLaMA, it incorporates a video Q-former, but it benefits from additional instruction-tuning data (Li et al., 2024). For visual encoding, we use UMT-L (Li et al., 2023c), which captures both spatial and temporal features specifically designed for video data. This model's higher memory requirements necessitated the use of smaller frame chunks in our experiments. For the LLM component, we used the stage-3 Mistral-7B version of VideoChat2, which demonstrated the best performance in its original paper.
433
+
434
+ # A.2. Hyperparameters
435
+
436
+ We report in Tab. 4 the hyperparameters used in our experiments. For $\infty$ -Video LLaMA and for NeXT-QA we use all the frames available with variable number of chunks of 256 frames.
437
+
438
+ Table 4. Hyperparameters used in our $\infty$ -variants for the different datasets.
439
+
440
+ <table><tr><td rowspan="2">Parameter</td><td colspan="2">NeXT-QA</td><td colspan="2">Egoschema</td><td colspan="2">VideoMME</td><td colspan="2">MovieChat</td></tr><tr><td>∞-Video LLaMA</td><td>∞-VideoChat2</td><td>∞-Video LLaMA</td><td>∞-VideoChat2</td><td>∞-VideoChat2</td><td>∞-Video LLaMA</td><td>∞-VideoChat2</td><td></td></tr><tr><td># chunks</td><td>-</td><td>8</td><td>8</td><td>8</td><td>8</td><td>8</td><td>8</td><td></td></tr><tr><td># frames</td><td>all</td><td>16</td><td>256</td><td>16</td><td>16</td><td>256</td><td>256</td><td></td></tr><tr><td>N</td><td>256</td><td>256</td><td>1024</td><td>256</td><td>256</td><td>1024</td><td>256</td><td></td></tr><tr><td>τ</td><td>0.75</td><td>0.75</td><td>0.75</td><td>0.75</td><td>0.5</td><td>0.75</td><td>0.75</td><td></td></tr></table>
441
+
442
+ # A.3. Evaluation
443
+
444
+ We further show in List. 1, 2, 3, 4 the prompts used for evaluation on open-ended question answering tasks for the Moviechat dataset.
445
+
446
+ Listing 1. ChatGPT-3.5 prompt for the overall accuracy and score metric.
447
+ ```python
448
+ "role": "system",
449
+ "content":
450
+ "You are an intelligent chatbot designed for evaluating the correctness of generative outputs for question-answer pairs."
451
+ "Your task is to compare the predicted answer with the correct answer and determine if they match meaningfully. Here's how you can accomplish the task:"
452
+ "--"
453
+ "#INSTRUCTIONS: "
454
+ "-- Focus on the meaningful match between the predicted answer and the correct answer.\n"
455
+ "-- Consider synonyms or paraphrases as valid matches.\n"
456
+ "-- Evaluate the correctness of the prediction compared to the answer."
457
+ },
458
+ ```
459
+
460
+ ```txt
461
+ 4https://huggingface.co/OpenGVLab/VideoChat2_stage3_Mistral_7B
462
+ ```
463
+
464
+ ```txt
465
+ "role": "user",
466
+ "content":
467
+ "Please evaluate the following video-based question-answer pair:\n\nf"Question: {question}\n"f"Correct Answer: {answer}\n"f"Predicted Answer: {pred}\n"Provide your evaluation only as a yes/no and score where the score is an integer value between 0 and 5, with 5 indicating the highest meaningful match."Please generate the response in the form of a Python dictionary string with keys 'pred' and 'score', where value of 'pred' is a string of 'yes' or 'no' and value of 'score' is in STRING."DO NOT PROVIDE ANY OTHER OUTPUT TEXT OR EXPLANATION. Only provide the Python dictionary string."For example, your response should look like this: {'pred': 'yes', 'score': 4.8}."
468
+ ```
469
+
470
+ Listing 2. ChatGPT-3.5 prompt for the contextual understanding (CI) metric.
471
+ ```txt
472
+ "role": "system",
473
+ "content":
474
+ "You are an intelligent chatbot designed for evaluating the factual accuracy of generative outputs for video-based question-answer pairs."
475
+ "Your task is to compare the predicted answer with the correct answer and determine if they are factually consistent. Here's how you can accomplish the task:"
476
+ "---"
477
+ "##INSTRUCTIONS: "
478
+ "- Focus on the factual consistency between the predicted answer and the correct answer. The predicted answer should not contain any misinterpretations or misinformation.\n"
479
+ "- The predicted answer must be factually accurate and align with the video content.\n"
480
+ "- Consider synonyms or paraphrases as valid matches.\n"
481
+ "- Evaluate the factual accuracy of the prediction compared to the answer."
482
+ },
483
+ {
484
+ "role": "user",
485
+ "content":
486
+ "Please evaluate the following video-based question-answer pair:\n\nf"Question: {question}\n"
487
+ f"Correct Answer: {answer}\n"
488
+ f"Predicted Answer: {pred}\n"
489
+ "Provide your evaluation only as a factual accuracy score where the factual accuracy score is an integer value between 0 and 5, with 5 indicating the highest level of factual consistency."
490
+ "Please generate the response in the form of a Python dictionary string with keys 'score', where its value is the factual accuracy score in INTEGER, not STRING."
491
+ "Do NOT PROVIDE ANY OTHER OUTPUT TEXT OR EXPLANATION. Only provide the Python dictionary string."
492
+ "For example, your response should look like this: {'score': 4.8}.
493
+ ```
494
+
495
+ Listing 3. ChatGPT-3.5 prompt for the detailed orientation (DO) metric.
496
+ ```txt
497
+ "role": "system",
498
+ "content":
499
+ "You are an intelligent chatbot designed for evaluating the detail orientation of generative outputs for video-based question-answer pairs."
500
+ "Your task is to compare the predicted answer with the correct answer and determine its level of detail, considering both completeness and specificity. Here's how you can accomplish the task:"
501
+ "---"
502
+ "##INSTRUCTIONS: "
503
+ -- Check if the predicted answer covers all major points from the video. The response should not leave out any key aspects.\n"
504
+ -- Evaluate whether the predicted answer includes specific details rather than just generic points. It should provide comprehensive information that is tied to specific elements of the video.\n"
505
+ -- Consider synonyms or paraphrases as valid matches.\n"
506
+ -- Provide a single evaluation score that reflects the level of detail orientation of the prediction, considering both completeness and specificity."
507
+ },
508
+ {
509
+ "role": "user",
510
+ "content":
511
+ "Please evaluate the following video-based question-answer pair:\n\nf"Question:{question}\n"
512
+ f"Correct Answer:{answer}\n"
513
+ f"Predicted Answer:{pred}\n"
514
+ "Provide your evaluation only as a detail orientation score where the detail orientation score is an integer value between 0 and 5, with 5 indicating the highest level of detail orientation."
515
+ "Please generate the response in the form of a Python dictionary string with keys 'score', where its value is the detail orientation score in INTEGER, not STRING."
516
+ "Do NOT PROVIDE ANY OTHER OUTPUT TEXT OR EXPLANATION. Only provide the Python dictionary string."
517
+ "For example, your response should look like this: {'score': 4.8}.
518
+ ```
519
+
520
+ Listing 4. ChatGPT-3.5 prompt for the contextual understanding (CU) metric.
521
+ ```txt
522
+ "role": "system",
523
+ "content":
524
+ "You are an intelligent chatbot designed for evaluating the contextual understanding of generative outputs for video-based question-answer pairs."
525
+ "Your task is to compare the predicted answer with the correct answer and determine if the generated response aligns with the
526
+ ```
527
+
528
+ ```txt
529
+ overall context of the video content. Here's how you can accomplish the task:"
530
+ "--------"
531
+ "##INSTRUCTIONS:
532
+ "Evaluate whether the predicted answer aligns with the overall context of the video content. It should not provide information that is out of context or misaligned.\n"
533
+ "The predicted answer must capture the main themes and sentiments of the video.\n"
534
+ "Consider synonyms or paraphrases as valid matches.\n"
535
+ "Provide your evaluation of the contextual understanding of the prediction compared to the answer."
536
+ },
537
+ "role": "user",
538
+ "content":
539
+ "Please evaluate the following video-based question-answer pair:\n\nf"Question:{question}\n"
540
+ f"Correct Answer:{answer}\n"
541
+ f"Predicted Answer:{pred}\n"
542
+ "Provide your evaluation only as a contextual understanding score where the contextual understanding score is an integer value between 0 and 5, with 5 indicating the highest level of contextual understanding."
543
+ "Please generate the response in the form of a Python dictionary string with keys 'score', where its value is contextual understanding score in INTEGER, not STRING."
544
+ "Do NOT PROVIDE ANY OTHER OUTPUT TEXT OR EXPLANATION. Only provide the Python dictionary string."
545
+ "For example, your response should look like this: \{'\'score':4.8\}.
546
+ ```
547
+
548
+ # B. Additional Experiments
549
+
550
+ # B.1. Ablation Studies on $\infty$ -Video LLaMA
551
+
552
+ ![](images/c88749596d4e02216dc627040721c61d7cc506e7861b09ac2887d755fb68d10e.jpg)
553
+ Figure 5. Ablation studies on the MovieChat dataset: Evaluation of accuracy and score metrics for various values of the number of basis functions $N$ and the contribution of long-term memory $\alpha$ .
554
+
555
+ In this section, we conduct ablation studies on $\infty$ -Video LLaMA on the MovieChat dataset. We ablate three hyperparameters: the percentage of the long-term memory used $\alpha$ , the number of basis functions $N$ and the sampling method. We explore $\alpha \in \{0, 0.25, 0.5, 0.75, 0.95, 1\}$ , covering the full spectrum from exclusively using the LTM ( $\alpha = 0$ ) to exclusively using the STM ( $\alpha = 1$ ). Additionally, we vary the number of basis functions with $N \in \{128, 256, 512, 1024\}$ to evaluate the impact of this parameter on performance and vary the sampling as either uniform or sticky.
556
+
557
+ Fig. 5 presents the accuracy and score provided by ChatGPT 3.5 as functions of the explored hyperparameters. The results reveal a general trend of increasing accuracy and score with $\alpha$ , up to a certain point, after which a slight decline is observed as $\alpha$ approaches 1. This trend is somewhat explained by the inherent variability in ChatGPT's outputs. Additionally, both accuracy and score tend to be higher for sticky memories compared to uniform sampling from $\alpha = 0.75$ onward, whereas uniform sampling demonstrates superior performance for lower values of $\alpha$ . Another observed trend is that as the number of basis functions increases, both metrics improve. However, for uniform sampling, performance slightly decreases beyond $N = 512$ .
558
+
559
+ ![](images/874b5d47a3453cab28ac6c66ab07ea81cb82a0eb6599ec4dc767a77fd6129439.jpg)
560
+ Figure 6. Highest continuous attention density frames selected using uniform memories in the Interstellar trailer for $\infty$ -Video LLaMA across 3 chunks. (Left) Interval: $[0, \tau^2]$ . (Middle) Interval: $(\tau^2, \tau]$ . (Right) Interval: $(\tau, 1]$ .
561
+
562
+ # B.2. Qualitative Analysis
563
+
564
+ In Fig. 6, we illustrate the attention density as a function of the number of frames for the uniform sampling LTM configuration, using $\alpha = 0.9$ , $N = 256$ , and $\tau = 0.5$ . This analysis spans 3 chunks of 256 frames each, corresponding to 3 contraction steps. Additionally, we showcase representative frames from high-density regions by identifying the top 10 frames in each interval and selecting non-redundant examples.
565
+
566
+ The results reveal that, while the model effectively identifies key moments during the first two contraction steps, it disproportionately focuses on the credits scene in the final step. This behaviour contrasts with the results in Fig. 4, where such focus is avoided.
567
+
568
+ We leave in Fig. 7 additional examples of predictions of our modified $\infty$ -Video LLaMA. We divide the video into 8 chunks of 256 frames with $N = 1024$ , $\tau = 0.75$ and $\alpha = 0.9$ both for uniform sampling and sticky memories.
569
+
570
+ ![](images/3d19230629798ff8b397eb5181f601ad589d1def03681c0bf75cf066645419cd.jpg)
571
+ Figure 7. Examples of $\infty$ -Video LLaMA answers with uniform sampling and sticky memories for short and ultra-long videos. Italicized corresponds to the correct answer while underlined corresponds to the wrong answer or hallucination.
2025/$∞$-Video_ A Training-Free Approach to Long Video Understanding via Continuous-Time Memory Consolidation/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6304d19a34f3545403224930356888cff2de42ac28c3defb792a1cc1c487ef21
3
+ size 874635
2025/$∞$-Video_ A Training-Free Approach to Long Video Understanding via Continuous-Time Memory Consolidation/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/(How) Can Transformers Predict Pseudo-Random Numbers_/3bbdd284-a0d6-49bf-8936-4fb5fce85525_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/(How) Can Transformers Predict Pseudo-Random Numbers_/3bbdd284-a0d6-49bf-8936-4fb5fce85525_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/(How) Can Transformers Predict Pseudo-Random Numbers_/3bbdd284-a0d6-49bf-8936-4fb5fce85525_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1c32fbf53d0921ab7af11e69246c09e795054b6c32551518b7549721a831b633
3
+ size 18564027
2025/(How) Can Transformers Predict Pseudo-Random Numbers_/full.md ADDED
@@ -0,0 +1,832 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # (How) Can Transformers Predict Pseudo-Random Numbers?
2
+
3
+ Tao Tao\*1 Darshil Doshi\*1 Dayal Singh Kalra\*2 Tianyu He\*1 Maisam Barkeshli 13
4
+
5
+ {tao2021, ddoshi, dayal, tianyuh, maissam}@umd.edu
6
+
7
+ # Abstract
8
+
9
+ Transformers excel at discovering patterns in sequential data, yet their fundamental limitations and learning mechanisms remain crucial topics of investigation. In this paper, we study the ability of Transformers to learn pseudo-random number sequences from linear congruential generators (LCGs), defined by the recurrence relation $x_{t + 1} = ax_t + c \mod m$ . We find that with sufficient architectural capacity and training data variety, Transformers can perform in-context prediction of LCG sequences with unseen moduli ( $m$ ) and parameters ( $a, c$ ). By analyzing the embedding layers and attention patterns, we uncover how Transformers develop algorithmic structures to learn these sequences in two scenarios of increasing complexity. First, we investigate how Transformers learn LCG sequences with unseen ( $a, c$ ) but fixed modulus; and demonstrate successful learning up to $m = 2^{32}$ . We find that models learn to factorize $m$ and utilize digit-wise number representations to make sequential predictions. In the second, more challenging scenario of unseen moduli, we show that Transformers can generalize to unseen moduli up to $m_{\mathrm{test}} = 2^{16}$ . In this case, the model employs a two-step strategy: first estimating the unknown modulus from the context, then utilizing prime factorizations to generate predictions. For this task, we observe a sharp transition in the accuracy at a critical depth $d = 3$ . We also find that the number of in-context sequence elements needed to reach high accuracy scales sublinearly with the modulus.
10
+
11
+ *Equal contribution – authors listed in pseudo-random order.
12
+ <sup>1</sup>Department of Physics, University of Maryland, College Park, USA <sup>2</sup>Department of Computer Science, University of Maryland, College Park, USA <sup>3</sup>Joint Quantum Institute, University of Maryland, College Park, USA. Correspondence to: Maisam Barkeshli <maissam@umd.edu>.
13
+
14
+ Proceedings of the $42^{nd}$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
15
+
16
+ We open source the code to reproduce our results: https://
17
+
18
+ # 1. Introduction
19
+
20
+ Transformer-based language models have proven to be extremely powerful sequence generative models. With copious amounts of training data and computational resources, they can identify and learn complex patterns from training corpora, resulting in numerous remarkable capabilities (Vaswani et al., 2017; Dosovitskiy et al., 2021). Recent research has demonstrated that these models, when provided with sufficient context and inference compute, can acquire new patterns and capabilities without additional training through techniques such as in-context learning (Radford et al., 2019) and chain-of-thought reasoning (Wei et al., 2023). While these models have achieved unprecedented success, understanding what underlying patterns are learned and how they learn them remains a significant challenge. Pseudo-Random Number Generators (PRNGs) represent an interesting test case for exploring these challenges. These algorithms, which are fundamental to modern cryptography and computer science, are designed to produce outputs that pass statistical tests for randomness, but nevertheless arise from mathematical patterns that could potentially be learned by sufficiently powerful sequence models.
21
+
22
+ This intersection between Transformer models' pattern-learning capabilities and the structured yet obfuscated nature of PRNG outputs raises intriguing questions about both the capabilities and limitations of these models. Can Transformers learn to predict PRNG outputs given sufficient training data, model capacity, and context? If so, what implications does this have for our understanding of both Transformer architectures and PRNGs? Do the Transformers learn the underlying generating algorithm or merely detect shortcuts and spurious patterns? What effect do model capacity, data variety, training methodologies, and context length have on the capabilities of Transformers?
23
+
24
+ This work aims to answer these questions by focusing on learning sequences obtained from linear congruential generators (LCGs) using GPT-style autoregressive Transformers. We demonstrate how Transformers can successfully learn LCGs with moduli up to $m = 2^{32}$ . We perform interpretability analyses, uncovering emergent structures in
25
+
26
+ the embedding layers, attention heads, and underlying algorithms that the Transformer uses to learn the sequences. We also perform several systematic scaling analyses to understand the effect of architecture and sequence complexity on model performance and in-context learning ability.
27
+
28
+ # 1.1. Related works
29
+
30
+ Our study on the learnability of PRNGs for Transformers touches on several modern and classic topics.
31
+
32
+ Interpretability and Modular Arithmetic: A growing body of work examines the circuits, algorithms and structures learned by Transformers (Sharkey et al., 2025; Olsson et al., 2022; Ahn et al., 2023; von Oswald et al., 2023; Akyurek et al., 2023; Hendel et al., 2023; Liu et al., 2024). A notably fruitful setting involves simple modular arithmetic problems (Power et al., 2022; Gromov, 2023; Nanda et al., 2023; Zhong et al., 2023; Doshi et al., 2024a;b; He et al., 2024). Our work adds to this by reverse-engineering the underlying algorithms and uncovering emergent structures in learning pseudo-random number sequences.
33
+
34
+ **Cracking PRNGs:** There is a classic duality between cryptography and learning theory (Rivest, 1991), and cracking PRNGs is an important topic in cryptography. Nevertheless, deep learning-based attacks have received limited attention in the post-Transformer era. Amigo et al. (2021) demonstrated that a fully-connected neural network can predict the outputs of a modified LCG with fixed (irrational) parameters $(a, c, m) = (1, \pi, 1)$ . In comparison, we systematically analyze the harder cases of unseen parameters using Transformers, reverse-engineer the learned algorithms, and study effects of scale and complexity.
35
+
36
+ Formal Grammars: LCG can also be viewed as a formal language (Type-3 regular grammar) lying within the Chomsky hierarchy (Chomsky, 1956). Formal languages provide an interesting setting for synthetic datasets that can be used to understand the properties of neural networks in controlled settings (Delétang et al., 2023; Allen-Zhu & Li, 2024; Cagnetta et al., 2024; Cagnetta & Wyart, 2024).
37
+
38
+ Chaotic time-series: A major application of neural networks is predicting time-series for chaotic dynamics, such as weather prediction (Lam et al., 2023) and financial modeling. PRNGs provide an analog of such dynamics in the discrete setting.
39
+
40
+ # 1.2. Linear Congruential Generators
41
+
42
+ LCG is a simple PRNG that generates the next number in a sequence $(x_0, x_1, \ldots, x_t)$ according to the map:
43
+
44
+ $$
45
+ x _ {t + 1} = \left(a x _ {t} + c\right) \mod m, \tag {1}
46
+ $$
47
+
48
+ where $m > 0$ is the modulus, $0 < a < m$ is the multiplier and $0 \leq c < m$ is referred to as the increment. An LCG map
49
+
50
+ is uniquely defined by the choice of $m, a, c$ and the initial seed $x_0$ . An important quantity that determines the complexity of an LCG sequence is its period: $1 \leq \mathcal{T}_m(a, c) \leq m$ . As we will show in the following sections, the period of a sequence plays a major role in the difficulty of prediction with Transformers. According to the Hull-Dobell Theorem (Hull & Dobell, 1962), the period $\mathcal{T}_m(a, c) = m$ if and only if the values of $a$ and $c$ satisfy the following criteria: (i) $m$ and $c$ are coprime, (ii) $a - 1$ is divisible by all prime factors of $m$ , (iii) $a - 1$ is divisible by 4 if $m$ is divisible by 4. We evaluate (test) all our models exclusively on sequences that obey the criteria of this theorem.
51
+
52
+ LCGs are widely utilized for their speed and simplicity, often forming the core of more complex PRNGs like PCG-64, which is used in NumPy. LCGs perform poorly at small bit sizes but improve rapidly with larger state sizes. For instance, an LCG with 88 bits of state can pass the stringent BigCrush randomness test (O'Neill, 2014).
53
+
54
+ # 2. Training Setup
55
+
56
+ We train decoder-only Transformers to autoregressively predict the next number in LCG sequences. This means it takes as input an LCG sequence $(x_0, \dots, x_{L-1})$ , outputs a sequence $(y_0, \dots, y_{L-1})$ , and trained so $y_t$ matches $x_{t+1}$ .
57
+
58
+ To predict an unknown LCG sequence, the Transformer needs to infer $m$ , $a$ , and $c$ in-context. We test the model's generalization ability in two distinct paradigms of increasing difficulty: FM: The model is trained and tested on sequences with a fixed modulus $m$ . UM: Model is trained on varying moduli, and tested on unseen moduli $M_{\mathrm{test}} = \{m_{\mathrm{test}}\}$ . We highlight the key details of our experimental setups here and provide an extensive discussion in Appendix A.
59
+
60
+ # 2.1. Dataset Generation and Evaluation
61
+
62
+ The settings below are used in Sections 3 and 4. In order to achieve better performance, we used a larger and higher-quality dataset in Section 5, which we detail later.
63
+
64
+ Fixed Modulus (FM): Given a modulus $m$ , we apply the Hull-Dobell Theorem to determine the possible values of $(a, c)$ that maximize the period. We then randomly select 64 values of $a$ and $c$ to generate the test dataset. To generate the training dataset, we exclude these test choices of $(a, c)$ and uniformly sample $N = 100,000$ LCG sequences of length $L + 1$ (where $L$ is the context length), with $n_a$ values of multipliers and $n_c$ values of increments. For each set of parameters $(a, c)$ , we sample an LCG sequence with a randomly selected initial seed $x_0$ . Note that the training dataset includes sequences with varying periods, while the test data only contains sequences that maximize the period.
65
+
66
+ Generalization to Unseen Modulus (UM): In this more
67
+
68
+ challenging paradigm, we first select a set of test moduli $M_{\mathrm{test}} = \{m_{\mathrm{test}}\}$ that would be reserved exclusively for evaluation. For each test modulus $m_{\mathrm{test}} \in M_{\mathrm{test}}$ , we determine the values of $(a,c)$ that maximize the period. We then randomly select 64 values of $a$ and $c$ each to generate the test dataset. These $64^2$ $(a,c)$ pairs are not considered while generating the training dataset.
69
+
70
+ For the training dataset generation, we sample $n_m$ modulus values from the range $[L, m_{\max}]$ , with $m_{\max} = \lfloor 1.2 \max(M_{\mathrm{test}}) \rfloor$ , while excluding all the values in $M_{\mathrm{test}}$ . For each modulus value $m$ , we uniformly select $n_a$ multipliers and $n_c$ increments, excluding the ones reserved for testing. For each triplet $(a, c, m)$ , we generate a sequence of length $L + 1$ using a randomly selected initial seed $x_0$ . This results in a total of $N = n_m \times n_a \times n_c$ training sequences.
71
+
72
+ We found that $n_m \gtrsim m_{\mathrm{test}} / 4$ yields good generalization performance. Based on this relationship and our target total number of training examples $N$ , we sample $n_a = n_c = \sqrt{\frac{N}{m_{\mathrm{test}} / 4}}$ values of multipliers and increments. Unless explicitly specified, we use this setting as the default configuration for all experiments.
73
+
74
+ In both paradigms, test accuracy is averaged over all $(a,c)$ test pairs and multiple initial seeds $x_0$ per pair. Accuracies are tracked at all sequence positions $1\leq t\leq L$
75
+
76
+ # 2.2. Tokenization, Architecture, and Optimizer
77
+
78
+ In Sections 3 and 4, each number is tokenized as a unique token, using a dictionary of size $m$ (FM) or $m_{\max}$ (UM). We employ GPT-style Transformers with learnable positional embeddings and weight tying (Press & Wolf, 2017).
79
+
80
+ When we scale up to larger moduli in Section 5, we restrict the dictionary size to $b$ by tokenizing each number in the sequence in base- $b$ (e.g. $b = 2^8$ , $3^5$ ). This results in $\lceil \log_b m \rceil$ tokens for each number. We also apply (modified) abacus positional embeddings (McLeish et al., 2024).
81
+
82
+ The model architecture is characterized by the number of blocks (depth), embedding dimension ( $d_{\mathrm{model}}$ ), number of attention heads ( $n_{\mathrm{heads}}$ ). Models are trained with AdamW (Loshchilov & Hutter, 2019) and CrossEntropy loss.
83
+
84
+ # 3. Training Results
85
+
86
+ We begin by investigating the minimal model that can solve the two tasks in consideration. Surprisingly, we found that Transformers only require one layer and one attention head to learn the FM task, as shown in Figure 2 (a) (for further results, see Appendix B). Conversely, the UM task requires a stronger architecture and careful hyperparameter tuning. Appendix C shows that model performance depends on the modulus, with prime moduli being challenging in the FM
87
+
88
+ ![](images/8d59bafd25dd73d6d72511072eafcc2294bdab395d7291c7739fc8b6c6097ddb.jpg)
89
+ Figure 1. Accuracy of predicting the last number (token) in the sequence: phase diagrams w.r.t. various depths and $n_{\mathrm{heads}}$ values. (a) $m_{\mathrm{test}} = 2048$ , constant width: $d_{\mathrm{model}} = 768$ . (b) $m_{\mathrm{test}} = 4096$ , width scaled proportionally: $d_{\mathrm{model}} = 128 \times n_{\mathrm{heads}}$ .
90
+
91
+ ![](images/a7be3f664413a1d1125f2e99526fd3d11bdff4ba41cdd7b46e208f0b16b8011c.jpg)
92
+
93
+ setting but not in the UM setting.
94
+
95
+ In Figure 1 we show how the performance varies with model depth and the number of attention heads. In Figure 1(a) we keep the embedding dimension fixed to $d_{\mathrm{model}} = 768$ , whereas in Figure 1(b) we scale it proportionally to the number of heads ( $d_{\mathrm{model}} = 128 \times n_{\mathrm{heads}}$ ). In both cases, we find that a minimum of three layers are required for effective generalization, with performance degrading sharply below this threshold. Further analysis across multiple $m_{\mathrm{test}}$ values (see Appendix D) confirms that this minimal depth requirement is universal. We also observe that additional attention heads improve model performance, with substantial gain occurring when increasing from one to two heads.
96
+
97
+ Several prior studies have also observed sharp changes in model capabilities as a function of model depth. This includes induction head formation (Olsson et al., 2022), in-context learning of modular addition (He et al., 2024) and various in-context generalization tasks (Chen & Zou, 2024). In general it is unclear to what extent these sharp depth-dependences are due to jumps in expressivity or trainability.
98
+
99
+ The UM task shows strong sensitivity to hyperparameters. As we increase $m_{\mathrm{test}}$ while keeping the model size fixed, we observe two key phenomena: the optimal learning rate $(\eta)$ and weight decay strength $(\lambda)$ shift significantly, and simultaneously, the range of hyperparameter resulting in effective performance narrows (see Appendix A.5).
100
+
101
+ We then carefully examine the training dynamics in both FM and UM settings (Figure 2). We categorize the training sequences into two groups: i) sequences with periods shorter than the context length, which can be solved through simple copying, and ii) sequences with periods longer than the context length, which require the model to deduce underlying rules for prediction. Our analysis reveals that the model first acquires copying ability for group i) in the early stages of training, and later "groks" the solution for group ii) (Power et al., 2022). Notably, the model's ability to generalize to test modulus $m_{\mathrm{test}}$ emerges simultaneously with this grokking phenomenon. These results demonstrate that
102
+
103
+ ![](images/b575e65bd176777b9f8354f87207b5c41d2d3c854f3ba1c91be2de5760b89402.jpg)
104
+ Figure 2. Training/test accuracy curves for predicting last number (token). (a) FM: $(m = 2048, \text{depth} = 1, n_{\text{heads}} = 1, d_{\text{model}} = 768)$ Test accuracy "groks" when training accuracy reaches near $100\%$ . (b) UM: $(m_{\text{test}} = 2048, \text{depth} = 6, n_{\text{heads}} = 4, d_{\text{model}} = 768)$ Test accuracy "groks" simultaneously with training accuracy on sequences with period longer than context length $(T_m > L = 256)$ , indicating delayed discovery of underlying rules.
105
+
106
+ ![](images/e5d9e8eb415a835c9851b9861a920fc837c6883e4ed9106c5c4b81b409da54ca.jpg)
107
+
108
+ the model develops different capabilities at distinct stages of training, with generalization ability emerging only after the model learns the underlying rules through solving the more challenging sequences. In Appendix E, we present an ablation study where models are trained exclusively on either short-period or long-period sequences. Our findings indicate that training exclusively on long-period sequences enables model generalization.
109
+
110
+ # 4. Interpreting How Transformers Predict PRNGs
111
+
112
+ In this section, we uncover the underlying algorithms implemented by the models for both FM and UM cases. While certain details of the algorithms differ in the two cases, they share common properties originating from the underlying LCG structure. We first discuss properties of LCG sequences that will be useful in interpreting model behaviors.
113
+
114
+ # 4.1. Residual Number System Representations
115
+
116
+ Consider an LCG sequence with modulus $m = 2048 = 2^{11}$ . Each number in this sequence can be represented as an 11-digit binary number:
117
+
118
+ $$
119
+ x \bmod 2 ^ {1 1} = \alpha_ {0} 2 ^ {0} + \alpha_ {1} 2 ^ {1} + \dots + \alpha_ {1 0} 2 ^ {1 0}, \tag {2}
120
+ $$
121
+
122
+ where $\{\alpha_0,\dots ,\alpha_{10}\}$ are the binary-valued digits (bits).
123
+
124
+ A useful property of LCGs with modulus $m = 2^{(\cdot)}$ is that each digit in the binary representation has a fixed period along the sequence. As shown in Figure 3, for a sequence of period $\mathcal{T}_m = m = 2^{11}$ , the $w^{th}$ lowest digit has a period of $2^w$ (Knuth, 1997). Thus, lower (higher) digits have smaller (larger) periods along LCG sequences. (See Appendix F.1 for a detailed derivation.) We will see later that trained Transformers have emergent structures that find these binary representations and utilize them to make systematic predictions from the context. Notably, the per-digit period plays an important role in the prediction accuracy of that
125
+
126
+ ![](images/227ddb782717cd3a9e7e13548813b736a2280a32e130d0d46e568efc87da225e.jpg)
127
+
128
+ ![](images/d59d11225bdb06fc4e089588245f79583a216e6ab00309535046eb26625ebc10.jpg)
129
+ Figure 3. Bit-wise periods in an example LCG sequence generated with $m = 2048$ , $a = 293$ , $c = 1033$ , which follows the Hull-Dobell theorem. In binary representation $w$ -th lowest bit has a period of $2^w$ , for $w \in \{1, \ldots, 11\}$ . Writing a new sequence by skipping every 2nd step ( $r = 2$ ) reduces the periods of all the bits by a factor of 2, rendering the lowest bit constant. $r = 2^k$ reduces bit-wise periods by a factor of $2^k$ , with last $k$ digits constant.
130
+
131
+ digit. To understand this, consider the $r$ -step iteration of Equation (1):
132
+
133
+ $$
134
+ x _ {t + r} = a ^ {r} x _ {t} + \sum_ {i = 1} ^ {r} a ^ {i - 1} c \mod m. \tag {3}
135
+ $$
136
+
137
+ In this new sequence wherein we skip $r$ steps, the period of each digit $\alpha_{w-1}$ reduces from $2^w$ to $2^w / \gcd(r, 2^w)$ . Consequently, the higher digits become relatively simpler to predict due to reduced periods while some lower digits become trivial to predict due to being constant along this new sequence. We demonstrate this for $m = 2048$ in Figure 3 (top panel). The digit-wise periods in the new sequence with $r = 2$ are reduced by a factor of 2, while the last digit is simply constant. Higher values of $r = 2^k$ will lead to even further simplifications of the sequence. Transformers can simplify the task of predicting LCG sequences by utilizing $r$ -step iterations from the in-context examples – with longer contexts leading to larger values of $r$ . Consequently, the per-digit and overall accuracies improve substantially with context (see Figure 4).
138
+
139
+ While moduli of the form $m = 2^{(\cdot)}$ lead Transformers to find binary representations, similar simplifications in composite moduli require more general representations of the Residual Number System (RNS) (Garner, 1959). RNS represents numbers by their values modulo pairwise coprime factorizations of $m$ . Specifically, consider sequences with a composite modulus $m$ , which has a prime factorization $m = p_1^{w_1}p_2^{w_2}\dots p_q^{w_q}$ . In this case, we can uniquely represent each number $(x\bmod m)$ as the tuple of residuals $(x\bmod p_1^{w_1},x\bmod p_2^{w_2},\ldots ,x\bmod p_q^{w_q})$ . Analogous to Equation (2), we can further decompose each residual,
140
+
141
+ $$
142
+ x \bmod p _ {j} ^ {w _ {j}} = \alpha_ {j, 0} p _ {j} ^ {0} + \alpha_ {j, 1} p _ {j} ^ {1} + \dots + \alpha_ {j, w _ {j} - 1} p _ {j} ^ {w _ {j} - 1} \tag {4}
143
+ $$
144
+
145
+ where $\alpha_{j,w} \in \{0,1,\dots,p_j - 1\}$ are base- $p_j$ digits. We refer to $\{\alpha_{j,w}\}$ as the "RNS representation" in the remainder of the text. When $\mathcal{T}_m = m$ , each digit $\alpha_{j,w}$ has a period of $p_j^w$ (derivation in Appendix F.2). The $r$ step iteration Equation (3) reduces the period of each digit $\alpha_{j,w}$ from $p_j^w$ to $p_j^w / \gcd(r, p_j^w)$ . This results in simplification of the prediction task whenever $r = p_1^{k_1} p_2^{k_2} \cdots p_q^{k_q}$ . We will see that identifying the RNS representations is a key simplification that the Transformer discovers in learning LCG sequences.
146
+
147
+ # 4.2. Interpretability: Fixed Modulus
148
+
149
+ # Qualitative Algorithm (fixed modulus):
150
+
151
+ i. Find RNS representations of inputs from the learned prime factorization of $m$
152
+ ii. Look back $r = p_j^k$ steps in the context and copy the lowest $k$ digits, for different prime factors $(p_j)$ of $m$
153
+ iii. Using these $r$ -step iterations, predict the higher digits of the simplified sequence
154
+
155
+ We now discuss the algorithm implemented by Transformers trained on LCG with a fixed modulus. We will show that, despite being provided integers as inputs, the model develops emergent structures that create and leverage the RNS representation of the inputs. We will focus on the setup with a 1-layer, single-head Transformer trained on LCG with $m = 2048$ . Similar results for composite moduli (e.g. $m = 7776$ ) and different model sizes are presented in Appendix G. We emphasize that this algorithm works for arbitrary $a, c, x_0$ for a given $m$ .
156
+
157
+ ![](images/3205363ba90a97788eade4b03c6d7f9c391a198c315c02c9138bb01d65a85bc7.jpg)
158
+ Figure 4. FM: Test accuracy for $m = 2048$ , depth $= 1$ , $n_{\mathrm{heads}} = 1$ , $d_{\mathrm{model}} = 768$ , averaged over $a, c$ , and seeds. (a) Test accuracy w.r.t. token positions. Ladder-like structure appears, with jumps occurring at $2^{k}$ -th positions. (b) We represent numbers as an eleven-digit binary number ( $2048 = 2^{11}$ ) and compute the per-digit test accuracy of model predictions.
159
+
160
+ ![](images/7dcb10a50a045be1e6a46ab560beec239f6e56bda3e59bb65505e43e9320d23f.jpg)
161
+ Figure 5. FM: $(a = 1589, c = 629)$ Embedding layer. (a1) 1st principal component groups the numbers mod 2. (a2) 2nd and 3rd principal components group numbers mod 4. (b) Embedding vectors of different numbers exhibit high cosine similarity when they are spaced $2^k$ apart, with the similarity increasing with $k$ .
162
+
163
+ We begin by analyzing the average accuracy of a trained
164
+
165
+ Transformer model as a function of token position along the context, shown in Figure 4 (a). (Recall that in this section a token corresponds to an integer of the LCG sequence). The accuracy exhibits a ladder-like structure, with each jump occurring exactly at the $2^{k}$ -th token position. These successive transitions can be explained using binary representations and $r$ -step recurrence (Equation (3)). Specifically, to predict the token at position $t \geq 2^{k}$ , the model can look back in the context at position $t - 2^{k}$ and implement $r = 2^{k}$ -step iteration. This allows the model to (i) copy the lowest $k$ bits since they remain unchanged; and (ii) simplify the higher bits, since their periods get reduced by a factor $2^{k}$ . We note that the accuracy trend remains unchanged across different choices of $a$ and $x_{0}$ (see Figure 21).
166
+
167
+ Next, in Figure 4(b), we compute the per-digit accuracy by converting both model predictions and ground truth labels to their binary representations according to Equation (2). We observe that the model can predict more digits correctly with more context, with sharp transitions occurring at $2^{k}$ -th token positions. This is a direct result of the sequences becoming increasingly more simplified as the model can look farther back in the context and utilize $(r = 2^{k})$ -step iterations. Since these simplifications occur in the form of digit-wise periods, Figure 4(b) serves as direct evidence that the model is internally developing and utilizing binary representations. The sequential learning of digits also explains the ladder-like structure of the accuracy in Figure 4(a). We find that the overall average accuracy (Figure 4(a)) multiplicatively depends on the per-digit accuracies (Figure 4(b)) (empirical proof in Figure 22(b))<sup>1</sup>
168
+
169
+ $$
170
+ \operatorname {a c c} _ {\text {o v e r a l l}} = \left(\operatorname {a c c} _ {\text {d i g i t 1}}\right) \left(\operatorname {a c c} _ {\text {d i g i t 2}}\right) \dots \left(\operatorname {a c c} _ {\text {d i g i t 1 1}}\right). \tag {5}
171
+ $$
172
+
173
+ Next, we investigate how various components of the model implement the algorithm outlined earlier this section.
174
+
175
+ ![](images/e42356d59e2af2c3b9dd16b35558f3c62ce5774085fba686c9ab91175296b30f.jpg)
176
+ (b) Cosine similarity of embedding vectors
177
+
178
+ ![](images/00496d0dbafc64f9a8ca2321355faa5f4f78ccef30b042a4f01a51637d24c861.jpg)
179
+
180
+ ![](images/c7dc80bab0b8a3d71ce6ff923f7b0c9667d8e7c70b4ecadadc9253b5d064a0cb.jpg)
181
+
182
+ ![](images/5821a8633804b27d6274a9d79882f4b95f00b1e87df421dfb20e511af64b6534.jpg)
183
+ Figure 6. FM: $(m = 2^{11}, a = 1589, c = 629)$ (a) Attention weights: each query attends most strongly to the tokens $2^k$ and $2^{k-1}$ distance backward, for the highest possible value of $k$ , enabling copying of lowest $k$ bits. The other faint lines facilitate the prediction of higher bits. (b) Post-ReLU hidden layer MLP activations at token position $t = 129$ (extracted using sequences with different $x_0$ ) as a function of the target number $x_{130}$ which it is supposed to predict. Each neuron gets activated only while predicting a specific $x_{130}$ , exhibiting a sparse, periodic pattern. (c) Output of the MLP block projected onto the (un)embedding matrix; after masking out all but a single given hidden-layer neuron. The green dot denotes the value at the target number. Each neuron resolves the correct prediction up to a periodic structure. (d) Output of the MLP block projected onto the (un)embedding matrix; after combining the signal from multiple neurons (i.e. gradually un-masking the neurons). The per-neuron periodic patterns constructively interfere at the correct output.
184
+
185
+ ![](images/82925bb40d1fdad753f2560a9d89aecf7617b5b14e826410e0ab66b6c565b55e.jpg)
186
+
187
+ ![](images/24143d40c7fc3b858bb3aa811b49ed912f3f33c5fb4e4250c1f2c578b022145a.jpg)
188
+
189
+ Step i: We begin by conducting Principal Components Analysis (PCA) of the embedding matrix, which shows how the model performs prime factorization to develop the binary representations (RNS for general $m$ ). Figure 5(a1) shows the projections of all numbers $x \in \{0, \dots, 2047\}$ along the first principal component of the embedding. We observe that the model groups the numbers into modulo 2 clusters along the first principal component. Similarly, the 2nd and 3rd principal components group the numbers into modulo 4 clusters (Figure 5(a2)). In general, we find principal directions that group the numbers into modulo $2^{(\cdot)}$ (see Figure 24). By clustering the numbers according to their remainder modulo different prime-powers, these principal directions naturally encode the digit-wise representations of the inputs. In Figure 5(b), we check the cosine similarity between the embedding vectors of different numbers. We see that the more digits two numbers share in the binary representation, the higher the cosine similarity of their embedding. This is a consequence of these numbers having similar components along principal directions corresponding to those digits. For composite moduli, we find similar clustering according to different prime factors of $m$ (see Figures 25, 26).
190
+
191
+ Step ii, iii: In Figure 6(a) we examine the attention weights and find that to predict the number at position $t$ , the model attends most strongly to the position $t - 2^k$ for the highest possible value of $k$ s.t. $t \geq 2^k$ (i.e. $k = \lfloor \log_2 t \rfloor$ ). This corresponds to the brightest line in Figure 6(a). Using the binary representation of the $(t - 2^k)$ -th token, the model can copy the lowest $k$ bits and simplify the prediction of higher bits. Additionally, the second brightest line appears at the position $t - 2^{k-1}$ , along with other faint lines at intermediate distances (multiples of $t - 2^{k'}$ for $k' < k-1$ ). The information obtained from all these lines are utilized by
192
+
193
+ the model in predicting the higher bits.
194
+
195
+ To verify that the brightestest line enables the copying of lower bits and that the second brightest line facilitates the prediction of higher bits, we performed the following two experiments. (i) For each query in the attention head, we mask out all keys except for the one at position $t - 2^k$ . We then measure the performance of this ablated model, shown in Figure 20(a). We observe that the model retains the ability to copy the $k$ lowest bits, but loses the ability to predict the higher bits. (ii) Next, we repeat the above ablation experiment while masking out all keys except the ones at positions $t - 2^k$ and $t - 2^{k-1}$ , shown in Figure 20(b). This results in a drastic improvement in the prediction of the higher bits compared to (i), confirming our assertions.
196
+
197
+ After the attention layer collects information about previous tokens, the MLP block ${}^{2}$ processes the information to make predictions. We find that each hidden neuron (post-ReLU) in the MLP exhibits a periodic response with a distinct period, as a function of the target prediction. Consider the MLP at token position $t$ . The input to the transformer at this position is $x_{t}$ and the output $y_{t}$ , should match the next number in the sequence $x_{t + 1}$ . In Figure 6(b) we show the activation value of selected neurons at token position $t = 129$ as a function of the target $x_{130}$ , for $m$ different sequences obtained by changing the seed $x_{0}$ for a given LCG sequence. We observe that only a sparse set of neurons are activated for a given target $x_{130}$ and that there is a strong spiked periodic structure in the response of each neuron as a function of $x_{130}$ , with neuron-specific frequencies.
198
+
199
+ The subsequent fully connected layer in the MLP block aggregates the contributions from all the activated neurons to
200
+
201
+ make the correct prediction (McCracken et al., 2025). To visualize the contributions from an individual neuron, we mask out the contribution from all other neurons and extract the MLP output for a fixed input sequence. We then project this output onto the (un)embedding matrix, which shows us the contribution of that single neuron in making the correct prediction. In Figure 6(c) we show that each neuron resolves the target number $x_{130}$ up to a distinct periodic pattern. The periodic patterns from different neurons constructively interfere at the target. In Figure 6(d), we observe that gradually adding contributions from multiple neurons resolves the correct output with increasing accuracy.
202
+
203
+ # 4.3. Interpretability: Generalization to Unseen Modulus
204
+
205
+ # Qualitative Algorithm (unseen modulus):
206
+
207
+ i. Encode information about various possible prime factorizations
208
+ ii. Estimate the modulus via the largest number in context
209
+ iii. Combine steps i and ii to construct correct RNS representations, then implement steps ii and iii from the fixed modulus algorithm
210
+
211
+ Unlike the FM case, the training set for UM is generated using many different moduli $m$ , unseen at test time. Since each modulus has its own RNS representation incompatible with other moduli, the model must implement a different, more general algorithm to solve UM tasks.
212
+
213
+ We analyze how the embedding layer and attention heads of a 4-layer Transformer model help implement the above algorithm to solve the UM task. The model is trained on a dataset generated with $n_m = n_a = n_c = 128$ , where $m_{\mathrm{max}} = 2457$ . To avoid leakage between training and test sets, we specifically exclude the moduli $m_{\mathrm{test}} \in \{1800 = 2^3 \cdot 3^2 \cdot 5^2, 2048 = 2^{11}, 2352 = 2^4 \cdot 3 \cdot 7^2\}$ from the training set. Note that the choice $m_{\mathrm{max}} = \lfloor 1.2 \cdot 2048 \rfloor$ is made to maintain consistency with the setting in Figure 1(a).
214
+
215
+ Figure 7. UM: PCA analysis of the embedding layer.
216
+ ![](images/1274d75d87135e5420edbcc20acc13d57a23d4f6f305062f7e87b5f240220bc5.jpg)
217
+ 3We read-out MLP outputs instead of network outputs to avoid distortion from the skip connection.
218
+
219
+ ![](images/8ff8179d3b029903ab5c6a7e31539993270914f1d0324e43903361c23a81f901.jpg)
220
+
221
+ Step i: We first analyze the embedding layer. In Figure 7(a), PCA shows a semi-circular structure along the first principal component, with the second principal component separating even and odd numbers. This semi-circle resembles the circular patterns seen in modular arithmetic tasks (Power et al., 2022; Zhong et al., 2023), but since our model is trained on multiple moduli, it cannot form a closed circle by identifying a unique 0 value. Figure 7(b) further shows that the 2nd and 3rd principal components group numbers by their remainders modulo 2 and 3, which likely reflects their prevalence as prime factors in the training set.
222
+
223
+ Note with varying moduli, the model need not form a binary encoding as before. Instead, we find attention heads in first layer group embedded numbers by remainders modulo different primes, each head specializing in a particular factor. This specialization allows the model to construct RNS representations with various prime bases.
224
+
225
+ To investigate head specialization, we analyze afforementioned first-layer attention heads in Figure 8, presenting PCA results for selected heads in panels (a1, b1, c1). For each, we input sequences using the corresponding $m_{\mathrm{test}}$ and randomly selected $(a, c)$ pairs (per the Hull-Dobell Theorem), then isolate the output $H^{(h)}$ for each head by zeroing out all other heads. We perform PCA at token position $t = 0$ ( $\mathrm{PCA}(H^{(h)}[:, 0, :])$ ), then projecting each number's feature vector $H^{(h)}[x, t, :]$ onto the top two principal components and labeling each point with its corresponding $x$ .
226
+
227
+ The analysis shows that each head groups numbers by their remainder modulo different prime factors, enabling the model to select suitable representations in later layers. The prominence of small primes in the top principal components likely reflects their frequency in the training data. Furthermore, we believe the performance gains observed in Figure 1 with more heads can be partly attributed to the model's improved capacity to capture additional prime factors for constructing RNS representations. More examples of specialization across various $(a, c, m_{\mathrm{test}}, x_0, t)$ are provided in Figure 27 (Appendix H.1).
228
+
229
+ To further demonstrate that these heads directly influence the model's performance, we measured per-digit accuracy before and after pruning each specialized head, as shown in panels (a2, b2, c2) and (a3, b3, c3). For pruning, we replace the head's output with its mean value $\text{mean}(\pmb{H}^{(h)}[:, :, :]) \in \mathbb{R}$ across all positions (using 10% of randomly selected training sequences), which preserves signal scale and avoids catastrophic model degradation. The results show that pruning a head responsible for a particular prime factor significantly impairs performance on corresponding digits, while other digits are less affected. For instance, in panel (a3), the model's ability to compute $7^1$ and $7^2$ digits is lost, while base-2 and base-3 digits remain above chance. Similarly, in (b3), removing the modulo-2 head
230
+
231
+ ![](images/5cd04f15806f3cb213ea7d76e03d3d51dfb01346792646ae35e6396e4f8ae29f.jpg)
232
+
233
+ ![](images/eabd410f161deef12096f07e1dec86ec307e1a1c66bf641d6720ace3fe40a3dc.jpg)
234
+ Figure 8. UM: PCA analysis of attention heads specialized for different prime factors and their impact on per-digit accuracy. (a1, b1, c1) PCA of outputs from specific heads; the first two principal components group numbers by remainder modulo 14, 4, and 3, respectively. (a2, b2, c2) Test accuracy for individual digits with representations from Equation (4) for each $m_{\mathrm{test}}$ . (a3, b3, c3) Per-digit test accuracy after pruning these heads, showing substantial performance degradation on the affected digits.
235
+
236
+ erases all corresponding digit accuracy, and in (c3), pruning the modulo-3 head greatly reduces base-3 digit performance, but leaves base-2 and base-5 largely intact.
237
+
238
+ Finally, we further validate the link between head specialization and digit-wise accuracy by pruning irrelevant heads. For $m_{\mathrm{test}} = 2048$ , pruning heads responsible for modulo 7 or 3 (as in panels (a1) or (c1)) yields the results in Figure 28. Interestingly, removing the modulo-3 head sometimes improves performance for specific token positions, while others show minimal degradation. These findings reinforce the connection between head specialization and digit-wise computation; further details can be found in Appendix H.2.
239
+
240
+ Step ii: The performance variations observed above suggest that the model is internally uncertain about which RNS representation to use, likely due to difficulty in determining $m_{\mathrm{test}}$ . As we discuss below, the model appears to estimate $m_{\mathrm{test}}$ greedily via in-context learning.
241
+
242
+ In Figure 9(a), using a sequence with $x_0 = 1$ , $a = 5$ , $c = 31$ and $m_{\mathrm{test}} = 2048$ , we observe a first-layer attention head that attends primarily to the largest numbers, as seen by the vertical lines in the attention weights. To analyze this further, in panel (b), we extract the output $H^{(h)} \in \mathbb{R}^{1 \times L \times d_{\mathrm{model}}}$ from this head for the same sequence and compute its cosine similarity with token embeddings for all $x < m_{\mathrm{test}}$ , producing a $\mathbb{R}^{L \times m_{\mathrm{test}}}$ matrix for the heatmap. This reveals that the head's output consistently has the highest similarity with the largest numbers that has been seen in context,
243
+
244
+ ![](images/6a21370a08287747b3d6e974d2c9028e96c26e37b1c296961b7d2f0e0ba61596.jpg)
245
+
246
+ ![](images/8ecf8fc21330c8b9e3ff8de7bf8bc6aaefbab37c2e6f669bf6b5c6aa3fe29cb0.jpg)
247
+
248
+ ![](images/964d05f9b68f419ab34913ca5bf71c4e5978b3fc5841b37ad6dd3aef57edfcf4.jpg)
249
+ Figure 9. UM: Attention head (layer 1, head 6) specialized in estimating $m_{\mathrm{test}}$ . (a) Queries attend to largest keys; (b) the head produces features with the highest cosine similarity to $m_{\mathrm{test}}$ ; (c) patching this head with features from sequences with $m_{\mathrm{patch}} = 1024$ (same $a, c$ ) steers the model to predict numbers $n < m_{\mathrm{patch}}$ .
250
+
251
+ indicating a greedy estimation of $m_{\mathrm{test}}$ .
252
+
253
+ To further verify that this head estimates $m_{\mathrm{test}}$ for later layers, we conduct a patching experiment (Zhang & Nanda, 2024), as shown in Figure 9(c). We generate a new sequence with the same $a$ , $c$ , and $x_0$ , but with $m_{\mathrm{patch}} = 1024$ , and extract $H^{(h)}$ patch $\in \mathbb{R}^{1 \times L \times d_{\mathrm{model}}}$ from this head. We then overwrite the output $H^{(h)}$ in a forward pass for the original sequence $(m_{\mathrm{test}} = 2048)$ with $H^{(h)}$ patch. The model now frequently predicts numbers smaller than $m_{\mathrm{patch}}$ . As shown in Figure 30 (Appendix H.3), patching other heads disrupts predictions but never induces a similar qualitative shift, confirming this head's unique role in estimating $m_{\mathrm{test}}$ .
254
+
255
+ One might expect that even a small error in estimating $m_{\mathrm{test}}$ would invalidate predictions, but this is not necessarily the case. As shown in Section 4.2, if the correct representation is chosen, the lower bits maintain a strong periodic signal. Since the model can prepare multiple RNS representations (as demonstrated in step i), a sufficiently close estimate of $m_{\mathrm{test}}$ allows these lower bits to guide the model toward the correct representation. Further discussion is provided in Appendix H.4 and step iii.
256
+
257
+ Step iii: Once the necessary features are prepared, subsequent layers implement the rest of the algorithm. As in the FM case, we observe a ladder pattern in digit-wise accuracy for lower digits at early token positions. This pattern, which demonstrates the copying bias, is visible in Figure 8(b2).
258
+
259
+ More careful inspection of Figure 8(b2) shows the model copies the lowest 5 digits. Interestingly, given the estimated $m_{\mathrm{test}} = 2033$ from step ii, the model effectively reduces it to $2033 / 2^5 \approx 63.53$ . Furthermore, since the model operates on integers, it could round it to 64, yielding $64 \cdot 2^5 = 2048 = m_{\mathrm{test}}$ . Thus, the model in principle, can predict higher digits accurately without the exact value of $m_{\mathrm{test}}$ .
260
+
261
+ While some algorithmic transition from lower to higher digits clearly occurs, the exact mechanism remains unclear. The sharp transition in per-digit performance at the $2^{5}$ digit in Figure 8(b2) supports this argument. Nevertheless, we believe the model applies an algorithm similar to FM for higher bits, which we will elaborate on in Appendix H.5.
262
+
263
+ # 5. Scaling Up the Modulus
264
+
265
+ In this section, we investigate training upon scaling up the LCG modulus, with the following modifications:
266
+
267
+ Base-b tokenization: To avoid massive dictionary sizes for large $m$ , we implement a base- $b$ tokenization scheme. Each integer is decomposed into a sequence of base- $b$ digits, beginning with the least significant digit; resulting in a vocabulary size of $b$ for any $m$ (for details see Appendix I.1). Based on the discussion in Section 4.1, it is beneficial to choose $b$ such that $\gcd(b, m) = b$ .
268
+
269
+ Abacus Embeddings: We encode positional information using a variant of the Abacus embedding (McLeish et al., 2024), as a sum of two learnable vectors. One vector encodes the position of the integer within the sequence, while the other encodes the position of each digit within the integer (for details, see Appendix I.2).
270
+
271
+ Fixed Modulus: For each modulus $m = 2^k$ , where $k$ is an integer in the range $16 \leq k \leq 32$ , we train a 2-layer model with $d_{\mathrm{model}} = 1024$ and a vocabulary size of 256. We select training sequences via the Hull-Dobell theorem, setting $n_a = n_c = 1024$ (See Appendix I.3 for training details). For the test dataset, we choose 512 values of $a$ and 64 values of $c$ that differ from those in the training set.
272
+
273
+ The quality of an LCG largely depends on its multiplier, traditionally evaluated via the spectral test (Knuth, 1997). In Figure 10(a), we test our model on both spectrally optimal Steele multipliers (Steele & Vigna, 2021) and arbitrary multipliers for $m = 2^{32}$ . While achieving $100\%$ test accuracy with equal in-context sequence lengths, the model performs consistently worse on Steele-generated sequences compared to those from arbitrary multipliers.
274
+
275
+ In Figure 10(b), a log-log plot reveals that the number of incontext sequence elements needed for $100\%$ test accuracy scales sublinearly with modulus $m$ as $m^{\gamma}$ , where $\gamma \approx 1/4$ .
276
+
277
+ Unseen modulus: For the UM case, we train a 6-layer Transformer on a dataset with $n_m = 32,768$ , $n_a = 128$ , $n_c = 1$ with $1024 < m_{\mathrm{train}} < 65,536$ . Sequences are length 512, each integer tokenized as two bytes (context length 1023). As before, test data uses unseen $m_{\mathrm{test}}$ and $(a, c)$ , focusing on $m_{\mathrm{test}} = 2^k$ , $3^k$ . Figure 11 shows that the number of in-context sequence elements needed to reach $60\%$ test accuracy scales as $m_{\mathrm{test}}^\gamma$ ( $0.24 \leq \gamma \leq 0.33$ ). The averaged test accuracy of each number in the sequence is shown in
278
+
279
+ ![](images/97920a08cffc776716c0f74a7ddffda61d9680eca50125f7e2eeb5f3edce8e88.jpg)
280
+ Figure 10. FM: (a) Average test accuracy $(m = 2^{32})$ vs number of in-context sequence elements. (b) The number of in-context sequence elements required to achieve $100\%$ test accuracy (minimum of 5 runs). (See Appendix I.3 for details)
281
+
282
+ ![](images/47c0fae2be98c25f50c35aa4410d2b794b1fcfd407e2210a966c7cee91d29c0b.jpg)
283
+
284
+ Appendix I.4. Test performance is influenced by the tokenization base, since the tokenization base highlights the periodic structure of LCGs making it more apparent and easier for the model to leverage during training and prediction. To confirm this, we train a model with tokenization base 243. In Figure 11, $m_{\mathrm{test}} = 2^k (3^k)$ sequences scale better when the tokenization base is $256 = 2^8$ ( $243 = 3^5$ ).
285
+
286
+ ![](images/0247f7e6d1d4be5c8f923c15c79f4fbfa55732a1feb367d44a1c06103feaf7ff.jpg)
287
+ Figure 11. UM: The number of in-context sequence elements needed for $60\%$ test accuracy grows sublinearly with modulus $m$ , depending on compatibility between $m$ and tokenization. (a) Base- $2^{8}$ tokenization; (b) base- $3^{5}$ tokenization.
288
+
289
+ ![](images/860a55047a85627139793636bb34678f2b7dcbe12332f8fcacebbde1ff10ca0b.jpg)
290
+
291
+ # 6. Conclusion
292
+
293
+ We have investigated Transformer training on LCG sequences, focusing on fixed modulus training as well as generalization to unseen moduli. In both cases, we have uncovered the algorithm used by the model to solve these tasks and highlighted the model components that implement the steps of the algorithm. We have found that the model finds and utilizes prime factorizations of $m$ and RNS representations of numbers to simplify the sequences and make predictions. We have provided the modified training recipe for scaling up the modulus in both FM and UM settings, and shown their scaling behaviors.
294
+
295
+ Limitations and future work: The results of this paper were limited to scales $m \leq 2^{32}$ . It would be interesting to test our results on much larger moduli as well. We leave the exploration of PRNGs that are built upon LCGs, such as PCGs and truncated LCGs for future works. It would also be interesting to make the training even more unbiased, by training on general classes of arithmetic sequences.
296
+
297
+ # Acknowledgements
298
+
299
+ M.B. thanks Carl Miller for discussions on PRNGs. This work is supported by NSF DMR-2345644 (D.S.K., T.T., and M.B.), and by an NSF CAREER award DMR-2045181 (T.H. and D.D.). The authors acknowledge the University of Maryland supercomputing resources (http://hpcc.umd.edu) made available for conducting the research reported in this paper.
300
+
301
+ # Impact Statement
302
+
303
+ Our work advances the understanding of how neural networks learn deterministic sequences, specifically LCGs. While this capability cannot compromise mainstream cryptographic systems, which use far more sophisticated techniques, our insights may contribute to the development of more robust cryptographic algorithms and a better understanding of neural networks' computational capabilities.
304
+
305
+ # References
306
+
307
+ Ahn, K., Cheng, X., Daneshmand, H., and Sra, S. Transformers learn to implement preconditioned gradient descent for in-context learning. In Oh, A., Neumann, T., Globerson, A., Saenko, K., Hardt, M., and Levine, S. (eds.), Advances in Neural Information Processing Systems, volume 36, pp. 45614-45650. Curran Associates, Inc., 2023. URL https://openreview.net/forum?id=LziniAXEI9.
308
+ Akyurek, E., Schuurmans, D., Andreas, J., Ma, T., and Zhou, D. What learning algorithm is in-context learning? investigations with linearmodels, 2023. URL https://openreview.net/forum?id=0g0X4H8yN4I.
309
+ Allen-Zhu, Z. and Li, Y. Physics of language models: Part 1, learning hierarchical language structures. 2024. URL https://arxiv.org/abs/2305.13673.
310
+ Amigo, G., Dong, L., and Marks Ii, R. J. Forecasting pseudo random numbers using deep learning. In 2021 15th International Conference on Signal Processing and Communication Systems (ICSPCS), pp. 1-7, 2021. doi: 10.1109/ICSPCS53099.2021.9660301.
311
+ Cagnetta, F. and Wyart, M. Towards a theory of how the structure of language is acquired by deep neural networks. arXiv preprint arXiv:2406.00048, 2024.
312
+ Cagnetta, F., Petrini, L., Tomasini, U. M., Favero, A., and Wyart, M. How deep neural networks learn compositional data: The random hierarchy model. *Physical Review X*, 14(3):031001, 2024.
313
+ Chen, X. and Zou, D. What can transformer learn with varying depth? case studies on sequence learning
314
+
315
+ tasks. In Forty-first International Conference on Machine Learning, 2024. URL https://openreview.net/forum?id=YNbCbcGyXE.
316
+ Chomsky, N. Three models for the description of language. IRE Transactions on information theory, 2(3):113-124, 1956.
317
+ Delétang, G., Ruoss, A., Grau-Moya, J., Genewein, T., Wenliang, L. K., Catt, E., Cundy, C., Hutter, M., Legg, S., Veness, J., and Ortega, P. A. Neural networks and the chomsky hierarchy, 2023. URL https://arxiv.org/abs/2207.02098.
318
+ Doshi, D., Das, A., He, T., and Gromov, A. To grok or not to grok: Disentangling generalization and memorization on corrupted algorithmic datasets. In The Twelfth International Conference on Learning Representations, 2024a. URL https://openreview.net/forum?id=UHjE5v5MB7.
319
+ Doshi, D., He, T., Das, A., and Gromov, A. Grokking modular polynomials, 2024b. URL https://arxiv.org/abs/2406.03495.
320
+ Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., Uszkoreit, J., and Houlsby, N. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=YicbFdNTTy.
321
+ Garner, H. L. The residue number system. In Papers Presented at the the March 3-5, 1959, Western Joint Computer Conference, IRE-AIEE-ACM '59 (Western), pp. 146-153, New York, NY, USA, 1959. Association for Computing Machinery. ISBN 9781450378659. doi: 10.1145/1457838.1457864. URL https://doi.org/10.1145/1457838.1457864.
322
+ Gromov, A. Grokking modular arithmetic, 2023. URL https://arxiv.org/abs/2301.02679.
323
+ He, T., Doshi, D., Das, A., and Gromov, A. Learning to grok: Emergence of in-context learning and skill composition in modular arithmetic tasks. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024. URL https://openreview.net/forum?id=aVh9KRZdRk.
324
+ Hendel, R., Geva, M., and Globerson, A. In-context learning creates task vectors, 2023.
325
+ Hull, T. E. and Dobell, A. R. Random number generators. SIAM Review, 4(3):230-254, 1962. doi: 10.1137/1004061. URL https://doi.org/10.1137/1004061.
326
+
327
+ Knuth, D. E. The art of computer programming, volume 2 (3rd ed.): seminumerical algorithms. Addison-Wesley Longman Publishing Co., Inc., USA, 1997. ISBN 0201896842.
328
+ Lam, R., Sanchez-Gonzalez, A., Willson, M., Wirnsberger, P., Fortunato, M., Alet, F., Ravuri, S., Ewalds, T., Eaton-Rosen, Z., Hu, W., et al. Learning skillful medium-range global weather forecasting. Science, 382(6677):1416-1421, 2023.
329
+ Liu, S., Ye, H., Xing, L., and Zou, J. In-context vectors: Making in context learning more effective and controllable through latent space steering, 2024.
330
+ Loshchilov, I. and Hutter, F. Decoupled weight decay regularization. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id=Bkg6RiCqY7.
331
+ McCracken, G., Moisescu-Pareja, G., Letourneau, V., Precup, D., and Love, J. Uncovering a universal abstract algorithm for modular addition in neural networks, 2025. URL https://arxiv.org/abs/2505.18266.
332
+ McLeish, S., Bansal, A., Stein, A., Jain, N., Kirchenbauer, J., Bartoldson, B. R., Kailkhura, B., Bhatele, A., Geiping, J., Schwarzschild, A., and Goldstein, T. Transformers can do arithmetic with the right embeddings, 2024. URL https://arxiv.org/abs/2405.17399.
333
+ Nanda, N., Chan, L., Lieberum, T., Smith, J., and Steinhardt, J. Progress measures for grokking via mechanistic interpretability. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=9XFSbDPmdW.
334
+ Olsson, C., Elhage, N., Nanda, N., Joseph, N., DasSarma, N., Henighan, T., Mann, B., Askell, A., Bai, Y., Chen, A., et al. In-context learning and induction heads. arXiv preprint arXiv:2209.11895, 2022.
335
+ O'Neill, M. E. Pcg: A family of simple fast space-efficient statistically good algorithms for random number generation. 2014. URL https://apisemantic scholar.org/CorpusID:3489282.
336
+ Power, A., Burda, Y., Edwards, H., Babuschkin, I., and Misra, V. Grokking: Generalization beyond overfitting on small algorithmic datasets. arXiv preprint arXiv:2201.02177, 2022.
337
+ Press, O. and Wolf, L. Using the output embedding to improve language models. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 2, Short Papers, pp. 157-163, 2017.
338
+
339
+ Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., and Sutskever, I. Language models are unsupervised multitask learners. 2019.
340
+ Rivest, R. L. Cryptography and machine learning. In International Conference on the Theory and Application of Cryptology, pp. 427-439. Springer, 1991.
341
+ Sharkey, L., Chughtai, B., Batson, J., Lindsey, J., Wu, J., Bushnaq, L., Goldowsky-Dill, N., Heimersheim, S., Ortega, A., Bloom, J., Biderman, S., Garriga-Alonso, A., Conmy, A., Nanda, N., Rumbelow, J., Wattenberg, M., Schoots, N., Miller, J., Michaud, E. J., Casper, S., Tegmark, M., Saunders, W., Bau, D., Todd, E., Geiger, A., Geva, M., Hoogland, J., Murfet, D., and McGrath, T. Open problems in mechanistic interpretability. 2025. URL https://arxiv.org/abs/2501.16496.
342
+ Steele, G. and Vigna, S. Computationally easy, spectrally good multipliers for congruential pseudorandom number generators, 2021. URL https://arxiv.org/abs/2001.05304.
343
+ Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., and Polosukhin, I. Attention is all you need. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS'17, pp. 6000-6010, Red Hook, NY, USA, 2017. Curran Associates Inc. ISBN 9781510860964.
344
+ von Oswald, J., Niklasson, E., Randazzo, E., Sacramento, J., Mordvintsev, A., Zhmoginov, A., and Vlademyrov, M. Transformers learn in-context by gradient descent, 2023.
345
+ Wei, J., Wang, X., Schuurmans, D., Bosma, M., Ichter, B., Xia, F., Chi, E., Le, Q., and Zhou, D. Chain-of-thought prompting elicits reasoning in large language models, 2023. URL https://arxiv.org/abs/2201.11903.
346
+ Zhang, F. and Nanda, N. Towards best practices of activation patching in language models: Metrics and methods. In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=Hf17y6u9BC.
347
+ Zhong, Z., Liu, Z., Tegmark, M., and Andreas, J. The clock and the pizza: Two stories in mechanistic explanation of neural networks. In Thirty-seventh Conference on Neural Information Processing Systems, 2023. URL https://openreview.net/forum?id=S5wmbQc1We.
348
+
349
+ # A. Experimental Details
350
+
351
+ This section provides further details about model architecture, dataset construction, and optimization.
352
+
353
+ # A.1. Dataset Construction
354
+
355
+ Fixed Modulus (FM): Given a modulus $m$ , we apply the Hull-Dobell Theorem to determine the possible values of $(a, c)$ that maximize the period. We then randomly select 64 values of $a$ and $c$ to generate the test dataset. To generate the training dataset, we exclude these test choices of $(a, c)$ and uniformly sample $N = 100,000$ LCG sequences of length $L$ (context length) with $n_a$ values of multipliers and $n_c$ values of increments. For each set of parameters $(a, c)$ , we sample an LCG sequence with a randomly selected initial seed $x_0$ . Note that the training dataset includes sequences with varying periods, while the test data only contains sequences that maximize the period.
356
+
357
+ ![](images/9b496818d6b502e5c0e49ac56c5b31466ca21831ef547702597fc96d006dfa1b.jpg)
358
+ Figure 12. The impact of training dataset parameters $(n_{m}, n_{a}, n_{c})$ on unseen modulus task performance.
359
+
360
+ ![](images/19d53be9a512e2baf18db161bea6ec10da187ba9d0d3c31f9a1f6b60a638b47a.jpg)
361
+
362
+ ![](images/294f3f9fb05c3512cf7314daf3eae3bb2d4fef180167f3ac7496380413a70ae2.jpg)
363
+
364
+ Generalization to Unseen Modulus (UM): For the test dataset, we first select a set of test moduli $M_{\mathrm{test}} = \{m_{\mathrm{test}}\}$ that would be reserved exclusively for evaluation. For each test modulus $m_{\mathrm{test}} \in M_{\mathrm{test}}$ , we apply the Hull-Dobell Theorem to determine the values of $(a, c)$ that maximize the period. We then randomly select 64 values of $a$ and $c$ to generate the test dataset. These 64 $(a, c)$ values are not considered while generating the training dataset.
365
+
366
+ For the training dataset generation, we sample the $n_m$ modulus values from the range $[L, \lfloor 1.2\max(M_{\mathrm{test}})\rfloor]$ while excluding all the values in $M_{\mathrm{test}}$ . For each modulus value $m$ , we uniformly select $n_a$ multipliers $(0 < a < m)$ and $n_c$ increments $(0 \leq c < m)$ , excluding the ones reserved for testing. For each parameter $(a, c, m)$ , we generate a sequence of length $L$ using a randomly selected initial seed $x_0$ . This results in a total of $N = n_m \times n_a \times n_c$ training sequences. We report that $N = 400,000$ served sufficient from the modulus values considered in this work.
367
+
368
+ Next, we examine the effect of training dataset composition $(n_{m}, n_{a}, n_{c})$ on the performance. Figure 12 shows the test accuracy primarily depends on $n_{p}$ and marginally on $n_{a}$ and $n_{c}$ . Furthermore, we found that $n_{m} \gtrsim m_{\mathrm{test}} / 4$ yields good generalization performance (result not shown here). Based on this relationship and our target total number of training examples $N$ , we sample $n_{a} = n_{c} = \sqrt{\frac{N}{m_{\mathrm{test}} / 4}}$ values of multipliers and increments. Unless explicitly specified, we use these parameter settings as the default configuration for all experiments.
369
+
370
+ # A.2. Model Architecture Details
371
+
372
+ We consider GPT-style Transformers (Radford et al., 2019) with learnable positional embeddings and weight tying (Press & Wolf, 2017). The model architecture is characterized by the number of blocks (depth), embedding dimension ( $d_{\mathrm{model}}$ ), and number of attention heads ( $n_{\mathrm{heads}}$ ). For most experiments, we use GELU activations, except in Section 4, where we use ReLU activations for better interpretability.
373
+
374
+ # A.3. Training Details
375
+
376
+ We train the models with Cross-entropy loss using AdamW optimizer (Loshchilov & Hutter, 2019) with momentum hyperparameters $\beta_{1} = 0.9$ and $\beta_{2} = 0.99$ . We implement a linear learning rate warmup over the first 2048 steps with an initial learning rate of zero and the target learning rate $\eta$ . By default, all experiments employ a batch size of 256. Weight decay is only applied to non-bias parameters.
377
+
378
+ In the unseen modulus case, we observed that both the optimal target learning rate $\eta$ and weight decay strength $\lambda$
379
+
380
+ ![](images/3d706cc3214c9c71341e2a38d3b84db53381ef0f8a4c575e1617df55e767d7aa.jpg)
381
+ Figure 13. Heatmap of test accuracy of a 6 layer Transformer with learning rate and weight decay as the axes. As the modulus is increased from 1024 to 16, 384 the range of hyperparameters resulting in reasonable accuracy becomes narrow.
382
+
383
+ ![](images/bd3d5dfcdb7edd9f5accf88cd073b528f5d033f0641258fa3f41eff7e0593a15.jpg)
384
+
385
+ ![](images/934a23c6a19bea58c6a92bd70247f92b2354037d096d7542d2e4180c55dd22c9.jpg)
386
+
387
+ are highly sensitive to minute changes in training dataset properties (modulus $m_{\mathrm{test}}$ , number of LCG parameters $n_m$ , $n_a$ , $n_c$ and total number of examples $N$ ) and architectural changes (depth and embedding dimension). To determine the optimal hyperpamraters, we scan the learning rates $\eta \in \{3e - 05, 1e - 04, 3e - 04, 1e - 03\}$ and weight decay strengths $\lambda \in \{0.01, 0.1, 1.0, 3.0\}$ .
388
+
389
+ # A.4. Training Cost
390
+
391
+ In Figure 10, the training of the $m = 2^{32}$ model was conducted using four NVIDIA A100 GPUs, requiring a total of 21.82 hours. The $m = 2^{16}$ model completed training in 4.83 hours under the same hardware setup. Despite having the same model size, the increased context length in the $m = 2^{32}$ model led to a significantly higher computational cost.
392
+
393
+ In Figure 11, both models were trained on a single NVIDIA H100 GPU for 22 hours.
394
+
395
+ # A.5. Hyperparameter Space Shrinking with increasing modulus
396
+
397
+ We also report a surprising phenomenon in the unseen modulus case, which we refer to. as the 'hyperparameter space shrinking.' As we increase the test modulus $m_{\mathrm{test}}$ while keeping the model architecture fixed, we observe that the optimal learning rate $(\eta)$ and weight decay strength $(\lambda)$ shift significantly. Moreover, the range of these hyperparameter values that yield reasonable performance becomes increasingly narrow. Figure 13 shows this result for a 6 layer Transformer.
398
+
399
+ # B. Fixed Modules Training Results
400
+
401
+ For the FM case, we find that a single attention head in one layer is sufficient to solve the task when the modulus is not a prime number. In Figure 14, we present the model's training loss and performance across training steps for $m = 2048$ . Notably, panels (c, f) reveal a significant disparity between training and test loss, indicating a grokking transition during the training process. Similarly, we plot in Figure 15 for similar curves for $m = 7776$ , where all curves are qualitatively the same.
402
+
403
+ # C. Prime Moduli
404
+
405
+ In the FM setting, when $m$ is a prime number, the task becomes much harder. Since there are no digit-wise periodic patterns, the model cannot perform the algorithm described in Section 4.2. In Figure 16, we trained two identical models to learn $m = 2039$ and $m = 2048$ , and we observe that the task with $m = 2039$ cannot be learned within the same number of training steps. Note that to rule out potential constraints from model capability, we used depth 2 models (as opposed to depth 1 in the main text) in both cases.
406
+
407
+ In the UM setting, the model exhibits similar test performance on sequences with prime $m$ and sequences with $m$ as a power of two, as shown in Figure 17. We hypothesize that training on a diverse set of moduli helps the model rely less on the digit patterns and instead focus on more generalizable structure.
408
+
409
+ ![](images/5980f52f3af5ae5771f0ae6ebc0e3c42387fb9b02a15bfab391c530be2a20aa8.jpg)
410
+
411
+ ![](images/619e95c3c2ed64d59cff8be869b32e557cf5ae3e96a3da65afeff5f18ed68f7d.jpg)
412
+
413
+ ![](images/e6336952afa4e6c36dc2158e61de6a17745b1fca7315f31e5b081b7c19cb1e2e.jpg)
414
+
415
+ ![](images/daa50771e7a34f9351f9c05a2b7bd506f7be3d26e749fb863dff1a51fe7d48f9.jpg)
416
+ Figure 14. Test accuracy and train/test loss for $m = 2048 = 2^{11}$ , depth=1. (a,b,c) $n_{\mathrm{heads}} = 1$ (d,e,f) $n_{\mathrm{heads}} = 4$ .
417
+
418
+ ![](images/90800845055e2b8a7dc976e6ac152990aff9ccf817b09aa9ac8779480913e1a3.jpg)
419
+
420
+ ![](images/0710f612e2f85ab2bcaa38f7ad90382810529faeaa1869f5efd4bbf772ec0877.jpg)
421
+
422
+ ![](images/5aa5eedd7c4324d702c523b47abcb6a2f9729b6d3205873555f03264a6db23c7.jpg)
423
+
424
+ ![](images/3a916345fd1362951f4bf49e859fe5c2975cf46a850b912d00c776392807ed5f.jpg)
425
+
426
+ ![](images/2a00f1bec953a265af81a1f206ec5bfb71dbaf21cfc727daa7430c80b2538d48.jpg)
427
+
428
+ ![](images/e197fcfe3f725271a9b8f44b8f8f656d6c2742188d81f38e6ee9235f2b47576a.jpg)
429
+ Figure 15. Test accuracy and train/test loss for $m = 7776 = 2^5 \cdot 3^5$ , depth=1. (a,b,c) $n_{\mathrm{heads}} = 1$ (d,e,f) $n_{\mathrm{heads}} = 4$ .
430
+
431
+ ![](images/fa63a2f90d18db23edfb1ddb3bad0ff99d62f4a1a500eceb445d88db47fc12ad.jpg)
432
+
433
+ ![](images/183b937794a89aff82f450b383e43ac8dcf9638b4a80119cbf61378ba88cc77d.jpg)
434
+
435
+ # D. Critical Depth for the Unseen Modulus Task
436
+
437
+ This section analyzes the depth and embedding dimension requirements for successfully training a Transformer on the unseen modulus task. The experimental details are the same as described in Appendix A.
438
+
439
+ We varied depths $\in \{2,3,4,6,8\}$ and embedding dimensions in $d_{\mathrm{model}} \in \{512,768,1024,1280\}$ , with the head dimension fixed to $d_{\mathrm{head}} = 128$ . For each depth and width, we scanned learning rates $\eta \in \{3e - 05,1e - 04,3e - 04,1e - 03\}$ and weight decay strengths $\lambda \in \{0.01,0.1,1.0,3.0\}$ to identify the optimal hyperparameters. We report that the optimal learning rate and weight decay strength heavily vary with depth, embedding dimension, and training dataset. For $m_{\mathrm{eval}} = \{1024,4096\}$ , the models were trained for $T = 100,000$ steps, while for $m_{\mathrm{eval}} = 16,384$ , the models required a longer training for $T = 200,000$ steps.
440
+
441
+ Figure 18 shows the test accuracy heatmaps with depth and embedding dimensions as the two axes. These results demonstrate that a minimum depth of 3 is required to learn the LCG sequence prediction task, with a marginal dependence on embedding dimension. This suggests the unseen modulus task requires a minimal computational depth of three to capture the underlying structure of LCGs.
442
+
443
+ ![](images/e5ebea0e6a1cc62423895870d7c025d8797fd12c31c00a56d754a9d6bce3983d.jpg)
444
+ (a) Test Accuracy
445
+
446
+ ![](images/e2c12f0635aec53f7d4fddabe5f88b0169d39e35e788dc75e11a36c683277c7d.jpg)
447
+ (b) Training Accuracy
448
+
449
+ ![](images/77d02cebdae06c07da72585681b9ec56682197e643dfee5791cc167bcd0909d4.jpg)
450
+ (c) Training Loss
451
+
452
+ ![](images/984184371d960018969bdeb15375359ac4bd4d2ba409fe41bf0122be5d987261.jpg)
453
+ Figure 16. FM: Comparison between $m = 2039$ (prime) and $m = 2048$ (power-of-two), with both models trained for 50,000 steps. Each model has depth 2 and $d_{\mathrm{model}} = 1024$ . The test set consists of sequences with the same periods, while the training set includes arbitrary multipliers not present in the test set.
454
+
455
+ ![](images/0985fd8ec0f3c50292d097ad612524942eff1e2272113b9f940c5a0a8107e23d.jpg)
456
+ Figure 18. Test accuracy heatmaps of with depth and embedding dimensions as the two axes.
457
+
458
+ ![](images/17058422830a6cb138f86764b95e6656122fa8ca3dff38aaf803da9ec2e3d2d8.jpg)
459
+ Figure 17. UM: Test accuracy comparison between $m = 2039$ (prime), $m = 1801$ (prime) and $m = 2048$ (power-of-two). The model was trained for 100,000 steps on a dataset consisting of 262,144 sequences with 512 distinct training moduli not present in the test set.
460
+
461
+ ![](images/417d4f87b7754a35fff2a859bf649fe8b07300974661c4bc1bc8d0d7bf3a0139.jpg)
462
+
463
+ # E. Training Time Interpretability
464
+
465
+ In this section, we examine the order in which training sequences with different periods are learned during training. For this experiment, we consider a six-layer Transformer with 4 heads and an embedding dimension of 768. For this experiment, we generate sequences of length 512 using 128 unseen moduli and 128 values of $a$ and $c$ each. The model is trained with Adam hyperparameters: $\eta = 3 \times 10^{-4}\beta_{1} = 0.9$ , $\beta_{2} = 0.99$ and weight decay strength $\lambda = 1.0$ .
466
+
467
+ Figure 19(left) compares the training accuracy of sequences with different periods relative to the context length 512. We
468
+
469
+ ![](images/53cfc7dad71c0e54cf13fb952e21878e75de3566a44955be653e6c99dcb5d6e2.jpg)
470
+ Figure 19. (left) Comparison of the training accuracy of sequences with different periods relative to the context length 512, (center) Accuracy when the model is only trained on sequences with period $< 512$ , (right) Accuracy when the model is trained on sequences with period $>512$ .
471
+
472
+ ![](images/b739a98f169f85a7cea7c3a6b232f9dfa0519c3cdc530e6a6ec9984315dd0b69.jpg)
473
+
474
+ ![](images/b528d79edebbdc69ce1656066ab88aaefa9c2035b7d0333f58a90e8e6643dd9b.jpg)
475
+
476
+ observe that sequences with period $< 512$ are memorized early in training, while the accuracy of long-period sequences coincides with the test accuracy. Next, we perform two more experiments by training the model on datasets consisting of (1) sequences with period $< 256$ , and (2) sequences with period $>512$ . Figure 19(center, right) show the results of these experiments. The model fails to generalize when trained only on low-period sequences while training only on long-period sequences eliminates grokking.
477
+
478
+ # F. LCG Properties
479
+
480
+ # F.1. The period of the lower $k$ -th bit when $m$ is power of 2
481
+
482
+ In this section, we show that for a sequence of period $\mathcal{T}_m = m = 2^K$ , the $k$ -th lowest digit has a period of $2^k$ along the sequence. Consider an LCG sequence:
483
+
484
+ $$
485
+ x _ {t + 1} = \left(a x _ {t} + c\right) \mod m, \tag {6}
486
+ $$
487
+
488
+ where $m$ is a power of 2, $m$ and $c$ are coprime and $a - 1$ is divisible by 4. The period of sequence $x_{t}$ is $m$ (Hull & Dobell, 1962). The lower $k$ -th bits of $x_{t}$ is given by:
489
+
490
+ $$
491
+ b _ {t, k} = \frac {z _ {t , k} - z _ {t , k - 1}}{2 ^ {k - 1}}, \tag {7}
492
+ $$
493
+
494
+ where $z_{t,k} = x_t \mod 2^k$ . Therefore, if $z_{t,k}$ has a period of $2^k$ , then the lower $k$ bits also have a period of $2^k$ . Below, we show that $z_{t,k}$ has a period of $2^k$ .
495
+
496
+ For an integer $M_{t}$ , we can can re-write $x_{t}$ as:
497
+
498
+ $$
499
+ x _ {t} = z _ {t, k} + M _ {t} 2 ^ {k}. \tag {8}
500
+ $$
501
+
502
+ Next, we substitute Equation (6) into the definition of $z_{t + 1,k}$ :
503
+
504
+ $$
505
+ \begin{array}{l} z _ {t + 1, k} = x _ {t + 1} \mod 2 ^ {k}, \\ = \left[ \left(a x _ {t} + c\right) \mod m \right] \mod 2 ^ {k}. \tag {9} \\ \end{array}
506
+ $$
507
+
508
+ As $m$ is divisible by $2^k$ , this simplifies to:
509
+
510
+ $$
511
+ \begin{array}{l} z _ {t + 1, k} = \left(a z _ {t, k} + c\right) \mod 2 ^ {k}, \\ = \left(a z _ {t, k} + a M _ {t} 2 ^ {k} + c\right) \mod 2 ^ {k}, \\ = \left(a z _ {t, k} + c\right) \mod 2 ^ {k}. \tag {10} \\ \end{array}
512
+ $$
513
+
514
+ Therefore, $z_{t,k}$ follows its own LCG recurrence with the same $a$ and $c$ but with a reduced modulus $2^k$ . Because $2^k$ and $c$ are coprime and $a - 1$ is divisible by 4, the period of $z_n$ is $2^k$ . Thus, the period of the lower $k$ bits is $2^k$ .
515
+
516
+ Since $z_{n,k}$ has period $2^k$ and $z_{n,k-1}$ has period $2^{k-1}$ , the period of $b_{n,k}$ is $2^k$ .
517
+
518
+ # F.2. Derivation of Equation (4)
519
+
520
+ We now derive Equation (4) of the main text:
521
+
522
+ $$
523
+ x _ {t} \bmod p _ {i} ^ {w _ {q}} = \alpha_ {i, 0, t} p _ {i} ^ {0} + \alpha_ {i, 1, t} p _ {i} ^ {1} + \dots + \alpha_ {i, w _ {i} - 1, t} p _ {i} ^ {w _ {i} - 1},
524
+ $$
525
+
526
+ where $\alpha_{i,w,t} \in \{0,1,\dots,p_i - 1\}$ are base- $p_i$ digits. When the period of $x_t$ is m, each digit $\alpha_{j,w,t}$ has a period of $p_i^w$ .
527
+
528
+ Consider an LCG sequence:
529
+
530
+ $$
531
+ x _ {t + 1} = \left(a x _ {t} + c\right) \mod m, \tag {11}
532
+ $$
533
+
534
+ where $m$ has a prime factorization $m = p_1^{w_1}p_2^{w_2}\dots p_q^{w_q}$ , $m$ and $c$ are coprime, $a - 1$ is divisible by all prime factors of $m$ and $a - 1$ is divisible by 4 if $m$ is divisible by 4 (Hull & Dobell, 1962).
535
+
536
+ Consider the residulas $R_{i,t} = x_t \mod p_i^{w_i}$ , where $i \in \{1 \ldots q\}$ . We have:
537
+
538
+ $$
539
+ x _ {t} = R _ {i, t} + M _ {i, t} p _ {i} ^ {w _ {i}}, \tag {12}
540
+ $$
541
+
542
+ where $M_{i,t}$ is an integer.
543
+
544
+ Substituting Equations (11) and (12) into the definition of $R_{i,t + 1}$ :
545
+
546
+ $$
547
+ \begin{array}{l} R _ {i, t + 1} = x _ {t + 1} \mod p _ {i} ^ {w _ {i}}, \\ = \left[ \left(a x _ {t} + c\right) \mod m \right] \mod p _ {i} ^ {w _ {i}}, \\ = \left(a x _ {t} + c\right) \mod p _ {i} ^ {w _ {i}}, \\ = \left(a R _ {i, t} + a M _ {i, t} p _ {i} ^ {w _ {i}} + c\right) \mod p _ {i} ^ {w _ {i}}, \\ = \left(a R _ {i, t} + c\right) \mod p _ {i} ^ {w _ {i}}. \tag {13} \\ \end{array}
548
+ $$
549
+
550
+ Next we consider $z_{i,k,t}$ , which is the lower $k$ base- $p_i$ digits of $R_{i,t}$ :
551
+
552
+ $$
553
+ z _ {i, k, t} = R _ {i, t} \mod p _ {i} ^ {k}. \tag {14}
554
+ $$
555
+
556
+ Similarly, the recurrence of $z_{i,k,t}$ can be simplified as:
557
+
558
+ $$
559
+ \begin{array}{l} z _ {i, k, t + 1} = R _ {i, t + 1} \mod p _ {i} ^ {k}, \\ = \left[ \left(a R _ {i, t} + c\right) \mod p _ {i} ^ {w _ {i}} \right] \mod p _ {i} ^ {k}, \\ = \left(a R _ {i, t} + c\right) \mod p _ {i} ^ {k}, \\ = \left(a z _ {i, k, t} + c\right) \mod p _ {i} ^ {k}. \tag {15} \\ \end{array}
560
+ $$
561
+
562
+ $z_{i,k,t}$ follows an LCG recurrence with the same $a$ and $c$ and a reduced modulus $p_i^k$ . Because $p_i^k$ and $c$ are coprime and $a - 1$ is divisible by $p_i$ , the period of $z_{i,k,t}$ is $p_i^k$ .
563
+
564
+ $\alpha_{i,k,t}$ , which is the lower $k$ -th base- $p_i$ digits of $y_{i,t}$ , can be written as:
565
+
566
+ $$
567
+ \alpha_ {i, k, t} = \frac {z _ {i , k , t} - z _ {i , k - 1 , t}}{p _ {i} ^ {k - 1}}. \tag {16}
568
+ $$
569
+
570
+ Since $z_{i,k,t}$ has period $p_i^k$ , the period of $\alpha_{i,k,t}$ is $p_i^k$ .
571
+
572
+ # G. Fixed Modulus Interpretability
573
+
574
+ In this subsection, we show additional results on the model's behavior on the FM task.
575
+
576
+ ![](images/835571f14a76f0a015d781be40367e74784374d91643bb5de39d4f0d3548b592.jpg)
577
+ (a)
578
+
579
+ ![](images/785280be76924885760da2865d5b0919735797df283d1bb2e8f05d37ca93fd04.jpg)
580
+ (b)
581
+
582
+ ![](images/d8040d10327d2fec2082d98305c3c2d91665cbd264ddbed662d831519d5dfe85.jpg)
583
+ Figure 20. $(m = 2048, l = 1, n_{\mathrm{head}} = 1, d_{\mathrm{model}} = 768)$ Per-digit test accuracies in binary representation, with attention masking (at inference time). $m = 2048 = 2^{11}$ , depth=1, $n_{\mathrm{heads}} = 1, d_{\mathrm{model}} = 768$ , averaged over $a, c$ and initial seeds. (a) For each query, only the attention to key at position $t - 2^k$ (where $k = \lfloor \log_2 t \rfloor$ ) is kept. All other attention weights are masked out. In this case, the model can successfully copy the last $k$ bits, but cannot predict higher bits. (b) For each query, only the attention to key at positions $t - 2^k$ and $t - 2^k$ are kept. All other attention weights are masked out. In this case, the model can predict higher bits with fairly high accuracy – this is remarkable given that majority of the attention weights are masked out.
584
+
585
+ ![](images/22ba733ec41ac83c6609cd5f738e52f54d97a6eab632a5f59ab3821060c2ce47.jpg)
586
+ Figure 21. Test accuracy vs token positions for $m = 2048 = 2^{11}$ , depth=1, various values of $a, c$ . (a,b) $n_{\mathrm{heads}} = 1$ (c,d) $n_{\mathrm{heads}} = 4$ . The accuracies for different $a$ and $c$ are exactly on top of each other.
587
+
588
+ ![](images/bf3475ea644eaa462e2edff6a2f226e4a8732010d0da059fc61d521b6398c37f.jpg)
589
+
590
+ ![](images/56e8008634291f1d9f135bbf3e5eabcde3bb28fd1a857052b7aa6844769c738b.jpg)
591
+
592
+ ![](images/f36fdaef428f3ef2989c0633f0d199d252cc049108ed6dac72144e7ea4a44270.jpg)
593
+ $\mathsf{n}_{\mathrm{heads}} = 1$
594
+
595
+ ![](images/b9ca52828ca00735603dd8d843e6868233488579afe7825d9b3c35035d2a7720.jpg)
596
+
597
+ ![](images/c1aa0d09c6fc6f9d8f16bc7739ec2d22b886564ca7ebadb978acf1e889e18894.jpg)
598
+
599
+ ![](images/aeae76e7e4c27ab7c72409f894a2338e505505f9e50ba8ac89426f8a6714ac2d.jpg)
600
+ $\mathsf{n}_{\mathrm{heads}} = 4$
601
+
602
+ ![](images/3224af968859d88911c9d68020d023a53d1bca543563f1048679aa3264989fbb.jpg)
603
+ Figure 22. Test accuracy for $m = 2048 = 2^{11}$ , depth=1, $n_{\mathrm{heads}} \in \{1,4\}$ , $d_{\mathrm{model}} = 768$ . (a,d) Test accuracy averaged over $a$ , $c$ and initial seeds. (b,e) Multiplication of per-digit test accuracies - matches exactly with the average test accuracy. (c,f) Per-digit accuracy in binary representation.
604
+
605
+ ![](images/a6a5344ca9f3231f9e588327314677b8fa6519d5913229c50941e9c2cdee6808.jpg)
606
+
607
+ ![](images/42c85500aa503b7aaaf8a6cb94f971060cb00e4a5513487066603516c74a1bab.jpg)
608
+
609
+ ![](images/958f1eb64bfe2460e1c25e6c436f1eec4bd113d8f2927eb6249f05f3da3ad213.jpg)
610
+
611
+ ![](images/bdddc723740b440b7050dccf762a5772fc762a85c1a167db364ebb5497efc3fa.jpg)
612
+
613
+ ![](images/c55b9f834967cbcae94ef4075d3eeae81d0a13faafe9e42cba4424fcfce9a415.jpg)
614
+ Figure 23. Test accuracy for $m = 7776 = 2^{5}3^{5}$ , depth=1, $n_{\mathrm{heads}} \in \{1,4\}$ , $d_{\mathrm{model}} = 768$ . (a,d) Test accuracy averaged over $a$ , $c$ and initial seeds. (b,e) Multiplication of per-digit test accuracies - matches exactly with the average test accuracy. (c,f) Per-digit accuracy in RNS representation.
615
+
616
+ ![](images/72d112e45329b322459bddfa6f723f61ae6876696dbbf15b499a55ff380c8d18.jpg)
617
+
618
+ ![](images/56b1af2c47f2bd3a0644ec2f50f3e1e7611624ea6a3589ca15be5b29d93ac619.jpg)
619
+
620
+ ![](images/75766eb596a48cf468b7f1f557014b4ab0ce7ef8615e58dea99da6b84119d909.jpg)
621
+ Figure 24. Projections along Top 6 principal components of the embedding matrix, for $m = 512$ , depth=1, $n_{\mathrm{heads}} = 1$ , $d_{\mathrm{model}} = 768$ .
622
+
623
+ ![](images/3bf0720cf121719393463884bb1e4cb2f6e1c22a0e933a077c269c3ed2b38e98.jpg)
624
+ Figure 25. Projections along Top 6 principal components of the embedding matrix, for $m = 7776$ , depth=1, $n_{\mathrm{heads}} = 1$ , $d_{\mathrm{model}} = 768$ .
625
+
626
+ ![](images/e6b313689d59dd0f1d4fb1adec88ef2201b83e3bc85844723f1cf83897be8d2e.jpg)
627
+ Figure 26. Projections along Top 6 principal components of the embedding matrix, for $m = 1800$ , depth=1, $n_{\mathrm{heads}} = 1$ , $d_{\mathrm{model}} = 768$ .
628
+
629
+ # H. Unseen Modulus Interpretability
630
+
631
+ # H.1. Extra PCA plots for first layer heads
632
+
633
+ We present additional PCA analyses of attention heads shown in Figure 8, examining $\mathrm{PCA}(H^{(h)}[:t,:])$ for each head $h$ across various combinations of $a$ , $c$ , $x_0$ , $m_{\mathrm{test}}$ , and position $t$ . The results are depicted in Figure 27, where we include two additional first-layer heads (heads 2 and 3) that are responsible for performing operations related to modulo 5. Notably, with different choices of $a$ , $c$ , $m_{\mathrm{test}}$ and $t$ compared to Figure 8 (a1, b1, c1), the clustering behavior remains unchanged.
634
+
635
+ Note the emergence of attention heads dedicated to processing modulo 2, 3, 5, and 7 can likely be attributed to the prevalence of these prime factors in the training set.
636
+
637
+ ![](images/b1ec28789f87e0819c80714c666f828e16268c504494924cfcd10516657f6de4.jpg)
638
+ (a) $a = 13, c = 3, m_{\mathrm{test}} = 2048, t = 0$
639
+
640
+ ![](images/073bab906c5487bfbbcdff35f01421bc718693424343f567fc23866737d5d092.jpg)
641
+ (b) $a = 9, c = 3, m_{\mathrm{test}} = 2048, t = 128$
642
+
643
+ ![](images/334aa10c0e42894403dd78ed238f946e703e409b78856eab0affb7a7754a501e.jpg)
644
+ (c) $a = 61, c = 7, m_{\mathrm{test}} = 1800, t = 47$
645
+ Figure 27. PCA analysis of first-layer heads. Although the ordering of numbers varies, the grouping behavior discussed in Section 4.3 remains invariant to changes in $a$ , $c$ , $m$ , $x_0$ , and $t$ . Note that the last head is the head that appears in Figure 9, which does not exhibit a strong grouping bias.
646
+
647
+ # H.2. Pruning heads corresponding to irrelevant prime factors
648
+
649
+ To further validate our findings from Figure 8 in Section 4.3 regarding the correlation between attention heads and digit-wise accuracy, we conduct additional pruning experiments. The results of these experiments are presented in Figures 28 and 29.
650
+
651
+ # H.3. Patching other heads
652
+
653
+ In Figure 30, we present patching experiments for heads not previously shown in Figure 9. We focus only on selected heads where patching significantly affects predictions. Notably, none of these cases exhibit qualitative changes stemming from modulus alterations, further supporting our assertion that the head shown in Figure 9 is specifically responsible for estimating $m_{\mathrm{test}}$ .
654
+
655
+ ![](images/10cc670292f49c83c03da65202813b1d6faf44e795cfe9cc7611f544f8da5a87.jpg)
656
+ (a) Original Model
657
+
658
+ ![](images/90595d32ad83d61df54fe049444135599c42523c2501df2ced5e75d37df435da.jpg)
659
+ Figure 28. Per-digit accuracy for $m_{\mathrm{test}} = 2048$ after pruning specific attention heads. (a) Results from the same model used in Section 4.3, identical to Figure 8 (b2); (b) Performance after pruning the attention head responsible for grouping numbers by their values modulo 3, which is irrelevant for solving sequences with $m_{\mathrm{test}}$ (containing only the prime factor 2). After pruning, the model's performance shows marginal improvement for specific early bits at lower token positions; (c) Performance after pruning the attention head responsible for grouping numbers by their values modulo 14. The model's performance on $m_{\mathrm{test}}$ decreases significantly, as this head partially contributes to processing relevant prime factors. However, since the primary head responsible for binary representation remains intact, the model maintains partial functionality.
660
+
661
+ ![](images/1a3f4775a59445010a65b3466a4297139718b3dd4dd47f38656d34463d6c61aa.jpg)
662
+ (b) Prune modulo 3 head
663
+
664
+ ![](images/1fd84f1f6d5031cd127f8dc54d6a77f06f44d96d97290cf68903dddee71ae804.jpg)
665
+
666
+ ![](images/8abc471f70e010bf2a986fd4cf3d91c28342ad96d223d423fcbc0bbfc14ae1be.jpg)
667
+ (c) Prune modulo 14 head
668
+
669
+ ![](images/96e80a680c3d5e17d2d347aacb66829aa11de82ff6fcd20732fb3453dd9e295c.jpg)
670
+ (a) Original Model
671
+
672
+ ![](images/8041e1fb05aefd2190ecece2df8f48322add51af25a59c5b2db9efdc1e66e0b8.jpg)
673
+
674
+ ![](images/f04ff29abfe8199a18e75f18505a4d54c2de6c634d3b70f187925296bd45f16e.jpg)
675
+ (b) Prune modulo 3 head
676
+
677
+ ![](images/d2bc6ea71ca42a39eb0c5920a25bea575685153c17df9c32fc982e5eb3780c59.jpg)
678
+
679
+ ![](images/a91185ec9a36a012dd33bcda96a650439ca9a0df4f2660a1dac1ea24a13e05b2.jpg)
680
+ (c) Prune modulo 2 head
681
+ Figure 29. Per-digit accuracy for $m_{\mathrm{test}} = 2352$ after pruning specific attention heads. (a) Results from the same model used in Section 4.3, identical to Figure 8 (b2); (b) Performance after pruning the attention head responsible for grouping numbers by their values modulo 3, which is relevant for one specific digit in this case. After pruning, the model's performance shows a clear degradation, with the strongest one happening exactly at the digit corresponding to modulo 3 (c) Performance after pruning the attention head responsible for grouping numbers by their values modulo 2. The model's performance on $m_{\mathrm{test}}$ got obliterated, as there are many base-2 digits in the RNS representation of $m_{\mathrm{test}}$ in this case.
682
+
683
+ # H.4. In-accurate estimation of $m_{\mathrm{test}}$
684
+
685
+ From the cosine-similarity panel in Figure 9, we observe that the model's estimation approximates the target $m_{\mathrm{test}} = 2048$ . However, detailed analysis reveals that the highest cosine-similarity occurs at $m_{\mathrm{est}} = 2033 = 19 \cdot 107$ , with neighboring values exhibiting similarly high cosine-similarity values. If we assume $m_{\mathrm{est}}$ represents the model's internal belief, then the prime representation would consist solely of powers of 19 and 107. Such a representation can only produce periodic structures for the $k$ -th bit of a binary number when $r = \operatorname{lcm}(19, 2^k)$ . Consequently, patterns before reaching that period would appear random in this representation, providing a weaker signal compared to the correct representation. This explains why the model preferentially selects binary representation for lower bits when $m_{\mathrm{test}} = 2048$ .
686
+
687
+ For higher bits, the low-bit representation can be determined up to $2^{k}$ bits through copying. If the model utilizes this information in later stages, the precision of $m_{\mathrm{est}}$ can be drastically improved. Specifically, when $\lfloor m_{\mathrm{est}} / 2^{k}\rfloor = \lfloor m_{\mathrm{test}} / 2^{k}\rfloor$ , the model can identify the correct representation as long as $|m_{\mathrm{test}} - m_{\mathrm{est}}| < 2^{k}$ . This argument can be extended to any other composite $m_{\mathrm{test}}$ . Note that this argument is hypothetical; further proof of this mechanism remains in future work.
688
+
689
+ ![](images/c1db80e1996ab297bd242d901d633b59561aef93956b83d446d663d0649a0b7f.jpg)
690
+ (a) layer 1, head 4
691
+
692
+ ![](images/f2039128028f180c0a9595377293d015b56c26fa4b56e7a109f863f9c3f32b8b.jpg)
693
+ (b) layer 2, head 4
694
+
695
+ ![](images/3595517a7b1a9af87b40f81fab429afaa1f85dd5dcd868eed860e0d764a0af6e.jpg)
696
+ (c) layer 3, head 6
697
+
698
+ ![](images/eb38ba6877978eb1fa0e48a4e89a3f1ac0c7ccd2ce3a567a6ff86a0fd0ef5133.jpg)
699
+ (d) layer 4, head 1
700
+ Figure 30. Patching experiments following the setting of Figure 9 in the main text. None of these heads, after patching, make the model believe that the modulus is close to $m_{\mathrm{patch}}$ .
701
+
702
+ # H.5. Evidence for Step iii
703
+
704
+ In Figure 31, we present attention patterns and token distance statistics for a selected attention head in later layers, with the same model as the one used in Section 4.3. The token distances are measured by the spacing between keys with top-4 attention weights for a given query. Our analysis reveals that the model develops a head capable of dynamically adjusting their lookback distance for computations based on $m_{\mathrm{test}}$ , which we interpret as evidence for step iii of the algorithm proposed in Section 4.3.
705
+
706
+ ![](images/6220d430e5c2fea70722a15f0cd082dec9383fd23c160f0804409c232e5d3ebe.jpg)
707
+
708
+ ![](images/f82988a2771b9f78834c484041256633d65d42794d1c79d960f1647eee86d450.jpg)
709
+
710
+ ![](images/be95ceb84595ac57ffa46462bd5bbf517aed741ec44de5b4a8c34c4b847cb6f3.jpg)
711
+ Figure 31. Attention patterns and token distance statistics for layer 2, head 3 of the model analyzed in Section 4.3. (a1, b1) Results for a sequence with $m_{\mathrm{test}} = 2048$ , $a = 5$ , and $c = 31$ . The statistics reveal that the model consistently looks back at distances that are multiples of 4, which divides $m_{\mathrm{test}}$ and enables the correct copy behavior. (a2, b2) Results for a sequence with $m_{\mathrm{test}} = 2352$ , $a = 85$ , and $c = 5$ . In contrast to panels (a1, b1), the same attention head now consistently looks back at distances that are multiples of 14, which allows the model to copy lower digits from the context. This adaptive behavior demonstrates that the model has acquired the ability to dynamically adjust its lookback distance by $r$ iterations to copy the lower digits and leave the higher digits to the later layers for computation.
712
+
713
+ ![](images/8ada2e81f49ee242ce6bd35a092a2df76a42e80cca31f4b92da0e64d1c1765ce.jpg)
714
+
715
+ # I. Scaling Up the Modulus
716
+
717
+ # I.1. Base-b tokenization
718
+
719
+ To convert an integer $x$ to base $b$ with the least significant digit (LSD) first, repeatedly divide $x$ by $b$ , storing remainders:
720
+
721
+ $$
722
+ d _ {k} = x \mod b, \quad x = \lfloor x / b \rfloor . \tag {17}
723
+ $$
724
+
725
+ Stop when $x = 0$ . The sequence $(d_0, d_1, \ldots)$ is the base- $b$ representation in LSD-first order.
726
+
727
+ Example: Converting $x = 3,214,748,365$ to base 256:
728
+
729
+ $$
730
+ 3, 2 1 4, 7 4 8, 3 6 5 \div 2 5 6 = 1 2, 5 5 7, 6 1 0 \text {r e m a i n d e r} 2 0 5, \quad d _ {0} = 2 0 5,
731
+ $$
732
+
733
+ $$
734
+ 1 2, 5 5 7, 6 1 0 \div 2 5 6 = 4 9, 0 5 3 \text {r e m a i n d e r} 4 2, \quad d _ {1} = 4 2,
735
+ $$
736
+
737
+ $$
738
+ 4 9, 0 5 3 \div 2 5 6 = 1 9 1 \text {r e m a i n d e r} 1 5 7, \quad d _ {2} = 1 5 7,
739
+ $$
740
+
741
+ $$
742
+ 1 9 1 \div 2 5 6 = 0 \text {r e m a i n d e r} 1 9 1, \quad d _ {3} = 1 9 1.
743
+ $$
744
+
745
+ The final LSD-first representation consists of four tokens:
746
+
747
+ $$
748
+ (2 0 5, 4 2, 1 5 7, 1 9 1) _ {2 5 6}.
749
+ $$
750
+
751
+ Each token is then one-hot encoded into a $b$ -dimensional vector, where only the index corresponding to the token value is set to 1. These one-hot vectors are then fed into a token embedding layer with an embedding dimension of $d_{model} = 1024$ .
752
+
753
+ # I.2. Abacas Embeddings
754
+
755
+ The positional embedding for the $j$ -th lower digit of the $i$ -th number in the sequence is defined as:
756
+
757
+ $$
758
+ \operatorname {P o s E m b e d} \left(T _ {i, j}\right) = E _ {\text {i n t}} (i) + E _ {\text {d i g i t}} (j) \tag {18}
759
+ $$
760
+
761
+ where $T_{i,j}$ represents the token corresponding to the $j$ -th digit of the $i$ -th integer.
762
+
763
+ - $E_{\mathrm{int}}(i), E_{\mathrm{digit}}(j) \in \mathbb{R}^{d_{\mathrm{model}}}$ are learnable embeddings.
764
+ - $E_{\mathrm{int}}(i)$ encodes the integer's position in the sequence.
765
+ - $E_{\mathrm{digit}}(j)$ encodes the digit's relative position within the integer.
766
+
767
+ This embedding scheme ensures that each token captures both the integer's global position and the byte's local position. Figure 32 provides a visualization of base- $b$ tokenization and abacus embedding.
768
+
769
+ # I.3. Fixed Modulus
770
+
771
+ For each modulus $m = 2^k$ , where $k \in [16,32]$ , we train a 2-layer GPT model with an embedding dimension of 1024 and a vocabulary size 256. The train set consists of $n_a = 1024$ multipliers and $n_c = 1024$ increments, selected via the Hull-Dobell theorem. One LCG sequence of length 512 is included in the train set for each (a, c) pair, resulting in a total training set size of $n_a \times n_c = 1,048,576$ . For each modulus, the model is trained for 200,000 steps with a batch size of 512. The context length is $512 \times$ the digit length of $m$ in the byte representation $-1$ . For $m = 2^{32}$ , the digit length in byte representation is 4; therefore, the context length is 2047. Training was performed using 4 A100 GPUs over a total duration of 21.82 hours. For $m = 65536$ , the digit length in byte representation is 2, resulting in a context length of 1023, with training taking 4.83 hours. For each modulus, the test set includes 512 unseen $a$ values and 64 unseen $c$ values selected via the Hull-Dobell theorem.
772
+
773
+ The model may converge to different solutions depending on two random seeds: one for model initialization and batch shuffling, and another for dataset generation. Figure 35 shows the median performance across five runs, with the shaded region representing the range between the minimum and maximum values. For larger moduli, not all models successfully find a solution that achieves $100\%$ test accuracy.
774
+
775
+ ![](images/6d73c60ebaf0e6b9176b59ddf36af0076f246be0a3e581b073a0f4c6b687abdb.jpg)
776
+ Figure 32. Visualization of base- $b$ tokenization and abacus embeddings. Abacus embedding 1 is shared by all the digits within the integer, while Abacus embedding 2 varies within the digit but is shared by all integers.
777
+
778
+ ![](images/d69bfcb238ca833a2926bfe412a4e27536dc47d38e7e288315bfc33f5e692520.jpg)
779
+ (a) PyTorch seed $= 9$ dataset seed $= 71$
780
+
781
+ ![](images/ac2a8d9c938dbe3a3275786625bfe0451d9d08edd81241931c1c2f3021ffa1d2.jpg)
782
+ (b) PyTorch seed $= 10$ data seed $= 71$
783
+
784
+ ![](images/6da603b5f4d3331fc75fb1d48fd4bc2dca5f6b3ae18108ff9bc56278a512632f.jpg)
785
+ (c) PyTorch seed $= 11$ data seed $= 71$
786
+
787
+ ![](images/0c45140f23672a8049b33b251633f3e4de088abd6b120d218f26ac5cb4e66667.jpg)
788
+ (d) PyTorch seed $= 11$ data seed $= 71$
789
+
790
+ ![](images/3b904366f044d9ce10bc88e9843d24b054b78abca2ce35bc79efe3a1b2a67877.jpg)
791
+ (e) PyTorch seed $= 11$ data seed $= 72$
792
+
793
+ ![](images/c0a32a2307fdb0428217bbab9f1b8a16bc4ccbd6034b32240c5acb076fc5fe5a.jpg)
794
+ (f) PyTorch seed $= 11$ data seed $= 73$
795
+ Figure 33. Test accuracy vs. Number index for $m = 2^{20}$ . First Row: Three models trained on the same dataset, each using a unique PyTorch random seed that controls model initialization and batch shuffling. Second Row: Three models trained on different datasets, with each dataset generated using a unique random seed controlling NumPy randomness for sampling $a$ , $c$ , and $x_0$ . All models converged to solutions that achieved and sustained $100\%$ test accuracy, but differed in the number of in-context examples required to reach this performance.
796
+
797
+ ![](images/12e69234a78123ef07e1b5c79cc8de1f38756b2271ae099eb6b041206e7133f2.jpg)
798
+ (a) PyTorch seed $= 9$ dataset seed $= 71$
799
+
800
+ ![](images/ac94ec6d62ebbc87f69d98b6a06c06e342bd6f7428e91003d18f9fda224734c6.jpg)
801
+ (b) PyTorch seed $= 10$ dataset seed $= 71$
802
+
803
+ ![](images/b7558882a7af56bb050bda701fdbb24cd6a152611ebbfc49a5d5ff9daded6d70.jpg)
804
+ (c) PyTorch seed $= 11$ dataset seed $= 71$
805
+
806
+ ![](images/8d9f0c254bc071836e922e78103c65b6e6795b1e95cb72ce546a316175cde559.jpg)
807
+ (d) PyTorch seed $= 11$ dataset seed $= 71$
808
+
809
+ ![](images/5ce5d7cde2793e8de091a1356f4a884b23ed24b23be2ac08deff8ebfe8f8c786.jpg)
810
+ (e) PyTorch seed $= 11$ dataset seed $= 72$
811
+
812
+ ![](images/ed082fb1bb846d2d321ec5195e1ff77061c77231295d25fd1502f8dedaf89233.jpg)
813
+ (f) PyTorch seed $= 11$ dataset seed $= 73$
814
+ Figure 34. Test accuracy vs Number index for $m = 2^{32}$ . First Row: Three models trained on the same dataset, each using a unique PyTorch random seed that controls model initialization and batch shuffling. Second Row: Three models trained on different datasets, with each generated using a unique random seed controlling NumPy randomness for sampling $a$ , $c$ , and $x_0$ . Only one of the five models found a solution that achieved and sustained $100\%$ test accuracy.
815
+
816
+ ![](images/d72fc4e922fe24c4e74677675cf4bd511de307be24e82d4b8a4b8e8778627db6.jpg)
817
+ Figure 35. Median number of in-context sequence elements required to achieve $100\%$ test accuracy across five runs. The shaded region represents the min-max range.
818
+
819
+ # I.4. Unseen Modulus
820
+
821
+ We train a 6-layer GPT model on a dataset that comprises $n_m = 32$ , 768 moduli, with $n_a = 128$ training $a$ values and $n_c = 1$ training $c$ values per modulus. This results in a total of $n_m \times n_a \times n_c = 4$ , 194, 304 sequences, each of length 512 in the training set. In Figure 36a, where the tokenization base is 256, $1024 < m_{\mathrm{train}} < 65536$ . In Figure 36b, where the tokenization base is 243, $1024 < m_{\mathrm{train}} < 59049$ . Multipliers are selected based on the Hull-Dobell theorem when
822
+
823
+ sufficient qualifying $a$ values are available; otherwise, random $a$ values are used to ensure 128 multipliers for each modulus. The models with approximately 76M parameters were trained on 16 million sequences over 400,000 steps, using a batch size of 128 on a single H100 GPU for 22.62 hours. Because LCGs are typically defined for moduli that are powers of prime numbers, the model is tested on moduli that are powers of the primes 2, 3, 5, and 7. The test set consists of 512 unseen $a$ values and 64 unseen $c$ values selected via the Hull-Dobell theorem for each test modulus.
824
+
825
+ Test performance is influenced by the tokenization base, exhibiting a bias toward moduli that share the same base as the tokenization method. For instance, in Figure 36 (a) when using a byte-level representation, the model achieves better performance on moduli $m_{\mathrm{test}} = 2^k$ compared to $m_{\mathrm{test}} = 3^k$ , $5^k$ , or $7^k$ . As contrasted with Figure 36 (b) where the tokenization base is $243 = 3^5$ , the model performs better on moduli $m = 3^k$ . This behavior is likely due to the property of LCGs, where for moduli that are powers of a prime $b$ , the lowest $k$ -th digit exhibits a period of $b^k$ . Tokenization in such a base highlights this periodic structure, making it more apparent and easier for the model to leverage during training and prediction.
826
+
827
+ ![](images/8b25e565c898ab89861ad1d6713d642e51ab76cc198a2a1688ee022446b4a914.jpg)
828
+ (a) Tokenization base $= 256 = 2^{8}$
829
+
830
+ ![](images/92ec39c8c9d33b05cb145941996a1d44716e6c389864a97debbedd259d2a9681.jpg)
831
+ (b) Tokenization base $= 243 = 3^{5}$
832
+ Figure 36. Test accuracy vs Number index. In (a), the moduli 2048 and 16384 (blue curves) have the same root 2 as the tokenization base 256. The model performs better on these two moduli. In (b), the moduli 2178 and 19683 (orange curves) have the same root 3 as the tokenization base 243. The model performs better on these two moduli.
2025/(How) Can Transformers Predict Pseudo-Random Numbers_/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e78b85ecc5fb868931aeb513e68b9cc76a375fb1715d578284913a92e89fde0
3
+ size 1986865
2025/(How) Can Transformers Predict Pseudo-Random Numbers_/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/(How) Do Language Models Track State_/695912dc-99b2-4f17-bf7d-f54159e0f6ec_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/(How) Do Language Models Track State_/695912dc-99b2-4f17-bf7d-f54159e0f6ec_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/(How) Do Language Models Track State_/695912dc-99b2-4f17-bf7d-f54159e0f6ec_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:acdc090bc88df6c53416e658b89d34b0df3ea9cf023906f0df615c06324d8d03
3
+ size 17520536
2025/(How) Do Language Models Track State_/full.md ADDED
@@ -0,0 +1,625 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # (How) Do Language Models Track State?
2
+
3
+ Belinda Z. Li<sup>1</sup> Zifan Carl Guo<sup>1</sup> Jacob Andreas<sup>1</sup>
4
+
5
+ # Abstract
6
+
7
+ Transformer language models (LMs) exhibit behaviors—from storytelling to code generation—that seem to require tracking the unobserved state of an evolving world. How do they do this? We study state tracking in LMs trained or fine-tuned to compose permutations (i.e., to compute the order of a set of objects after a sequence of swaps). Despite the simple algebraic structure of this problem, many other tasks (e.g., simulation of finite automata and evaluation of boolean expressions) can be reduced to permutation composition, making it a natural model for state tracking in general. We show that LMs consistently learn one of two state tracking mechanisms for this task. The first closely resembles the "associative scan" construction used in recent theoretical work by Liu et al. (2023) and Merrill et al. (2024). The second uses an easy-to-compute feature (permutation parity) to partially prune the space of outputs, and then refines this with an associative scan. LMs that learn the former algorithm tend to generalize better and converge faster, and we show how to steer LMs toward one or the other with intermediate training tasks that encourage or suppress the heuristics. Our results demonstrate that transformer LMs, whether pre-trained or fine-tuned, can learn to implement efficient and interpretable state-tracking mechanisms, and the emergence of these mechanisms can be predicted and controlled. Code and data are available at https://github.com/belindal/state-tracking.
8
+
9
+ # 1. Introduction
10
+
11
+ Language models (LMs) are trained to model the surface form of text. A growing body of work suggests that model internals contain a latent, decodable state of the world—e.g., situations described by language and results of program
12
+
13
+ execution—to support prediction (Li et al., 2021; Nanda et al., 2023; Li et al., 2023). However, the mechanisms that LMs use to construct these representations are not understood. Do LMs simulate state evolution step by step across successive hidden layers or token representations (Yang et al., 2024)? Are states approximated through a complex collection of heuristics (jylin04 et al., 2024)? Is state tracking an illusion (Bender & Koller, 2020)?
14
+
15
+ This paper studies the implementation and emergence of state tracking mechanisms in language models using permutation composition as a model system: given a fixed set of objects, we train or fine-tune LMs to predict the final position of each object after a sequence of rearrangements. Previous work has used versions of this task to evaluate LMs' empirical state tracking abilities (Li et al., 2021; Kim & Schuster, 2023; Li et al., 2023). Additionally, as shown by Barrington (1989), many complex, natural, state-tracking tasks—including simulation of finite automata and evaluation of Boolean expressions—can be reduced to permutation tracking with five or more objects. This makes it a natural model for studying state tracking in general.
16
+
17
+ Our analysis proceeds in several steps. §2 provides technical preliminaries: §2.1 and §2.2 introduce state tracking problems and the permutation composition task we use to model them (Figure 1A), and §2.3 reviews the set of interpretability tools we use to analyze LM computations. Next, §3 lays out a family of algorithms that past work has suggested LMs might, in principle, use to solve the state tracking task (Figure 1D), and describes the signatures—expected readouts from different interpretability methods—that we would expect to find if a given algorithm is implemented (Figure 1B-C).
18
+
19
+ Finally, §4 and §5 present experimental findings. Across a range of sizes, architectures, and pretraining schemes, we find that LMs consistently learn one of two state tracking mechanisms. The first mechanism, which we call the "associative algorithm" (AA), resembles the associative scan construction used by Liu et al. (2023) and Merrill & Sabharwal (2024) to establish theoretical lower bounds on the expressive capacity of Transformers. The second mechanism, which we call the "parity-associative algorithm" (PAA), first rules out a subset of final states using an easy-to-compute permutation parity heuristic, then uses an associative scan
20
+
21
+ ![](images/318e6e0a15a2fd87446f93e8111f7c93846fd53b9d28737e4e3830b30d721cb8.jpg)
22
+
23
+ ![](images/81ed49a8702dd39b4e0e8d5a4829b9ae2aebd38190ae58e3a61896e502f9f215.jpg)
24
+ D Transformer-Implementable Algorithms
25
+
26
+ # B Prefix Patching Signature
27
+
28
+ How much of prefix must be modified at each layer to change outputs?
29
+
30
+ Patch prefix up to this token on this layer
31
+
32
+ ![](images/ec76a7c08c09824724940567450ba0f0ce346da52e7f3b0f8bf7cb0037bf832e.jpg)
33
+
34
+ Correctly predicts final state when prefix up to this cell is patched.
35
+ Rules out a subset of states, but does not uniquely identify the correct state, when prefix up to this cell is patched.
36
+ Predicts final state with chance accuracy.
37
+
38
+ # C Probing Signature
39
+
40
+ What percentage of the state/ state parity sequence can be accurately probed from LMs' intermediate layers?
41
+
42
+ Train linear probe to decode $n$ th state in sequence from $n$ th position in each layer's representations
43
+
44
+ ![](images/fc83095bc76fa64fcc0efdba5398679bb9b6a138c58a9075e96149d0127f5a97.jpg)
45
+
46
+ State Probe
47
+ State Parity Probe (chanc accuracy is 0.5)
48
+
49
+ ![](images/8b9990711acc8202f0625d374c5362e075bce2a78e8f71a66aa277a8610ee7ea.jpg)
50
+ Figure 1. We use permutation word problems as a simple model of state tracking. Actions are permutations, and states are the products of those permutations; the current state can be tracked by taking the cumulative product from left to right (§2). We identify several possible algorithms that Transformers may use to solve permutation word problems: sequential, parallel, associative, and parity-associative (§3). Above, we depict the "signatures" of each algorithm under two types of interpretability analysis: prefix patching, where we create pairs of prompts differing only on the first token, then substitute all activation except the prefix up to a token at a particular layer, and probing, where we train a linear probe to map from last-token representations across the layers to either the final state or the final state parity (§2.3). Note: the dotted lines indicate two different probing signatures consistent with this algorithm (see Appendix C.3 for more details).
51
+
52
+ to obtain a final prediction. Notably, we fail to find evidence for either step-by-step simulation or fully parallel composition, despite their being theoretically implementable by LMs. We support our findings with evidence from representation interventions (Meng et al., 2022; Zhang & Nanda, 2024; §4.2), probes (Shi et al., 2016; §4.3), patterns in prediction errors (Zhong et al., 2024; §4.4), attention maps (Clark et al., 2019; §4.5), and training dynamics (McCoy et al., 2020;
53
+
54
+ Olsson et al., 2022; Hu et al., 2023; §5.1).
55
+
56
+ The scan operation for PAA appears difficult for LMs to implement robustly, and the choice of mechanism sometimes significantly impacts model performance on long sequences (§5.1). Whether a given LM learns AA or PAA is highly stochastic (§5.2). However, each is associated with a characteristic set of phase transitions in the training loss (Chen et al., 2024), and LMs can be steered toward one solution or
57
+
58
+ the other by training on an intermediate task that encourages or discourages LMs from learning a parity heuristic (§5.3).
59
+
60
+ As pretrained LMs sometimes re-use circuits when finetuned on related tasks (Prakash et al., 2024; Merullo et al., 2024), our results suggest a possible mechanism by which real-world LMs might perform state tracking when modeling language, code, and games. We show preliminary evidence of these algorithms on a version of our permutation composition tasks expressed in natural language (Appendix E). Looking beyond state tracking, these findings underscore both the complexity and variability of LM solutions to complex tasks, which may involve both heuristic features and structured solutions.
61
+
62
+ # 2. Background and Preliminaries
63
+
64
+ # 2.1. State Tracking
65
+
66
+ Inferring common ground in discourse (Li et al., 2021), navigating the environment (Vafa et al., 2024), reasoning about code (Merrill et al., 2024), and playing games (Li et al., 2023; Karvonen, 2024) all require being able to track the evolving state of a real or abstract world. There has been significant interest in understanding whether (and how) LMs can perform these tasks. In theoretical work, researchers have observed that many natural state-tracking problems (including the ones listed above) are associated with the complexity class $\mathsf{NC}^1$ , but Transformers cannot track the state of arbitrarily long inputs (Merrill et al., 2022; Huet et al., 2025; Bhattamishra et al., 2020; Delétang et al., 2023; Strobl et al., 2024). However, prior work has shown that Transformers with $O(\log n)$ depth can model inputs of up to length $n$ (Liu et al., 2023; Merrill & Sabharwal, 2024). Empirical work, meanwhile, has found that large LMs learn to solve state tracking problems (Kim & Schuster, 2023) and encode state information in their representations (Li et al., 2021; Li et al., 2023). But a mechanistic understanding of how trained LMs infer these states has remained elusive.
67
+
68
+ # 2.2. Permutation Group Word Problems
69
+
70
+ Toward this understanding, the experiments in this paper focus on one specific state tracking problem, permutation composition. At a high level, this problem presents LMs with a set of objects and a sequence of reshuffling operations; LMs must then compute the final order of the objects after all reshufflings have been applied (Figure 1A). Though less familiar than discourse tracking or program evaluation, Kim & Schuster (2023) used a version of this task to evaluate LM state tracking. More importantly, as shown by Barrington (1989) and recently highlighted by Merrill et al. (2024), permutation tracking (with five or more objects) is $\mathsf{NC}^1$ -complete, meaning any other state tracking task in this family can be converted into a permutation tracking class.
71
+
72
+ This, combined with its simple structure, makes it a natural model system for studying state tracking in general.
73
+
74
+ More formally, the finite symmetric group $S_{n}$ comprises the set of permutations of $n$ objects equipped with a composition operation. For example, 42315 denotes the permutation of 5 objects (i.e. in $S_{5}$ ) that moves the first object to the fourth position, the second object to the second position, etc. Importantly for our findings in this paper, every permutation can be expressed as a composition of two-element swaps (in Figure 1A, $a_{0}$ , but not $a_{1}$ , is an example of a swap). The parity of a permutation (even or odd) is the parity of the number of swaps needed to create it.
75
+
76
+ The composition of two permutations, standardly denoted $a_1 \circ a_0$ , is the result of applying $a_1$ after $a_0$ . Inputs to sequence models in machine learning are typically written with earlier inputs before later inputs (i.e., left-to-right), so for consistency with this convention, we will write $a_0a_1$ to denote the application of $a_0$ then $a_1$ . Figure 1A shows the result of composing 42315 and 12534 in sequence.
77
+
78
+ Finally, the word problem on $S_{n}$ is the problem of computing the product of a sequence of permutations. This product itself corresponds to a single permutation (32514 in Figure 1). But, following the intuition given at the beginning of the section, it may equivalently be interpreted as the final ordering of the objects being rearranged (DBAEC in Figure 1A). Following this intuitive explanation (and by analogy to other state tracking problems), we will use $a_{t}$ to denote a single permutation ("action") in a sequence, and $s_{t} = a_{0}\dots a_{t}$ to denote the result of a sequence of permutations (a "state").
79
+
80
+ Given a sequence of permutations, we use $\epsilon(a_{t})$ to denote the parity of the $t$ th permutation, so:
81
+
82
+ $$
83
+ \epsilon \left(s _ {t}\right) = \epsilon \left(a _ {0} \dots a _ {t}\right) = \sum_ {i} \epsilon \left(a _ {i}\right) \mod 2 \tag {1}
84
+ $$
85
+
86
+ (where $\epsilon$ is 0 for even permutations and 1 for odd ones).
87
+
88
+ All experiments in this paper train transformer language models to solve the word problem: they take as input a sequence of actions $[a_0, \dots, a_t]$ , and output a sequence of state predictions $[s_0, \dots, s_t]$ . We also validate our findings on a natural language version of this task in Appendix E, where permutations are expressed as instructions like swap positions 2 and 3.
89
+
90
+ # 2.3. Interpretability Methods
91
+
92
+ Our experiments employ several interpretability techniques to understand how LMs solve permutation word problems, which we briefly describe below. Throughout this paper, we use $h_{t,l}$ to denote the internal LM representation at token position $t$ after Transformer layer $l$ , with $T$ and $L$ denoting the maximum input length and number of layers respectively.
93
+
94
+ Probing In probing experiments (Shi et al., 2016), we fix the target LM, then train a smaller "probe" model (e.g. a linear classifier) to map LM hidden representations $h$ to quantities $z$ hypothesized to be encoded by the LM (Figure 1C). Our experiments specifically evaluate whether (1) the state $s_t$ , and (2) the final state parity is linearly encoded in intermediate-layer representations. For each layer $l$ , we train (1) a state probe to predict $p(s_t \mid h_{t,l})$ and (2) a parity probe to predict $p(\epsilon(s_t) \mid h_{t,l})$ . Given a trained LM, we collect representations on one set of input sequences to train the probe, then evaluate probe accuracy on a held-out set.
95
+
96
+ Activation Patching Probing experiments reveal what information is present in an LM's representations, but not that this information is used by the LM during prediction. Activation patching is a method for determining which representations play a causal role in prediction. Portions of the LM's internal representations are overwritten ("patched") with representations derived from alternative inputs; if predictions change, we may conclude that the overwritten representations was used for prediction (Meng et al., 2022; Zhang & Nanda, 2024; Heimersheim & Nanda, 2024).
97
+
98
+ Let $p(y \mid x; h \gets h')$ denote the probability that an LM assigns to the output $y$ given an input $x$ , but with the representation $h$ replaced by some other representation $h'$ . In a typical experiment, we first construct a "clean" input $x$ that we wish to analyze, and a "corrupted" input $x'$ that alters or removes information from $x$ (e.g. by adding noise or changing its semantics). Next, we compute the most probable outputs from clean and corrupted inputs:
99
+
100
+ $$
101
+ \widehat {y} = \underset {y} {\arg \max } p (y \mid x)
102
+ $$
103
+
104
+ $$
105
+ \widehat {y ^ {\prime}} = \arg \max _ {y} p (y \mid x ^ {\prime})
106
+ $$
107
+
108
+ We then re-run the LM on the corrupted input $x'$ , but substitute a hidden representation from the clean input $x$ , and measure how much prediction shifts toward the clean output $\hat{y}$ using the normalized logit difference (Wang et al., 2023):
109
+
110
+ $$
111
+ \mathrm {N L D} = \frac {\mathrm {L D} \left(x ^ {\prime} ; h _ {t , l} \leftarrow h _ {t , l} ^ {\text {c l e a n}}\right) - \mathrm {L D} \left(x ^ {\prime}\right)}{\mathrm {L D} (x) - \mathrm {L D} \left(x ^ {\prime}\right)} \tag {2}
112
+ $$
113
+
114
+ where
115
+
116
+ $$
117
+ \operatorname {L D} (\cdot) = \log p (\widehat {y} \mid \cdot) - \log p (\widehat {y ^ {\prime}} \mid \cdot)
118
+ $$
119
+
120
+ and the representation $h_{t,l}^{\mathrm{clean}}$ is taken from the clean run of the model. A value of NLD close to 1 indicates that we have restored a part of the circuit that computes $\hat{y}$ .
121
+
122
+ In this paper, we evaluate which representations are involved in prediction by presenting models with a clean sequence $[a_0,a_1,\dots ,a_t]$ associated with a final state $s_t$ . We then produce a corrupted sequence differing only in the first token, $[a_0',a_1,\dots ,a_t]$ , associated with a final state
123
+
124
+ $s_t^\prime$ . We then identify the hidden states that, when patched in, cause the model to output $s_t$ rather than $s_t^\prime$ with high probability. Our main experiments specifically perform prefix patching, where all hidden representations up to index $t$ ( $h_{1:t,l} \gets h_{1:t,l}^{\mathrm{clean}}$ ) are patched at a particular layer $l$ (Figure 1B). Prefix patching allows us to localize how information gets progressively transferred to the final token as we move deeper into the network. A value close to 1 means that some part of the prefix representation was used for prediction; a value close to 0 means that no part was.
125
+
126
+ We also experiment with other types of localization techniques (including suffix and window patching), as well as zero-ablating certain activations in Appendix B.
127
+
128
+ # 3. What Algorithms Can Transformers Implement in Theory?
129
+
130
+ To use the methods described in §2.3 to interpret model behavior, we must first establish a phenomenology for LM state tracking—identifying candidate state tracking algorithms that might be implemented by the model, along with the empirical probing and activation patching results we would expect to find if these algorithms are implemented. Below, we describe a set of state tracking mechanisms suggested by the existing literature.
131
+
132
+ For each mechanism, we first present a sketch of an implementation, in the form of rules for computing the value stored in the hidden state for each layer and timestep. We then describe the "signature" of each algorithm—the result we would expect from the application of prefix patching and probing techniques described in the preceding section.
133
+
134
+ # 3.1. Sequential Algorithm
135
+
136
+ The sequential algorithm composes permutations one at a time from left to right (analogous to a mechanism some LMs use to solve multi-hop reasoning problems; Yang et al., 2024). Signatures of this algorithm would provide evidence that LMs implement step-by-step "simulation" in their hidden states to solve state tracking tasks. In this algorithm, each hidden state $h_{t,l}$ stores the associated action $a_t$ until $s_t$ can be computed, maintaining $h_{t,t} = s_t$ . As shown in the first row of Figure 1D, this computation depends only on hidden states with $l \leq t$ .
137
+
138
+ <table><tr><td>ht,0 = at ∨t</td><td>// initialize actions</td></tr><tr><td>(h0,0 = st)</td><td>// by definition; see §2.2</td></tr><tr><td>for t = 1..T, l = 1..L do</td><td></td></tr><tr><td>if l &lt; t then ht,l = ht,l-1 = at</td><td>// propagate actions</td></tr><tr><td>if l = t then ht,l = ht-1,l-1ht,l-1</td><td></td></tr><tr><td>= st-1at = st</td><td>// update states</td></tr><tr><td>if l &gt; t then ht,l = ht,l-1 = st</td><td>// propagate states</td></tr><tr><td>end for</td><td></td></tr></table>
139
+
140
+ Patching Signature Because of this dependency, any patching experiment that replaces only hidden states with $l > t$ will not affect the final model predictions, leading to the upper triangular patching signature shown in the first row of Figure 1B.
141
+
142
+ Probing Signature Because $s_t$ can only be predicted at layer $l = t$ , we expect a state probe to show a linear dependence on depth: for sequences of maximum length $T$ , a probe at layer $l$ will correctly label an $l / T$ fraction of states. If these state representations linearly encode parity, then the accuracy of the parity probe will also increase linearly; otherwise, it will remain constant.
143
+
144
+ # 3.2. Parallel Algorithm
145
+
146
+ As noted in §2.2, the word problem on $S_{5}$ belongs to $\mathsf{NC}^{1}$ (and thus requires a circuit depth that scales logarithmically with sequence length). The word problem on $S_{3}$ , however, belongs to $\mathsf{TC}^{0}$ , the class of decision problems with constant-depth threshold circuits. See discussion in Appendix A and Merrill & Sabharwal (2023). A constant-depth circuit will give rise to a set of hidden-state dependencies like the second row of Figure 1D.
147
+
148
+ **Patching Signature** Let $l_{P}$ denote the number of layers needed to implement the constant-depth circuit for this task. For patching interventions conducted at or earlier than layer $l_{P}$ , we expect the model's predictions to change; at deeper layers than $l_{P}$ , interventions will have no effect at all, resulting in the L-shaped pattern shown in the second row of Figure 1B.
149
+
150
+ Probing Signature We expect the probe to obtain perfect accuracy within a constant number of layers. Because the algorithm described in Appendix A computes state parity as an intermediate quantity, the parity probe will also obtain perfect accuracy within a constant number of layers.
151
+
152
+ # 3.3. Associative Algorithm
153
+
154
+ In the associative algorithm (AA), Transformers compose permutations hierarchically: in each layer, adjacent sequences of permutations are grouped together and their product is computed. This is analogous to recursive scan in Liu et al. (2023) and flattened expression evaluation in Merrill et al. (2024). This algorithm takes advantage of the associative nature of the product of permutations, whereby $a_0a_1a_2a_3 = (a_0a_1)(a_2a_3)$ . It ensures that $h_{t,l} = a_{t - 2^l +1}\dots a_t$ , and thus that $h_{t,\log (t + 1)} = a_0\dots a_t$ . Signatures of this algorithm would provide evidence that LMs perform state tracking not by encoding states, but rather by mapping between states, for prefixes of increasing length.
155
+
156
+ <table><tr><td>ht,0 = at ∨t</td><td>// initialize actions</td></tr><tr><td>for t = 0..T, l = 1..L do</td><td></td></tr><tr><td>if l ≤ log(t + 1) then</td><td></td></tr><tr><td>ht,l = ht-2l-1,l-1ht,t,l-1</td><td></td></tr><tr><td>= at-2l+1···at</td><td>// compose actions</td></tr><tr><td>else ht,l = ht,t-l-1 = st</td><td>// propagate actions</td></tr><tr><td>end for</td><td></td></tr></table>
157
+
158
+ (Defining $h_{t < 0,l} = h_{0,l}$ for notational convenience.)
159
+
160
+ As seen in the third row of Figure 1D, the model's prediction for $s_t$ depends on the hidden representation $h_{t/2}$ in the layer before the final state is computed, the representation at $h_{t/4}$ in the layer before that, etc.
161
+
162
+ Patching Signature Consequently, for AA, the length of the prefix that must be modified to alter model behavior increases exponentially in depth, resulting in the signature in the third row of Figure 1B.
163
+
164
+ Probing Signature We similarly expect to see an exponentially increasing state probe accuracy (because $s_t$ becomes predictable at layer $l = \log t$ , a probe at layer $l$ will correctly label a $2^l / T$ fraction of states). If state parity is encoded in state representations, then parity probe accuracy will also increase exponentially.
165
+
166
+ # 3.4. Parity-Associative Algorithm
167
+
168
+ In this algorithm (PAA), LMs compute the final state in two stages: first computing the parity of the state (which can be performed in a constant number of layers using a subroutine from the Parallel algorithm); then separately computing the remaining information needed to identify the final state (the "parity complement") using a procedure analogous to AA. (Unlike the preceding algorithms, we are not aware of any previous proposals for solving permutation composition problems in this way; but as we will see, it is useful for understanding interactions between "heuristic" and "algorithmic" solutions in real LMs.)
169
+
170
+ We model implementation of PAA with hidden states comprising two "registers" $\epsilon$ and $\kappa$ (i.e. $h_{t,l} = (\epsilon_{t,l},\kappa_{t,l})$ which store the parity and complement respectively.
171
+
172
+ <table><tr><td>κ0,t = at ∨t</td><td>// initialize actions</td></tr><tr><td>ε0,t = par(st) ∀t</td><td>// compute parities (App. A)</td></tr><tr><td colspan="2">for t = 0..T, l = 1..L do</td></tr><tr><td>εt,l = εt,l-1</td><td>// propagate parities</td></tr><tr><td colspan="2">if l ≤ log(t+1) then</td></tr><tr><td>κt,l = comp(κt-2l-1,l-1κt,l-1)</td><td>// compose</td></tr><tr><td>else κt,l = κt,l-1</td><td>// propagate complements</td></tr><tr><td>end for</td><td></td></tr></table>
173
+
174
+ In this algorithm, the hidden state at position $i$ holds that
175
+
176
+ position's state parity and parity complement (if computed at this point). Parity, like $S_{3}$ , may be computed with a constant number of layers. The algorithm sketch given above is deliberately vague about the implementation of the parity complement composition operation (comp). In practice, different representations of this complement appear to be learned across different runs; see Figure 10 for evidence that these representations are computed using a brittle (and perhaps heuristic- or memorization-based) mechanism.
177
+
178
+ **Patching Signature** If the corrupted input has a different parity from the clean input, then in layers deeper than those used to compute parity, it is necessary to restore the entire prefix to cause the LM to assign full probability to the clean prediction. On these inputs, prefix patching will show a signature similar to the parallel algorithm (see Figure 8B). However, if the corrupted input has the same parity as the clean input, the portion of the hidden state computed in parallel remains the same, while its complement is computed using the same mechanism as the associative algorithm (see Figure 8A). These inputs will thus exhibit an AA-like (exponentially-shaped) patching pattern. When averaged together, parity-matched and parity-mismatched patching will produce a pattern with two regions, one shaped like the associative algorithm (associated with a $50\%$ restoration in accuracy) and one shaped like the parallel algorithm (associated with a $100\%$ restoration in accuracy). Again, this may be most easily understood graphically (Figure 1).
179
+
180
+ Probing Signature We expect state probes to improve exponentially with depth, while parity probes converge to $100\%$ at a constant depth.
181
+
182
+ # 4. What Mechanisms do Transformers Learn?
183
+
184
+ In this section, we compare these theoretical state tracking mechanisms to empirical properties of LMs trained for permutation tasks. It is important to emphasize that the various signatures described above provide necessary, but not sufficient, conditions for implementation of the associated algorithm; the exact mechanism that LMs use in practice is likely complex and dependent on other input features not captured by the algorithms described above.
185
+
186
+ Nevertheless, our experiments successfully rule out some possible state tracking mechanisms and identify algorithmic features likely to be shared between the idealized mechanisms above and the true behavior learned by transformers. Specifically, our experiments yield evidence consistent with the associative algorithm (AA) in some models and the parity-associative algorithm (PAA) in other models, across architectures, sizes, and initializations.
187
+
188
+ # 4.1. Experimental Setup
189
+
190
+ We generate 1 million unique length-100 sequences of permutations in both $S_{3}$ and $S_{5}$ . We split the data 90/10 for training/analysis, and fine-tune these models (using a cross-entropy loss) to predict the state corresponding to each prefix of each action sequence:
191
+
192
+ $$
193
+ \mathcal {L} = - \sum_ {t = 0} ^ {9 9} \log p _ {\mathrm {L M}} \left(s _ {t} \mid a _ {0} \dots a _ {t}\right), \tag {3}
194
+ $$
195
+
196
+ where $p_{\mathsf{LM}}(s_n \mid a_0 \dots a_t)$ is the probability the language model places on state token $s_n$ when conditioned on the length- $n$ prefix of the document.
197
+
198
+ Except where noted, we begin with Pythia-160M models pre-trained on the Pile dataset (Biderman et al., 2023). Regardless of initialization scheme, we fine-tune models for 20 epochs on Equation (3) using the AdamW optimizer with learning rate 5e-5 and batch size 128. For larger models (above 700M parameters), we train using bfloat16.
199
+
200
+ # 4.2. Activation Patching
201
+
202
+ For both the $S_{3}$ and $S_{5}$ tasks, across training runs, we find that activation patching results exhibit two broad clusters of behavior. For some trained models, they match the activation patching signature associated with AA; in others, they match the signature of PAA—even when the only source of variability across training runs is the order in which data is presented. Results for prototypical AA- and PAA-type models, on both $S_{3}$ and $S_{5}$ , are shown in Figure 2. Additional patching results in Appendix B confirm that patching intermediate representations of PAA-type models (the light
203
+
204
+ ![](images/bc50f9384f06bc1811052db8cdecc7144cd3dd06076ef774a8b5d33f67b1ba52.jpg)
205
+ Figure 2. Activation patching on the residual stream for various Pythia models trained on $S_{3}$ and $S_{5}$ . Each cell at layer $l$ and token $t$ represents the probability of the correct final state when the entire prefix up to $t$ at layer $l$ is restored. We find signatures matching the AA and PAA algorithms from Figure 1, with both models ignoring exponentially longer prefixes as we traverse down the layers, and PAA models containing intermediate representations that encode some information about the final state, but not its parity.
206
+
207
+ ![](images/5d1c77e94c6e21d718058bc75e1037dc2faa4c04893c6c3da0cd03a510a24152.jpg)
208
+ Figure 3. Accuracy of state probe and state parity probe across layers on $S_{3}$ and $S_{5}$ models sometimes match signatures for AA, and sometimes PAA. In all models, the state probe accuracy increases roughly exponentially with model depth. We find that in PAA models, the parity of the state is linearly decodable from earlier intermediate layers, while in the AA models shown above, the parity is never linearly encoded in any layer of the model. (In other AA models, the parity can only be linearly decoded at the final layer.)
209
+
210
+ ![](images/9e0c71bbf9652890790b8c5c22472b10d6cbb9ef0e7a84f9ab4130fdc5526c60.jpg)
211
+
212
+ ![](images/e12d896fb9ebe8544949f29de7259d0a7ab75bf68e07412c96df1aecb66e4a93.jpg)
213
+
214
+ ![](images/e7ff7c25d391d19abc10143ea6a9fd4fc53e38c719fc24fc132f639e4393f61d.jpg)
215
+
216
+ ![](images/1f4f3dbacf8fedf46a9082f76f427c8e85c3635f3c2a7920e31077b9917b61d2.jpg)
217
+ Figure 4. In models that learn PAA on $S_{3}$ , representations of the final product can be geometrically decomposed into two orthogonal directions, corresponding to the parity of the product (represented as the Z-axis in the above graph) and cluster identity of the product (represented by the X-Y plane). Note that the clusters are at 60 degrees to each other, and products of different parities within a cluster are equidistant from each other, with odd-parity products in one plane, and even-parity products in another plane.
218
+
219
+ colored cells in Figure 2) results specifically in predictions with incorrect parity. We find standard deviations to be low in Figure 9, confirming the robustness of our signatures.
220
+
221
+ # 4.3. Probing
222
+
223
+ Test set accuracies of linear probes across LM layers $l$ are plotted in Figure 3. We report standard deviations of these accuracies in Table 1, which are all less than $10^{-3}$ . We again find empirical signatures consistent with those predicted by AA and PAA, on both $S_{3}$ and $S_{5}$ . Models with AA-type probing signatures always have AA-type patching signatures, and vice versa. Throughout the rest of this paper, we refer to models (and state-tracking mechanisms) as "AA-type" or "PAA-type" based on which cluster of signatures they exhibit. Results in Appendix C break down probe accuracies by sequence length, confirming that models solve sequences of exponentially longer length at deeper layers.
224
+
225
+ What exactly is the "non-parity residual" for PAA models? We visualize the linear components of representations near the final layer(s) of PAA models trained on $S_{3}$ . The rep
226
+
227
+ resentations of states can be cleanly decomposed into two orthogonal parts: the parity of the product and a residual cluster identity, forming a triangular prism. In Figure 4, we project representations from the PAA model for each of the six states onto these components. Even-parity states (darker colors) and odd-parity states (lighter colors) are symmetric. The three cluster "spokes" are spaced 60 degrees apart. $^2$
228
+
229
+ # 4.4. Generalization by Sequence Length
230
+
231
+ We next evaluate the state and parity accuracy of AA- and PAA-type models for held-out inputs of varying length. In general, we find that models learn to generalize perfectly to sequences of up to the length of their training data, then face a steep accuracy dropoff after (which we refer to as the "cutoff length"), rather than generalizing uniformly across all sequence lengths.
232
+
233
+ In Figure 5, where we plot the cutoff lengths at which each accuracy dips below $98\%$ . We find that for models that learn PAA, the parity accuracy cutoff length is much longer than the state accuracy cutoff length, whereas, for models that learn an AA-type mechanism, the two cutoff lengths are equal. Furthermore, models that learn an AA-type mechanism tend to generalize better overall.
234
+
235
+ # 4.5. Attention Patterns
236
+
237
+ We look at attention patterns of LMs and check whether they can be used to differentiate between PAA models and AA models. Specifically, we find that in the early layers, PAA models exhibit parity heads, heads that place attention to odd-parity actions. Recall that the parity of a state can be determined by counting the number of odd-parity actions, and taking the parity of the count (Equation (1)). Examples of the parity head attention pattern are shown in Figure 15. We find no evidence of parity heads in any layer of AA models. (See Appendix F for a formal metric measuring how much an attention head behaves like a parity head.)
238
+
239
+ ![](images/e51785909cf2d322de117c5e30c96bc3508a84ab33a07ffb8e11ca8428388623.jpg)
240
+ Figure 5. Generalization curves showing state and parity prediction accuracy as sequence lengths vary. Models are trained on length-100 sequences and asked to generalize to varying lengths of sequences. We plot generalization curves for AA and PAA models on $S_{3}$ and $S_{5}$ . In each plot, we show the $98\%$ cutoff threshold, the sequence length at which accuracy dips below $98\%$ . In the models that learned PAA, the parity cutoff is larger than the state cutoff, while in models that learned AA, the parity cutoff equals the state cutoff. Generally speaking, models that learned AA generalize better than ones that learned PAA.
241
+
242
+ ![](images/c1f8c45571ca9290b7b0dcf6cea69193d26295dee481e60be4c7dd7f27a59713.jpg)
243
+ Figure 6. Annotated training curves for models that learn the AA and PAA algorithms. In PAA models (blue), we find that convergence happens in two phases: in the first phase, they learn to generalize parities up to sequence length 100, and in the second, they learn to generalize the states. In AA models (orange), parities and states are learned simultaneously. Note that AA models also tend to converge faster to (ultimately) a lower loss than PAA models.
244
+
245
+ We also find evidence that attention patterns in AA models sparsify in later layers of the network, forming a tree-like pattern expected of AA, shown in Figure 16.
246
+
247
+ # 5. Why do Transformers Learn One Mechanism or Another?
248
+
249
+ Having determined that trained models consistently exhibit AA- or PAA-like signatures, we next study the factors that
250
+
251
+ determine which mechanism emerges during training.
252
+
253
+ # 5.1. When in Training Do Distinct Mechanisms Arise?
254
+
255
+ We find that an LM's eventual mechanism can be identified very early in training, based on the pattern of prediction errors. As in Figure 6, LMs that eventually learn AA improve the quality of their parity and state predictions in lockstep, while LMs that learn PAA learn in two phases: they first converge on learning parity over the entire length of the
256
+
257
+ training sequence; and only then do they learn to accurately predict the state itself.3
258
+
259
+ Because it is possible to identify these patterns early in training, our subsequent experiments classify LMs as AA-type or PAA-type based on generalization curves (Section 4.4) after 10k training steps, rather than waiting for the full probing and patching signatures to emerge.
260
+
261
+ # 5.2. What Factors Affect Which Mechanism is Learned?
262
+
263
+ Whether an LM learns AA or PAA is a deterministic function of four factors: model architecture, size, initialization scheme, and fine-tuning data order. Our next experiments evaluate each of these factors in turn. We explore two different model architecture families of various sizes (GPT-2, Radford et al., 2019, and Pythia, Biderman et al., 2023), several different model initializations (pre-trained on the Pile and trained from scratch with different random initializations), and up to 12 different data ordering seeds.
264
+
265
+ We find that model architecture and initialization, rather than model size, are the biggest determining factors of what mechanism the model chooses to learn. Figure 7 shows the ratio of LMs that learn each mechanism, aggregated by model architecture and initialization. The low variance indicates a minimal effect of model size. GPT-2 models, pre-trained or not, are split roughly evenly between the two mechanisms, while Pythia models tend to learn AA when pre-trained on the Pile, and PAA when not.
266
+
267
+ ![](images/ee1f9e52c21f4de9d90448e54fc9e62ccbe91ab7106b6e9d74631ecc5799d7c7.jpg)
268
+ Figure 7. Proportion of GPT-2 and Pythia models that learn an AA-type mechanism, a PAA-type mechanism, or neither under different training regimes described in Section 5.
269
+
270
+ # 5.3. How Does Pre-training Affect Mechanism Choice?
271
+
272
+ We show that appropriately designed intermediate tasks can encourage models to learn one mechanism or the other.
273
+
274
+ Topic Modeling As a controlled way of studying how the next-token-prediction (NTP) objective affects which
275
+
276
+ mechanism LMs converge to, we generate length-100 documents with only $S_{3}$ elements as vocabulary items, and pre-train (randomly initialized) LMs with NTP on these documents, before training them on $S_{3}$ . Specifically, the documents are generated from a topic model with parameters: # of topics = 4, $\alpha = 0.3$ , and $\beta = 0.1$ , where $\alpha$ is the density of topics in each document and $\beta$ is density of words in each topic. As shown in Figure 7, when from-scratch LMs are trained with our topic modeling NTP objective, they always learn an AA-type mechanism.
277
+
278
+ Parity Prediction We first train the entire model on predicting the state parity of the sequence to output token 1 if odd and $\emptyset$ if even, before transitioning to training on the actual $S_{3}$ objective. In Figure 7, we show that we can induce GPT-2 and Pythia models to learn PAA when trained from scratch on parity. Notably, from-scratch Pythia models already tend to learn PAA as a baseline behavior. Therefore, we also apply this curriculum on Pythia models pre-trained on the Pile, and find that it consistently converts the mechanism learned from AA-type to PAA-type. $^{5}$
279
+
280
+ Control: Random Next-Token-Prediction As a control, we train LMs on length-100 documents of random $S_{3}$ elements sampled from a uniform distribution. We confirm that the control fine-tuning did not affect the ratio with which LMs learned each mechanism.
281
+
282
+ # 6. Conclusion
283
+
284
+ We have shown that LMs trained on permutation tracking tasks learn one of two distinct mechanisms: one consistent with an "associative algorithm" (AA) that composes action subsequences in parallel across successive layers; and another with a "parity-associative algorithm" (PAA) which first computes a shallow parity heuristic in early layers and then computes a residual to the parity using an associative procedure. LMs that learn an AA-type mechanism tend to generalize better and converge faster; different choices of model architecture and training scheme encourage the discovery of one mechanism over another.
285
+
286
+ While a large number of other state tracking tasks can be reduced to the more complex permutation task we study $(S_{5})$ , our experiments leave open the question of whether the specific mechanisms LMs use to solve $S_{5}$ are also deployed for these other tasks.
287
+
288
+ # Impact Statement
289
+
290
+ The $S_{3}$ and $S_{5}$ tasks we choose to study in this paper can be generalized to many different state tracking scenarios funda
291
+
292
+ mental to many aspects of reasoning capabilities. Methods for identifying mechanisms that LMs implement, especially when these differ from human-designed algorithms, can provide crucial insights on how to build more robust LMs, control their behavior, and predict their failures. Our experiments focus on small-scale models, and we do not anticipate any immediate ethical considerations associated with our findings.
293
+
294
+ # Acknowledgments
295
+
296
+ This work was supported by the OpenPhilanthropy foundation, the MIT Quest for Intelligence, and the National Science Foundation under grant IIS-2238240. BZL is additionally supported by a Clare Boothe Luce fellowship, and JA is supported by a Sloan fellowship. This work benefited from many conversations during the Simons Institute Program on Language Models and Transformers. The authors would also like to thank Reuben Stern, Sebastian Zhu, and Gabe Grand for feedback on drafts of the paper.
297
+
298
+ # References
299
+
300
+ Barrington, D. A. Bounded-width polynomial-size branching programs recognize exactly those languages in NC1. Journal of Computer and System Sciences, 38(1):150-164, 1989. ISSN 0022-0000. doi: https://doi.org/10.1016/0022-0000(89)90037-8. URL https://www.sciencedirect.com/science/article/pii/00220000899900378.
301
+ Bender, E. M. and Koller, A. Climbing towards NLU: On meaning, form, and understanding in the age of data. In Jurafsky, D., Chai, J., Schluter, N., and Tetreault, J. (eds.), Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 5185-5198, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.463. URL https://aclanthology.org/2020.acl-main.463/.
302
+ Bhattachamishra, S., Ahuja, K., and Goyal, N. On the Ability and Limitations of Transformers to Recognize Formal Languages. In Webber, B., Cohn, T., He, Y., and Liu, Y. (eds.), Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 7096-7116, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-main.576. URL https://aclanthology.org/2020.emnlp-main.576/.
303
+ Biderman, S., Schoelkopf, H., Anthony, Q. G., Bradley, H., O'Brien, K., Hallahan, E., Khan, M. A., Purohit, S., Prashanth, U. S., Raff, E., et al. Pythia: A suite for analyzing large language models across training and scaling.
304
+
305
+ In International Conference on Machine Learning, pp. 2397-2430. PMLR, 2023.
306
+ Chen, A., Shwartz-Ziv, R., Cho, K., Leavitt, M. L., and Saphra, N. Sudden Drops in the Loss: Syntax Acquisition, Phase Transitions, and Simplicity Bias in MLMs. In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=M05PiKHELW.
307
+ Clark, K., Khandelwal, U., Levy, O., and Manning, C. D. What does BERT look at? an analysis of BERT's attention. In Linzen, T., Chrupaña, G., Belinkov, Y., and Hupkes, D. (eds.), Proceedings of the 2019 ACL Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pp. 276-286, Florence, Italy, August 2019. Association for Computational Linguistics. doi: 10.18653/v1/W19-4828. URL https://aclanthology.org/W19-4828/.
308
+ Delétang, G., Ruoss, A., Grau-Moya, J., Genewein, T., Wen-liang, L. K., Catt, E., Cundy, C., Hutter, M., Legg, S., Veness, J., and Ortega, P. A. Neural Networks and the Chomsky Hierarchy. In 11th International Conference on Learning Representations, 2023.
309
+ Heimersheim, S. and Nanda, N. How to use and interpret activation patching. arXiv preprint arXiv:2404.15255, 2024.
310
+ Hu, M. Y., Chen, A., Saphra, N., and Cho, K. Latent state models of training dynamics. Transactions on Machine Learning Research, 2023. ISSN 2835-8856. URL https://openreview.net/forum?id=NE2xXWo0LF.
311
+ Huet, A., Houidi, Z. B., and Rossi, D. Episodic memories generation and evaluation benchmark for large language models. In The Thirteenth International Conference on Learning Representations, 2025. URL https://openreview.net/forum?id=6ycX677p21.
312
+ jylin04, JackS, Karvonen, A., and Can. OthelloGPT learned a bag of heuristics, 2024. URL https://www.lesswrong.com/posts/gcpNuEZnxAPayaKBY/othellogpt-learned-a-bag-of-heuristics-1.
313
+ Karvonen, A. Emergent World Models and Latent Variable Estimation in Chess-Playing Language Models. In First Conference on Language Modeling, 2024. URL https://openreview.net/forum?id=PPTrmvEnpW.
314
+ Kim, N. and Schuster, S. Entity Tracking in Language Models. In Rogers, A., Boyd-Graber, J., and Okazaki, N. (eds.), Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 3835-3855, Toronto, Canada, July 2023. Association for Computational Linguistics.
315
+
316
+ doi: 10.18653/v1/2023.acl-long.213. URL https://aclanthology.org/2023.acl-long.213/.
317
+ Li, B. Z., Nye, M., and Andreas, J. Implicit Representations of Meaning in Neural Language Models. In Zong, C., Xia, F., Li, W., and Navigli, R. (eds.), Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 1813-1827, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.143. URL https://aclanthology.org/2021.acl-long.143/.
318
+ Li, K., Hopkins, A. K., Bau, D., Viégas, F., Pfister, H., and Wattenberg, M. Emergent World Representations: Exploring a Sequence Model Trained on a Synthetic Task. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=DeG07_TcZvT.
319
+ Liu, B., Ash, J. T., Goel, S., Krishnamurthy, A., and Zhang, C. Transformers Learn Shortcuts to Automata. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=De4FYqjFueZ.
320
+ McCoy, R. T., Min, J., and Linzen, T. BERTs of a feather do not generalize together: Large variability in generalization across models with similar test set performance. In Alishahi, A., Belinkov, Y., Chrupa, G., Hupkes, D., Pinter, Y., and Sajjad, H. (eds.), Proceedings of the Third BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP, pp. 217-227, Online, November 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.blackboxnlp-1.21. URL https://aclanthology.org/2020.blackboxnlp-1.21/.
321
+ Meng, K., Bau, D., Andonian, A., and Belinkov, Y. Locating and editing factual associations in GPT. Advances in Neural Information Processing Systems, 35:17359-17372, 2022.
322
+ Merrill, W. and Sabharwal, A. The Parallelism Tradeoff: Limitations of Log-Precision Transformers. Transactions of the Association for Computational Linguistics, 11:531-545, 2023. doi: 10.1162/tacl_a_00562. URL https://aclanthology.org/2023.tacl-1.31/.
323
+ Merrill, W. and Sabharwal, A. A Little Depth Goes a Long Way: The Expressive Power of Log-Depth Transformers. In NeurIPS 2024 Workshop on Mathematics of Modern Machine Learning, 2024.
324
+ Merrill, W., Sabharwal, A., and Smith, N. A. Saturated Transformers are Constant-Depth Threshold Circuits.
325
+
326
+ Transactions of the Association for Computational Linguistics, 10:843-856, 2022. doi: 10.1162/tacl_a_00493. URL https://aclanthology.org/2022.tacl-1.49/.
327
+ Merrill, W., Petty, J., and Sabharwal, A. The Illusion of State in State-Space Models. In *Forty-first International Conference on Machine Learning*, 2024. URL https://openreview.net/forum?id=QZgo9JZpLq.
328
+ Merullo, J., Eickhoff, C., and Pavlick, E. Circuit Component Reuse Across Tasks in Transformer Language Models. In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=fpoAYV6Wsk.
329
+ Nanda, N., Lee, A., and Wattenberg, M. Emergent Linear Representations in World Models of Self-Supervised Sequence Models, 2023. URL https://arxiv.org/abs/2309.00941.
330
+ Olsson, C., Elhage, N., Nanda, N., Joseph, N., DasSarma, N., Henighan, T., Mann, B., Askell, A., Bai, Y., Chen, A., Conerly, T., Drain, D., Ganguli, D., Hatfield-Dodds, Z., Hernandez, D., Johnston, S., Jones, A., Kernion, J., Lovitt, L., Ndousse, K., Amodei, D., Brown, T., Clark, J., Kaplan, J., McCandlish, S., and Olah, C. In-context Learning and Induction Heads. Transformer Circuits Thread, 2022. https://transformer-circuits.pub/2022/incontext-learning-and-induction-heads/index.html.
331
+ Prakash, N., Shaham, T. R., Haklay, T., Belinkov, Y., and Bau, D. Fine-Tuning Enhances Existing Mechanisms: A Case Study on Entity Tracking. In Proceedings of the 2024 International Conference on Learning Representations, 2024. arXiv:2402.14811.
332
+ Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., Sutskever, I., et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019.
333
+ Shi, X., Padhi, I., and Knight, K. Does string-based neural MT learn source syntax? In Su, J., Duh, K., and Carreras, X. (eds.), Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 1526-1534, Austin, Texas, November 2016. Association for Computational Linguistics. doi: 10.18653/v1/D16-1159. URL https://aclanthology.org/D16-1159/.
334
+ Strobl, L., Merrill, W., Weiss, G., Chiang, D., and An-gluin, D. What Formal Languages Can Transformers Express? A Survey. Transactions of the Association for Computational Linguistics, 12:543-561, 2024. doi: 10.1162/tacl_a_00663. URL https://aclanthology.org/2024.tacl-1.30/.
335
+
336
+ Vafa, K., Chen, J. Y., Rambachan, A., Kleinberg, J., and Mullainathan, S. Evaluating the World Model Implicit in a Generative Model. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024. URL https://openreview.net/forum?id=aVK4JFpegy.
337
+ Wang, K. R., Variengien, A., Conmy, A., Shlegeris, B., and Steinhardt, J. Interpretability in the wild: a circuit for indirect object identification in GPT-2 small. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=NpsVSN6o4u1.
338
+ Yang, S., Gribovskaya, E., Kassner, N., Geva, M., and Riedel, S. Do Large Language Models Latently Perform Multi-Hop Reasoning? In Ku, L.-W., Martins, A., and Srikumar, V. (eds.), Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 10210-10229, Bangkok, Thailand, August 2024. Association for Computational Linguistics. doi: 10.18653/v1/2024.acl-long.550. URL https://aclanthology.org/2024.acl-long.550/.
339
+ Zhang, F. and Nanda, N. Towards best practices of activation patching in language models: Metrics and methods. In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=Hf17y6u9BC.
340
+ Zhong, Z., Liu, Z., Tegmark, M., and Andreas, J. The clock and the pizza: Two stories in mechanistic explanation of neural networks. Advances in Neural Information Processing Systems, 36, 2024.
341
+
342
+ # A. A Constant-Depth Algorithmexists for $S_{3}$
343
+
344
+ $S_{5}$ is the smallest non-solvable permutation group. $S_{3}$ is isomorphic to $D_{3}$ , the symmetry group of an equilateral triangle, which can be generated by a transposition $a = (23)$ and a 3-cycle $b = (123)$ . These generators satisfy the relation $ab = ba^{-1}$ , which allows any word problem in $S_{3}$ to be reduced by tracking (1) the cumulative parity of transpositions and (2) the count of 3-cycles modulo 3. Since both parity checking and modular counting can be computed using constant-depth threshold circuits, the word problem for $S_{3}$ belongs to $\mathsf{TC}^0$ .
345
+
346
+ # B. Full Activation Patching Results
347
+
348
+ In the activation patching experiments, we overwrite ("patch") portions of the LM's internal representations and compute how much the resulting logits have changed. As discussed in Section 2.3, we perform prefix patching to localize important token positions. However, in addition to prefix patching, we also explore the following types of localization methods:
349
+
350
+ 1. In suffix patching, all tokens starting from $t$ up to one before the last token of the sequence $(h_{t:|A| - 1,l})$ are patched at a particular layer $l$ .<sup>7</sup>
351
+ 2. In window patching, all tokens in a $w$ -width window starting from $t$ ( $h_{t:t + w - 1,l}$ ) are patched at layer $l$ .
352
+
353
+ For each of the above localization techniques, we patch the representation with several different types of content:
354
+
355
+ 1. In representation deletion, we overwrite target representation(s) entirely with a zero vector,
356
+
357
+ $$
358
+ h _ {t, l} = \mathbf {0}
359
+ $$
360
+
361
+ and measure the NLD as follows:
362
+
363
+ $$
364
+ \mathrm {N L D} = \frac {\mathrm {L D} (a _ {1} \dots a _ {t}) - \mathrm {L D} (a _ {1} \dots a _ {t} ; h _ {t , l} \leftarrow \mathbf {0})}{\mathrm {L D} (a _ {1} \dots a _ {t})}
365
+ $$
366
+
367
+ 2. In representation substitution, we overwrite the representation(s) with those derived from running the LM on a minimally different (corrupted) representation $P_{\mathrm{corr}}$ . This is the setting described in Section 2.3.
368
+
369
+ Full results are shown in Figure 8. In general, we discover the following:
370
+
371
+ In PAA models, parities are computed in parallel in early-mid layers We use prefix substitution patching described in Section 2.3, but plot pairs that have same parity final states $(\epsilon (\widehat{y}) = \epsilon (\widehat{y^{\prime}}))$ separately from pairs that have opposite parity final states $(\epsilon (\widehat{y})\neq \epsilon (\widehat{y^{\prime}}))$
372
+
373
+ Results are shown in Figure 8A (for same parity) and 8B (for opposite parity). We find that in AA models, parities are computed with the state - with both the same-parity and opposite-parity patching patterns displaying the same exponential curve. However, in PAA models, the patching patterns for same- and opposite-parities differ drastically. When parities are the same, only the parity complement must be computed to infer the final state; the patching pattern in this case indicates that the parity complement is computed in an associative manner. When the parities are different, the patching signature has a component that resembles a parallel patching signature, which is where the parity is computed. Restoring prefixes of layers before the parity is computed results in the entire prediction being of the correct parity, while restoring prefixes of layers after that results in the entire prediction being of the incorrect parity. We see that parities are computed roughly in parallel at early layers (around layers 3-5). Note that there is a middle region where restoring the prefixes shifts the logits towards the correct prediction, but not $100\%$ : when prefixes in these regions are restored, the LM does not know the parity of the final answer, but does know some aspects of the parity complement, which was computed in an associative manner.
374
+
375
+ ![](images/6d0c20a46f962edf526589671c292521016d9417d309311022e3a333265de64a.jpg)
376
+ A
377
+ Prefix Substitution Patching (Same Parity)
378
+
379
+ ![](images/a2a2d1af298d06e95d46e93d666dd0aa73f8fcc6afe43e68a1b6ea259a52667e.jpg)
380
+ B
381
+ Prefix Substitution Patching (Opposite Parity)
382
+
383
+ ![](images/70b7b343c85e88336c3ae9f1a52295d01c3291f3298ca8ebbb9782d0b4d44e4c.jpg)
384
+ C
385
+ Suffix Deletion Patching
386
+
387
+ ![](images/f420d909344222a1951300d283d7a4e1cecde302dfa06cd2be4152960dc2d85b.jpg)
388
+ D
389
+ Window Deletion Patching
390
+
391
+ ![](images/4b446c116c3c9794d942ac7fdf89c9c1c3b848fbfa878de7625099590145a137.jpg)
392
+ Normalized Logit Difference
393
+ Figure 8. Activation patching results across different types of localization (prefix, suffix, window patching) and different types of patching content (substitution, deletion). (A): Prefix-substitution results on only sequences with the same parity. We see the same exponential patching pattern in both AA and PAA models, showing that parity complements are computed in the same associative manner. (B): Prefix-substitution results on only sequences with opposite parities. We see the exponential patching pattern in AA models, meaning that in AA models, parities are computed with the state. In PAA models, however, the patching pattern is roughly parallel, meaning parities are computed roughly in parallel in early layers. (C): Suffix-deletion results show that we can ignore progressively longer sequences of suffixes as we go down the layers of the network, consistent with how we believe AA and PAA work. (D): Window-deletion results show that important activations are arranged hierarchically, again consistent with how we believe AA and PAA work.
394
+
395
+ Increasingly longer suffixes are ignored for AA and PAA models in later layers In Figure 8C, we show suffix deletion patching results, finding that we can swap out exponentially longer both AA and PAA models without affecting the prediction. This is in line with how the associative algorithm in either model works: suffixes of progressively longer lengths are collected into the final token as we go down the layers.
396
+
397
+ Important activations are arranged hierarchically In Figure 8D, we show window deletion patching results, with a window size of 1. We find a patching pattern consistent with the associative algorithm: deleting any single token in the early layers is extremely important, but the spacing of important tokens gets sparser as we go down the layers, consistent with the depiction of AA/PAA in Figure 1. At the bottom layers, deleting any single token is unimportant for the final computation of the state.
398
+
399
+ Patching signatures are relatively consistent across examples In Figure 9, we plot the standard deviations across 200 pairs of S3 inputs for the following three sets of results: (A) prefix substitution patching of AA models, (B) prefix
400
+
401
+ ![](images/0f4d1bf62b13686e976a173a9c2cf7d60b0cf9bbaf46750f6fa21f7d03488202.jpg)
402
+ Figure 9. Standard deviations of the prefix substitution activation patching results across 200 S3 input pairs, for (A) AA models, (B) PAA models on pairs with the same parity, and (C) PAA models on pairs with opposite parity. We find generally low standard deviations across examples.
403
+
404
+ substitution patching of PAA models (opposite parity inputs), (C) prefix substitution patching of PAA models (same parity inputs). We find relatively low standard deviations in all three cases, showing that these signatures hold across different examples.
405
+
406
+ # C. Full Probing Results
407
+
408
+ # C.1. Probing signatures are relatively consistent across examples
409
+
410
+ We investigate the sensitivity of our probing signatures to the data on which the probe was trained. We focus on Pythia models trained on S3. For each model type (PAA vs. AA) and each probe type (parity vs. state probe), we train 10 different probes across 10 different random subsets of the S3 dataset, and report the standard deviations of their accuracies across the 10 runs. Results can be found in Table 1. We find low standard deviations (less than $10^{-3}$ ) in all four cases, indicating that our probe signatures are robust to different subsets of the data and to randomness in probe training.
411
+
412
+ # C.2. Probe accuracies over sequence lengths
413
+
414
+ How do the probe accuracies in Figure 3 decompose over sequence lengths? We sweep over $S_{3}$ sequences $a_{1}\ldots a_{i}$ of lengths ranging from $i = 5$ to 100, and train a linear probe that takes in input $h_{t,l}|a_1\ldots a_t$ —the layer- $l$ , position- $t$ representation of the model on input sequence $a_{1}\ldots a_{i}$ with $t < i$ —and aims to predict the final state $s_i$ from the hidden representation.
415
+
416
+ The mean probability the probe put on the correct answer is plotted in Figure 10. We find that, generally speaking, both AA and PAA linearly encode states of exponentially longer sequences as they go down the layers. We find evidence that the PAA models use their intermediate layers to compute parity in parallel: at around the second residual layer, PAA models place $\frac{1}{3}$ probability on the correct answer (there are three actions of each parity in $S_{3}$ ).
417
+
418
+ # C.3. Examples of Associative Algorithm Representations that Do or Do Not Linearly Encode Parity
419
+
420
+ As shown in Figure 1, models that learn AA sometimes encode parity linearly at the final layer but sometimes do not. The examples shown in Figure 3 all do not linearly encode parity at the final layer. We show a 3D visualization of the $S_{3}$ AA model's final hidden representations along the three principal components of the representation (which explain $41.8\%$ of the variance in the data) in Figure 11. As we can see, parity is not linearly encoded at the final layer. In Figure 12, we show
421
+
422
+ <table><tr><td rowspan="2">Layer</td><td colspan="2">Pythia on S3 (PAA)</td><td colspan="2">Pythia on S3 (AA)</td></tr><tr><td>State Probe</td><td>Parity Probe</td><td>State Probe</td><td>Parity Probe</td></tr><tr><td>0</td><td>4.16 × 10-6</td><td>3.03 × 10-6</td><td>6.33 × 10-6</td><td>2.71 × 10-6</td></tr><tr><td>1</td><td>3.36 × 10-6</td><td>3.31 × 10-6</td><td>2.62 × 10-6</td><td>2.82 × 10-6</td></tr><tr><td>2</td><td>4.52 × 10-6</td><td>5.45 × 10-6</td><td>1.46 × 10-6</td><td>8.97 × 10-7</td></tr><tr><td>3</td><td>4.31 × 10-5</td><td>5.59 × 10-4</td><td>5.00 × 10-6</td><td>1.38 × 10-6</td></tr><tr><td>4</td><td>1.58 × 10-5</td><td>3.72 × 10-5</td><td>4.16 × 10-6</td><td>1.11 × 10-6</td></tr><tr><td>5</td><td>1.70 × 10-5</td><td>5.38 × 10-6</td><td>1.97 × 10-6</td><td>1.11 × 10-6</td></tr><tr><td>6</td><td>1.87 × 10-5</td><td>7.02 × 10-6</td><td>4.73 × 10-6</td><td>1.59 × 10-6</td></tr><tr><td>7</td><td>1.29 × 10-5</td><td>1.34 × 10-5</td><td>7.79 × 10-6</td><td>3.05 × 10-6</td></tr><tr><td>8</td><td>3.18 × 10-5</td><td>3.08 × 10-5</td><td>1.18 × 10-5</td><td>2.64 × 10-6</td></tr><tr><td>9</td><td>2.96 × 10-4</td><td>6.85 × 10-5</td><td>2.36 × 10-5</td><td>3.53 × 10-6</td></tr><tr><td>10</td><td>3.10 × 10-4</td><td>7.98 × 10-5</td><td>2.60 × 10-5</td><td>2.96 × 10-6</td></tr><tr><td>11</td><td>1.86 × 10-4</td><td>8.22 × 10-5</td><td>8.83 × 10-6</td><td>2.77 × 10-6</td></tr><tr><td>12</td><td>7.05 × 10-5</td><td>4.01 × 10-5</td><td>1.20 × 10-6</td><td>2.75 × 10-6</td></tr></table>
423
+
424
+ Table 1. Standard deviations across probe accuracies. We focus our analysis on S3 Pythia models and train 10 probes on different subsets of the S3 dataset. Standard deviations are tiny in all cases, indicating robust signatures.
425
+
426
+ ![](images/b75b8167ba32de941aebdc0df69eaaf5ee9ee774854072bbd35413edae4cfe33.jpg)
427
+
428
+ ![](images/b5d5656519c6df36be948193cac35a6728b400529f47933bd69153c8ecb56468.jpg)
429
+ Figure 10. We plot the average accuracy of a linear probe trained to predict the final state of an action sequence $A$ , given the corresponding final-token hidden representation of AA and PAA models on $A$ . We find that both types of models can handle longer sequence lengths as we go down the network, and that PAA models compute the parities of sequences at roughly layer 2, after which they can get the parity of the state correct but not the exact state.
430
+
431
+ final-layer hidden representations from an AA model that does linearly encode the parity (from-scratch GPT2-base on $S_{3}$ ). When projected onto three components that explain $49.9\%$ of the variance in the data, we find a clear linear separation between the odd and even parity representations.
432
+
433
+ # D. Full Linear Decomposition Results
434
+
435
+ # D.1. $S_{3}$
436
+
437
+ We visualize the linear decomposition of the last-layer or penultimate-layer representations across various PAA models. We find the triangular prism shape similar to Figure 4 in all of them, but there was no consistency in which states were paired to form the clusters.
438
+
439
+ One interpretation is that PAA models may be learning various presentations of $S_{3}$ , with each clustering configuration corresponding to a different presentation. Generally speaking, $S_{n}$ can be generated by a 2-cycle and an $n$ -cycle: any permutation of $S_{n}$ can be created by composing these two permutations. For example, $S_{3}$ can be generated by the 2-cycle $1 \leftrightarrow 2$ and 3-cycle $1 \rightarrow 2 \rightarrow 3 \rightarrow 1$ , which corresponds to the clustering $\{(123, 213), (312, 132), (231, 321)\}$ : the states
440
+
441
+ ![](images/30c8e3c8d2f630ec952e6a46a5f56d6bcdf6a71aa95a9c27216e0b7e6a7ef4c6.jpg)
442
+
443
+ ![](images/c7d4eab77e16f171173a09473d49849fcc2cd2e12f9357f2a67fc9476cd5fe7a.jpg)
444
+
445
+ ![](images/d946b702b944c37cd647ba5db9caf33449ee80b78784a1121e0f7a914b46aded.jpg)
446
+
447
+ ![](images/25bcfb413298ffa2fa9698a1c461c5e10e9ba693e0c1589b4100ad687ec234d1.jpg)
448
+ Figure 11. Example activations from an AA model that does not linearly encodes parity at the final layer, projected on three principal components with a total explained variance of $41.8\%$ . Blue points have even parity, while orange points have odd parity.
449
+ Figure 12. Example activations from an AA model that does linearly encode parity at the final layer. Blue points have even parity, while orange points have odd parity. (Left) State and state parity probe signatures of this model. (Right) projection of hidden representations onto three components with a total explained variance of $49.9\%$ .
450
+
451
+ within the cluster can be transformed into each other by applying $1 \leftrightarrow 2$ , while states between clusters are related to each other by $1 \rightarrow 2 \rightarrow 3 \rightarrow 1$ . PAA models that cluster according to this pattern may have learned these generators.
452
+
453
+ # D.2. $S_{5}$
454
+
455
+ What happens in models that learn PAA in $S_{5}$ ? We visualize the penultimate-layer representation of a Pythia-160M model that learned PAA on $S_{5}$ in 3D space, with parity along one axis and two orthogonal directions along the other two. We find 4 distinct clusters, corresponding to the position of 1 in the state (states having 1 in position 4 and 1 in position 5 are clustered together).
456
+
457
+ # E. Simulating State Tracking in Natural Language
458
+
459
+ To emulate a more practical scenario, we train pre-trained and from-scratch Pythia models on a version of the S3 permutation composition task expressed in natural language. For example, the permutation "132" would be expressed as "swap positions 2 and 3," while "312" would be "rotate the last item to the front." We train LLMs to predict the final state (e.g., 231) from the final period token of the sequence. For example, the following sequence:
460
+
461
+ ![](images/7dd554effc32ed87f097e2a6e6c8f37af4117328bb274a9312e2cc72af18d921.jpg)
462
+ Figure 13. Projecting models that learn PAA on $S_{5}$ into 3D space. Unlike PAA models on $S_{3}$ (Figure 4), the state cannot be fully represented by a clean decomposition into 3 directions (notice the colors superimposed on each other). However, we do still find symmetry across the parity axis, similar to $S_{3}$ . Moreover, there are 4 neat clusters, one at the center, and three outward protruding "prongs". We find that the clusters correspond to the position of 1 in the state.
463
+
464
+ ![](images/3c1c22e2acc3d6444cdfbbba09156bd6cc0d6a1b7bf922a4b1d1b3d133ead9f1.jpg)
465
+
466
+ ![](images/4d9fe6a3f982f80495876f70d53bc6b2470eda0ed876dc3a301aaf478b436aa7.jpg)
467
+
468
+ ![](images/a3d6eb92104017b5729980054fa062d65d107d1ed318e40e5b862b41b26e017f.jpg)
469
+
470
+ Swap positions 2 and 3. Rotate the last item to the front. Swap positions 1 and 2.
471
+
472
+ would map to permutation sequence "132, 312, 213" and finally correspond to the state "123" after the swaps. We then conduct a similar style of probing and activation patching experiments on models trained on this task.
473
+
474
+ # E.1. Probing experiments
475
+
476
+ We train probes to map from the activation of each layer at the position of the final “.” token to the final state. Shown in Figure 14, as in our results on synthetic data, probing results are consistent with associative mechanisms – the state probe improves exponentially over layers. In pre-trained Pythia, we see the model represent the state parity much earlier (in terms of layer) than the actual state representation, a signature of the PAA algorithm. For non-pre-trained Pythia, the accuracy of the state and state parity probes increases at a similar rate, indicating that it is more likely learning an associative algorithm; whether it is the strict AA algorithm we identified in the synthetic case is unclear.
477
+
478
+ # E.2. Activation patching experiments
479
+
480
+ We patch prefixes up to a fixed token position. As shown in Figure 14, both models display a distinctly associative signature with exponentially longer prefixes being disregarded for the final state prediction as depth increases. Furthermore, the pre-trained Pythia model possesses a light blue middle section – a sign of the PAA algorithm. Interestingly, the pre-trained Pythia results are significantly more “compressed” over the layers – the LLM computes the state very early on. We suspect this may be due to the pre-trained LLM taking advantage of its innate natural language understanding (and perhaps pre-trained state tracking abilities!) to quickly solve the task in an early layer.
481
+
482
+ # F. Full Attention Heads Analysis
483
+
484
+ # F.1. Formalizing Parity Heads
485
+
486
+ To formalize a metric for whether an attention head behaves like a parity head, we define a parity head score as the percentage of sequence lengths (ranging from 5 to 80) over which the head places significantly more attention on odd-parity permutations than even-parity permutations, measuring significance using a $95\%$ confidence interval.
487
+
488
+ Definition F.1. Let $\alpha_{i,\ell}^{(H)}(x)$ be the attention weight of the $H$ th attention head in layer $\ell$ at position $i$ for input $x$ where $x$ is the list of actions $[a_1\ldots a_t]$ .
489
+
490
+ ![](images/89b6dc0a9c97cc170adbe213806246c3ad453c94c82ff34cf12fe472faa7386c.jpg)
491
+ Pretrained Pythia-160M
492
+ Activation Patching
493
+
494
+ ![](images/6fa50a50089d737feb44d6537d98bfe09a352458664946888fb8b63762ca538f.jpg)
495
+ Probing
496
+
497
+ ![](images/f58d925f8f810181c13fe1cd2a8d6cc3be0ed4157a96a0e7f1fa77d152235553.jpg)
498
+ Non-pretrained Pythia-160M
499
+
500
+ ![](images/879a996541beecef75e43e8fd5c44df03ef2784aa177291dd009e7c63dbc1e37.jpg)
501
+ Figure 14. Patching and probing result for Pythia models trained on natural language permutation composition task. We plot the signature of a pre-trained Pythia model (top) and a non-pre-trained Pythia model (bottom). In both cases, the signatures are consistent with the state being learned associatively (both the patching signature and state probe have an exponential curve). The signature of the pre-trained model is consistent with a PAA signature, with the parity probe converging in early layers, and the activation patching signature containing a light-blue middle section.
502
+
503
+ Define the sets of attention weights on odd and even tokens of $x$ as:
504
+
505
+ $$
506
+ \mathcal {A} _ {\ell , H, \text {o d d}} (x) = \left\{\alpha_ {i, \ell} ^ {H} (x): a _ {i} \text {i s o d d} \right\},
507
+ $$
508
+
509
+ $$
510
+ \mathcal {A} _ {\ell , H, \text {e v e n}} (x) = \left\{\alpha_ {i, \ell} ^ {H} (x): a _ {i} \text {i s e v e n} \right\}.
511
+ $$
512
+
513
+ We find heads that respond to parity can be local: for example, attention head 5 in layer 1 responds to odd-parity permutations in the midpoint of the sequence, while attention head 4 responds to ones late in the sequence.
514
+
515
+ Thus, we record the parity head score $\sigma_{\ell ,H,\text{parity}}$ , which measures the proportion of the sequence for which more attention is placed on odd-parity actions compared to even-parity actions:
516
+
517
+ $$
518
+ \sigma_ {\ell , H, \text {p a r i t y}} = \frac {1}{L - 5} \cdot \sum_ {t = 5} ^ {L} \sigma_ {\ell , H, \text {p a r i t y}, t}, \quad \text {w h e r e}
519
+ $$
520
+
521
+ $$
522
+ \sigma_ {\ell , H, \text {p a r i t y}, t} = 1 \left(\mathbb {E} \left[ \mathcal {A} _ {\ell , H, \text {o d d}} ([ a _ {1} \dots a _ {i} ]) \right] - 0. 9 5 \cdot \mathrm {C I} _ {\ell , H, \text {o d d}} ([ a _ {1} \dots a _ {i} ]) > \mathbb {E} \left[ \mathcal {A} _ {\ell , H, \text {e v e n}} ([ a _ {1} \dots a _ {i} ]) ]\right)\right).
523
+ $$
524
+
525
+ Here, $[a_1\ldots a_i]$ denotes the first $i$ elements of the sequence $x$ , and $\mathrm{CI}_{\ell ,H,\mathrm{odd}}$ refers to the confidence interval around the average attention weights on odd-parity tokens. We use sequence lengths of up to $L = 80$ for $S_{3}$ and $L = 50$ for $S_{5}$ .
526
+
527
+ We find no evidence of parity heads in any layer of AA models. However, we find at least two attention heads with $\sigma$ significantly exceeding $50\%$ in the first few layers of PAA models, highlighted in Table 2.
528
+
529
+ # F2. AA Attention Patterns
530
+
531
+ What sorts of attention patterns appear in AA models? Because attention is dense, we visualize only the top-K attention traces from and to each position at each layer. Specifically, we plot the attentions of an LM on an input as a graph with:
532
+
533
+ ![](images/6f44c4bcf5632900290a19f42c5b98eedd3da3b21a3b729df700172661407837.jpg)
534
+ Figure 15. Examples of parity heads in a PAA model. We plot heatmaps showing attention weights on each source token at each target token location (we show up to only 60 source tokens for heads 4 and 5 for the sake of space). We draw arrows / yellow lines at source tokens corresponding to odd-parity actions. Note that parity heads attend almost exclusively to odd-parity tokens.
535
+
536
+ ![](images/53033be53c929d1556f76435a6db606a56b4a628922e43a9a652d5ac83858f07.jpg)
537
+
538
+ ![](images/7eb77cb5ce3074c1923e6acf3687887b9efb84ba6ce2aab6d0e1abe843fe09f8.jpg)
539
+
540
+ <table><tr><td>Algorithm</td><td>Layer</td><td>Head</td><td>Parity Head Score</td></tr><tr><td rowspan="3">S3(PAA)</td><td>1</td><td>1</td><td>90.1%±3.0%</td></tr><tr><td>1</td><td>4</td><td>86.4%±8.2%</td></tr><tr><td>0</td><td>5</td><td>67.1%±5.1%</td></tr><tr><td rowspan="3">S3(AA)</td><td>0</td><td>4</td><td>3.3%±4.5%</td></tr><tr><td>2</td><td>7</td><td>3.0%±6.1%</td></tr><tr><td>11</td><td>0</td><td>2.0%±4.0%</td></tr><tr><td rowspan="3">S5(PAA)</td><td>3</td><td>3</td><td>83.6%±9.6%</td></tr><tr><td>3</td><td>2</td><td>80.6%±6.2%</td></tr><tr><td>2</td><td>6</td><td>50.3%±22.4%</td></tr><tr><td rowspan="3">S5(AA)</td><td>0</td><td>7</td><td>5.9%±8.2%</td></tr><tr><td>0</td><td>3</td><td>3.8%±5.4%</td></tr><tr><td>0</td><td>0</td><td>3.2%±4.3%</td></tr></table>
541
+
542
+ Table 2. Top-3 parity head scores across all attention heads in each type of model. We report average parity head scores $(\%)$ over 100 examples, as well as their standard deviations. Informally, this metric captures the proportion of the sequence over which more attention is placed on odd-parity actions than even-parity actions.
543
+
544
+ ![](images/c3d5eef44eac7110112bb2642debfe5f3f115929eb43b5f168a378fe13dfa246.jpg)
545
+ Figure 16. Attention patterns in AA models form a tree-like pattern, with tokens in successive layers attending to larger windows of downstream tokens. This is in line with how we expect the associative algorithm to function. We plot only the most salient attention weights by pruning edges for which the attention weight is $< 0.95$ , the target token is not in the top-3 attended-to tokens from the source token, or the source token is not in the top-10 attended-from tokens for the target token. We expect that the attention patterns visualized here do not form a single clean tree, but the superimposition of multiple trees.
546
+
547
+ 1. Nodes $(t,l)$ for each token position $t$ and layer $l$ ,
548
+ 2. Edges between two nodes $(t_1, l - 1)$ and $(t_2, l)$ if position $t_2$ at layer $l$ attends to position $t$ at layer $l - 1$ . We define "atends to" as follows:
549
+
550
+ Let $\alpha_{t_1\to t_2}^{(l)}$ denote the maximum attention weight (across all attention heads at layer $l$ ) from position $t_1$ at layer $l - 1$ to position $t_2$ at layer $l$ .
551
+
552
+ We say $(t_2, l)$ attends to $(t_1, l - 1)$ if all of the following conditions are met:
553
+
554
+ (a) $\alpha_{t_1\to t_2}^{(l)} > 0.95$
555
+ (b) $\alpha_{t_1\to t_2}^{(l)}\in \mathrm{top - 3}(\{\alpha_{i\to t_2}^{(l)}:i\in [1,n]\})$ .. $t_1$ is among the top-3 attended-to tokens for $t_2$ at layer $l$
556
+ (c) $\alpha_{t_1\to t_2}^{(l)}\in \mathrm{top - }10(\{\alpha_{t_1\to j}^{(l)}:k\in [1,n]\})$ .. $t_2$ is among the top-10 attended-from tokens for $t_1$ at layer $l - 1$
557
+
558
+ We show example attention patterns for an AA model on three sample prompts in Figure 16. We only plot the attention subgraph directly connected to the final token position at the final layer (which is used to predict the state). We find that attention in AA models forms a tree-like pattern where successive layers attend to wider and wider context windows, with nodes that are more and more spaced apart. This is in line with how we believe the associative algorithm works: adjacent pairs of actions are grouped together at each layer in a hierarchical manner.
559
+
560
+ Note that the tree is not entirely clean: there are redundant edges and edges that cross over each other. We suspect that the subgraph we've picked up on is not a single tree, but rather the superimposition of multiple trees, each potentially contributing to not just the prediction for the final token, but also the predictions of the previous tokens.
561
+
562
+ # G. How are these algorithms learned over the course of training?
563
+
564
+ We conduct a more detailed analysis of the training phases for two Pythia models trained on the $S_{5}$ task: one that learned AA and one that learned PAA. The training curves are shown in Figure 6, and we investigate the generalization behavior at different points along these curves. Both models improve over training by progressively generalizing to longer sequence lengths, rather than making uniform gains across all lengths. In the case of the PAA model, convergence appears to occur in two distinct phases: first, the model learns the parity of states across the entire length-100 sequence, followed by learning how to predict the state. By contrast, the AA model learns to generalize parity and state simultaneously.
565
+
566
+ # H. Additional Factors Influencing Learned Algorithm
567
+
568
+ # H.1. Model Size
569
+
570
+ We have investigated whether model size influences which algorithm the models learn to implement. As shown in Figure 17, model size empirically does not seem to have much effect on the choice of learned algorithm, with model architecture and initialization having a much bigger effect. Some notable differences between the GPT-2 and Pythia architecture are the use of rotary embeddings, parallelized attention, and feedforward layers rather than sequential, and untied embedding and unembedding.
571
+
572
+ # H.2. Topic Modeling
573
+
574
+ The topic model used in Section 5.3 is parameterized as follows: We generate the distribution of the 4 topics in each document using a random Dirichlet distribution with $\alpha = 0.3$ . The distribution $p(\text{token} \mid \text{topic})$ for each token 123, 132, 213, 231, 312, 321 is:
575
+
576
+ $$
577
+ \left[ \begin{array}{l l l l l l} 3. 0 6 \cdot 1 0 ^ {- 2}, & 1. 1 1 \cdot 1 0 ^ {- 1}, & 5. 7 9 \cdot 1 0 ^ {- 4}, & 6. 4 5 \cdot 1 0 ^ {- 3}, & 6. 5 8 \cdot 1 0 ^ {- 3}, & 8. 4 5 \cdot 1 0 ^ {- 1} \\ 3. 3 6 \cdot 1 0 ^ {- 1}, & 1. 6 9 \cdot 1 0 ^ {- 4}, & 6. 6 3 \cdot 1 0 ^ {- 1}, & 8. 0 5 \cdot 1 0 ^ {- 7}, & 1. 6 8 \cdot 1 0 ^ {- 7}, & 7. 8 1 \cdot 1 0 ^ {- 4} \\ 7. 9 2 \cdot 1 0 ^ {- 5}, & 1. 4 1 \cdot 1 0 ^ {- 2}, & 9. 4 4 \cdot 1 0 ^ {- 1}, & 4. 5 3 \cdot 1 0 ^ {- 4}, & 4. 1 3 \cdot 1 0 ^ {- 2}, & 3. 2 7 \cdot 1 0 ^ {- 1 1} \\ 2. 8 5 \cdot 1 0 ^ {- 3}, & 1. 2 9 \cdot 1 0 ^ {- 9}, & 7. 0 6 \cdot 1 0 ^ {- 1}, & 6. 3 7 \cdot 1 0 ^ {- 7}, & 2. 5 8 \cdot 1 0 ^ {- 3}, & 2. 8 9 \cdot 1 0 ^ {- 1} \end{array} \right]
578
+ $$
579
+
580
+ We also trained LMs using a topic model with a second token-topic distribution, aiming to distinguish the effect of this particular topic distribution from the effect of topic modeling pretraining in general. On the second distribution, we also find that both randomly initialized GPT-2 and Pythia models learn AA in Figure 18. The $p(\text{token} \mid \text{topic})$ distribution for this model is listed below:
581
+
582
+ $$
583
+ \left[ \begin{array}{c c c c c c} 9. 3 1 \cdot 1 0 ^ {- 1} & 2. 3 2 \cdot 1 0 ^ {- 3} & 1. 3 8 \cdot 1 0 ^ {- 8} & 5. 8 6 \cdot 1 0 ^ {- 1 0} & 4. 6 2 \cdot 1 0 ^ {- 5} & 6. 6 3 \cdot 1 0 ^ {- 2} \\ 2. 1 0 \cdot 1 0 ^ {- 4} & 3. 1 2 \cdot 1 0 ^ {- 4} & 9. 3 2 \cdot 1 0 ^ {- 7} & 9. 0 7 \cdot 1 0 ^ {- 6} & 2. 5 3 \cdot 1 0 ^ {- 1} & 7. 4 7 \cdot 1 0 ^ {- 1} \\ 4. 9 5 \cdot 1 0 ^ {- 1} & 1. 1 8 \cdot 1 0 ^ {- 3} & 4. 5 5 \cdot 1 0 ^ {- 1} & 2. 1 7 \cdot 1 0 ^ {- 2} & 1. 8 6 \cdot 1 0 ^ {- 8} & 2. 7 1 \cdot 1 0 ^ {- 2} \\ 6. 5 5 \cdot 1 0 ^ {- 1} & 4. 9 2 \cdot 1 0 ^ {- 4} & 3. 4 4 \cdot 1 0 ^ {- 1} & 2. 2 8 \cdot 1 0 ^ {- 7} & 1. 9 4 \cdot 1 0 ^ {- 4} & 2. 1 4 \cdot 1 0 ^ {- 8} \end{array} \right]
584
+ $$
585
+
586
+ ![](images/4f37ab1d9a90fe5aeb98ebe39952d97cfae30c77820b5e9c80a4227cfb49ce39.jpg)
587
+
588
+ ![](images/25f0affd820d065a8a007f1bb06efe0d69c1c51e7cc2282d35782a27df568ace.jpg)
589
+
590
+ ![](images/3ab2a94abd9ff247daf2a327fb177b6b07ff8d472cdaac01627fe55190ca140e.jpg)
591
+ Figure 17. Proportion of $S_{3}$ algorithms learned by models of various sizes from the GPT-2 and Pythia families. Model architecture and initialization are much bigger factors in influencing the algorithms learned than model size.
592
+
593
+ ![](images/0e5dd29faea405439b4b717dc5525eb9d0bd3935c72987f02dae417c1badeba3.jpg)
594
+
595
+ # H.3. Parity Loss Curriculum
596
+
597
+ We explored an additional procedure that encourages models to learn parity via an extra loss term. We train an extra linear classifier that takes in the residual activations of an early layer (e.g., layer 3) in which we find parity to be typically computed through probing. We train with this additional loss term to induce the representation to linearly encode parity early on. The classifier is trained to output (1) parity or (2) a (parity, action) tuple, to ensure that the residual also encodes the original action, and not just the parity. After training, we evaluate the model on the original $S_{3}$ task. Both procedures induce the model to learn PAA consistently, though the (parity, action) classifier typically allows the model to generalize better.
598
+
599
+ # H.4. Length Curriculum
600
+
601
+ We implemented a curriculum training approach where the model was progressively exposed to documents of increasing length. We first trained on only the initial 10 tokens, then expanded to 25 tokens, 50 tokens, and finally the complete 100-token sequences. Each stage of the curriculum was trained for a fixed number of epochs (data). The goal of such a curriculum is to push the model to learn the associative algorithm (AA), as the parity heuristic, we hypothesize, might be less useful for shorter sequences. However, empirically, such a curriculum has no obvious effect on the kind of algorithm the model learns. Of the 5 trials, 2 trials of GPT-2 learn AA, and the other 3 trials learn PAA.
602
+
603
+ We discovered that all five models can perfectly generalize both parity and state when trained on the first 25 tokens. It is only when trained to generalize to sequence length 50 that the distinction between PAA and AA emerges. Models learning the PAA algorithm do not generalize, while models learning AA can generalize from length 25 to 50, as illustrated by Figure 19. This further confirms our finding that the model learns the $S_{3}$ algorithm early on.
604
+
605
+ ![](images/a1c534b0030f433c99ef0f18701e986a406f5ddc0687afb087f19fa785347c2c.jpg)
606
+ Figure 18. Proportion of $S_{3}$ algorithms learned by models first pre-trained on the two topic models compared to the randomly initialized baselines. Topic modeling, regardless of the specific distributions, pushes the model to learn AA.
607
+
608
+ ![](images/83deee6bed943cf6af9dc5d68e9cedcf685c43e1a3cc5021a11cf49166d003f4.jpg)
609
+
610
+ ![](images/6f887cbb08884cb5e0b034718facf84fda8ce03070d02f531615b9c3ec3df3d6.jpg)
611
+
612
+ ![](images/3b52388df7c5c595a0883849e7e96a85a92712b505f22226ae447a177dfbaa2a.jpg)
613
+
614
+ ![](images/1c913d0780138d3d2222930378f0d595bb3040bb0a7fc90156e1f8bbded6c362.jpg)
615
+
616
+ ![](images/f2b52eca8b6975a2856e1d0ce6dedfc2aeb7a9f9b52ca99ceaa1fb42edb72d42.jpg)
617
+
618
+ ![](images/e92f7d41350441092b04384a75af7a4dd5b4e1080fad0396dfcde6e24ef64340.jpg)
619
+ Figure 19. Model generalization curves when trained using a length curriculum after training on 10, 25, 50, and 100 tokens, respectively. While the length curriculum doesn't push the model to learn one algorithm or the other, it shows that the model learns these algorithms early on, as indicated by whether the model can generalize well from training on 25 tokens to 50 tokens.
620
+
621
+ ![](images/db70875e9a77c6634098064d435424b00efb9431a6092989315d7d98e67ddda2.jpg)
622
+
623
+ ![](images/f3ad4f6824e57d754427b85f9c6ed83586164354c80f9339d0f08e0586730691.jpg)
624
+
625
+ ![](images/82361238145aaab9edfc0568642d551d9e1e54efc1078635eae4b281efa812ca.jpg)
2025/(How) Do Language Models Track State_/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:a9e54173a8162dc8468c383bb26389a3dd80db74a6c5c8767dad6ba39129466e
3
+ size 2105023
2025/(How) Do Language Models Track State_/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2025/3D Question Answering via only 2D Vision-Language Models/328a3b80-b211-4a99-aaf9-20826a719f1b_content_list.json ADDED
The diff for this file is too large to render. See raw diff