Chelsea707 commited on
Commit
6ba1e21
·
verified ·
1 Parent(s): 797a851

Add Batch 7169746e-d462-4b50-8645-1b7d8807623d 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 +64 -0
  2. 2024/Straight-Through Meets Sparse Recovery_ the Support Exploration Algorithm/da09c8ee-7662-4840-b308-d4ebd84fe5b7_content_list.json +0 -0
  3. 2024/Straight-Through Meets Sparse Recovery_ the Support Exploration Algorithm/da09c8ee-7662-4840-b308-d4ebd84fe5b7_model.json +0 -0
  4. 2024/Straight-Through Meets Sparse Recovery_ the Support Exploration Algorithm/da09c8ee-7662-4840-b308-d4ebd84fe5b7_origin.pdf +3 -0
  5. 2024/Straight-Through Meets Sparse Recovery_ the Support Exploration Algorithm/full.md +0 -0
  6. 2024/Straight-Through Meets Sparse Recovery_ the Support Exploration Algorithm/images.zip +3 -0
  7. 2024/Straight-Through Meets Sparse Recovery_ the Support Exploration Algorithm/layout.json +0 -0
  8. 2024/StrokeNUWA—Tokenizing Strokes for Vector Graphic Synthesis/b14d089f-0f3b-46df-8e68-6cec5128119c_content_list.json +2020 -0
  9. 2024/StrokeNUWA—Tokenizing Strokes for Vector Graphic Synthesis/b14d089f-0f3b-46df-8e68-6cec5128119c_model.json +0 -0
  10. 2024/StrokeNUWA—Tokenizing Strokes for Vector Graphic Synthesis/b14d089f-0f3b-46df-8e68-6cec5128119c_origin.pdf +3 -0
  11. 2024/StrokeNUWA—Tokenizing Strokes for Vector Graphic Synthesis/full.md +332 -0
  12. 2024/StrokeNUWA—Tokenizing Strokes for Vector Graphic Synthesis/images.zip +3 -0
  13. 2024/StrokeNUWA—Tokenizing Strokes for Vector Graphic Synthesis/layout.json +0 -0
  14. 2024/Structure Your Data_ Towards Semantic Graph Counterfactuals/a1df89bd-1d9a-4b7e-a93f-1969f3a0ca6c_content_list.json +0 -0
  15. 2024/Structure Your Data_ Towards Semantic Graph Counterfactuals/a1df89bd-1d9a-4b7e-a93f-1969f3a0ca6c_model.json +0 -0
  16. 2024/Structure Your Data_ Towards Semantic Graph Counterfactuals/a1df89bd-1d9a-4b7e-a93f-1969f3a0ca6c_origin.pdf +3 -0
  17. 2024/Structure Your Data_ Towards Semantic Graph Counterfactuals/full.md +0 -0
  18. 2024/Structure Your Data_ Towards Semantic Graph Counterfactuals/images.zip +3 -0
  19. 2024/Structure Your Data_ Towards Semantic Graph Counterfactuals/layout.json +0 -0
  20. 2024/Structure-Aware E(3)-Invariant Molecular Conformer Aggregation Networks/ae9b8328-8568-45b8-b672-0bf3f4d9039b_content_list.json +0 -0
  21. 2024/Structure-Aware E(3)-Invariant Molecular Conformer Aggregation Networks/ae9b8328-8568-45b8-b672-0bf3f4d9039b_model.json +0 -0
  22. 2024/Structure-Aware E(3)-Invariant Molecular Conformer Aggregation Networks/ae9b8328-8568-45b8-b672-0bf3f4d9039b_origin.pdf +3 -0
  23. 2024/Structure-Aware E(3)-Invariant Molecular Conformer Aggregation Networks/full.md +0 -0
  24. 2024/Structure-Aware E(3)-Invariant Molecular Conformer Aggregation Networks/images.zip +3 -0
  25. 2024/Structure-Aware E(3)-Invariant Molecular Conformer Aggregation Networks/layout.json +0 -0
  26. 2024/Structure-based drug design by denoising voxel grids/45f13b51-8d7b-47ac-9649-16ca362418b6_content_list.json +0 -0
  27. 2024/Structure-based drug design by denoising voxel grids/45f13b51-8d7b-47ac-9649-16ca362418b6_model.json +0 -0
  28. 2024/Structure-based drug design by denoising voxel grids/45f13b51-8d7b-47ac-9649-16ca362418b6_origin.pdf +3 -0
  29. 2024/Structure-based drug design by denoising voxel grids/full.md +461 -0
  30. 2024/Structure-based drug design by denoising voxel grids/images.zip +3 -0
  31. 2024/Structure-based drug design by denoising voxel grids/layout.json +0 -0
  32. 2024/Structured Chemistry Reasoning with Large Language Models/97833c28-d860-4d9c-8354-3f2713827dbf_content_list.json +0 -0
  33. 2024/Structured Chemistry Reasoning with Large Language Models/97833c28-d860-4d9c-8354-3f2713827dbf_model.json +0 -0
  34. 2024/Structured Chemistry Reasoning with Large Language Models/97833c28-d860-4d9c-8354-3f2713827dbf_origin.pdf +3 -0
  35. 2024/Structured Chemistry Reasoning with Large Language Models/full.md +395 -0
  36. 2024/Structured Chemistry Reasoning with Large Language Models/images.zip +3 -0
  37. 2024/Structured Chemistry Reasoning with Large Language Models/layout.json +0 -0
  38. 2024/Structured Inverse-Free Natural Gradient Descent_ Memory-Efficient & Numerically-Stable KFAC/e1fd546c-4cbd-40c9-add1-283fc66a87ce_content_list.json +0 -0
  39. 2024/Structured Inverse-Free Natural Gradient Descent_ Memory-Efficient & Numerically-Stable KFAC/e1fd546c-4cbd-40c9-add1-283fc66a87ce_model.json +0 -0
  40. 2024/Structured Inverse-Free Natural Gradient Descent_ Memory-Efficient & Numerically-Stable KFAC/e1fd546c-4cbd-40c9-add1-283fc66a87ce_origin.pdf +3 -0
  41. 2024/Structured Inverse-Free Natural Gradient Descent_ Memory-Efficient & Numerically-Stable KFAC/full.md +724 -0
  42. 2024/Structured Inverse-Free Natural Gradient Descent_ Memory-Efficient & Numerically-Stable KFAC/images.zip +3 -0
  43. 2024/Structured Inverse-Free Natural Gradient Descent_ Memory-Efficient & Numerically-Stable KFAC/layout.json +0 -0
  44. 2024/Studying K-FAC Heuristics by Viewing Adam through a Second-Order Lens/3ec91fc3-a978-4b4a-9944-ec3b1d79464d_content_list.json +0 -0
  45. 2024/Studying K-FAC Heuristics by Viewing Adam through a Second-Order Lens/3ec91fc3-a978-4b4a-9944-ec3b1d79464d_model.json +0 -0
  46. 2024/Studying K-FAC Heuristics by Viewing Adam through a Second-Order Lens/3ec91fc3-a978-4b4a-9944-ec3b1d79464d_origin.pdf +3 -0
  47. 2024/Studying K-FAC Heuristics by Viewing Adam through a Second-Order Lens/full.md +0 -0
  48. 2024/Studying K-FAC Heuristics by Viewing Adam through a Second-Order Lens/images.zip +3 -0
  49. 2024/Studying K-FAC Heuristics by Viewing Adam through a Second-Order Lens/layout.json +0 -0
  50. 2024/StyDeSty_ Min-Max Stylization and Destylization for Single Domain Generalization/06c19bcc-2231-4a64-bfd0-084f8b84c002_content_list.json +0 -0
.gitattributes CHANGED
@@ -5674,3 +5674,67 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
5674
  2024/Stochastic[[:space:]]positional[[:space:]]embeddings[[:space:]]improve[[:space:]]masked[[:space:]]image[[:space:]]modeling/20efe4e3-1621-4b5d-bc90-ac430f501cad_origin.pdf filter=lfs diff=lfs merge=lfs -text
5675
  2024/Stop[[:space:]]Regressing_[[:space:]]Training[[:space:]]Value[[:space:]]Functions[[:space:]]via[[:space:]]Classification[[:space:]]for[[:space:]]Scalable[[:space:]]Deep[[:space:]]RL/a02abe10-fa78-4a57-8b29-8ef9c3136823_origin.pdf filter=lfs diff=lfs merge=lfs -text
5676
  2024/StrWAEs[[:space:]]to[[:space:]]Invariant[[:space:]]Representations/dfafa247-664f-404e-85b7-e8233046aa52_origin.pdf filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5674
  2024/Stochastic[[:space:]]positional[[:space:]]embeddings[[:space:]]improve[[:space:]]masked[[:space:]]image[[:space:]]modeling/20efe4e3-1621-4b5d-bc90-ac430f501cad_origin.pdf filter=lfs diff=lfs merge=lfs -text
5675
  2024/Stop[[:space:]]Regressing_[[:space:]]Training[[:space:]]Value[[:space:]]Functions[[:space:]]via[[:space:]]Classification[[:space:]]for[[:space:]]Scalable[[:space:]]Deep[[:space:]]RL/a02abe10-fa78-4a57-8b29-8ef9c3136823_origin.pdf filter=lfs diff=lfs merge=lfs -text
5676
  2024/StrWAEs[[:space:]]to[[:space:]]Invariant[[:space:]]Representations/dfafa247-664f-404e-85b7-e8233046aa52_origin.pdf filter=lfs diff=lfs merge=lfs -text
5677
+ 2024/Straight-Through[[:space:]]Meets[[:space:]]Sparse[[:space:]]Recovery_[[:space:]]the[[:space:]]Support[[:space:]]Exploration[[:space:]]Algorithm/da09c8ee-7662-4840-b308-d4ebd84fe5b7_origin.pdf filter=lfs diff=lfs merge=lfs -text
5678
+ 2024/StrokeNUWA—Tokenizing[[:space:]]Strokes[[:space:]]for[[:space:]]Vector[[:space:]]Graphic[[:space:]]Synthesis/b14d089f-0f3b-46df-8e68-6cec5128119c_origin.pdf filter=lfs diff=lfs merge=lfs -text
5679
+ 2024/Structure[[:space:]]Your[[:space:]]Data_[[:space:]]Towards[[:space:]]Semantic[[:space:]]Graph[[:space:]]Counterfactuals/a1df89bd-1d9a-4b7e-a93f-1969f3a0ca6c_origin.pdf filter=lfs diff=lfs merge=lfs -text
5680
+ 2024/Structure-Aware[[:space:]]E(3)-Invariant[[:space:]]Molecular[[:space:]]Conformer[[:space:]]Aggregation[[:space:]]Networks/ae9b8328-8568-45b8-b672-0bf3f4d9039b_origin.pdf filter=lfs diff=lfs merge=lfs -text
5681
+ 2024/Structure-based[[:space:]]drug[[:space:]]design[[:space:]]by[[:space:]]denoising[[:space:]]voxel[[:space:]]grids/45f13b51-8d7b-47ac-9649-16ca362418b6_origin.pdf filter=lfs diff=lfs merge=lfs -text
5682
+ 2024/Structured[[:space:]]Chemistry[[:space:]]Reasoning[[:space:]]with[[:space:]]Large[[:space:]]Language[[:space:]]Models/97833c28-d860-4d9c-8354-3f2713827dbf_origin.pdf filter=lfs diff=lfs merge=lfs -text
5683
+ 2024/Structured[[:space:]]Inverse-Free[[:space:]]Natural[[:space:]]Gradient[[:space:]]Descent_[[:space:]]Memory-Efficient[[:space:]]&[[:space:]]Numerically-Stable[[:space:]]KFAC/e1fd546c-4cbd-40c9-add1-283fc66a87ce_origin.pdf filter=lfs diff=lfs merge=lfs -text
5684
+ 2024/Studying[[:space:]]K-FAC[[:space:]]Heuristics[[:space:]]by[[:space:]]Viewing[[:space:]]Adam[[:space:]]through[[:space:]]a[[:space:]]Second-Order[[:space:]]Lens/3ec91fc3-a978-4b4a-9944-ec3b1d79464d_origin.pdf filter=lfs diff=lfs merge=lfs -text
5685
+ 2024/StyDeSty_[[:space:]]Min-Max[[:space:]]Stylization[[:space:]]and[[:space:]]Destylization[[:space:]]for[[:space:]]Single[[:space:]]Domain[[:space:]]Generalization/06c19bcc-2231-4a64-bfd0-084f8b84c002_origin.pdf filter=lfs diff=lfs merge=lfs -text
5686
+ 2024/SuDA_[[:space:]]Support-based[[:space:]]Domain[[:space:]]Adaptation[[:space:]]for[[:space:]]Sim2Real[[:space:]]Hinge[[:space:]]Joint[[:space:]]Tracking[[:space:]]with[[:space:]]Flexible[[:space:]]Sensors/33fe3d26-6c57-4039-a1cb-44368f1636bc_origin.pdf filter=lfs diff=lfs merge=lfs -text
5687
+ 2024/Sub-token[[:space:]]ViT[[:space:]]Embedding[[:space:]]via[[:space:]]Stochastic[[:space:]]Resonance[[:space:]]Transformers/1529584a-9e0c-4948-a489-09d8f6006317_origin.pdf filter=lfs diff=lfs merge=lfs -text
5688
+ 2024/Subequivariant[[:space:]]Reinforcement[[:space:]]Learning[[:space:]]in[[:space:]]3D[[:space:]]Multi-Entity[[:space:]]Physical[[:space:]]Environments/7406f251-31df-4cfb-b4fd-79f7bd371886_origin.pdf filter=lfs diff=lfs merge=lfs -text
5689
+ 2024/Subgoal-based[[:space:]]Demonstration[[:space:]]Learning[[:space:]]for[[:space:]]Formal[[:space:]]Theorem[[:space:]]Proving/38c2a02a-8b44-42a1-9da7-a9df764802c9_origin.pdf filter=lfs diff=lfs merge=lfs -text
5690
+ 2024/Subgraphormer_[[:space:]]Unifying[[:space:]]Subgraph[[:space:]]GNNs[[:space:]]and[[:space:]]Graph[[:space:]]Transformers[[:space:]]via[[:space:]]Graph[[:space:]]Products/60d73880-5136-4875-b5ba-a616194b012e_origin.pdf filter=lfs diff=lfs merge=lfs -text
5691
+ 2024/Subhomogeneous[[:space:]]Deep[[:space:]]Equilibrium[[:space:]]Models/be3525b2-bc10-4a92-9617-cbac48ff2991_origin.pdf filter=lfs diff=lfs merge=lfs -text
5692
+ 2024/Submodular[[:space:]]framework[[:space:]]for[[:space:]]structured-sparse[[:space:]]optimal[[:space:]]transport/81bf4674-0251-498b-bd4a-3b433ba6fedd_origin.pdf filter=lfs diff=lfs merge=lfs -text
5693
+ 2024/Subsampling[[:space:]]is[[:space:]]not[[:space:]]Magic_[[:space:]]Why[[:space:]]Large[[:space:]]Batch[[:space:]]Sizes[[:space:]]Work[[:space:]]for[[:space:]]Differentially[[:space:]]Private[[:space:]]Stochastic[[:space:]]Optimisation/c959d4bd-1787-49ec-bcfa-122592d2422c_origin.pdf filter=lfs diff=lfs merge=lfs -text
5694
+ 2024/Successor[[:space:]]Features[[:space:]]for[[:space:]]Efficient[[:space:]]Multi-Subject[[:space:]]Controlled[[:space:]]Text[[:space:]]Generation/f568bb18-4c16-416c-8a30-172f549df10f_origin.pdf filter=lfs diff=lfs merge=lfs -text
5695
+ 2024/Superpoint[[:space:]]Gaussian[[:space:]]Splatting[[:space:]]for[[:space:]]Real-Time[[:space:]]High-Fidelity[[:space:]]Dynamic[[:space:]]Scene[[:space:]]Reconstruction/fa58b4d4-3833-4332-a908-0d74cde21358_origin.pdf filter=lfs diff=lfs merge=lfs -text
5696
+ 2024/Superposition[[:space:]]Prompting_[[:space:]]Improving[[:space:]]and[[:space:]]Accelerating[[:space:]]Retrieval-Augmented[[:space:]]Generation/08233afa-6cf4-46fb-a483-804c410856f3_origin.pdf filter=lfs diff=lfs merge=lfs -text
5697
+ 2024/Supervised[[:space:]]Matrix[[:space:]]Factorization_[[:space:]]Local[[:space:]]Landscape[[:space:]]Analysis[[:space:]]and[[:space:]]Applications/8140fbca-e4cf-4f81-b3f8-62711bbc9621_origin.pdf filter=lfs diff=lfs merge=lfs -text
5698
+ 2024/SurfPro_[[:space:]]Functional[[:space:]]Protein[[:space:]]Design[[:space:]]Based[[:space:]]on[[:space:]]Continuous[[:space:]]Surface/f808b19c-681e-4771-af69-26aa74fe66f4_origin.pdf filter=lfs diff=lfs merge=lfs -text
5699
+ 2024/Surface-VQMAE_[[:space:]]Vector-quantized[[:space:]]Masked[[:space:]]Auto-encoders[[:space:]]on[[:space:]]Molecular[[:space:]]Surfaces/56b991e0-9fe0-4799-a55b-299d32c36138_origin.pdf filter=lfs diff=lfs merge=lfs -text
5700
+ 2024/Surprisingly[[:space:]]Strong[[:space:]]Performance[[:space:]]Prediction[[:space:]]with[[:space:]]Neural[[:space:]]Graph[[:space:]]Features/cc14c83d-8339-402b-8e16-958d3226e29b_origin.pdf filter=lfs diff=lfs merge=lfs -text
5701
+ 2024/Swallowing[[:space:]]the[[:space:]]Bitter[[:space:]]Pill_[[:space:]]Simplified[[:space:]]Scalable[[:space:]]Conformer[[:space:]]Generation/f679228e-b560-4bf2-a493-d57bdc1c089e_origin.pdf filter=lfs diff=lfs merge=lfs -text
5702
+ 2024/Switchable[[:space:]]Decision_[[:space:]]Dynamic[[:space:]]Neural[[:space:]]Generation[[:space:]]Networks/c55b9b5b-50ee-4c84-9098-87ccdb38ad5e_origin.pdf filter=lfs diff=lfs merge=lfs -text
5703
+ 2024/Switched[[:space:]]Flow[[:space:]]Matching_[[:space:]]Eliminating[[:space:]]Singularities[[:space:]]via[[:space:]]Switching[[:space:]]ODEs/5a8caf49-dae1-4591-97f7-c29d01a87db1_origin.pdf filter=lfs diff=lfs merge=lfs -text
5704
+ 2024/Switching[[:space:]]the[[:space:]]Loss[[:space:]]Reduces[[:space:]]the[[:space:]]Cost[[:space:]]in[[:space:]]Batch[[:space:]]Reinforcement[[:space:]]Learning/93a411d2-6615-4dde-85d9-a302d0fae13a_origin.pdf filter=lfs diff=lfs merge=lfs -text
5705
+ 2024/SyCoCa_[[:space:]]Symmetrizing[[:space:]]Contrastive[[:space:]]Captioners[[:space:]]with[[:space:]]Attentive[[:space:]]Masking[[:space:]]for[[:space:]]Multimodal[[:space:]]Alignment/2e92c62b-5515-4c78-8d54-bd6732a6c867_origin.pdf filter=lfs diff=lfs merge=lfs -text
5706
+ 2024/Symbolic[[:space:]]Music[[:space:]]Generation[[:space:]]with[[:space:]]Non-Differentiable[[:space:]]Rule[[:space:]]Guided[[:space:]]Diffusion/6bfe9e26-ef9f-4d4e-9933-41bf1931c996_origin.pdf filter=lfs diff=lfs merge=lfs -text
5707
+ 2024/Symmetric[[:space:]]Matrix[[:space:]]Completion[[:space:]]with[[:space:]]ReLU[[:space:]]Sampling/94ac7d82-0507-40b5-ab1a-acb93804b5c4_origin.pdf filter=lfs diff=lfs merge=lfs -text
5708
+ 2024/Symmetric[[:space:]]Replay[[:space:]]Training_[[:space:]]Enhancing[[:space:]]Sample[[:space:]]Efficiency[[:space:]]in[[:space:]]Deep[[:space:]]Reinforcement[[:space:]]Learning[[:space:]]for[[:space:]]Combinatorial[[:space:]]Optimization/013d92d8-e01b-49e7-8d1f-a61c4708cf47_origin.pdf filter=lfs diff=lfs merge=lfs -text
5709
+ 2024/Symmetry[[:space:]]Induces[[:space:]]Structure[[:space:]]and[[:space:]]Constraint[[:space:]]of[[:space:]]Learning/1961c67e-0239-47ae-bfe7-4a57c83d2cca_origin.pdf filter=lfs diff=lfs merge=lfs -text
5710
+ 2024/Synergistic[[:space:]]Integration[[:space:]]of[[:space:]]Coordinate[[:space:]]Network[[:space:]]and[[:space:]]Tensorial[[:space:]]Feature[[:space:]]for[[:space:]]Improving[[:space:]]Neural[[:space:]]Radiance[[:space:]]Fields[[:space:]]from[[:space:]]Sparse[[:space:]]Inputs/8c38b6a9-3457-423d-b443-d8626fe5a4fe_origin.pdf filter=lfs diff=lfs merge=lfs -text
5711
+ 2024/TENG_[[:space:]]Time-Evolving[[:space:]]Natural[[:space:]]Gradient[[:space:]]for[[:space:]]Solving[[:space:]]PDEs[[:space:]]With[[:space:]]Deep[[:space:]]Neural[[:space:]]Nets[[:space:]]Toward[[:space:]]Machine[[:space:]]Precision/7688d70a-d1dc-4aa2-8115-50a7d54b1df7_origin.pdf filter=lfs diff=lfs merge=lfs -text
5712
+ 2024/TERD_[[:space:]]A[[:space:]]Unified[[:space:]]Framework[[:space:]]for[[:space:]]Safeguarding[[:space:]]Diffusion[[:space:]]Models[[:space:]]Against[[:space:]]Backdoors/72e89bb7-327d-4b92-adae-08efefc36c35_origin.pdf filter=lfs diff=lfs merge=lfs -text
5713
+ 2024/TIC-TAC_[[:space:]]A[[:space:]]Framework[[:space:]]For[[:space:]]Improved[[:space:]]Covariance[[:space:]]Estimation[[:space:]]In[[:space:]]Deep[[:space:]]Heteroscedastic[[:space:]]Regression/a1993638-853a-4459-bc89-9d3da22bbd14_origin.pdf filter=lfs diff=lfs merge=lfs -text
5714
+ 2024/TSLANet_[[:space:]]Rethinking[[:space:]]Transformers[[:space:]]for[[:space:]]Time[[:space:]]Series[[:space:]]Representation[[:space:]]Learning/87390601-6694-47c1-9a10-7e76d2d3ee7c_origin.pdf filter=lfs diff=lfs merge=lfs -text
5715
+ 2024/TVE_[[:space:]]Learning[[:space:]]Meta-attribution[[:space:]]for[[:space:]]Transferable[[:space:]]Vision[[:space:]]Explainer/ab30ef16-b02f-4e36-88ef-8ab2e1a9cac1_origin.pdf filter=lfs diff=lfs merge=lfs -text
5716
+ 2024/TabLog_[[:space:]]Test-Time[[:space:]]Adaptation[[:space:]]for[[:space:]]Tabular[[:space:]]Data[[:space:]]Using[[:space:]]Logic[[:space:]]Rules/d574be46-79bd-40f6-8930-945e51906787_origin.pdf filter=lfs diff=lfs merge=lfs -text
5717
+ 2024/Tabular[[:space:]]Insights,[[:space:]]Visual[[:space:]]Impacts_[[:space:]]Transferring[[:space:]]Expertise[[:space:]]from[[:space:]]Tables[[:space:]]to[[:space:]]Images/c406c7d0-2f2e-4f1c-86f2-0f42c75167f4_origin.pdf filter=lfs diff=lfs merge=lfs -text
5718
+ 2024/Tackling[[:space:]]Non-Stationarity[[:space:]]in[[:space:]]Reinforcement[[:space:]]Learning[[:space:]]via[[:space:]]Causal-Origin[[:space:]]Representation/1ec21727-6473-482d-8209-c49743d66283_origin.pdf filter=lfs diff=lfs merge=lfs -text
5719
+ 2024/Tackling[[:space:]]Prevalent[[:space:]]Conditions[[:space:]]in[[:space:]]Unsupervised[[:space:]]Combinatorial[[:space:]]Optimization_[[:space:]]Cardinality,[[:space:]]Minimum,[[:space:]]Covering,[[:space:]]and[[:space:]]More/ccc77dad-9533-4608-a4a8-20f2524afb6f_origin.pdf filter=lfs diff=lfs merge=lfs -text
5720
+ 2024/Tag-LLM_[[:space:]]Repurposing[[:space:]]General-Purpose[[:space:]]LLMs[[:space:]]for[[:space:]]Specialized[[:space:]]Domains/d6341e7b-f859-409d-8207-93b7405a1031_origin.pdf filter=lfs diff=lfs merge=lfs -text
5721
+ 2024/Tandem[[:space:]]Transformers[[:space:]]for[[:space:]]Inference[[:space:]]Efficient[[:space:]]LLMs/c1d2e444-fdd7-4e04-aa64-e239259b463d_origin.pdf filter=lfs diff=lfs merge=lfs -text
5722
+ 2024/Target[[:space:]]Networks[[:space:]]and[[:space:]]Over-parameterization[[:space:]]Stabilize[[:space:]]Off-policy[[:space:]]Bootstrapping[[:space:]]with[[:space:]]Function[[:space:]]Approximation/1b634e08-efba-4c27-8f01-bcfc5653b92d_origin.pdf filter=lfs diff=lfs merge=lfs -text
5723
+ 2024/Task[[:space:]]Groupings[[:space:]]Regularization_[[:space:]]Data-Free[[:space:]]Meta-Learning[[:space:]]with[[:space:]]Heterogeneous[[:space:]]Pre-trained[[:space:]]Models/7c76f066-3277-42b8-9e84-1c81ae1eb750_origin.pdf filter=lfs diff=lfs merge=lfs -text
5724
+ 2024/Task-aware[[:space:]]Orthogonal[[:space:]]Sparse[[:space:]]Network[[:space:]]for[[:space:]]Exploring[[:space:]]Shared[[:space:]]Knowledge[[:space:]]in[[:space:]]Continual[[:space:]]Learning/86df842a-5e03-4d61-b093-249d4cd0114d_origin.pdf filter=lfs diff=lfs merge=lfs -text
5725
+ 2024/Taylor[[:space:]]Videos[[:space:]]for[[:space:]]Action[[:space:]]Recognition/c8deefc0-560e-454c-bf86-6f8729715933_origin.pdf filter=lfs diff=lfs merge=lfs -text
5726
+ 2024/Tell,[[:space:]]Don’t[[:space:]]Show_[[:space:]]Language[[:space:]]Guidance[[:space:]]Eases[[:space:]]Transfer[[:space:]]Across[[:space:]]Domains[[:space:]]in[[:space:]]Images[[:space:]]and[[:space:]]Videos/7d1a8b92-5fed-4b7f-ab2f-3af168a8c147_origin.pdf filter=lfs diff=lfs merge=lfs -text
5727
+ 2024/Temporal[[:space:]]Logic[[:space:]]Specification-Conditioned[[:space:]]Decision[[:space:]]Transformer[[:space:]]for[[:space:]]Offline[[:space:]]Safe[[:space:]]Reinforcement[[:space:]]Learning/82dd53dd-c571-4d7c-8110-ff917fc01beb_origin.pdf filter=lfs diff=lfs merge=lfs -text
5728
+ 2024/Temporal[[:space:]]Spiking[[:space:]]Neural[[:space:]]Networks[[:space:]]with[[:space:]]Synaptic[[:space:]]Delay[[:space:]]for[[:space:]]Graph[[:space:]]Reasoning/8f05be85-8640-4514-80a3-cc89911556dd_origin.pdf filter=lfs diff=lfs merge=lfs -text
5729
+ 2024/Test-Time[[:space:]]Degradation[[:space:]]Adaptation[[:space:]]for[[:space:]]Open-Set[[:space:]]Image[[:space:]]Restoration/ee5bbc55-0ce9-4bd6-876c-afb466cf956f_origin.pdf filter=lfs diff=lfs merge=lfs -text
5730
+ 2024/Test-Time[[:space:]]Model[[:space:]]Adaptation[[:space:]]with[[:space:]]Only[[:space:]]Forward[[:space:]]Passes/33656ae8-8f4d-4613-85f4-677af53fcd65_origin.pdf filter=lfs diff=lfs merge=lfs -text
5731
+ 2024/Test-Time[[:space:]]Regret[[:space:]]Minimization[[:space:]]in[[:space:]]Meta[[:space:]]Reinforcement[[:space:]]Learning/862c1efb-2e8d-4516-97c4-733f7822f980_origin.pdf filter=lfs diff=lfs merge=lfs -text
5732
+ 2024/Testing[[:space:]]the[[:space:]]Feasibility[[:space:]]of[[:space:]]Linear[[:space:]]Programs[[:space:]]with[[:space:]]Bandit[[:space:]]Feedback/85f5c119-4654-47bf-a06f-8a37a78cddce_origin.pdf filter=lfs diff=lfs merge=lfs -text
5733
+ 2024/The[[:space:]]Balanced-Pairwise-Affinities[[:space:]]Feature[[:space:]]Transform/7de6cfb3-3d1d-4790-9ff8-d237d295b431_origin.pdf filter=lfs diff=lfs merge=lfs -text
5734
+ 2024/The[[:space:]]Benefits[[:space:]]of[[:space:]]Reusing[[:space:]]Batches[[:space:]]for[[:space:]]Gradient[[:space:]]Descent[[:space:]]in[[:space:]]Two-Layer[[:space:]]Networks_[[:space:]]Breaking[[:space:]]the[[:space:]]Curse[[:space:]]of[[:space:]]Information[[:space:]]and[[:space:]]Leap[[:space:]]Exponents/003ca220-34da-49d2-9c5d-c5cc9fa8b15c_origin.pdf filter=lfs diff=lfs merge=lfs -text
5735
+ 2024/The[[:space:]]Computational[[:space:]]Complexity[[:space:]]of[[:space:]]Finding[[:space:]]Second-Order[[:space:]]Stationary[[:space:]]Points/2d93eaaf-cce2-439c-8d51-14f5e80cbd60_origin.pdf filter=lfs diff=lfs merge=lfs -text
5736
+ 2024/The[[:space:]]Effect[[:space:]]of[[:space:]]Weight[[:space:]]Precision[[:space:]]on[[:space:]]the[[:space:]]Neuron[[:space:]]Count[[:space:]]in[[:space:]]Deep[[:space:]]ReLU[[:space:]]Networks/5747eec8-1b92-48c1-a5c2-d3d12084dd41_origin.pdf filter=lfs diff=lfs merge=lfs -text
5737
+ 2024/The[[:space:]]Emergence[[:space:]]of[[:space:]]Reproducibility[[:space:]]and[[:space:]]Consistency[[:space:]]in[[:space:]]Diffusion[[:space:]]Models/4544aba4-8ede-40e1-b55c-be6a6e037e02_origin.pdf filter=lfs diff=lfs merge=lfs -text
5738
+ 2024/The[[:space:]]Entropy[[:space:]]Enigma_[[:space:]]Success[[:space:]]and[[:space:]]Failure[[:space:]]of[[:space:]]Entropy[[:space:]]Minimization/c1c6e4f4-a631-42c2-a7f4-f6e7f1bf02a8_origin.pdf filter=lfs diff=lfs merge=lfs -text
5739
+ 2024/The[[:space:]]Expressive[[:space:]]Power[[:space:]]of[[:space:]]Path-Based[[:space:]]Graph[[:space:]]Neural[[:space:]]Networks/7b639ff5-5097-48ad-ad19-d012f6488652_origin.pdf filter=lfs diff=lfs merge=lfs -text
5740
+ 2024/The[[:space:]]Fundamental[[:space:]]Limits[[:space:]]of[[:space:]]Least-Privilege[[:space:]]Learning/d0c7649c-53c0-46fb-b5dc-67ba762498b8_origin.pdf filter=lfs diff=lfs merge=lfs -text
2024/Straight-Through Meets Sparse Recovery_ the Support Exploration Algorithm/da09c8ee-7662-4840-b308-d4ebd84fe5b7_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/Straight-Through Meets Sparse Recovery_ the Support Exploration Algorithm/da09c8ee-7662-4840-b308-d4ebd84fe5b7_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/Straight-Through Meets Sparse Recovery_ the Support Exploration Algorithm/da09c8ee-7662-4840-b308-d4ebd84fe5b7_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f520105042ade49f1f5515d711990e8e35fbc934b06f8fc3ea2d984235e92468
3
+ size 1840033
2024/Straight-Through Meets Sparse Recovery_ the Support Exploration Algorithm/full.md ADDED
The diff for this file is too large to render. See raw diff
 
2024/Straight-Through Meets Sparse Recovery_ the Support Exploration Algorithm/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4407287a7b93ba8c28f4b73c03fb79add81d1f86a631affb43a18a8812ac9ff6
3
+ size 2431645
2024/Straight-Through Meets Sparse Recovery_ the Support Exploration Algorithm/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/StrokeNUWA—Tokenizing Strokes for Vector Graphic Synthesis/b14d089f-0f3b-46df-8e68-6cec5128119c_content_list.json ADDED
@@ -0,0 +1,2020 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "StrokeNUWA—Tokenizing Strokes for Vector Graphic Synthesis",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 158,
8
+ 109,
9
+ 813,
10
+ 132
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Zecheng Tang $^{12}$ Chenfei Wu $^{2}$ Zekai Zhang $^{2}$ Minheng Ni $^{2}$ Shengming Yin $^{2}$ Yu Liu $^{2}$ Zhengyuan Yang $^{3}$ Lijuan Wang $^{3}$ Zicheng Liu $^{3}$ Juntao Li $^{1}$ Nan Duan $^{2}$",
17
+ "bbox": [
18
+ 94,
19
+ 176,
20
+ 875,
21
+ 209
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Abstract",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 241,
31
+ 234,
32
+ 320,
33
+ 250
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "To leverage LLMs for visual synthesis, traditional methods convert raster image information into discrete grid tokens through specialized visual modules, while disrupting the model's ability to capture the true semantic representation of visual scenes. This paper posits that an alternative representation of images, vector graphics, can effectively surmount this limitation by enabling a more natural and semantically coherent segmentation of the image information. Thus, we introduce StrokeNUWA, a pioneering work exploring a better visual representation — \"stroke tokens\" on vector graphics, which is inherently visual semantics rich, naturally compatible with LLMs, and highly compressed. Equipped with stroke tokens, StrokeNUWA can significantly surpass traditional LLM-based and optimization-based methods across various metrics in the vector graphic generation task. Besides, StrokeNUWA achieves up to a $94 \\times$ speedup in inference over the speed of prior methods with an exceptional SVG code compression ratio of $6.9\\%$ . Our code is available at https://github.com/ProjectNUWA/StrokeNUWA.",
40
+ "bbox": [
41
+ 117,
42
+ 255,
43
+ 444,
44
+ 616
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1. Introduction",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 86,
54
+ 636,
55
+ 217,
56
+ 652
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "In recent years, Large transformer-based Language Models, commonly referred as LLMs, have made significant strides, particularly in the domain of Natural Language Processing (NLP) (Brown et al., 2020; Chowdhery et al., 2022; Touvron et al., 2023; Anil et al., 2023). Concurrently, LLMs are gradually expanding their capabilities to other modalities, such as audio (Ghosal et al., 2023), medical (Singhal et al., 2023) and robotics (Brohan et al., 2023).",
63
+ "bbox": [
64
+ 84,
65
+ 662,
66
+ 475,
67
+ 782
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "Current methodologies (Reddy et al., 2021; Wu et al., 2022;",
74
+ "bbox": [
75
+ 84,
76
+ 790,
77
+ 475,
78
+ 806
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "*Equal contribution ${}^{1}$ Soochow University ${}^{2}$ Microsoft Research Asia ${}^{3}$ Microsoft Azure AI. Correspondence to: Nan Duan <nanduan@microsoft.com>.",
85
+ "bbox": [
86
+ 84,
87
+ 815,
88
+ 475,
89
+ 854
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "Proceedings of the $41^{st}$ International Conference on Machine Learning, Vienna, Austria. PMLR 235, 2024. Copyright 2024 by the author(s).",
96
+ "bbox": [
97
+ 84,
98
+ 864,
99
+ 473,
100
+ 905
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "image",
106
+ "img_path": "images/743b6c52619eae21f86ca411322dfa8729d0fdb8f4fb54f8c319dc7517b5b5dc.jpg",
107
+ "image_caption": [
108
+ "Figure 1. Comparison between the visual representation of \"grid\" token and our proposed \"stroke\" token. Instead of tokenizing pixels from raster images, we explore a novel visual representation by tokenizing codes, from another image format—Scalable Vector Graphic (SVG). \"Stroke\" tokens have the following advantages: (1) inherently contain visual semantics, (2) naturally compatible with LLMs, and (3) highly compressed."
109
+ ],
110
+ "image_footnote": [],
111
+ "bbox": [
112
+ 504,
113
+ 234,
114
+ 870,
115
+ 468
116
+ ],
117
+ "page_idx": 0
118
+ },
119
+ {
120
+ "type": "text",
121
+ "text": "Chang et al., 2022; Kondratyuk et al., 2023) enable LLMs to generate visual information by transforming the continuous visual pixels into discrete grid tokens via specialized visual modules such as VQ-VAE (Van Den Oord et al., 2017) and VQ-GAN (Esser et al., 2021). Subsequently, these transformed grid tokens are processed by the LLM in a manner akin to textual word handling, which facilitates LLMs' generative modeling process. However, when compared with diffusion models (Rombach et al., 2022), LLMs still fall behind (Lee et al., 2022; Sun et al., 2023). The shortcomings of LLMs in visual tasks primarily arise from two reasons: First, the transformation process relies on specific visual modules, which inherently possess limitations. For instance, advanced visual modules like VQ-GAN (Esser et al., 2021) can lead to the generation of images with artifact (Yu et al., 2023); Second, the use of grid tokens can disrupt the visual semantics, as the grids are artificially designed and not inherently semantic-aware. This artificial discretization imposes constraints on the model's ability to capture the true semantic representation of visual scenes.",
122
+ "bbox": [
123
+ 495,
124
+ 603,
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/407a3fdceebe0003766a89bb3df19050e05bcd3b2cb88de4ddae0e0eeeeba5ee.jpg",
144
+ "image_caption": [
145
+ "Figure 2. SVG generated by StrokeNUWA. For each image, we provide partial keywords for clarity."
146
+ ],
147
+ "image_footnote": [],
148
+ "bbox": [
149
+ 98,
150
+ 80,
151
+ 849,
152
+ 518
153
+ ],
154
+ "page_idx": 1
155
+ },
156
+ {
157
+ "type": "text",
158
+ "text": "Is there a visual representation that preserves the semantic integrity of visual information while being conducive to processing by LLMs? Finding such a representation within the framework of grid tokens is non-trivial, as the arrangement of grid tokens is typically regular and uniform, whereas the semantic structure within images is often irregular and complex. As illustrated in Fig. 1, the dolphin's body is arbitrarily segmented into different grid tokens. Although there have been efforts to improve the VQ-VAE method (Esser et al., 2021; Yu et al., 2023), enhancing the visual representation quality, they are fundamentally constrained by the limitations inherent to raster image formats, leading to bottlenecks in semantic preservation. In light of these challenges, we propose a novel approach that fundamentally retains the semantic concepts of images by utilizing an alternative image format: vector graphics. Different from pixel-based formats, vector graphics intrinsically reveal the construction of objects, naturally encapsulating the semantic concepts of the image. For example, our proposed \"stroke\" tokens segment the dolphin into sequentially connected strokes, where each stroke unit contains complete semantic information, such as the dolphin's fin (stroke ①) and back (stroke ②).",
159
+ "bbox": [
160
+ 84,
161
+ 554,
162
+ 475,
163
+ 885
164
+ ],
165
+ "page_idx": 1
166
+ },
167
+ {
168
+ "type": "text",
169
+ "text": "It is worth mentioning that our intention is not to claim that vector graphics are superior to raster images, but rather to introduce a fresh perspective on visual representation. The advantages of our \"stroke\" token concept include: (1) Inherently contains visual semantics: each stroke token intrinsically contains visual semantics, offering a more intuitive semantic segmentation of the image content; (2) Naturally compatible with LLMs: the creation process of vector graphics is naturally sequential and interconnected, which mirrors the way LLMs process information. In other words, Each stroke is created in relation to the ones before and after it, establishing a contiguous and coherent sequence that LLMs can process more naturally; (3) Highly compressed: strokes in vector graphics can be highly compressed, allowing each stroke token to encapsulate a rich, compressed representation of the visual information, significantly reducing the data size while maintaining quality and semantic integrity.",
170
+ "bbox": [
171
+ 495,
172
+ 554,
173
+ 887,
174
+ 811
175
+ ],
176
+ "page_idx": 1
177
+ },
178
+ {
179
+ "type": "text",
180
+ "text": "Based on the above analysis, we introduce StrokeNUWA, a model that crafts vector graphics without the reliance on the visual module. StrokeNUWA consists of a VQ-Stroke module and an Encoder-Decoder model. The VQ-Stroke, based on the residual quantizer model architecture (Mar",
181
+ "bbox": [
182
+ 495,
183
+ 818,
184
+ 888,
185
+ 893
186
+ ],
187
+ "page_idx": 1
188
+ },
189
+ {
190
+ "type": "header",
191
+ "text": "StrokeNUWA — Tokenizing Strokes for Vector Graphic Synthesis",
192
+ "bbox": [
193
+ 277,
194
+ 56,
195
+ 694,
196
+ 70
197
+ ],
198
+ "page_idx": 1
199
+ },
200
+ {
201
+ "type": "page_number",
202
+ "text": "2",
203
+ "bbox": [
204
+ 480,
205
+ 922,
206
+ 491,
207
+ 934
208
+ ],
209
+ "page_idx": 1
210
+ },
211
+ {
212
+ "type": "text",
213
+ "text": "tinez et al., 2014), can compress serialized vector graphic information into several SVG tokens. The Encoder-Decoder model primarily utilizes the capabilities of a pre-trained LLM to generate SVG tokens guided by text prompts.",
214
+ "bbox": [
215
+ 84,
216
+ 85,
217
+ 473,
218
+ 147
219
+ ],
220
+ "page_idx": 2
221
+ },
222
+ {
223
+ "type": "text",
224
+ "text": "We compare StrokeNUWA with optimization-based methods in the text-guided Scalable Vector Graphic (SVG) generation task. Our approach achieves higher CLIPScore (Hessel et al., 2021) metrics, suggesting that utilizing stroke tokens can yield content with richer visual semantics. When benchmarked against LLM-based baselines, our method surpasses them across all metrics, indicating that stroke tokens can integrate effectively with LLMs. Finally, due to the compression capabilities inherent in vector graphics, our model demonstrates significant efficiency in generation, achieving speed improvements of up to 94 times.",
225
+ "bbox": [
226
+ 84,
227
+ 152,
228
+ 475,
229
+ 319
230
+ ],
231
+ "page_idx": 2
232
+ },
233
+ {
234
+ "type": "text",
235
+ "text": "In a nutshell, our contributions can be outlined as follows:",
236
+ "bbox": [
237
+ 84,
238
+ 325,
239
+ 468,
240
+ 340
241
+ ],
242
+ "page_idx": 2
243
+ },
244
+ {
245
+ "type": "list",
246
+ "sub_type": "text",
247
+ "list_items": [
248
+ "- We introduce StrokeNUWA, the pioneering study exploring a better visual representation—stroke token, to synthesize vector graphics solely through LLMs without relying on specialized visual modules.",
249
+ "- We propose VQ-Stroke, a specialized Vector Quantized Variational Autoencoder (VQ-VAE) designed to compress vector graphics into stroke tokens, providing an exceptional compression ratio of $6.9\\%$ .",
250
+ "- We conduct detailed experiments that demonstrate the significant potential of stroke tokens in the text-guided vector graphic synthesis task."
251
+ ],
252
+ "bbox": [
253
+ 102,
254
+ 345,
255
+ 473,
256
+ 518
257
+ ],
258
+ "page_idx": 2
259
+ },
260
+ {
261
+ "type": "text",
262
+ "text": "2. Related Work",
263
+ "text_level": 1,
264
+ "bbox": [
265
+ 84,
266
+ 537,
267
+ 227,
268
+ 554
269
+ ],
270
+ "page_idx": 2
271
+ },
272
+ {
273
+ "type": "text",
274
+ "text": "2.1. Visual Representation",
275
+ "text_level": 1,
276
+ "bbox": [
277
+ 84,
278
+ 564,
279
+ 272,
280
+ 579
281
+ ],
282
+ "page_idx": 2
283
+ },
284
+ {
285
+ "type": "text",
286
+ "text": "In the realm of computer graphics, two predominant image formats prevail: raster images, characterized by pixel matrices; and vector images, a.k.a, Scalable Vector Graphic (SVG), characterized by a series of code language commands (Zhang et al., 2023). Recent developments in visual synthesis have predominantly centered on generating raster images. The basic idea is to transform the continuous image pixels into discrete grid tokens via specialized visual modules such as VQ-VAE (Van Den Oord et al., 2017) and VQ-GAN (Esser et al., 2021), and then leverage LLMs to generate these tokens (Wu et al., 2022; Kondratyuk et al., 2023). Most recently, some works have tried to improve \"grid\" tokens by designing advanced architectures such as Lookup-Free Quantization (Yu et al., 2023) and Efficient VQ-GAN (Cao et al., 2023). However, these \"grid\" token representations can disrupt visual semantics as the grids are artificially designed, which lacks inherent semantic awareness, and are easily subject to the visual module's intrinsic limitations like disturbances and tampering (Hu et al., 2023). Our study is a pioneering effort to explore a better visual representation by proposing the concept of the \"stroke\" token.",
287
+ "bbox": [
288
+ 84,
289
+ 588,
290
+ 475,
291
+ 905
292
+ ],
293
+ "page_idx": 2
294
+ },
295
+ {
296
+ "type": "text",
297
+ "text": "Table 1. Overview of basic SVG commands, including M, L, and C, where each command contains one beginning point $(x_0,y_0)$ and one end point $(x_{1},y_{1})$ . For Cubic Bezier command, it contains two extra control points $(c_0^x,c_0^y)$ and $(c_1^x,c_1^y)$ .",
298
+ "bbox": [
299
+ 496,
300
+ 80,
301
+ 885,
302
+ 138
303
+ ],
304
+ "page_idx": 2
305
+ },
306
+ {
307
+ "type": "table",
308
+ "img_path": "images/2f35591a2789c6c6dcacf532b11bf1c9ce600a2d9a9c36347e5d45bbf45767f2.jpg",
309
+ "table_caption": [],
310
+ "table_footnote": [],
311
+ "table_body": "<table><tr><td>Name</td><td>Symbol</td><td>Argument</td><td>Example</td></tr><tr><td>Move To</td><td>M</td><td>(x0,y0)(x1,y1)</td><td>(x0,y0) (x1,y1)</td></tr><tr><td>Line To</td><td>L</td><td>(x0,y0)(x1,y1)</td><td>(x0,y0) (x1,y1)</td></tr><tr><td rowspan=\"2\">Cubic Bezier</td><td rowspan=\"2\">C</td><td rowspan=\"2\">(x0,y0)(x1,y1)(c0x,c0y)(c1x,c1y)</td><td>(c0x,c0y) (x1,y1)</td></tr><tr><td>(x0,y0) (c1x,c1y)</td></tr></table>",
312
+ "bbox": [
313
+ 506,
314
+ 145,
315
+ 874,
316
+ 313
317
+ ],
318
+ "page_idx": 2
319
+ },
320
+ {
321
+ "type": "text",
322
+ "text": "Different from the 'grid' tokens, the \"stroke\" token is inherently defined by contextually associated coded language commands that offer strong semantic integrity, potentially mitigating the aforementioned issues.",
323
+ "bbox": [
324
+ 496,
325
+ 321,
326
+ 887,
327
+ 383
328
+ ],
329
+ "page_idx": 2
330
+ },
331
+ {
332
+ "type": "text",
333
+ "text": "2.2. SVG Generation",
334
+ "text_level": 1,
335
+ "bbox": [
336
+ 496,
337
+ 398,
338
+ 648,
339
+ 412
340
+ ],
341
+ "page_idx": 2
342
+ },
343
+ {
344
+ "type": "text",
345
+ "text": "SVG generation employs a method of structured code generation for producing graphics, which offers better interpretability, flexibility, and scalability in image representation. The current mainstream approach of SVG generation is optimization-based methods (Su et al., 2023; Jain et al., 2023; Xing et al., 2023), which share a similarity with traditional raster image generation, involving iteratively refining randomly initialized SVG paths to fit a target raster image with a differentiable rasterizer (Li et al., 2020). However, the optimization process is both time-consuming and computationally intensive, e.g., creating an SVG graphic comprised of 24 SVG paths can exceed 20 minutes<sup>1</sup>. Alternatively, some recent approaches have begun to adopt auto-regressive models to directly generate code for SVG synthesis (Wang et al., 2022; Wu et al., 2023a). However, due to the inherent extensive length nature of SVGs and a lack of effective SVG representation, these methods constrain LLMs to generate complex SVGs. To address these challenges, we introduce VQ-Stroke and present the concept of “stroke” tokens. By transforming SVGs into stroke tokens, our approach enables LLMs to produce intricate SVGs with significantly improved inference speed.",
346
+ "bbox": [
347
+ 495,
348
+ 422,
349
+ 888,
350
+ 755
351
+ ],
352
+ "page_idx": 2
353
+ },
354
+ {
355
+ "type": "text",
356
+ "text": "3. Methodology",
357
+ "text_level": 1,
358
+ "bbox": [
359
+ 496,
360
+ 773,
361
+ 633,
362
+ 791
363
+ ],
364
+ "page_idx": 2
365
+ },
366
+ {
367
+ "type": "text",
368
+ "text": "3.1. Problem Formulation",
369
+ "text_level": 1,
370
+ "bbox": [
371
+ 496,
372
+ 800,
373
+ 683,
374
+ 814
375
+ ],
376
+ "page_idx": 2
377
+ },
378
+ {
379
+ "type": "text",
380
+ "text": "SVG code provides a suite of command and syntax rules, e.g., the \"<rect>\" command defines a rectangle shape with its position, width, and height, which can",
381
+ "bbox": [
382
+ 495,
383
+ 823,
384
+ 885,
385
+ 869
386
+ ],
387
+ "page_idx": 2
388
+ },
389
+ {
390
+ "type": "header",
391
+ "text": "StrokeNUWA — Tokenizing Strokes for Vector Graphic Synthesis",
392
+ "bbox": [
393
+ 277,
394
+ 56,
395
+ 694,
396
+ 70
397
+ ],
398
+ "page_idx": 2
399
+ },
400
+ {
401
+ "type": "page_footnote",
402
+ "text": "<sup>1</sup>We test with LIVE (Ma et al., 2022) and VectorFusion (Jain et al., 2023) on one NVIDIA V100 GPU.",
403
+ "bbox": [
404
+ 496,
405
+ 878,
406
+ 885,
407
+ 904
408
+ ],
409
+ "page_idx": 2
410
+ },
411
+ {
412
+ "type": "page_number",
413
+ "text": "3",
414
+ "bbox": [
415
+ 480,
416
+ 922,
417
+ 491,
418
+ 934
419
+ ],
420
+ "page_idx": 2
421
+ },
422
+ {
423
+ "type": "text",
424
+ "text": "be written as $<\\text{rect} x=\"10\" y=\"20\" width=\"50\" height=\"80\"/>$ . However, considering the multitude of SVG command types, creating such a system not only requires a complex data structure, but without a massive dataset, LLMs would struggle to model the diverse range of commands effectively. Therefore, as shown in Tab. 1, we can simplify each SVG using just three basic commands: \"Move To\", \"Line To\", and \"Cubic Bezier\" by following Iconshop (Wu et al., 2023a) and DeepSVG (Carlier et al., 2020). For instance, intricate commands like \"<rect>\" can be constructed by those three basic commands. After simplification, an SVG $\\mathcal{G} = \\{\\mathcal{P}_i\\}_{i=1}^N$ can be described with $N$ SVG paths, with each SVG path $\\mathcal{P}_i$ consists of $M_i$ basic commands: $\\mathcal{P}_i = \\{\\mathcal{C}_i^j\\}_{j=1}^{M_i}$ , where $\\mathcal{C}_i^j$ is the $j$ -th command in the $i$ -th path. Eventually, each basic command $\\mathcal{C} = (T, \\mathcal{V})$ is consistent of command type $T \\in \\{\\mathsf{M}, \\mathsf{L}, \\mathsf{C}\\}$ , and the corresponding position argument $\\mathcal{V}$ .",
425
+ "bbox": [
426
+ 83,
427
+ 84,
428
+ 475,
429
+ 340
430
+ ],
431
+ "page_idx": 3
432
+ },
433
+ {
434
+ "type": "text",
435
+ "text": "3.2.StrokeNUWA",
436
+ "text_level": 1,
437
+ "bbox": [
438
+ 84,
439
+ 351,
440
+ 215,
441
+ 364
442
+ ],
443
+ "page_idx": 3
444
+ },
445
+ {
446
+ "type": "text",
447
+ "text": "StrokeNUWA contains three core components: a Vector Quantized-Stroke (VQ-Stroke) for SVG compression, an Encoder-Decoder-based LLM (EDM) for SVG generation, and an SVG Fixer (SF) for post-processing. Firstly, VQ-Stroke compresses the SVG into stroke tokens, which enables a transformation between the SVG code and the discrete stroke tokens. Then, EDM utilizes the stroke tokens produced from VQ-Stroke to generate SVG code. Finally, SF is a post-processing module designed to refine the quality of the generated SVGs, given that the output generated from the EDM or VQ-Stroke may not always conform to the stringent syntactical rules of SVG code. Below, we will introduce the details of each component.",
448
+ "bbox": [
449
+ 83,
450
+ 375,
451
+ 477,
452
+ 571
453
+ ],
454
+ "page_idx": 3
455
+ },
456
+ {
457
+ "type": "text",
458
+ "text": "3.2.1. VECTOR QUANTIZED-STROKE",
459
+ "text_level": 1,
460
+ "bbox": [
461
+ 84,
462
+ 585,
463
+ 346,
464
+ 601
465
+ ],
466
+ "page_idx": 3
467
+ },
468
+ {
469
+ "type": "text",
470
+ "text": "VQ-Stroke encompasses two main stages: “Code to Matrix” stage that transforms SVG code into the matrix format suitable for model input, and “Matrix to Token” stage that transforms the matrix data into stroke tokens.",
471
+ "bbox": [
472
+ 84,
473
+ 609,
474
+ 475,
475
+ 670
476
+ ],
477
+ "page_idx": 3
478
+ },
479
+ {
480
+ "type": "text",
481
+ "text": "Code to Matrix As depicted in Fig. 3, we first transform the simplified SVG code (Sec. 3.1) into SVG matrix format by converting each basic command $\\mathcal{C}_i^j$ to the individual vector $\\mathcal{K}_i^j\\in \\mathbb{R}^9$ with rules $f$ :",
482
+ "bbox": [
483
+ 84,
484
+ 689,
485
+ 475,
486
+ 752
487
+ ],
488
+ "page_idx": 3
489
+ },
490
+ {
491
+ "type": "equation",
492
+ "text": "\n$$\n\\mathcal {K} _ {i} ^ {j} = f \\left(\\mathcal {C} _ {i} ^ {j}\\right) = \\left(T, x _ {0}, y _ {0}, c _ {0} ^ {x}, c _ {0} ^ {y}, c _ {1} ^ {x}, c _ {1} ^ {y}, x _ {1}, y _ {1}\\right) _ {i} ^ {j}, \\tag {1}\n$$\n",
493
+ "text_format": "latex",
494
+ "bbox": [
495
+ 106,
496
+ 766,
497
+ 475,
498
+ 786
499
+ ],
500
+ "page_idx": 3
501
+ },
502
+ {
503
+ "type": "text",
504
+ "text": "where $T$ denotes the basic command type, $(x_0,y_0)$ and $(x_{1},y_{1})$ represent the beginning and the end points, with $(c_0^x,c_0^y)$ and $(c_1^x,c_1^y)$ as the control points of each basic command. Then, to establish interconnections among the adjacent commands, we set the end point of $j$ -th command $(x_{1},y_{1})_{i}^{j}$ equal to the beginning point $(x_0,y_0)_i^{j + 1}$ of the subsequent $(j + 1)$ -th command in each individual path.",
505
+ "bbox": [
506
+ 84,
507
+ 799,
508
+ 475,
509
+ 906
510
+ ],
511
+ "page_idx": 3
512
+ },
513
+ {
514
+ "type": "image",
515
+ "img_path": "images/867050e96ef5293c5dc00b545412482a554a00f4c742e1bbeb99486ec206440e.jpg",
516
+ "image_caption": [
517
+ "Figure 3. Overview of VQ-Stroke."
518
+ ],
519
+ "image_footnote": [],
520
+ "bbox": [
521
+ 514,
522
+ 83,
523
+ 870,
524
+ 424
525
+ ],
526
+ "page_idx": 3
527
+ },
528
+ {
529
+ "type": "text",
530
+ "text": "We then decompose all the paths within the SVG $\\mathcal{G}$ into distinct basic commands and combine their corresponding vectors into a matrix form:",
531
+ "bbox": [
532
+ 496,
533
+ 465,
534
+ 885,
535
+ 508
536
+ ],
537
+ "page_idx": 3
538
+ },
539
+ {
540
+ "type": "equation",
541
+ "text": "\n$$\n\\begin{array}{l} f (\\mathcal {G}) = (f (P _ {i})) _ {i = 1} ^ {N} = \\left(\\left(f (\\mathcal {C} _ {i} ^ {j})\\right) _ {j = 1} ^ {M _ {i}}\\right) _ {i = 1} ^ {N} \\\\ = \\left( \\begin{array}{c c c c} \\left(\\mathcal {K} _ {1} ^ {1}; & \\mathcal {K} _ {1} ^ {2}; & \\dots ; & \\mathcal {K} _ {1} ^ {M _ {1}}\\right) \\\\ \\vdots & \\vdots & \\ddots & \\vdots \\\\ \\left(\\mathcal {K} _ {N} ^ {1}; & \\mathcal {K} _ {N} ^ {2}; & \\dots ; & \\mathcal {K} _ {N} ^ {M _ {N}}\\right) \\end{array} \\right), \\tag {2} \\\\ \\end{array}\n$$\n",
542
+ "text_format": "latex",
543
+ "bbox": [
544
+ 549,
545
+ 507,
546
+ 885,
547
+ 604
548
+ ],
549
+ "page_idx": 3
550
+ },
551
+ {
552
+ "type": "text",
553
+ "text": "where $\"\\; \"$ denotes the stack operation, and each matrix row represents an individual command. Thus, we can obtain a structured SVG matrix $f(\\mathcal{G}) \\in \\mathbb{R}^{(\\sum_{i=1}^{N} M_i) \\times 9}$ to represent an SVG that contains $\\sum_{i=1}^{N} M_i$ individual basic commands.",
554
+ "bbox": [
555
+ 496,
556
+ 614,
557
+ 885,
558
+ 680
559
+ ],
560
+ "page_idx": 3
561
+ },
562
+ {
563
+ "type": "text",
564
+ "text": "Matrix to Stroke After obtaining the SVG matrix $f(\\mathcal{G})$ , we aim to compress the matrix into discrete stroke tokens via latent representation, with which one can reconstruct the $f(\\mathcal{G})$ . As shown in Fig. 3, the VQ-Stroke model is composed of Down-Sample blocks, a Stroke Codebook $\\mathcal{B}$ and Up-Sample blocks. The SVG matrix $f(\\mathcal{G})$ is first encoded by the Down-Sample blocks to obtain the compressed representations, which entails increasing the number of representation channels (column of $f(\\mathcal{G})$ ) while concurrently compressing the spatial dimensions (row of $f(\\mathcal{G})$ ) to yield a more compact representation, i.e. compressing the number of commands into $T$ s.t. $T < \\sum_{i=1}^{N} M_i$ . Then, the Codebook $\\mathcal{B}$ simultaneously conducts $d$ levels of compression with residual vector quantization (Barnes et al., 1996;",
565
+ "bbox": [
566
+ 495,
567
+ 694,
568
+ 888,
569
+ 905
570
+ ],
571
+ "page_idx": 3
572
+ },
573
+ {
574
+ "type": "header",
575
+ "text": "StrokeNUWA — Tokenizing Strokes for Vector Graphic Synthesis",
576
+ "bbox": [
577
+ 277,
578
+ 56,
579
+ 694,
580
+ 70
581
+ ],
582
+ "page_idx": 3
583
+ },
584
+ {
585
+ "type": "page_number",
586
+ "text": "4",
587
+ "bbox": [
588
+ 480,
589
+ 922,
590
+ 491,
591
+ 934
592
+ ],
593
+ "page_idx": 3
594
+ },
595
+ {
596
+ "type": "image",
597
+ "img_path": "images/a58370ed3561ee8eced9376009a95ce8691f3d8dd27ea37b693e81d90c6cbc27.jpg",
598
+ "image_caption": [
599
+ "Figure 4. Architecture of Down-Sample and Up-Sample Blocks."
600
+ ],
601
+ "image_footnote": [],
602
+ "bbox": [
603
+ 89,
604
+ 84,
605
+ 460,
606
+ 262
607
+ ],
608
+ "page_idx": 4
609
+ },
610
+ {
611
+ "type": "text",
612
+ "text": "Wang et al., 2023), enabling VQ-Stroke to better model the compressed representations. We depict the detailed architecture of Down-Sample blocks and Up-Sample blocks in Fig 4, wherein both blocks first utilize a Conv1d or ConvTranspose1d model to compress or expand the features, succeeded by a ResNet1d module and an additional Conv1d module for feature extraction. It is worth mentioning that a low compression rate allows the VQ-Stroke to learn the fine details of SVGs (the first and second columns), while more aggressive compression (the third column) enables the VQ-Stroke to capture the overall contours of the SVGs. As illustrated in Fig.5, a low compression rate allows the VQ-Stroke to learn the fine details of SVGs (the first and second columns), while more aggressive compression (the third column) enables the VQ-Stroke to capture the overall contours of the SVGs. We have more discussion in Sec. 4.2. Finally, the Down-Sample blocks reconstruct the SVG latent representation output from the Codebook $\\mathcal{B}$ .",
613
+ "bbox": [
614
+ 84,
615
+ 301,
616
+ 475,
617
+ 575
618
+ ],
619
+ "page_idx": 4
620
+ },
621
+ {
622
+ "type": "text",
623
+ "text": "Following Dhariwal et al., the training objective of VQ-Stroke consists of commitment loss, codebook loss, and reconstruction loss, which can be written as:",
624
+ "bbox": [
625
+ 84,
626
+ 582,
627
+ 475,
628
+ 627
629
+ ],
630
+ "page_idx": 4
631
+ },
632
+ {
633
+ "type": "equation",
634
+ "text": "\n$$\n\\begin{array}{l} \\ell_ {V Q - S t r o k e} = \\alpha \\left(\\ell_ {\\text {c o d e b o o k}} + \\ell_ {\\text {c o m m i t}}\\right) + \\ell_ {\\text {r e c o n}} \\\\ = \\alpha \\left(\\left\\| \\mathcal {Z} - \\operatorname {s g} [ \\tilde {\\mathcal {Z}} ] \\right\\| _ {2} ^ {2} + \\left\\| \\operatorname {s g} [ \\mathcal {Z} ] - \\tilde {\\mathcal {Z}} \\right\\| _ {2} ^ {2}\\right) \\tag {3} \\\\ + \\operatorname {M S E} (\\widetilde {f (\\mathcal {G})}, f (\\mathcal {G})), \\\\ \\end{array}\n$$\n",
635
+ "text_format": "latex",
636
+ "bbox": [
637
+ 112,
638
+ 638,
639
+ 473,
640
+ 705
641
+ ],
642
+ "page_idx": 4
643
+ },
644
+ {
645
+ "type": "text",
646
+ "text": "where $\\alpha$ is the hyper-parameter, $\\mathcal{Z}$ is the compressed latent output from down-sample blocks, $\\tilde{\\mathcal{Z}}$ is the latent looked up from codebook $\\mathcal{B}$ , and $\\mathrm{sg}[\\cdot]$ is the gradient clipping operation. Besides, we pre-normalize the input data into the $[-1, 1]$ range to stabilize the training process.",
647
+ "bbox": [
648
+ 84,
649
+ 715,
650
+ 475,
651
+ 792
652
+ ],
653
+ "page_idx": 4
654
+ },
655
+ {
656
+ "type": "text",
657
+ "text": "3.2.2. ENCODER-DECODER-BASED LLM",
658
+ "text_level": 1,
659
+ "bbox": [
660
+ 86,
661
+ 806,
662
+ 375,
663
+ 821
664
+ ],
665
+ "page_idx": 4
666
+ },
667
+ {
668
+ "type": "text",
669
+ "text": "We employ an Encoder-Decoder LLM (EDM) to predict the stroke tokens obtained from the codebook $\\mathcal{B}$ . Considering LLM's inherent textual instruction capability, we freeze the EDM encoder to leverage its inherited textual knowledge. Subsequently, we fine-tune the EDM decoder",
670
+ "bbox": [
671
+ 84,
672
+ 829,
673
+ 475,
674
+ 905
675
+ ],
676
+ "page_idx": 4
677
+ },
678
+ {
679
+ "type": "image",
680
+ "img_path": "images/1154c271292d513ab606675a0ae6556ddc6ae7f236db496ab1148158bc85a502.jpg",
681
+ "image_caption": [
682
+ "Figure 5. Analysis of SVG reconstruction, where $C$ is a constant representing the number of inserted $<\\mathbb{M}>$ command in PI setting. To facilitate clear observation of the SVG composition, we represent each basic command with a distinct color."
683
+ ],
684
+ "image_footnote": [],
685
+ "bbox": [
686
+ 500,
687
+ 83,
688
+ 880,
689
+ 371
690
+ ],
691
+ "page_idx": 4
692
+ },
693
+ {
694
+ "type": "text",
695
+ "text": "to learn the stroke token prediction task. Due to the discrepancy between the vocabulary of stroke tokens and the original LLM's vocabulary, we extend EDM with an additional stroke embedding layer and a stroke predictor. Consequently, given the trainable model parameters $\\theta$ and the textual prompt $\\pmb{K}$ , we maximize the log probability $\\operatorname{argmax}_{\\theta} \\prod_{i=1}^{T} P(t_i \\mid t_{<i}, \\pmb{K})$ with the cross-entropy loss.",
696
+ "bbox": [
697
+ 495,
698
+ 450,
699
+ 887,
700
+ 558
701
+ ],
702
+ "page_idx": 4
703
+ },
704
+ {
705
+ "type": "text",
706
+ "text": "3.2.3. SVG FIXER",
707
+ "text_level": 1,
708
+ "bbox": [
709
+ 496,
710
+ 571,
711
+ 630,
712
+ 585
713
+ ],
714
+ "page_idx": 4
715
+ },
716
+ {
717
+ "type": "text",
718
+ "text": "A critical issue arises in the generation results from both SDM and EDM, as they fail to guarantee Equ. 1 due to the discrepancies of the interconnection points among adjacent commands in each individual SVG path, i.e., $(x_{1},y_{1})_{i}^{j}\\neq (x_{0},y_{0})_{i}^{j + 1}$ in $i$ -th path. To address this issue, we introduce the SVG Fixer (SF) as a post-processing module for the generated results. It encompasses two strategies: Path Clipping (PC) and Path Interpolation (PI). Specifically, PC involves the direct substitution of each SVG command's beginning point with the endpoint of adjacent SVG commands: $(x_0,y_0)_i^{j + 1}\\coloneqq (x_1,y_1)_i^j$ . On the other hand, PI entails the addition of M commands between each pair of adjacent, yet non-interconnected SVG commands to bridge the discrepancy, i.e., if $(x_{1},y_{1})_{i}^{j}\\neq (x_{0},y_{0})_{i}^{j + 1}\\Rightarrow$ adding an extra command $\\left(\\mathbb{M},(x_1,y_1)_i^j,0,0,0,0,(x_0,y_0)_i^{j + 1}\\right)$ to force the previous command's end point to move to the beginning point of the next adjacent command. As shown in Fig. 5, PC can streamline the overall paths of SVGs, making them more succinct, but may lead to some inaccuracies in the details. On the other hand, PI tends to reveal more gener",
719
+ "bbox": [
720
+ 495,
721
+ 594,
722
+ 888,
723
+ 905
724
+ ],
725
+ "page_idx": 4
726
+ },
727
+ {
728
+ "type": "header",
729
+ "text": "StrokeNUWA — Tokenizing Strokes for Vector Graphic Synthesis",
730
+ "bbox": [
731
+ 277,
732
+ 56,
733
+ 694,
734
+ 70
735
+ ],
736
+ "page_idx": 4
737
+ },
738
+ {
739
+ "type": "page_number",
740
+ "text": "5",
741
+ "bbox": [
742
+ 480,
743
+ 922,
744
+ 491,
745
+ 934
746
+ ],
747
+ "page_idx": 4
748
+ },
749
+ {
750
+ "type": "text",
751
+ "text": "ated stokes' details, but it may introduce more curves. Each strategy has its own applicable scenarios.",
752
+ "bbox": [
753
+ 84,
754
+ 85,
755
+ 475,
756
+ 116
757
+ ],
758
+ "page_idx": 5
759
+ },
760
+ {
761
+ "type": "text",
762
+ "text": "4. Experiment",
763
+ "text_level": 1,
764
+ "bbox": [
765
+ 84,
766
+ 133,
767
+ 210,
768
+ 152
769
+ ],
770
+ "page_idx": 5
771
+ },
772
+ {
773
+ "type": "text",
774
+ "text": "4.1. Experimental Settings",
775
+ "text_level": 1,
776
+ "bbox": [
777
+ 84,
778
+ 160,
779
+ 274,
780
+ 176
781
+ ],
782
+ "page_idx": 5
783
+ },
784
+ {
785
+ "type": "text",
786
+ "text": "Dataset We construct the training and evaluation data with FIGR-8-SVG dataset (Clouâtre & Demers, 2019), which consists of massive monochromatic (black-and-white) SVG icons. We pre-process the SVG data by transforming each SVG sample into standardized representations, eliminating the redundant SVG paths, dropping the outer black box, and filtering the data by applying a threshold of 1,024 basic commands in length. We filter the instance with less than two annotated discrete keywords and apply a template \"Generating SVG according to keywords: $\\{\\dots\\}\"$ to build the text prompt. After preprocessing, we sample 2,000 instances with varying SVG code lengths as the testing set, 8,000 samples for validation, and apply the remaining 740K samples for training.",
787
+ "bbox": [
788
+ 84,
789
+ 184,
790
+ 475,
791
+ 396
792
+ ],
793
+ "page_idx": 5
794
+ },
795
+ {
796
+ "type": "text",
797
+ "text": "Evaluation Metrics For VQ-Stroke, we primarily consider the reconstruction quality and the compression effectiveness. We evaluate the reconstruction quality with the Fréchet Inception Distance $(\\mathrm{FID})^2$ (Heusel et al., 2017) and the CLIPScore (Hessel et al., 2021). Given that the generated SVG graphics consist solely of lines, we set the background color to white to mitigate the potential biases for FID and CLIPScore brought by the background (Wu et al., 2023a). Additionally, we calculate the Edit Score (EDIT) between the reconstructed SVG code and the Golden SVG (ground truth) code to reflect the fidelity of the reconstructed SVG graphics in replicating fine details. To reflect the practical compression effectiveness of VQ-Stroke, we calculate the Compression Ratio (CR) score between the tokenized SVG code and the stroke tokens, i.e., $\\mathrm{CR} = \\mathrm{Len}(\\mathrm{tokenized~SVG~code}) / \\mathrm{Len}(\\mathrm{stroke~tokens})$ . For StokeNUWA, apart from utilizing the metrics mentioned above, we supplement evaluation with Human Preference Score (HPS) (Wu et al., 2023b) and Recall Score to reflect the quality of the generated SVG graphics and their degree of overlap with the Golden SVG code. Additionally, we also report the time required to generate each SVG and conduct the qualitative evaluation. More details about evaluation are illustrated in Appendix A.",
798
+ "bbox": [
799
+ 84,
800
+ 416,
801
+ 477,
802
+ 779
803
+ ],
804
+ "page_idx": 5
805
+ },
806
+ {
807
+ "type": "text",
808
+ "text": "Tasks and Baselines We evaluate VQ-Stroke and StrokeNUWA with the SVG reconstruction and the text-guided SVG generation tasks, respectively. For VQ-Stroke, considering the absence of works in the field of SVG representation, we focus on comparing the performance of two",
809
+ "bbox": [
810
+ 84,
811
+ 792,
812
+ 475,
813
+ 869
814
+ ],
815
+ "page_idx": 5
816
+ },
817
+ {
818
+ "type": "image",
819
+ "img_path": "images/5b9302375b190f9c8f9335b667c79a7c6cda1f6f89bbc04000bf14cc1e834a84.jpg",
820
+ "image_caption": [
821
+ "Figure 6. Reconstruction cases generated by VQ-Stroke, difficulty (reflected by path numbers) increases from left to right."
822
+ ],
823
+ "image_footnote": [],
824
+ "bbox": [
825
+ 504,
826
+ 84,
827
+ 877,
828
+ 321
829
+ ],
830
+ "page_idx": 5
831
+ },
832
+ {
833
+ "type": "text",
834
+ "text": "SF methods, i.e., PI and PC. Additionally, we evaluate the reconstruction performance of two different compression rates, i.e., compression rates of 2 and 4. For StrokeNUWA, we compare with the optimization-based methods, including Vector Fusion (Jain et al., 2023) and the Stable Diffusion (Rombach et al., 2022) combined with LIVE method (Li et al., 2020). Given that optimization-based methods are notably time-intensive, i.e., requiring more than 20 minutes to generate a single SVG on one NVIDIA V100 GPU, we randomly sample 500 instances from the testing set for evaluation to ensure a feasible timeframe. Additionally, we also compare with the LLM-based method Iconshop (Wu et al., 2023a). We re-implement Iconshop with the same Flan-T5 backbone as in StrokeNUWA and use T5 tokenizer to encode the numerical values built in Iconshop. Notably, the primary distinction between Iconshop and StrokeNUWA lies in their approaches to handling visual representation. While Iconshop directly treats SVG code as visual tokens, StrokeNUWA converts SVGs into stroke tokens with VQ-Stroke. We set the maximum model length to 1,500 for IconShop to ensure the SVG completeness.",
835
+ "bbox": [
836
+ 495,
837
+ 402,
838
+ 888,
839
+ 720
840
+ ],
841
+ "page_idx": 5
842
+ },
843
+ {
844
+ "type": "text",
845
+ "text": "Implementation Details For VQ-Stroke, we set the depth of the residual vector quantization $d$ to 2, corresponding to compression rates of 2 and 4. Then, we set the codebook size $|\\mathcal{B}|$ as 4096, with each code corresponding to a latent representation of 512 dimensions. We set $\\alpha = 1$ in Equ. 3 during the training process. For EDM, we utilize the 3B Flan-T5 model (Chung et al., 2022) as the backbone. We utilize DeepSpeed Library (Rajbhandari et al., 2020) to implement models on 64 NVIDIA V100 GPUs and set the maximum model length as 512.",
846
+ "bbox": [
847
+ 495,
848
+ 753,
849
+ 885,
850
+ 905
851
+ ],
852
+ "page_idx": 5
853
+ },
854
+ {
855
+ "type": "header",
856
+ "text": "StrokeNUWA — Tokenizing Strokes for Vector Graphic Synthesis",
857
+ "bbox": [
858
+ 277,
859
+ 56,
860
+ 694,
861
+ 70
862
+ ],
863
+ "page_idx": 5
864
+ },
865
+ {
866
+ "type": "page_footnote",
867
+ "text": "${}^{2}$ Specifically,we obtain the image features of rendered SVG graphics with the CLIP image encoder (Radford et al., 2021)",
868
+ "bbox": [
869
+ 84,
870
+ 877,
871
+ 473,
872
+ 905
873
+ ],
874
+ "page_idx": 5
875
+ },
876
+ {
877
+ "type": "page_number",
878
+ "text": "6",
879
+ "bbox": [
880
+ 480,
881
+ 922,
882
+ 491,
883
+ 934
884
+ ],
885
+ "page_idx": 5
886
+ },
887
+ {
888
+ "type": "table",
889
+ "img_path": "images/a589ac4fe12770d76c350da2ed4fd88e819c7c6d32b21d8151cbe40dc96ab3cb.jpg",
890
+ "table_caption": [
891
+ "Table 2. Performance of StrokeNUWA, where \"Optim/Pred Length\" denotes the actual predicted or optimized number of paths."
892
+ ],
893
+ "table_footnote": [],
894
+ "table_body": "<table><tr><td rowspan=\"2\">Methods</td><td colspan=\"3\">Visual Performance</td><td colspan=\"3\">SVG Code Quality</td><td rowspan=\"2\">Generation Speed (↓) (per SVG)</td></tr><tr><td>FID (↓)</td><td>CLIPScore (↑)</td><td>HPS (↑)</td><td>Recall (↑) (Stoke Token)</td><td>EDIT (↓)</td><td>Optim / Pred Length (Avg)</td></tr><tr><td>SD &amp; LIVE</td><td>14.236</td><td>12.908</td><td>11.210</td><td>0.028</td><td>-</td><td>160 (32 Path)</td><td>≈ 28.0 min</td></tr><tr><td>VectorFusion</td><td>7.754</td><td>17.539</td><td>15.901</td><td>0.079</td><td>-</td><td>2,048 (128 Path)</td><td>≈ 30.0 min</td></tr><tr><td>Iconshop</td><td>17.828</td><td>8.402</td><td>8.234</td><td>0.114</td><td>24,792.476</td><td>993.244</td><td>≈ 63.743 sec</td></tr><tr><td>StrokeNUWA (PC)</td><td>6.607</td><td>17.852</td><td>16.134</td><td>0.239</td><td>9,092.476</td><td>271.420</td><td>≈ 19.128 sec</td></tr><tr><td>StrokeNUWA (PI)</td><td>6.513</td><td>17.994</td><td>16.801</td><td>0.207</td><td>12,249.091</td><td>271.420</td><td>≈ 19.128 sec</td></tr></table>",
895
+ "bbox": [
896
+ 94,
897
+ 114,
898
+ 877,
899
+ 244
900
+ ],
901
+ "page_idx": 6
902
+ },
903
+ {
904
+ "type": "table",
905
+ "img_path": "images/e42fb712ba0ebe8f1d0596da569504bfcd282d2a8a95bfc2daebbac80dc3d3d0.jpg",
906
+ "table_caption": [
907
+ "Table 3. Performance of VQ-Stroke on SVG reconstruction task, where C-2 and C-4 denote the Compression Rate 2 and 4."
908
+ ],
909
+ "table_footnote": [],
910
+ "table_body": "<table><tr><td>Methods</td><td>FID (↓)</td><td>CLIPScore (↑)</td><td>EDIT (↓)</td><td>CR (↓)</td></tr><tr><td>SQM (C-2)</td><td>-</td><td>-</td><td>1,114.791</td><td>8.549%</td></tr><tr><td>SQM (C-2) + SF (PC)</td><td>3.751</td><td>19.861</td><td>1,096.313</td><td>8.786%</td></tr><tr><td>SQM (C-2) + SF (PI)</td><td>3.518</td><td>20.290</td><td>1,315.137</td><td>13.780%</td></tr><tr><td>SQM (C-4) + SF (PI)</td><td>4.943</td><td>15.192</td><td>2,100.671</td><td>6.890%</td></tr><tr><td>Golden SVG</td><td>-</td><td>-</td><td>-</td><td>100%</td></tr></table>",
911
+ "bbox": [
912
+ 89,
913
+ 297,
914
+ 473,
915
+ 383
916
+ ],
917
+ "page_idx": 6
918
+ },
919
+ {
920
+ "type": "text",
921
+ "text": "4.2. Quantitative Evaluation",
922
+ "text_level": 1,
923
+ "bbox": [
924
+ 86,
925
+ 391,
926
+ 287,
927
+ 405
928
+ ],
929
+ "page_idx": 6
930
+ },
931
+ {
932
+ "type": "text",
933
+ "text": "VQ-Stroke We report the reconstruction quality of VQ-Stroke in Tab. 3. without SF, VQ-Stroke fails to generate results that conform to SVG syntax. After equipping VQ-Stroke with SF, PI facilitates a more faithful approximation of the original SVG graphics by achieving the lowest FID score and demonstrating a higher concordance with the given text prompts, as evidenced by the lowest CLIP score. In contrast, the PC method yields better alignment results with the original SVG code as it achieves the lowest EDIT score. Utilizing compression level 2 (C-4), VQ-Stroke attains a notable Compression Ratio (CR) of $6.9\\%$ , maintaining performance on par with that of C-2 as evidenced by comparable CLIPScore and FID. This suggests that VQ-Stroke preserves the semantic integrity of the original SVG graphics despite the substantial path compression.",
934
+ "bbox": [
935
+ 84,
936
+ 414,
937
+ 475,
938
+ 641
939
+ ],
940
+ "page_idx": 6
941
+ },
942
+ {
943
+ "type": "text",
944
+ "text": "StrokeNUWA As illustrated in Table 2, StrokeNUWA outperforms other methods by achieving superior results. Specifically, in terms of visual performance, StrokeNUWA is capable of generating graphics that more closely resemble the Golden SVG—evidenced by the lowest FID score (6.513) and the highest HPS (16.801). This indicates that our Stroke Tokens offer great compatibility with the LLMs. Moreover, StrokeNUWA has attained the highest CLIPScore (17.994), surpassing optimization-based methods. This suggests that stroke tokens encapsulate visual semantics effectively. In terms of the quality of the SVG code and the efficiency of generation, the Stroke Token not only aligns closely with the Golden standard but also markedly enhances the generation speed, i.e., around 19 seconds of StrokeNUWA V.S. around 30 minutes of optimization-based method LIVE, which underscores the outstanding compressive capability of the stroke token on the original SVG code.",
945
+ "bbox": [
946
+ 84,
947
+ 652,
948
+ 477,
949
+ 909
950
+ ],
951
+ "page_idx": 6
952
+ },
953
+ {
954
+ "type": "image",
955
+ "img_path": "images/ce31acd46f04f4f2f6b1c789e50a6d7b8191053be08d64c5a0b8fc3bd591b61a.jpg",
956
+ "image_caption": [
957
+ "(a) Comparison between StrokeNUWA and other baselines."
958
+ ],
959
+ "image_footnote": [],
960
+ "bbox": [
961
+ 514,
962
+ 253,
963
+ 867,
964
+ 518
965
+ ],
966
+ "page_idx": 6
967
+ },
968
+ {
969
+ "type": "image",
970
+ "img_path": "images/2051689bd929d308616eb6c3d078342025d151987096f60f8d809609d234a112.jpg",
971
+ "image_caption": [
972
+ "(b) Cases generated by GPT-4-Turbo with same keywords. As GPT-4 is not open-source, we cannot get the generation time.",
973
+ "Figure 7. Sampled cases from different models in SVG generation task, where the CLIPScore is the average score calculated across four generated cases for each method."
974
+ ],
975
+ "image_footnote": [],
976
+ "bbox": [
977
+ 506,
978
+ 555,
979
+ 864,
980
+ 623
981
+ ],
982
+ "page_idx": 6
983
+ },
984
+ {
985
+ "type": "text",
986
+ "text": "4.3. Qualitative Evaluation",
987
+ "text_level": 1,
988
+ "bbox": [
989
+ 496,
990
+ 731,
991
+ 689,
992
+ 744
993
+ ],
994
+ "page_idx": 6
995
+ },
996
+ {
997
+ "type": "text",
998
+ "text": "Case Study We show the reconstruction results of VQ-Stroke with varying complexity levels in Fig. 8 and present a qualitative comparison between StrokeNUWA and other baselines in Fig. 7(a). It is impressive that VQ-Stroke can reconstruct complex SVGs with a limit of only 4,096 codebook size. Then, at the Compression Rate of 2 (CR-2), VQ-Stroke successfully outlines the edge of objects within the graphics, demonstrating that stroke tokens can be highly compressed with a dense representation and inherently incorporate semantic segmentation, which is essential for",
999
+ "bbox": [
1000
+ 495,
1001
+ 753,
1002
+ 888,
1003
+ 905
1004
+ ],
1005
+ "page_idx": 6
1006
+ },
1007
+ {
1008
+ "type": "header",
1009
+ "text": "StrokeNUWA — Tokenizing Strokes for Vector Graphic Synthesis",
1010
+ "bbox": [
1011
+ 277,
1012
+ 56,
1013
+ 694,
1014
+ 70
1015
+ ],
1016
+ "page_idx": 6
1017
+ },
1018
+ {
1019
+ "type": "page_number",
1020
+ "text": "7",
1021
+ "bbox": [
1022
+ 480,
1023
+ 922,
1024
+ 491,
1025
+ 934
1026
+ ],
1027
+ "page_idx": 6
1028
+ },
1029
+ {
1030
+ "type": "image",
1031
+ "img_path": "images/ec0e0fb0a396667408e054cef901d390bd25c13be34f9f6d5466502483bc0406.jpg",
1032
+ "image_caption": [
1033
+ "Figure 8. Reconstruction performance of difference VQ-Strokes."
1034
+ ],
1035
+ "image_footnote": [],
1036
+ "bbox": [
1037
+ 86,
1038
+ 80,
1039
+ 472,
1040
+ 189
1041
+ ],
1042
+ "page_idx": 7
1043
+ },
1044
+ {
1045
+ "type": "image",
1046
+ "img_path": "images/baf6a65de9d86a6d3428905cb0f65b573da3a2747589d370b6e0bc304721dc89.jpg",
1047
+ "image_caption": [
1048
+ "Figure 9. Human evaluation between StrokeNUWA and LLM-based method—Iconshop."
1049
+ ],
1050
+ "image_footnote": [],
1051
+ "bbox": [
1052
+ 86,
1053
+ 224,
1054
+ 472,
1055
+ 311
1056
+ ],
1057
+ "page_idx": 7
1058
+ },
1059
+ {
1060
+ "type": "text",
1061
+ "text": "retaining visual semantics. Regarding the comparison of StrokeNUWA, we note that employing LLM-based generation methods can result in incomplete SVGs (Iconshop). This is attributed to the excessive SVG code lengths and LLMs struggling to capture the key information embedded within SVG graphics. However, the use of stroke tokens can mitigate these issues by compressing the paths and being compatible with LLMs. Furthermore, we find that the performance of the optimization-based method heavily relies on the outputs generated by the stable diffusion model, which is subject to the limitations of grid tokens mentioned in Sec. 1, e.g., it is hard to capture the visual semantics and tends to generate extra visual information that is not aligned with the text prompt. Besides, the optimization process is extremely slow. In contrast, StrokeNUWA, which utilizes stroke tokens, inherently contains visual semantic segmentation. As a result, the content generated is more aligned with the textual semantics, providing a more coherent and semantically accurate graphic.",
1062
+ "bbox": [
1063
+ 86,
1064
+ 363,
1065
+ 475,
1066
+ 651
1067
+ ],
1068
+ "page_idx": 7
1069
+ },
1070
+ {
1071
+ "type": "text",
1072
+ "text": "Human Evaluation Furthermore, we conduct a human evaluation to compare the generated SVG outputs from StrokeNUWA with those produced by the LLM-based method, Iconshop. We select 50 different textual prompts and guide the model to generate corresponding SVGs for evaluation. As depicted in Figure 9, our comparison is founded on three criteria: Prompt Alignment (consistency between the generated result and the text prompt), Overall Quality (the general caliber of SVGs), and Graphic Details (intracacies such as curves). We observe that StrokeNUWA, compared to Iconshop, which regards code as visual representation, not only yields more complete content (better Overall Quality) but produces results more closely aligned with the textual prompts (better Prompt Alignment) $^3$ . Given that stroke",
1073
+ "bbox": [
1074
+ 84,
1075
+ 657,
1076
+ 475,
1077
+ 869
1078
+ ],
1079
+ "page_idx": 7
1080
+ },
1081
+ {
1082
+ "type": "table",
1083
+ "img_path": "images/f09edee5ed0004b23f3196f3a2631b871d66085932cc6319cb2b35ccd2f064d5.jpg",
1084
+ "table_caption": [
1085
+ "Table 4. Comparison among different VQ-Stroke Settings."
1086
+ ],
1087
+ "table_footnote": [],
1088
+ "table_body": "<table><tr><td colspan=\"2\">Settings</td><td rowspan=\"2\">FID (↓)</td><td rowspan=\"2\">CLIPScore (↑)</td><td rowspan=\"2\">EDIT (↓)</td></tr><tr><td>|B|</td><td>Dim</td></tr><tr><td>2048</td><td>512</td><td>5.702</td><td>19.365</td><td>2,323.810</td></tr><tr><td>4096</td><td>512</td><td>3.518</td><td>20.290</td><td>1,315.137</td></tr><tr><td>4096</td><td>1024</td><td>3.901</td><td>20.159</td><td>1,793.008</td></tr><tr><td>8192</td><td>512</td><td>2.639</td><td>21.014</td><td>907.106</td></tr></table>",
1089
+ "bbox": [
1090
+ 501,
1091
+ 102,
1092
+ 879,
1093
+ 215
1094
+ ],
1095
+ "page_idx": 7
1096
+ },
1097
+ {
1098
+ "type": "text",
1099
+ "text": "tokens compress the details of SVG, it is natural that StrokeNUWA excels in generating Graphic Details.",
1100
+ "bbox": [
1101
+ 496,
1102
+ 241,
1103
+ 887,
1104
+ 272
1105
+ ],
1106
+ "page_idx": 7
1107
+ },
1108
+ {
1109
+ "type": "text",
1110
+ "text": "5. Ablation Study",
1111
+ "text_level": 1,
1112
+ "bbox": [
1113
+ 496,
1114
+ 291,
1115
+ 648,
1116
+ 308
1117
+ ],
1118
+ "page_idx": 7
1119
+ },
1120
+ {
1121
+ "type": "text",
1122
+ "text": "5.1. Analysis of VQ-Stroke Model Architecture",
1123
+ "text_level": 1,
1124
+ "bbox": [
1125
+ 496,
1126
+ 310,
1127
+ 828,
1128
+ 325
1129
+ ],
1130
+ "page_idx": 7
1131
+ },
1132
+ {
1133
+ "type": "text",
1134
+ "text": "To investigate the impact of VQ-Stroke architecture configurations on the stroke token performance, we experiment with different codebook sizes $|\\mathcal{B}|$ and codebook dimension $\\mathrm{Dim}$ . As shown in Tab. 4, we can observe that by increasing the codebook size while simultaneously reducing the dimension of each stroke token, the VQ-Stroke achieves superior performance across multiple metrics. We sample a set of reconstruction cases to showcase the trend of changes in Fig. 8, which indicates that, with a larger codebook size and smaller dimension, the VQ-Stroke can delineate details with greater accuracy, e.g., straighter lines.",
1135
+ "bbox": [
1136
+ 495,
1137
+ 334,
1138
+ 887,
1139
+ 501
1140
+ ],
1141
+ "page_idx": 7
1142
+ },
1143
+ {
1144
+ "type": "text",
1145
+ "text": "5.2. Comparison with GPT-4",
1146
+ "text_level": 1,
1147
+ "bbox": [
1148
+ 496,
1149
+ 510,
1150
+ 702,
1151
+ 526
1152
+ ],
1153
+ "page_idx": 7
1154
+ },
1155
+ {
1156
+ "type": "text",
1157
+ "text": "We compare the generation results with GPT-4 (Achiam et al., 2023) by employing the following template to guide GPT-4 in producing the corresponding SVG code: Generate SVG codes in icon style based on keywords:{KEYWORDS}. We show the rendered SVGs in Fig. 7(b), where we can observe that GPT-4 can only generate simple SVGs, which is consistent with LLM-based methods. Moreover, GPT-4 often yields SVGs that are incongruent with the associated text. On the contrary, StrokeNUWA can generate complex SVGs that are consistent with textual prompts.",
1158
+ "bbox": [
1159
+ 495,
1160
+ 534,
1161
+ 887,
1162
+ 700
1163
+ ],
1164
+ "page_idx": 7
1165
+ },
1166
+ {
1167
+ "type": "text",
1168
+ "text": "6. Conclusion and Future Work",
1169
+ "text_level": 1,
1170
+ "bbox": [
1171
+ 496,
1172
+ 713,
1173
+ 766,
1174
+ 729
1175
+ ],
1176
+ "page_idx": 7
1177
+ },
1178
+ {
1179
+ "type": "text",
1180
+ "text": "This paper presents StrokeNUWA, a pioneering study that explores a superior visual representation—\"stroke\" tokens, as an alternative method for expressing images through vector graphics. Stroke tokens not only preserve the semantic integrity of the images but are also conducive to processing by LLMs. Moreover, strokes in vector graphics can be highly compressed. Experiments indicate that, equipped with stroke tokens, LLMs can achieve superior results across various metrics in the SVG synthesis task. Moving forward, we aim to continue improving the quality of stroke tokens through advanced visual tokenization methods for LLMs.",
1181
+ "bbox": [
1182
+ 495,
1183
+ 739,
1184
+ 887,
1185
+ 905
1186
+ ],
1187
+ "page_idx": 7
1188
+ },
1189
+ {
1190
+ "type": "header",
1191
+ "text": "StrokeNUWA — Tokenizing Strokes for Vector Graphic Synthesis",
1192
+ "bbox": [
1193
+ 277,
1194
+ 56,
1195
+ 694,
1196
+ 70
1197
+ ],
1198
+ "page_idx": 7
1199
+ },
1200
+ {
1201
+ "type": "page_footnote",
1202
+ "text": "3The main reason for low Prompt Alignment in Iconshop is also due to the incompleteness of the generated SVGs.",
1203
+ "bbox": [
1204
+ 84,
1205
+ 878,
1206
+ 472,
1207
+ 905
1208
+ ],
1209
+ "page_idx": 7
1210
+ },
1211
+ {
1212
+ "type": "page_number",
1213
+ "text": "8",
1214
+ "bbox": [
1215
+ 480,
1216
+ 922,
1217
+ 491,
1218
+ 934
1219
+ ],
1220
+ "page_idx": 7
1221
+ },
1222
+ {
1223
+ "type": "text",
1224
+ "text": "Impact Statement",
1225
+ "text_level": 1,
1226
+ "bbox": [
1227
+ 86,
1228
+ 83,
1229
+ 240,
1230
+ 99
1231
+ ],
1232
+ "page_idx": 8
1233
+ },
1234
+ {
1235
+ "type": "text",
1236
+ "text": "The implications of this work are manifold, potentially revolutionizing the visual synthesis from another format of image, vector graphics. As stroke tokens refine the interplay between visual representation and LLMs, future advancements in visual tokenization techniques designed for LLMs are anticipated. Moving forward, the community can extend stroke token application into wider tasks and domains, including SVG comprehension and open-domain SVG synthesis for images from the real world. As we pioneer this nascent field, we are conscious of the profound societal impact that such advancements in machine learning and graphical representations hold. The capabilities for automated graphic design, scalable vector graphics production, and enhanced digital artistry foreshadow considerable shifts in industries reliant on visual content. By forging new pathways for artistic expression and visual communication, our work stands to not only contribute to the scientific community but also to catalyze transformations in creative, technological, and educational sectors. We recognize the importance of our work and our responsibility to ensure that our contributions to the field are conducted ethically, aiming to benefit society as a whole, democratize the visual landscape, and enrich it through responsible and judicious innovation.",
1237
+ "bbox": [
1238
+ 86,
1239
+ 109,
1240
+ 475,
1241
+ 470
1242
+ ],
1243
+ "page_idx": 8
1244
+ },
1245
+ {
1246
+ "type": "text",
1247
+ "text": "References",
1248
+ "text_level": 1,
1249
+ "bbox": [
1250
+ 86,
1251
+ 491,
1252
+ 181,
1253
+ 507
1254
+ ],
1255
+ "page_idx": 8
1256
+ },
1257
+ {
1258
+ "type": "list",
1259
+ "sub_type": "ref_text",
1260
+ "list_items": [
1261
+ "Achiam, J., Adler, S., Agarwal, S., Ahmad, L., Akkaya, I., Aleman, F. L., Almeida, D., Altenschmidt, J., Altman, S., Anadkat, S., et al. Gpt-4 technical report. arXiv preprint arXiv:2303.08774, 2023.",
1262
+ "Anil, R., Dai, A. M., First, O., Johnson, M., Lepikhin, D., Passos, A., Shakeri, S., Taropa, E., Bailey, P., Chen, Z., et al. Palm 2 technical report. arXiv preprint arXiv:2305.10403, 2023.",
1263
+ "Barnes, C. F., Rizvi, S. A., and Nasrabadi, N. M. Advances in residual vector quantization: A review. IEEE transactions on image processing, 5(2):226-262, 1996.",
1264
+ "Brohan, A., Brown, N., Carbajal, J., Chebotar, Y., Chen, X., Choromanski, K., Ding, T., Driess, D., Dubey, A., Finn, C., et al. Rt-2: Vision-language-action models transfer web knowledge to robotic control. arXiv preprint arXiv:2307.15818, 2023.",
1265
+ "Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J. D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. Language models are few-shot learners. Advances in neural information processing systems, 33: 1877-1901, 2020.",
1266
+ "Cao, S., Yin, Y., Huang, L., Liu, Y., Zhao, X., Zhao, D., and Huang, K. Efficient-vqgan: Towards high-resolution"
1267
+ ],
1268
+ "bbox": [
1269
+ 86,
1270
+ 515,
1271
+ 475,
1272
+ 905
1273
+ ],
1274
+ "page_idx": 8
1275
+ },
1276
+ {
1277
+ "type": "list",
1278
+ "sub_type": "ref_text",
1279
+ "list_items": [
1280
+ "image generation with efficient vision transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 7368-7377, 2023.",
1281
+ "Carlier, A., Danelljan, M., Alahi, A., and Timofte, R. Deepsvg: A hierarchical generative network for vector graphics animation. Advances in Neural Information Processing Systems, 33:16351-16361, 2020.",
1282
+ "Chang, H., Zhang, H., Jiang, L., Liu, C., and Freeman, W. T. Maskgit: Masked generative image transformer. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11315-11325, 2022.",
1283
+ "Chowdhery, A., Narang, S., Devlin, J., Bosma, M., Mishra, G., Roberts, A., Barham, P., Chung, H. W., Sutton, C., Gehrmann, S., et al. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311, 2022.",
1284
+ "Chung, H. W., Hou, L., Longpre, S., Zoph, B., Tay, Y., Fedus, W., Li, E., Wang, X., Dehghani, M., Brahma, S., et al. Scaling instruction-finetuned language models. arXiv preprint arXiv:2210.11416, 2022.",
1285
+ "Clouatre, L. and Demers, M. Figr: Few-shot image generation with reptile. arXiv preprint arXiv:1901.02199, 2019.",
1286
+ "Dhariwal, P., Jun, H., Payne, C., Kim, J. W., Radford, A., and Sutskever, I. Jukebox: A generative model for music. arXiv preprint arXiv:2005.00341, 2020.",
1287
+ "Esser, P., Rombach, R., and Ommer, B. Taming transformers for high-resolution image synthesis. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 12873-12883, 2021.",
1288
+ "Ghosal, D., Majumder, N., Mehrish, A., and Poria, S. Text-to-audio generation using instruction-tuned llm and latent diffusion model. arXiv preprint arXiv:2304.13731, 2023.",
1289
+ "Hessel, J., Holtzman, A., Forbes, M., Bras, R. L., and Choi, Y. Clipscore: A reference-free evaluation metric for image captioning. arXiv preprint arXiv:2104.08718, 2021.",
1290
+ "Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., and Hochreiter, S. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems, 30, 2017.",
1291
+ "Hu, Q., Zhang, G., Qin, Z., Cai, Y., Yu, G., and Li, G. Y. Robust semantic communications with masked vq-vae enabled codebook. IEEE Transactions on Wireless Communications, 2023.",
1292
+ "Jain, A., Xie, A., and Abbeel, P. Vectorfusion: Text-to-svg by abstracting pixel-based diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1911-1920, 2023."
1293
+ ],
1294
+ "bbox": [
1295
+ 498,
1296
+ 85,
1297
+ 887,
1298
+ 905
1299
+ ],
1300
+ "page_idx": 8
1301
+ },
1302
+ {
1303
+ "type": "header",
1304
+ "text": "StrokeNUWA — Tokenizing Strokes for Vector Graphic Synthesis",
1305
+ "bbox": [
1306
+ 277,
1307
+ 56,
1308
+ 694,
1309
+ 71
1310
+ ],
1311
+ "page_idx": 8
1312
+ },
1313
+ {
1314
+ "type": "page_number",
1315
+ "text": "9",
1316
+ "bbox": [
1317
+ 480,
1318
+ 922,
1319
+ 491,
1320
+ 934
1321
+ ],
1322
+ "page_idx": 8
1323
+ },
1324
+ {
1325
+ "type": "list",
1326
+ "sub_type": "ref_text",
1327
+ "list_items": [
1328
+ "Kim, Y., Mo, S., Kim, M., Lee, K., Lee, J., and Shin, J. Biast-to-text: Debiasing unknown visual biases through language interpretation. arXiv preprint arXiv:2301.11104, 2023.",
1329
+ "Kim, Z. M., Du, W., Raheja, V., Kumar, D., and Kang, D. Improving iterative text revision by learning where to edit from other revision tasks. arXiv preprint arXiv:2212.01350, 2022.",
1330
+ "Kondratyuk, D., Yu, L., Gu, X., Lezama, J., Huang, J., Hornung, R., Adam, H., Akbari, H., Alon, Y., Birodkar, V., et al. Videopoet: A large language model for zero-shot video generation. arXiv preprint arXiv:2312.14125, 2023.",
1331
+ "Lee, D., Kim, C., Kim, S., Cho, M., and HAN, W. S. Draft-and-revise: Effective image generation with contextual rq-transformer. Advances in Neural Information Processing Systems, 35:30127-30138, 2022.",
1332
+ "Li, T.-M., Lukáč, M., Gharbi, M., and Ragan-Kelley, J. Differentiable vector graphics rasterization for editing and learning. ACM Transactions on Graphics (TOG), 39 (6):1-15, 2020.",
1333
+ "Ma, X., Zhou, Y., Xu, X., Sun, B., Filev, V., Orlov, N., Fu, Y., and Shi, H. Towards layer-wise image vectorization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16314-16323, 2022.",
1334
+ "Martinez, J., Hoos, H. H., and Little, J. J. Stacked quantizers for compositional vector compression. arXiv preprint arXiv:1411.2173, 2014.",
1335
+ "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.",
1336
+ "Rajbhandari, S., Rasley, J., Ruwase, O., and He, Y. Zero: Memory optimizations toward training trillion parameter models. In SC20: International Conference for High Performance Computing, Networking, Storage and Analysis, pp. 1-16. IEEE, 2020.",
1337
+ "Reddy, M. D. M., Basha, M. S. M., Hari, M. M. C., and Pechalaiah, M. N. Dall-e: Creating images from text. UGC Care Group I Journal, 8(14):71-75, 2021.",
1338
+ "Rombach, R., Blattmann, A., Lorenz, D., Esser, P., and Ommer, B. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 10684-10695, 2022."
1339
+ ],
1340
+ "bbox": [
1341
+ 86,
1342
+ 84,
1343
+ 478,
1344
+ 905
1345
+ ],
1346
+ "page_idx": 9
1347
+ },
1348
+ {
1349
+ "type": "list",
1350
+ "sub_type": "ref_text",
1351
+ "list_items": [
1352
+ "Singhal, K., Tu, T., Gottweis, J., Sayres, R., Wulczyn, E., Hou, L., Clark, K., Pfohl, S., Cole-Lewis, H., Neal, D., et al. Towards expert-level medical question answering with large language models. arXiv preprint arXiv:2305.09617, 2023.",
1353
+ "Su, H., Liu, X., Niu, J., Cui, J., Wan, J., Wu, X., and Wang, N. Marvel: Raster gray-level manga vectorization via primitive-wise deep reinforcement learning. IEEE Transactions on Circuits and Systems for Video Technology, 2023.",
1354
+ "Sun, Q., Yu, Q., Cui, Y., Zhang, F., Zhang, X., Wang, Y., Gao, H., Liu, J., Huang, T., and Wang, X. Generative pretraining in multimodality. arXiv preprint arXiv:2307.05222, 2023.",
1355
+ "Tang, Z., Zhou, K., Wang, P., Ding, Y., Li, J., et al. Detoxify language model step-by-step. arXiv preprint arXiv:2308.08295, 2023.",
1356
+ "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.",
1357
+ "Van Den Oord, A., Vinyals, O., et al. Neural discrete representation learning. Advances in neural information processing systems, 30, 2017.",
1358
+ "Wang, C., Chen, S., Wu, Y., Zhang, Z., Zhou, L., Liu, S., Chen, Z., Liu, Y., Wang, H., Li, J., et al. Neural codec language models are zero-shot text to speech synthesizers. arXiv preprint arXiv:2301.02111, 2023.",
1359
+ "Wang, Y., Pu, G., Luo, W., Wang, Y., Xiong, P., Kang, H., and Lian, Z. Aesthetic text logo synthesis via content-aware layout inferring. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2436-2445, 2022.",
1360
+ "Wu, C., Liang, J., Ji, L., Yang, F., Fang, Y., Jiang, D., and Duan, N. Nüwa: Visual synthesis pre-training for neural visual world creation. In European conference on computer vision, pp. 720-736. Springer, 2022.",
1361
+ "Wu, R., Su, W., Ma, K., and Liao, J. Iconshop: Text-guided vector icon synthesis with autoregressive transformers. ACM Transactions on Graphics (TOG), 42(6): 1-14, 2023a.",
1362
+ "Wu, X., Sun, K., Zhu, F., Zhao, R., and Li, H. Human preference score: Better aligning text-to-image models with human preference. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 2096-2105, 2023b."
1363
+ ],
1364
+ "bbox": [
1365
+ 498,
1366
+ 84,
1367
+ 887,
1368
+ 905
1369
+ ],
1370
+ "page_idx": 9
1371
+ },
1372
+ {
1373
+ "type": "header",
1374
+ "text": "StrokeNUWA — Tokenizing Strokes for Vector Graphic Synthesis",
1375
+ "bbox": [
1376
+ 277,
1377
+ 56,
1378
+ 694,
1379
+ 71
1380
+ ],
1381
+ "page_idx": 9
1382
+ },
1383
+ {
1384
+ "type": "page_number",
1385
+ "text": "10",
1386
+ "bbox": [
1387
+ 477,
1388
+ 922,
1389
+ 495,
1390
+ 934
1391
+ ],
1392
+ "page_idx": 9
1393
+ },
1394
+ {
1395
+ "type": "list",
1396
+ "sub_type": "ref_text",
1397
+ "list_items": [
1398
+ "Xing, X., Zhou, H., Wang, C., Zhang, J., Xu, D., and Yu, Q. Svgdreamer: Text guided svg generation with diffusion model. arXiv preprint arXiv:2312.16476, 2023.",
1399
+ "Yu, L., Lezama, J., Gundavarapu, N. B., Versari, L., Sohn, K., Minnen, D., Cheng, Y., Gupta, A., Gu, X., Hauptmann, A. G., et al. Language model beats diffusion-tokenizer is key to visual generation. arXiv preprint arXiv:2310.05737, 2023.",
1400
+ "Zhang, T., Liu, H., Zhang, P., Cheng, Y., and Wang, H. Beyond pixels: Exploring human-readable SVG generation for simple images with vision language models. arXiv preprint arXiv:2311.15543, 2023."
1401
+ ],
1402
+ "bbox": [
1403
+ 86,
1404
+ 84,
1405
+ 475,
1406
+ 285
1407
+ ],
1408
+ "page_idx": 10
1409
+ },
1410
+ {
1411
+ "type": "header",
1412
+ "text": "StrokeNUWA — Tokenizing Strokes for Vector Graphic Synthesis",
1413
+ "bbox": [
1414
+ 277,
1415
+ 56,
1416
+ 692,
1417
+ 70
1418
+ ],
1419
+ "page_idx": 10
1420
+ },
1421
+ {
1422
+ "type": "page_number",
1423
+ "text": "11",
1424
+ "bbox": [
1425
+ 478,
1426
+ 922,
1427
+ 493,
1428
+ 934
1429
+ ],
1430
+ "page_idx": 10
1431
+ },
1432
+ {
1433
+ "type": "text",
1434
+ "text": "A. Evaluation Metrics",
1435
+ "text_level": 1,
1436
+ "bbox": [
1437
+ 84,
1438
+ 83,
1439
+ 274,
1440
+ 99
1441
+ ],
1442
+ "page_idx": 11
1443
+ },
1444
+ {
1445
+ "type": "text",
1446
+ "text": "Here we will elaborate more meticulously on the setup of the evaluation.",
1447
+ "bbox": [
1448
+ 84,
1449
+ 109,
1450
+ 565,
1451
+ 125
1452
+ ],
1453
+ "page_idx": 11
1454
+ },
1455
+ {
1456
+ "type": "text",
1457
+ "text": "A.1. Automatic Evaluation Metrics",
1458
+ "text_level": 1,
1459
+ "bbox": [
1460
+ 84,
1461
+ 141,
1462
+ 333,
1463
+ 155
1464
+ ],
1465
+ "page_idx": 11
1466
+ },
1467
+ {
1468
+ "type": "text",
1469
+ "text": "EDIT Score The EDIT Score calculates how many insertions, substitutions, and deletions are needed to make two strings identical. In the field of NLP, the Edit Score measures the similarity between two strings (Kim et al., 2022; Tang et al., 2023). In the task of SVG generation, we evaluate the quality of the generated SVG from the code perspective, i.e., the closer the generated SVG code is to the ground truth SVG, the higher the quality of the SVG path, indicating fewer repeated paths and missing paths. It is worth noting that we only test the direct SVG generation methods, including Iconshop and StrokeNUWA. For optimization-based methods, e.g., SD & LIVE and VectorFusion, which continuously optimize raster images and do not have a fixed ground truth SVG, it is not possible to evaluate with EDIT score. We convert all the SVGs into the code format, treat the codes as strings, and calculate the corresponding EDIT scores.",
1470
+ "bbox": [
1471
+ 84,
1472
+ 164,
1473
+ 887,
1474
+ 286
1475
+ ],
1476
+ "page_idx": 11
1477
+ },
1478
+ {
1479
+ "type": "text",
1480
+ "text": "Recall Rate Based on our observations, we have noticed that for the majority of SVGs, some key paths and keywords match. For example, given the keyword \"clock\", the corresponding SVG should contain key SVG paths resembling clock hands. By identifying these key paths, one can roughly understand that the SVG represents a clock. Therefore, we design the Recall Score to measure how many key paths in the generated SVG can match the ground truth. Specifically, we convert both the generated SVG and the ground truth SVG into stroke tokens with VQ-Stroke and then calculate how many strokes in the generated SVG's corresponding stroke tokens appear in the ground truth using the following formula: $\\text{Recall} = \\frac{|P \\cap \\mathcal{G}|}{|\\mathcal{G}|}$ , where $|P \\cap \\mathcal{G}|$ represents the number of overlapping stroke tokens between the generated stroke tokens $P$ and the ground truth stroke tokens $\\mathcal{G}$ . We convert all SVGs into the stroke token format, subsequently computing the recall rate.",
1481
+ "bbox": [
1482
+ 84,
1483
+ 301,
1484
+ 887,
1485
+ 428
1486
+ ],
1487
+ "page_idx": 11
1488
+ },
1489
+ {
1490
+ "type": "text",
1491
+ "text": "A.2. Human Evaluation",
1492
+ "text_level": 1,
1493
+ "bbox": [
1494
+ 84,
1495
+ 443,
1496
+ 256,
1497
+ 455
1498
+ ],
1499
+ "page_idx": 11
1500
+ },
1501
+ {
1502
+ "type": "text",
1503
+ "text": "Considering the potential bias and inaccuracies that automated metrics may introduce in evaluating SVGs, e.g., CLIP-Score (Kim et al., 2023), we organize a human evaluation process. In this human evaluation, we employ 10 evaluators and provide each with 100 evaluation samples. Each sample set included an SVG generated by StrokeNUWA and one generated by Iconshop. Evaluators are tasked with assessing the following aspects:",
1504
+ "bbox": [
1505
+ 84,
1506
+ 465,
1507
+ 888,
1508
+ 527
1509
+ ],
1510
+ "page_idx": 11
1511
+ },
1512
+ {
1513
+ "type": "list",
1514
+ "sub_type": "text",
1515
+ "list_items": [
1516
+ "- Prompt Alignment: Whether the generated SVG aligns with the given prompt.",
1517
+ "- Overall Quality: The general quality of the generated SVG, such as balance of content and clarity.",
1518
+ "- Graphic Details: The presence of detailed elements in the generated SVG, such as intricacies outlined by curves."
1519
+ ],
1520
+ "bbox": [
1521
+ 102,
1522
+ 545,
1523
+ 861,
1524
+ 613
1525
+ ],
1526
+ "page_idx": 11
1527
+ },
1528
+ {
1529
+ "type": "text",
1530
+ "text": "Evaluators are instructed to evaluate StrokeNUWA against Iconshop in each metric, determining whether StrokeNUWA wins, ties, or loses against Iconshop. Before releasing the human evaluation cases, we conducted thorough checks to ensure there were no private information or problematic biases present in the cases. Additionally, we refrained from collecting personal information or inquiring about evaluators' private details during the annotation process.",
1531
+ "bbox": [
1532
+ 84,
1533
+ 631,
1534
+ 887,
1535
+ 694
1536
+ ],
1537
+ "page_idx": 11
1538
+ },
1539
+ {
1540
+ "type": "text",
1541
+ "text": "B. Additional Ablation Experiments",
1542
+ "text_level": 1,
1543
+ "bbox": [
1544
+ 84,
1545
+ 710,
1546
+ 393,
1547
+ 728
1548
+ ],
1549
+ "page_idx": 11
1550
+ },
1551
+ {
1552
+ "type": "text",
1553
+ "text": "B.1. Effectiveness of Different Textual Prompts",
1554
+ "text_level": 1,
1555
+ "bbox": [
1556
+ 84,
1557
+ 737,
1558
+ 416,
1559
+ 752
1560
+ ],
1561
+ "page_idx": 11
1562
+ },
1563
+ {
1564
+ "type": "text",
1565
+ "text": "We study the effectiveness of different textual prompts on StrokeNUWA. Specifically, as shown in Fig. 10, we embed keywords into different textual prompt templates to guide SVG generation. These new prompts were then fed into the StrokeNUWA model to generate SVGs. It is worth mentioning that, for the sake of conciseness in illustrating the impact of different textual prompts, we employ the PI method as the SVG fixer and prompt the StokeNUWA with different textual prompts. We try five different textual prompts (including the one used in the main experiment). Notably, the first four templates place the keywords in different positions within the prompt, while the last one reconstructs the keywords into a natural language sentence using LLM. For instance, for the keywords \"cloud\" and \"rain\", we can rewrite them in natural language as: \"Raindrops are falling from the cloud\".",
1566
+ "bbox": [
1567
+ 84,
1568
+ 760,
1569
+ 887,
1570
+ 882
1571
+ ],
1572
+ "page_idx": 11
1573
+ },
1574
+ {
1575
+ "type": "header",
1576
+ "text": "StrokeNUWA — Tokenizing Strokes for Vector Graphic Synthesis",
1577
+ "bbox": [
1578
+ 277,
1579
+ 56,
1580
+ 694,
1581
+ 70
1582
+ ],
1583
+ "page_idx": 11
1584
+ },
1585
+ {
1586
+ "type": "page_footnote",
1587
+ "text": "<sup>4</sup>https://en.wikipedia.org/wiki/Edit_distance",
1588
+ "bbox": [
1589
+ 104,
1590
+ 890,
1591
+ 495,
1592
+ 905
1593
+ ],
1594
+ "page_idx": 11
1595
+ },
1596
+ {
1597
+ "type": "page_number",
1598
+ "text": "12",
1599
+ "bbox": [
1600
+ 477,
1601
+ 922,
1602
+ 495,
1603
+ 934
1604
+ ],
1605
+ "page_idx": 11
1606
+ },
1607
+ {
1608
+ "type": "text",
1609
+ "text": "Templates for Different Textual Prompts",
1610
+ "text_level": 1,
1611
+ "bbox": [
1612
+ 112,
1613
+ 85,
1614
+ 352,
1615
+ 99
1616
+ ],
1617
+ "page_idx": 12
1618
+ },
1619
+ {
1620
+ "type": "text",
1621
+ "text": "Template 1 (Utilize in the main experiment)",
1622
+ "text_level": 1,
1623
+ "bbox": [
1624
+ 99,
1625
+ 104,
1626
+ 405,
1627
+ 119
1628
+ ],
1629
+ "page_idx": 12
1630
+ },
1631
+ {
1632
+ "type": "text",
1633
+ "text": "Generating SVG according to keywords: {Keywords}",
1634
+ "bbox": [
1635
+ 99,
1636
+ 119,
1637
+ 454,
1638
+ 136
1639
+ ],
1640
+ "page_idx": 12
1641
+ },
1642
+ {
1643
+ "type": "text",
1644
+ "text": "Template 2 (Shuffle the Keywords order)",
1645
+ "text_level": 1,
1646
+ "bbox": [
1647
+ 99,
1648
+ 143,
1649
+ 385,
1650
+ 157
1651
+ ],
1652
+ "page_idx": 12
1653
+ },
1654
+ {
1655
+ "type": "text",
1656
+ "text": "Generating SVG according to keywords: {Shuffled Keywords}",
1657
+ "bbox": [
1658
+ 99,
1659
+ 157,
1660
+ 513,
1661
+ 172
1662
+ ],
1663
+ "page_idx": 12
1664
+ },
1665
+ {
1666
+ "type": "text",
1667
+ "text": "Template 3",
1668
+ "text_level": 1,
1669
+ "bbox": [
1670
+ 99,
1671
+ 181,
1672
+ 179,
1673
+ 195
1674
+ ],
1675
+ "page_idx": 12
1676
+ },
1677
+ {
1678
+ "type": "text",
1679
+ "text": "Please generate an SVG that includes the following attributes: {Keywords}",
1680
+ "bbox": [
1681
+ 99,
1682
+ 196,
1683
+ 591,
1684
+ 212
1685
+ ],
1686
+ "page_idx": 12
1687
+ },
1688
+ {
1689
+ "type": "text",
1690
+ "text": "Template 4",
1691
+ "text_level": 1,
1692
+ "bbox": [
1693
+ 99,
1694
+ 219,
1695
+ 179,
1696
+ 233
1697
+ ],
1698
+ "page_idx": 12
1699
+ },
1700
+ {
1701
+ "type": "text",
1702
+ "text": "Here are some keywords: $\\{$ Keywords $\\}$ , generate the corresponding SVG:",
1703
+ "bbox": [
1704
+ 99,
1705
+ 234,
1706
+ 580,
1707
+ 250
1708
+ ],
1709
+ "page_idx": 12
1710
+ },
1711
+ {
1712
+ "type": "text",
1713
+ "text": "Template 5 (Re-organize the keywords into natural language",
1714
+ "text_level": 1,
1715
+ "bbox": [
1716
+ 99,
1717
+ 257,
1718
+ 522,
1719
+ 273
1720
+ ],
1721
+ "page_idx": 12
1722
+ },
1723
+ {
1724
+ "type": "text",
1725
+ "text": "{Natural language prompt including keywords}",
1726
+ "bbox": [
1727
+ 99,
1728
+ 273,
1729
+ 413,
1730
+ 287
1731
+ ],
1732
+ "page_idx": 12
1733
+ },
1734
+ {
1735
+ "type": "text",
1736
+ "text": "Figure 10. Templates for different textual prompts.",
1737
+ "bbox": [
1738
+ 333,
1739
+ 300,
1740
+ 635,
1741
+ 315
1742
+ ],
1743
+ "page_idx": 12
1744
+ },
1745
+ {
1746
+ "type": "table",
1747
+ "img_path": "images/d03279c0bedca0a12c1cb98c8f6e2cc7be5be2f4696d522e5f3c51ae5e1ec9d6.jpg",
1748
+ "table_caption": [
1749
+ "Table 5. Effectiveness of Different Textual Prompts."
1750
+ ],
1751
+ "table_footnote": [],
1752
+ "table_body": "<table><tr><td rowspan=\"2\">Prompt</td><td colspan=\"3\">Visual Performance</td><td colspan=\"3\">SVG Code Quality</td></tr><tr><td>FID (↓)</td><td>CLIPScore (↑)</td><td>HPS (↑)</td><td>Recall (↑) (Stoke Token)</td><td>EDIT (↓)</td><td>Optim / Pred Length (Avg)</td></tr><tr><td>Template 1</td><td>6.513</td><td>17.994</td><td>16.801</td><td>0.207</td><td>12,249.091</td><td>271.420</td></tr><tr><td>Template 2</td><td>6.612</td><td>18.113</td><td>16.942</td><td>0.211</td><td>12,223.724</td><td>274.006</td></tr><tr><td>Template 3</td><td>8.726</td><td>16.026</td><td>14.093</td><td>0.199</td><td>13,287.631</td><td>263.196</td></tr><tr><td>Template 4</td><td>11.607</td><td>13.852</td><td>9.097</td><td>0.101</td><td>19,167.086</td><td>181.059</td></tr><tr><td>Template 5</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr></table>",
1753
+ "bbox": [
1754
+ 178,
1755
+ 347,
1756
+ 790,
1757
+ 469
1758
+ ],
1759
+ "page_idx": 12
1760
+ },
1761
+ {
1762
+ "type": "text",
1763
+ "text": "We report the StrokeNUWA performance with different textual prompts in Tab. 5. We can observe that if the textual prompt doesn't change much, i.e., it stays consistent with the training phase or has minor modifications (such as changing the order of keywords), the performance of the StrokeNUWA is not greatly affected and might even generate SVGs of higher quality (Template 2). However, if a new textual prompt is adopted, the position of the keywords becomes very important. If the keywords are still at the end of the textual prompt (Template 3), the model's performance shows a slight decrease across various metrics. However, suppose the keywords are not at the end (Template 4). In that case, StrokeNUWA fails to generate complex SVGs, resulting in failures on some complicated test samples and a significant drop in overall metrics. For the last case (Template 5), if keyword prompts are completely unused by StrokeNUWA during the training stage, i.e., the prompts during inference are entirely inconsistent with the prompts used during training, then StrokeNUWA can only generate a few simple SVGs, thus making the generated SVGs difficult to evaluate. We also provide some generated SVGs from StrokeNUWA under different textual prompts for reference in Fig. 12.",
1764
+ "bbox": [
1765
+ 83,
1766
+ 501,
1767
+ 888,
1768
+ 667
1769
+ ],
1770
+ "page_idx": 12
1771
+ },
1772
+ {
1773
+ "type": "text",
1774
+ "text": "B.2. Semantic Clusters of Strokes",
1775
+ "text_level": 1,
1776
+ "bbox": [
1777
+ 84,
1778
+ 684,
1779
+ 321,
1780
+ 698
1781
+ ],
1782
+ "page_idx": 12
1783
+ },
1784
+ {
1785
+ "type": "text",
1786
+ "text": "We adopt the following configuration of VQ-Stroke (the depth of the residual vector quantization is 2, with compression rates of 2 and 4, respectively, and a vocabulary size of 4096, which is the model configuration used in the main experiment), and performed clustering on all stroke tokens in the stroke codebook.",
1787
+ "bbox": [
1788
+ 83,
1789
+ 708,
1790
+ 887,
1791
+ 753
1792
+ ],
1793
+ "page_idx": 12
1794
+ },
1795
+ {
1796
+ "type": "text",
1797
+ "text": "We manually set the number of clusters to 10 categories and analyze them using the T-SNE method. We present the results of vocabulary clustering under the condition of a compression rate of 2 in Fig. 11, where we divide the clustering results into two types. Specifically, the cases in the right column of the above figure indicate that the distribution of these stroke tokens is very concentrated. These Stroke Tokens have very distinct features, such as representing Dots, Vertical Lines, or direction-specific short lines. In contrast, the cases in the left column represent strokes with less distinct features. This type of strokes includes various different categories of stroke types (for example, short/long strokes, direction-specific hooks, etc.). We believe that these types of strokes (on the left) constitute complex SVGs, and are greatly influenced by the vocabulary size set in VQ-Stroke. A larger vocabulary may learn more complex and layered strokes.",
1798
+ "bbox": [
1799
+ 83,
1800
+ 760,
1801
+ 887,
1802
+ 882
1803
+ ],
1804
+ "page_idx": 12
1805
+ },
1806
+ {
1807
+ "type": "header",
1808
+ "text": "StrokeNUWA — Tokenizing Strokes for Vector Graphic Synthesis",
1809
+ "bbox": [
1810
+ 277,
1811
+ 56,
1812
+ 694,
1813
+ 70
1814
+ ],
1815
+ "page_idx": 12
1816
+ },
1817
+ {
1818
+ "type": "page_footnote",
1819
+ "text": "$^{5}$ https://en.wikipedia.org/wiki/T-distributed_stochastic_neighbor_embedding",
1820
+ "bbox": [
1821
+ 104,
1822
+ 888,
1823
+ 759,
1824
+ 905
1825
+ ],
1826
+ "page_idx": 12
1827
+ },
1828
+ {
1829
+ "type": "page_number",
1830
+ "text": "13",
1831
+ "bbox": [
1832
+ 477,
1833
+ 922,
1834
+ 495,
1835
+ 934
1836
+ ],
1837
+ "page_idx": 12
1838
+ },
1839
+ {
1840
+ "type": "image",
1841
+ "img_path": "images/7c1c16d07dd5706bf9a12e94bb56344f2ccb310babbe7235102f459481240557.jpg",
1842
+ "image_caption": [
1843
+ "Figure 11. Semantic Clusters of Strokes"
1844
+ ],
1845
+ "image_footnote": [],
1846
+ "bbox": [
1847
+ 166,
1848
+ 84,
1849
+ 803,
1850
+ 406
1851
+ ],
1852
+ "page_idx": 13
1853
+ },
1854
+ {
1855
+ "type": "text",
1856
+ "text": "C. SVG Generation with more Attributes",
1857
+ "text_level": 1,
1858
+ "bbox": [
1859
+ 84,
1860
+ 460,
1861
+ 433,
1862
+ 478
1863
+ ],
1864
+ "page_idx": 13
1865
+ },
1866
+ {
1867
+ "type": "text",
1868
+ "text": "In order to incorporate more elements into the process of Stroke generation, we have expanded the Code to Matrix method (as described in section 3.2.1 of the original paper). Specifically, we have added three placeholders to the original matrix, so that Equation 1: $K_{ij} = f(C_{ij}) = (T,x_0,y_0,c_0^x,c_0^y,c_1^x,c_1^y,x_1,y_1)_{ij}$ becomes $(\\mathcal{K}_i^j)' = f'(\\mathcal{C}_i^j) = (T,\\text{color}_i,\\text{width}_i,\\text{opacity}_i,x_0,y_0,c_0^x,c_0^y,c_1^x,c_1^y,x_1,y_1)_i^j$ . It's worth noting that the placeholders $(color_i, width_i, \\text{and opacity}_i)$ here can be expanded to any number, which can be defined by the user and reflected to the SVG through rules. For simplicity of demonstration and validate the feasibility of adding more attributes into \"stroke tokens\", we insert three special placeholders: 1) color: to control the color of the SVG path; 2) width: to control the width of the SVG path; and 3) opacity: to control the transparency of the SVG path. Since the SVG dataset we used does not provide these parameters, we randomly generated some values for a toy experiment.",
1869
+ "bbox": [
1870
+ 83,
1871
+ 487,
1872
+ 888,
1873
+ 626
1874
+ ],
1875
+ "page_idx": 13
1876
+ },
1877
+ {
1878
+ "type": "text",
1879
+ "text": "For clarity, we compare the predicted strokes from VQ-Stroke model under different settings in Fig. 13, where Raw predicted SVG only uses numerical coordinates as attributes, while Random Colored SVG fills the color attribute in the SVG Path using a rule-based method. The two sub-figures in the bottom of Fig. 13 show the results trained with **VQ-Stroke** with different vocabulary sizes and attributes, i.e., color, path width, and opacity.",
1880
+ "bbox": [
1881
+ 83,
1882
+ 632,
1883
+ 887,
1884
+ 694
1885
+ ],
1886
+ "page_idx": 13
1887
+ },
1888
+ {
1889
+ "type": "text",
1890
+ "text": "We retrain the EDM model in the paper using the aforementioned stroke tokens which fused with 3 attributes. Finally, we show some generated cases in Fig. 14.",
1891
+ "bbox": [
1892
+ 83,
1893
+ 700,
1894
+ 887,
1895
+ 732
1896
+ ],
1897
+ "page_idx": 13
1898
+ },
1899
+ {
1900
+ "type": "header",
1901
+ "text": "StrokeNUWA — Tokenizing Strokes for Vector Graphic Synthesis",
1902
+ "bbox": [
1903
+ 277,
1904
+ 56,
1905
+ 694,
1906
+ 70
1907
+ ],
1908
+ "page_idx": 13
1909
+ },
1910
+ {
1911
+ "type": "page_number",
1912
+ "text": "14",
1913
+ "bbox": [
1914
+ 477,
1915
+ 922,
1916
+ 495,
1917
+ 934
1918
+ ],
1919
+ "page_idx": 13
1920
+ },
1921
+ {
1922
+ "type": "table",
1923
+ "img_path": "images/bd60544c59fdc2bb9147e7e15cf33ffc62b9bd7879da26572361615f2585ba57.jpg",
1924
+ "table_caption": [],
1925
+ "table_footnote": [],
1926
+ "table_body": "<table><tr><td></td><td></td><td></td></tr><tr><td>Template 1: Generate SVG according to keywords: Light Bulb, Emitting Light</td><td>Template 3: Please generate an SVG that includes the following attributes: Light Bulb, Emitting Light</td><td>Template 4: Here are some keywords: Light Bulb, Emitting Light, generate the corresponding SVG:</td></tr><tr><td></td><td></td><td></td></tr><tr><td>Template 1: Generate SVG according to keywords: Clock, Night</td><td>Template 3: Please generate an SVG that includes the following attributes: Clock, Night</td><td>Template 4: Here are some keywords: Clock, Night, generate the corresponding SVG:</td></tr><tr><td></td><td></td><td></td></tr><tr><td>Template 1: Generate SVG according to keywords: Rain, Weather</td><td>Template 3: Please generate an SVG that includes the following attributes: Rain, Weather</td><td>Template 4: Here are some keywords: Rain, Weather, generate the corresponding SVG:</td></tr><tr><td></td><td></td><td></td></tr><tr><td>Template 1: Generate SVG according to keywords: Car, Vehicle</td><td>Template 3: Please generate an SVG that includes the following attributes: Car, Vehicle</td><td>Template 4: Here are some keywords: Car, Vehicle, generate the corresponding SVG:</td></tr></table>",
1927
+ "bbox": [
1928
+ 89,
1929
+ 145,
1930
+ 877,
1931
+ 792
1932
+ ],
1933
+ "page_idx": 14
1934
+ },
1935
+ {
1936
+ "type": "text",
1937
+ "text": "Figure 12. SVG cases generated by StrokeNUWA with different textual prompts.",
1938
+ "bbox": [
1939
+ 243,
1940
+ 824,
1941
+ 725,
1942
+ 839
1943
+ ],
1944
+ "page_idx": 14
1945
+ },
1946
+ {
1947
+ "type": "header",
1948
+ "text": "StrokeNUWA — Tokenizing Strokes for Vector Graphic Synthesis",
1949
+ "bbox": [
1950
+ 279,
1951
+ 56,
1952
+ 694,
1953
+ 70
1954
+ ],
1955
+ "page_idx": 14
1956
+ },
1957
+ {
1958
+ "type": "page_number",
1959
+ "text": "15",
1960
+ "bbox": [
1961
+ 477,
1962
+ 922,
1963
+ 495,
1964
+ 934
1965
+ ],
1966
+ "page_idx": 14
1967
+ },
1968
+ {
1969
+ "type": "image",
1970
+ "img_path": "images/51ad5910da4cc59ca498a9b58f11aa8ab651dff940819ffffe1683078cba4026.jpg",
1971
+ "image_caption": [
1972
+ "Figure 13. SVG reconstruction with more attributes."
1973
+ ],
1974
+ "image_footnote": [],
1975
+ "bbox": [
1976
+ 176,
1977
+ 102,
1978
+ 787,
1979
+ 414
1980
+ ],
1981
+ "page_idx": 15
1982
+ },
1983
+ {
1984
+ "type": "image",
1985
+ "img_path": "images/dd9e5ce02613507d9860ba73898ffd60dbf234aa225fc205f14c4713e8df21bf.jpg",
1986
+ "image_caption": [
1987
+ "Figure 14. SVG generated by StrokeNUWA fused with more attributes."
1988
+ ],
1989
+ "image_footnote": [],
1990
+ "bbox": [
1991
+ 163,
1992
+ 488,
1993
+ 805,
1994
+ 854
1995
+ ],
1996
+ "page_idx": 15
1997
+ },
1998
+ {
1999
+ "type": "header",
2000
+ "text": "StrokeNUWA — Tokenizing Strokes for Vector Graphic Synthesis",
2001
+ "bbox": [
2002
+ 277,
2003
+ 56,
2004
+ 694,
2005
+ 70
2006
+ ],
2007
+ "page_idx": 15
2008
+ },
2009
+ {
2010
+ "type": "page_number",
2011
+ "text": "16",
2012
+ "bbox": [
2013
+ 478,
2014
+ 922,
2015
+ 495,
2016
+ 934
2017
+ ],
2018
+ "page_idx": 15
2019
+ }
2020
+ ]
2024/StrokeNUWA—Tokenizing Strokes for Vector Graphic Synthesis/b14d089f-0f3b-46df-8e68-6cec5128119c_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/StrokeNUWA—Tokenizing Strokes for Vector Graphic Synthesis/b14d089f-0f3b-46df-8e68-6cec5128119c_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7057abb690e6f0bbfd9c79135920891eb4d3e096304fb451d4011564b0b9fbe7
3
+ size 6531785
2024/StrokeNUWA—Tokenizing Strokes for Vector Graphic Synthesis/full.md ADDED
@@ -0,0 +1,332 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # StrokeNUWA—Tokenizing Strokes for Vector Graphic Synthesis
2
+
3
+ Zecheng Tang $^{12}$ Chenfei Wu $^{2}$ Zekai Zhang $^{2}$ Minheng Ni $^{2}$ Shengming Yin $^{2}$ Yu Liu $^{2}$ Zhengyuan Yang $^{3}$ Lijuan Wang $^{3}$ Zicheng Liu $^{3}$ Juntao Li $^{1}$ Nan Duan $^{2}$
4
+
5
+ # Abstract
6
+
7
+ To leverage LLMs for visual synthesis, traditional methods convert raster image information into discrete grid tokens through specialized visual modules, while disrupting the model's ability to capture the true semantic representation of visual scenes. This paper posits that an alternative representation of images, vector graphics, can effectively surmount this limitation by enabling a more natural and semantically coherent segmentation of the image information. Thus, we introduce StrokeNUWA, a pioneering work exploring a better visual representation — "stroke tokens" on vector graphics, which is inherently visual semantics rich, naturally compatible with LLMs, and highly compressed. Equipped with stroke tokens, StrokeNUWA can significantly surpass traditional LLM-based and optimization-based methods across various metrics in the vector graphic generation task. Besides, StrokeNUWA achieves up to a $94 \times$ speedup in inference over the speed of prior methods with an exceptional SVG code compression ratio of $6.9\%$ . Our code is available at https://github.com/ProjectNUWA/StrokeNUWA.
8
+
9
+ # 1. Introduction
10
+
11
+ In recent years, Large transformer-based Language Models, commonly referred as LLMs, have made significant strides, particularly in the domain of Natural Language Processing (NLP) (Brown et al., 2020; Chowdhery et al., 2022; Touvron et al., 2023; Anil et al., 2023). Concurrently, LLMs are gradually expanding their capabilities to other modalities, such as audio (Ghosal et al., 2023), medical (Singhal et al., 2023) and robotics (Brohan et al., 2023).
12
+
13
+ Current methodologies (Reddy et al., 2021; Wu et al., 2022;
14
+
15
+ *Equal contribution ${}^{1}$ Soochow University ${}^{2}$ Microsoft Research Asia ${}^{3}$ Microsoft Azure AI. Correspondence to: Nan Duan <nanduan@microsoft.com>.
16
+
17
+ Proceedings of the $41^{st}$ International Conference on Machine Learning, Vienna, Austria. PMLR 235, 2024. Copyright 2024 by the author(s).
18
+
19
+ ![](images/743b6c52619eae21f86ca411322dfa8729d0fdb8f4fb54f8c319dc7517b5b5dc.jpg)
20
+ Figure 1. Comparison between the visual representation of "grid" token and our proposed "stroke" token. Instead of tokenizing pixels from raster images, we explore a novel visual representation by tokenizing codes, from another image format—Scalable Vector Graphic (SVG). "Stroke" tokens have the following advantages: (1) inherently contain visual semantics, (2) naturally compatible with LLMs, and (3) highly compressed.
21
+
22
+ Chang et al., 2022; Kondratyuk et al., 2023) enable LLMs to generate visual information by transforming the continuous visual pixels into discrete grid tokens via specialized visual modules such as VQ-VAE (Van Den Oord et al., 2017) and VQ-GAN (Esser et al., 2021). Subsequently, these transformed grid tokens are processed by the LLM in a manner akin to textual word handling, which facilitates LLMs' generative modeling process. However, when compared with diffusion models (Rombach et al., 2022), LLMs still fall behind (Lee et al., 2022; Sun et al., 2023). The shortcomings of LLMs in visual tasks primarily arise from two reasons: First, the transformation process relies on specific visual modules, which inherently possess limitations. For instance, advanced visual modules like VQ-GAN (Esser et al., 2021) can lead to the generation of images with artifact (Yu et al., 2023); Second, the use of grid tokens can disrupt the visual semantics, as the grids are artificially designed and not inherently semantic-aware. This artificial discretization imposes constraints on the model's ability to capture the true semantic representation of visual scenes.
23
+
24
+ ![](images/407a3fdceebe0003766a89bb3df19050e05bcd3b2cb88de4ddae0e0eeeeba5ee.jpg)
25
+ Figure 2. SVG generated by StrokeNUWA. For each image, we provide partial keywords for clarity.
26
+
27
+ Is there a visual representation that preserves the semantic integrity of visual information while being conducive to processing by LLMs? Finding such a representation within the framework of grid tokens is non-trivial, as the arrangement of grid tokens is typically regular and uniform, whereas the semantic structure within images is often irregular and complex. As illustrated in Fig. 1, the dolphin's body is arbitrarily segmented into different grid tokens. Although there have been efforts to improve the VQ-VAE method (Esser et al., 2021; Yu et al., 2023), enhancing the visual representation quality, they are fundamentally constrained by the limitations inherent to raster image formats, leading to bottlenecks in semantic preservation. In light of these challenges, we propose a novel approach that fundamentally retains the semantic concepts of images by utilizing an alternative image format: vector graphics. Different from pixel-based formats, vector graphics intrinsically reveal the construction of objects, naturally encapsulating the semantic concepts of the image. For example, our proposed "stroke" tokens segment the dolphin into sequentially connected strokes, where each stroke unit contains complete semantic information, such as the dolphin's fin (stroke ①) and back (stroke ②).
28
+
29
+ It is worth mentioning that our intention is not to claim that vector graphics are superior to raster images, but rather to introduce a fresh perspective on visual representation. The advantages of our "stroke" token concept include: (1) Inherently contains visual semantics: each stroke token intrinsically contains visual semantics, offering a more intuitive semantic segmentation of the image content; (2) Naturally compatible with LLMs: the creation process of vector graphics is naturally sequential and interconnected, which mirrors the way LLMs process information. In other words, Each stroke is created in relation to the ones before and after it, establishing a contiguous and coherent sequence that LLMs can process more naturally; (3) Highly compressed: strokes in vector graphics can be highly compressed, allowing each stroke token to encapsulate a rich, compressed representation of the visual information, significantly reducing the data size while maintaining quality and semantic integrity.
30
+
31
+ Based on the above analysis, we introduce StrokeNUWA, a model that crafts vector graphics without the reliance on the visual module. StrokeNUWA consists of a VQ-Stroke module and an Encoder-Decoder model. The VQ-Stroke, based on the residual quantizer model architecture (Mar
32
+
33
+ tinez et al., 2014), can compress serialized vector graphic information into several SVG tokens. The Encoder-Decoder model primarily utilizes the capabilities of a pre-trained LLM to generate SVG tokens guided by text prompts.
34
+
35
+ We compare StrokeNUWA with optimization-based methods in the text-guided Scalable Vector Graphic (SVG) generation task. Our approach achieves higher CLIPScore (Hessel et al., 2021) metrics, suggesting that utilizing stroke tokens can yield content with richer visual semantics. When benchmarked against LLM-based baselines, our method surpasses them across all metrics, indicating that stroke tokens can integrate effectively with LLMs. Finally, due to the compression capabilities inherent in vector graphics, our model demonstrates significant efficiency in generation, achieving speed improvements of up to 94 times.
36
+
37
+ In a nutshell, our contributions can be outlined as follows:
38
+
39
+ - We introduce StrokeNUWA, the pioneering study exploring a better visual representation—stroke token, to synthesize vector graphics solely through LLMs without relying on specialized visual modules.
40
+ - We propose VQ-Stroke, a specialized Vector Quantized Variational Autoencoder (VQ-VAE) designed to compress vector graphics into stroke tokens, providing an exceptional compression ratio of $6.9\%$ .
41
+ - We conduct detailed experiments that demonstrate the significant potential of stroke tokens in the text-guided vector graphic synthesis task.
42
+
43
+ # 2. Related Work
44
+
45
+ # 2.1. Visual Representation
46
+
47
+ In the realm of computer graphics, two predominant image formats prevail: raster images, characterized by pixel matrices; and vector images, a.k.a, Scalable Vector Graphic (SVG), characterized by a series of code language commands (Zhang et al., 2023). Recent developments in visual synthesis have predominantly centered on generating raster images. The basic idea is to transform the continuous image pixels into discrete grid tokens via specialized visual modules such as VQ-VAE (Van Den Oord et al., 2017) and VQ-GAN (Esser et al., 2021), and then leverage LLMs to generate these tokens (Wu et al., 2022; Kondratyuk et al., 2023). Most recently, some works have tried to improve "grid" tokens by designing advanced architectures such as Lookup-Free Quantization (Yu et al., 2023) and Efficient VQ-GAN (Cao et al., 2023). However, these "grid" token representations can disrupt visual semantics as the grids are artificially designed, which lacks inherent semantic awareness, and are easily subject to the visual module's intrinsic limitations like disturbances and tampering (Hu et al., 2023). Our study is a pioneering effort to explore a better visual representation by proposing the concept of the "stroke" token.
48
+
49
+ Table 1. Overview of basic SVG commands, including M, L, and C, where each command contains one beginning point $(x_0,y_0)$ and one end point $(x_{1},y_{1})$ . For Cubic Bezier command, it contains two extra control points $(c_0^x,c_0^y)$ and $(c_1^x,c_1^y)$ .
50
+
51
+ <table><tr><td>Name</td><td>Symbol</td><td>Argument</td><td>Example</td></tr><tr><td>Move To</td><td>M</td><td>(x0,y0)(x1,y1)</td><td>(x0,y0) (x1,y1)</td></tr><tr><td>Line To</td><td>L</td><td>(x0,y0)(x1,y1)</td><td>(x0,y0) (x1,y1)</td></tr><tr><td rowspan="2">Cubic Bezier</td><td rowspan="2">C</td><td rowspan="2">(x0,y0)(x1,y1)(c0x,c0y)(c1x,c1y)</td><td>(c0x,c0y) (x1,y1)</td></tr><tr><td>(x0,y0) (c1x,c1y)</td></tr></table>
52
+
53
+ Different from the 'grid' tokens, the "stroke" token is inherently defined by contextually associated coded language commands that offer strong semantic integrity, potentially mitigating the aforementioned issues.
54
+
55
+ # 2.2. SVG Generation
56
+
57
+ SVG generation employs a method of structured code generation for producing graphics, which offers better interpretability, flexibility, and scalability in image representation. The current mainstream approach of SVG generation is optimization-based methods (Su et al., 2023; Jain et al., 2023; Xing et al., 2023), which share a similarity with traditional raster image generation, involving iteratively refining randomly initialized SVG paths to fit a target raster image with a differentiable rasterizer (Li et al., 2020). However, the optimization process is both time-consuming and computationally intensive, e.g., creating an SVG graphic comprised of 24 SVG paths can exceed 20 minutes<sup>1</sup>. Alternatively, some recent approaches have begun to adopt auto-regressive models to directly generate code for SVG synthesis (Wang et al., 2022; Wu et al., 2023a). However, due to the inherent extensive length nature of SVGs and a lack of effective SVG representation, these methods constrain LLMs to generate complex SVGs. To address these challenges, we introduce VQ-Stroke and present the concept of “stroke” tokens. By transforming SVGs into stroke tokens, our approach enables LLMs to produce intricate SVGs with significantly improved inference speed.
58
+
59
+ # 3. Methodology
60
+
61
+ # 3.1. Problem Formulation
62
+
63
+ SVG code provides a suite of command and syntax rules, e.g., the "<rect>" command defines a rectangle shape with its position, width, and height, which can
64
+
65
+ be written as $<\text{rect} x="10" y="20" width="50" height="80"/>$ . However, considering the multitude of SVG command types, creating such a system not only requires a complex data structure, but without a massive dataset, LLMs would struggle to model the diverse range of commands effectively. Therefore, as shown in Tab. 1, we can simplify each SVG using just three basic commands: "Move To", "Line To", and "Cubic Bezier" by following Iconshop (Wu et al., 2023a) and DeepSVG (Carlier et al., 2020). For instance, intricate commands like "<rect>" can be constructed by those three basic commands. After simplification, an SVG $\mathcal{G} = \{\mathcal{P}_i\}_{i=1}^N$ can be described with $N$ SVG paths, with each SVG path $\mathcal{P}_i$ consists of $M_i$ basic commands: $\mathcal{P}_i = \{\mathcal{C}_i^j\}_{j=1}^{M_i}$ , where $\mathcal{C}_i^j$ is the $j$ -th command in the $i$ -th path. Eventually, each basic command $\mathcal{C} = (T, \mathcal{V})$ is consistent of command type $T \in \{\mathsf{M}, \mathsf{L}, \mathsf{C}\}$ , and the corresponding position argument $\mathcal{V}$ .
66
+
67
+ # 3.2.StrokeNUWA
68
+
69
+ StrokeNUWA contains three core components: a Vector Quantized-Stroke (VQ-Stroke) for SVG compression, an Encoder-Decoder-based LLM (EDM) for SVG generation, and an SVG Fixer (SF) for post-processing. Firstly, VQ-Stroke compresses the SVG into stroke tokens, which enables a transformation between the SVG code and the discrete stroke tokens. Then, EDM utilizes the stroke tokens produced from VQ-Stroke to generate SVG code. Finally, SF is a post-processing module designed to refine the quality of the generated SVGs, given that the output generated from the EDM or VQ-Stroke may not always conform to the stringent syntactical rules of SVG code. Below, we will introduce the details of each component.
70
+
71
+ # 3.2.1. VECTOR QUANTIZED-STROKE
72
+
73
+ VQ-Stroke encompasses two main stages: “Code to Matrix” stage that transforms SVG code into the matrix format suitable for model input, and “Matrix to Token” stage that transforms the matrix data into stroke tokens.
74
+
75
+ Code to Matrix As depicted in Fig. 3, we first transform the simplified SVG code (Sec. 3.1) into SVG matrix format by converting each basic command $\mathcal{C}_i^j$ to the individual vector $\mathcal{K}_i^j\in \mathbb{R}^9$ with rules $f$ :
76
+
77
+ $$
78
+ \mathcal {K} _ {i} ^ {j} = f \left(\mathcal {C} _ {i} ^ {j}\right) = \left(T, x _ {0}, y _ {0}, c _ {0} ^ {x}, c _ {0} ^ {y}, c _ {1} ^ {x}, c _ {1} ^ {y}, x _ {1}, y _ {1}\right) _ {i} ^ {j}, \tag {1}
79
+ $$
80
+
81
+ where $T$ denotes the basic command type, $(x_0,y_0)$ and $(x_{1},y_{1})$ represent the beginning and the end points, with $(c_0^x,c_0^y)$ and $(c_1^x,c_1^y)$ as the control points of each basic command. Then, to establish interconnections among the adjacent commands, we set the end point of $j$ -th command $(x_{1},y_{1})_{i}^{j}$ equal to the beginning point $(x_0,y_0)_i^{j + 1}$ of the subsequent $(j + 1)$ -th command in each individual path.
82
+
83
+ ![](images/867050e96ef5293c5dc00b545412482a554a00f4c742e1bbeb99486ec206440e.jpg)
84
+ Figure 3. Overview of VQ-Stroke.
85
+
86
+ We then decompose all the paths within the SVG $\mathcal{G}$ into distinct basic commands and combine their corresponding vectors into a matrix form:
87
+
88
+ $$
89
+ \begin{array}{l} f (\mathcal {G}) = (f (P _ {i})) _ {i = 1} ^ {N} = \left(\left(f (\mathcal {C} _ {i} ^ {j})\right) _ {j = 1} ^ {M _ {i}}\right) _ {i = 1} ^ {N} \\ = \left( \begin{array}{c c c c} \left(\mathcal {K} _ {1} ^ {1}; & \mathcal {K} _ {1} ^ {2}; & \dots ; & \mathcal {K} _ {1} ^ {M _ {1}}\right) \\ \vdots & \vdots & \ddots & \vdots \\ \left(\mathcal {K} _ {N} ^ {1}; & \mathcal {K} _ {N} ^ {2}; & \dots ; & \mathcal {K} _ {N} ^ {M _ {N}}\right) \end{array} \right), \tag {2} \\ \end{array}
90
+ $$
91
+
92
+ where $"\; "$ denotes the stack operation, and each matrix row represents an individual command. Thus, we can obtain a structured SVG matrix $f(\mathcal{G}) \in \mathbb{R}^{(\sum_{i=1}^{N} M_i) \times 9}$ to represent an SVG that contains $\sum_{i=1}^{N} M_i$ individual basic commands.
93
+
94
+ Matrix to Stroke After obtaining the SVG matrix $f(\mathcal{G})$ , we aim to compress the matrix into discrete stroke tokens via latent representation, with which one can reconstruct the $f(\mathcal{G})$ . As shown in Fig. 3, the VQ-Stroke model is composed of Down-Sample blocks, a Stroke Codebook $\mathcal{B}$ and Up-Sample blocks. The SVG matrix $f(\mathcal{G})$ is first encoded by the Down-Sample blocks to obtain the compressed representations, which entails increasing the number of representation channels (column of $f(\mathcal{G})$ ) while concurrently compressing the spatial dimensions (row of $f(\mathcal{G})$ ) to yield a more compact representation, i.e. compressing the number of commands into $T$ s.t. $T < \sum_{i=1}^{N} M_i$ . Then, the Codebook $\mathcal{B}$ simultaneously conducts $d$ levels of compression with residual vector quantization (Barnes et al., 1996;
95
+
96
+ ![](images/a58370ed3561ee8eced9376009a95ce8691f3d8dd27ea37b693e81d90c6cbc27.jpg)
97
+ Figure 4. Architecture of Down-Sample and Up-Sample Blocks.
98
+
99
+ Wang et al., 2023), enabling VQ-Stroke to better model the compressed representations. We depict the detailed architecture of Down-Sample blocks and Up-Sample blocks in Fig 4, wherein both blocks first utilize a Conv1d or ConvTranspose1d model to compress or expand the features, succeeded by a ResNet1d module and an additional Conv1d module for feature extraction. It is worth mentioning that a low compression rate allows the VQ-Stroke to learn the fine details of SVGs (the first and second columns), while more aggressive compression (the third column) enables the VQ-Stroke to capture the overall contours of the SVGs. As illustrated in Fig.5, a low compression rate allows the VQ-Stroke to learn the fine details of SVGs (the first and second columns), while more aggressive compression (the third column) enables the VQ-Stroke to capture the overall contours of the SVGs. We have more discussion in Sec. 4.2. Finally, the Down-Sample blocks reconstruct the SVG latent representation output from the Codebook $\mathcal{B}$ .
100
+
101
+ Following Dhariwal et al., the training objective of VQ-Stroke consists of commitment loss, codebook loss, and reconstruction loss, which can be written as:
102
+
103
+ $$
104
+ \begin{array}{l} \ell_ {V Q - S t r o k e} = \alpha \left(\ell_ {\text {c o d e b o o k}} + \ell_ {\text {c o m m i t}}\right) + \ell_ {\text {r e c o n}} \\ = \alpha \left(\left\| \mathcal {Z} - \operatorname {s g} [ \tilde {\mathcal {Z}} ] \right\| _ {2} ^ {2} + \left\| \operatorname {s g} [ \mathcal {Z} ] - \tilde {\mathcal {Z}} \right\| _ {2} ^ {2}\right) \tag {3} \\ + \operatorname {M S E} (\widetilde {f (\mathcal {G})}, f (\mathcal {G})), \\ \end{array}
105
+ $$
106
+
107
+ where $\alpha$ is the hyper-parameter, $\mathcal{Z}$ is the compressed latent output from down-sample blocks, $\tilde{\mathcal{Z}}$ is the latent looked up from codebook $\mathcal{B}$ , and $\mathrm{sg}[\cdot]$ is the gradient clipping operation. Besides, we pre-normalize the input data into the $[-1, 1]$ range to stabilize the training process.
108
+
109
+ # 3.2.2. ENCODER-DECODER-BASED LLM
110
+
111
+ We employ an Encoder-Decoder LLM (EDM) to predict the stroke tokens obtained from the codebook $\mathcal{B}$ . Considering LLM's inherent textual instruction capability, we freeze the EDM encoder to leverage its inherited textual knowledge. Subsequently, we fine-tune the EDM decoder
112
+
113
+ ![](images/1154c271292d513ab606675a0ae6556ddc6ae7f236db496ab1148158bc85a502.jpg)
114
+ Figure 5. Analysis of SVG reconstruction, where $C$ is a constant representing the number of inserted $<\mathbb{M}>$ command in PI setting. To facilitate clear observation of the SVG composition, we represent each basic command with a distinct color.
115
+
116
+ to learn the stroke token prediction task. Due to the discrepancy between the vocabulary of stroke tokens and the original LLM's vocabulary, we extend EDM with an additional stroke embedding layer and a stroke predictor. Consequently, given the trainable model parameters $\theta$ and the textual prompt $\pmb{K}$ , we maximize the log probability $\operatorname{argmax}_{\theta} \prod_{i=1}^{T} P(t_i \mid t_{<i}, \pmb{K})$ with the cross-entropy loss.
117
+
118
+ # 3.2.3. SVG FIXER
119
+
120
+ A critical issue arises in the generation results from both SDM and EDM, as they fail to guarantee Equ. 1 due to the discrepancies of the interconnection points among adjacent commands in each individual SVG path, i.e., $(x_{1},y_{1})_{i}^{j}\neq (x_{0},y_{0})_{i}^{j + 1}$ in $i$ -th path. To address this issue, we introduce the SVG Fixer (SF) as a post-processing module for the generated results. It encompasses two strategies: Path Clipping (PC) and Path Interpolation (PI). Specifically, PC involves the direct substitution of each SVG command's beginning point with the endpoint of adjacent SVG commands: $(x_0,y_0)_i^{j + 1}\coloneqq (x_1,y_1)_i^j$ . On the other hand, PI entails the addition of M commands between each pair of adjacent, yet non-interconnected SVG commands to bridge the discrepancy, i.e., if $(x_{1},y_{1})_{i}^{j}\neq (x_{0},y_{0})_{i}^{j + 1}\Rightarrow$ adding an extra command $\left(\mathbb{M},(x_1,y_1)_i^j,0,0,0,0,(x_0,y_0)_i^{j + 1}\right)$ to force the previous command's end point to move to the beginning point of the next adjacent command. As shown in Fig. 5, PC can streamline the overall paths of SVGs, making them more succinct, but may lead to some inaccuracies in the details. On the other hand, PI tends to reveal more gener
121
+
122
+ ated stokes' details, but it may introduce more curves. Each strategy has its own applicable scenarios.
123
+
124
+ # 4. Experiment
125
+
126
+ # 4.1. Experimental Settings
127
+
128
+ Dataset We construct the training and evaluation data with FIGR-8-SVG dataset (Clouâtre & Demers, 2019), which consists of massive monochromatic (black-and-white) SVG icons. We pre-process the SVG data by transforming each SVG sample into standardized representations, eliminating the redundant SVG paths, dropping the outer black box, and filtering the data by applying a threshold of 1,024 basic commands in length. We filter the instance with less than two annotated discrete keywords and apply a template "Generating SVG according to keywords: $\{\dots\}"$ to build the text prompt. After preprocessing, we sample 2,000 instances with varying SVG code lengths as the testing set, 8,000 samples for validation, and apply the remaining 740K samples for training.
129
+
130
+ Evaluation Metrics For VQ-Stroke, we primarily consider the reconstruction quality and the compression effectiveness. We evaluate the reconstruction quality with the Fréchet Inception Distance $(\mathrm{FID})^2$ (Heusel et al., 2017) and the CLIPScore (Hessel et al., 2021). Given that the generated SVG graphics consist solely of lines, we set the background color to white to mitigate the potential biases for FID and CLIPScore brought by the background (Wu et al., 2023a). Additionally, we calculate the Edit Score (EDIT) between the reconstructed SVG code and the Golden SVG (ground truth) code to reflect the fidelity of the reconstructed SVG graphics in replicating fine details. To reflect the practical compression effectiveness of VQ-Stroke, we calculate the Compression Ratio (CR) score between the tokenized SVG code and the stroke tokens, i.e., $\mathrm{CR} = \mathrm{Len}(\mathrm{tokenized~SVG~code}) / \mathrm{Len}(\mathrm{stroke~tokens})$ . For StokeNUWA, apart from utilizing the metrics mentioned above, we supplement evaluation with Human Preference Score (HPS) (Wu et al., 2023b) and Recall Score to reflect the quality of the generated SVG graphics and their degree of overlap with the Golden SVG code. Additionally, we also report the time required to generate each SVG and conduct the qualitative evaluation. More details about evaluation are illustrated in Appendix A.
131
+
132
+ Tasks and Baselines We evaluate VQ-Stroke and StrokeNUWA with the SVG reconstruction and the text-guided SVG generation tasks, respectively. For VQ-Stroke, considering the absence of works in the field of SVG representation, we focus on comparing the performance of two
133
+
134
+ ![](images/5b9302375b190f9c8f9335b667c79a7c6cda1f6f89bbc04000bf14cc1e834a84.jpg)
135
+ Figure 6. Reconstruction cases generated by VQ-Stroke, difficulty (reflected by path numbers) increases from left to right.
136
+
137
+ SF methods, i.e., PI and PC. Additionally, we evaluate the reconstruction performance of two different compression rates, i.e., compression rates of 2 and 4. For StrokeNUWA, we compare with the optimization-based methods, including Vector Fusion (Jain et al., 2023) and the Stable Diffusion (Rombach et al., 2022) combined with LIVE method (Li et al., 2020). Given that optimization-based methods are notably time-intensive, i.e., requiring more than 20 minutes to generate a single SVG on one NVIDIA V100 GPU, we randomly sample 500 instances from the testing set for evaluation to ensure a feasible timeframe. Additionally, we also compare with the LLM-based method Iconshop (Wu et al., 2023a). We re-implement Iconshop with the same Flan-T5 backbone as in StrokeNUWA and use T5 tokenizer to encode the numerical values built in Iconshop. Notably, the primary distinction between Iconshop and StrokeNUWA lies in their approaches to handling visual representation. While Iconshop directly treats SVG code as visual tokens, StrokeNUWA converts SVGs into stroke tokens with VQ-Stroke. We set the maximum model length to 1,500 for IconShop to ensure the SVG completeness.
138
+
139
+ Implementation Details For VQ-Stroke, we set the depth of the residual vector quantization $d$ to 2, corresponding to compression rates of 2 and 4. Then, we set the codebook size $|\mathcal{B}|$ as 4096, with each code corresponding to a latent representation of 512 dimensions. We set $\alpha = 1$ in Equ. 3 during the training process. For EDM, we utilize the 3B Flan-T5 model (Chung et al., 2022) as the backbone. We utilize DeepSpeed Library (Rajbhandari et al., 2020) to implement models on 64 NVIDIA V100 GPUs and set the maximum model length as 512.
140
+
141
+ Table 2. Performance of StrokeNUWA, where "Optim/Pred Length" denotes the actual predicted or optimized number of paths.
142
+
143
+ <table><tr><td rowspan="2">Methods</td><td colspan="3">Visual Performance</td><td colspan="3">SVG Code Quality</td><td rowspan="2">Generation Speed (↓) (per SVG)</td></tr><tr><td>FID (↓)</td><td>CLIPScore (↑)</td><td>HPS (↑)</td><td>Recall (↑) (Stoke Token)</td><td>EDIT (↓)</td><td>Optim / Pred Length (Avg)</td></tr><tr><td>SD &amp; LIVE</td><td>14.236</td><td>12.908</td><td>11.210</td><td>0.028</td><td>-</td><td>160 (32 Path)</td><td>≈ 28.0 min</td></tr><tr><td>VectorFusion</td><td>7.754</td><td>17.539</td><td>15.901</td><td>0.079</td><td>-</td><td>2,048 (128 Path)</td><td>≈ 30.0 min</td></tr><tr><td>Iconshop</td><td>17.828</td><td>8.402</td><td>8.234</td><td>0.114</td><td>24,792.476</td><td>993.244</td><td>≈ 63.743 sec</td></tr><tr><td>StrokeNUWA (PC)</td><td>6.607</td><td>17.852</td><td>16.134</td><td>0.239</td><td>9,092.476</td><td>271.420</td><td>≈ 19.128 sec</td></tr><tr><td>StrokeNUWA (PI)</td><td>6.513</td><td>17.994</td><td>16.801</td><td>0.207</td><td>12,249.091</td><td>271.420</td><td>≈ 19.128 sec</td></tr></table>
144
+
145
+ Table 3. Performance of VQ-Stroke on SVG reconstruction task, where C-2 and C-4 denote the Compression Rate 2 and 4.
146
+
147
+ <table><tr><td>Methods</td><td>FID (↓)</td><td>CLIPScore (↑)</td><td>EDIT (↓)</td><td>CR (↓)</td></tr><tr><td>SQM (C-2)</td><td>-</td><td>-</td><td>1,114.791</td><td>8.549%</td></tr><tr><td>SQM (C-2) + SF (PC)</td><td>3.751</td><td>19.861</td><td>1,096.313</td><td>8.786%</td></tr><tr><td>SQM (C-2) + SF (PI)</td><td>3.518</td><td>20.290</td><td>1,315.137</td><td>13.780%</td></tr><tr><td>SQM (C-4) + SF (PI)</td><td>4.943</td><td>15.192</td><td>2,100.671</td><td>6.890%</td></tr><tr><td>Golden SVG</td><td>-</td><td>-</td><td>-</td><td>100%</td></tr></table>
148
+
149
+ # 4.2. Quantitative Evaluation
150
+
151
+ VQ-Stroke We report the reconstruction quality of VQ-Stroke in Tab. 3. without SF, VQ-Stroke fails to generate results that conform to SVG syntax. After equipping VQ-Stroke with SF, PI facilitates a more faithful approximation of the original SVG graphics by achieving the lowest FID score and demonstrating a higher concordance with the given text prompts, as evidenced by the lowest CLIP score. In contrast, the PC method yields better alignment results with the original SVG code as it achieves the lowest EDIT score. Utilizing compression level 2 (C-4), VQ-Stroke attains a notable Compression Ratio (CR) of $6.9\%$ , maintaining performance on par with that of C-2 as evidenced by comparable CLIPScore and FID. This suggests that VQ-Stroke preserves the semantic integrity of the original SVG graphics despite the substantial path compression.
152
+
153
+ StrokeNUWA As illustrated in Table 2, StrokeNUWA outperforms other methods by achieving superior results. Specifically, in terms of visual performance, StrokeNUWA is capable of generating graphics that more closely resemble the Golden SVG—evidenced by the lowest FID score (6.513) and the highest HPS (16.801). This indicates that our Stroke Tokens offer great compatibility with the LLMs. Moreover, StrokeNUWA has attained the highest CLIPScore (17.994), surpassing optimization-based methods. This suggests that stroke tokens encapsulate visual semantics effectively. In terms of the quality of the SVG code and the efficiency of generation, the Stroke Token not only aligns closely with the Golden standard but also markedly enhances the generation speed, i.e., around 19 seconds of StrokeNUWA V.S. around 30 minutes of optimization-based method LIVE, which underscores the outstanding compressive capability of the stroke token on the original SVG code.
154
+
155
+ ![](images/ce31acd46f04f4f2f6b1c789e50a6d7b8191053be08d64c5a0b8fc3bd591b61a.jpg)
156
+ (a) Comparison between StrokeNUWA and other baselines.
157
+
158
+ ![](images/2051689bd929d308616eb6c3d078342025d151987096f60f8d809609d234a112.jpg)
159
+ (b) Cases generated by GPT-4-Turbo with same keywords. As GPT-4 is not open-source, we cannot get the generation time.
160
+ Figure 7. Sampled cases from different models in SVG generation task, where the CLIPScore is the average score calculated across four generated cases for each method.
161
+
162
+ # 4.3. Qualitative Evaluation
163
+
164
+ Case Study We show the reconstruction results of VQ-Stroke with varying complexity levels in Fig. 8 and present a qualitative comparison between StrokeNUWA and other baselines in Fig. 7(a). It is impressive that VQ-Stroke can reconstruct complex SVGs with a limit of only 4,096 codebook size. Then, at the Compression Rate of 2 (CR-2), VQ-Stroke successfully outlines the edge of objects within the graphics, demonstrating that stroke tokens can be highly compressed with a dense representation and inherently incorporate semantic segmentation, which is essential for
165
+
166
+ ![](images/ec0e0fb0a396667408e054cef901d390bd25c13be34f9f6d5466502483bc0406.jpg)
167
+ Figure 8. Reconstruction performance of difference VQ-Strokes.
168
+
169
+ ![](images/baf6a65de9d86a6d3428905cb0f65b573da3a2747589d370b6e0bc304721dc89.jpg)
170
+ Figure 9. Human evaluation between StrokeNUWA and LLM-based method—Iconshop.
171
+
172
+ retaining visual semantics. Regarding the comparison of StrokeNUWA, we note that employing LLM-based generation methods can result in incomplete SVGs (Iconshop). This is attributed to the excessive SVG code lengths and LLMs struggling to capture the key information embedded within SVG graphics. However, the use of stroke tokens can mitigate these issues by compressing the paths and being compatible with LLMs. Furthermore, we find that the performance of the optimization-based method heavily relies on the outputs generated by the stable diffusion model, which is subject to the limitations of grid tokens mentioned in Sec. 1, e.g., it is hard to capture the visual semantics and tends to generate extra visual information that is not aligned with the text prompt. Besides, the optimization process is extremely slow. In contrast, StrokeNUWA, which utilizes stroke tokens, inherently contains visual semantic segmentation. As a result, the content generated is more aligned with the textual semantics, providing a more coherent and semantically accurate graphic.
173
+
174
+ Human Evaluation Furthermore, we conduct a human evaluation to compare the generated SVG outputs from StrokeNUWA with those produced by the LLM-based method, Iconshop. We select 50 different textual prompts and guide the model to generate corresponding SVGs for evaluation. As depicted in Figure 9, our comparison is founded on three criteria: Prompt Alignment (consistency between the generated result and the text prompt), Overall Quality (the general caliber of SVGs), and Graphic Details (intracacies such as curves). We observe that StrokeNUWA, compared to Iconshop, which regards code as visual representation, not only yields more complete content (better Overall Quality) but produces results more closely aligned with the textual prompts (better Prompt Alignment) $^3$ . Given that stroke
175
+
176
+ Table 4. Comparison among different VQ-Stroke Settings.
177
+
178
+ <table><tr><td colspan="2">Settings</td><td rowspan="2">FID (↓)</td><td rowspan="2">CLIPScore (↑)</td><td rowspan="2">EDIT (↓)</td></tr><tr><td>|B|</td><td>Dim</td></tr><tr><td>2048</td><td>512</td><td>5.702</td><td>19.365</td><td>2,323.810</td></tr><tr><td>4096</td><td>512</td><td>3.518</td><td>20.290</td><td>1,315.137</td></tr><tr><td>4096</td><td>1024</td><td>3.901</td><td>20.159</td><td>1,793.008</td></tr><tr><td>8192</td><td>512</td><td>2.639</td><td>21.014</td><td>907.106</td></tr></table>
179
+
180
+ tokens compress the details of SVG, it is natural that StrokeNUWA excels in generating Graphic Details.
181
+
182
+ # 5. Ablation Study
183
+
184
+ # 5.1. Analysis of VQ-Stroke Model Architecture
185
+
186
+ To investigate the impact of VQ-Stroke architecture configurations on the stroke token performance, we experiment with different codebook sizes $|\mathcal{B}|$ and codebook dimension $\mathrm{Dim}$ . As shown in Tab. 4, we can observe that by increasing the codebook size while simultaneously reducing the dimension of each stroke token, the VQ-Stroke achieves superior performance across multiple metrics. We sample a set of reconstruction cases to showcase the trend of changes in Fig. 8, which indicates that, with a larger codebook size and smaller dimension, the VQ-Stroke can delineate details with greater accuracy, e.g., straighter lines.
187
+
188
+ # 5.2. Comparison with GPT-4
189
+
190
+ We compare the generation results with GPT-4 (Achiam et al., 2023) by employing the following template to guide GPT-4 in producing the corresponding SVG code: Generate SVG codes in icon style based on keywords:{KEYWORDS}. We show the rendered SVGs in Fig. 7(b), where we can observe that GPT-4 can only generate simple SVGs, which is consistent with LLM-based methods. Moreover, GPT-4 often yields SVGs that are incongruent with the associated text. On the contrary, StrokeNUWA can generate complex SVGs that are consistent with textual prompts.
191
+
192
+ # 6. Conclusion and Future Work
193
+
194
+ This paper presents StrokeNUWA, a pioneering study that explores a superior visual representation—"stroke" tokens, as an alternative method for expressing images through vector graphics. Stroke tokens not only preserve the semantic integrity of the images but are also conducive to processing by LLMs. Moreover, strokes in vector graphics can be highly compressed. Experiments indicate that, equipped with stroke tokens, LLMs can achieve superior results across various metrics in the SVG synthesis task. Moving forward, we aim to continue improving the quality of stroke tokens through advanced visual tokenization methods for LLMs.
195
+
196
+ # Impact Statement
197
+
198
+ The implications of this work are manifold, potentially revolutionizing the visual synthesis from another format of image, vector graphics. As stroke tokens refine the interplay between visual representation and LLMs, future advancements in visual tokenization techniques designed for LLMs are anticipated. Moving forward, the community can extend stroke token application into wider tasks and domains, including SVG comprehension and open-domain SVG synthesis for images from the real world. As we pioneer this nascent field, we are conscious of the profound societal impact that such advancements in machine learning and graphical representations hold. The capabilities for automated graphic design, scalable vector graphics production, and enhanced digital artistry foreshadow considerable shifts in industries reliant on visual content. By forging new pathways for artistic expression and visual communication, our work stands to not only contribute to the scientific community but also to catalyze transformations in creative, technological, and educational sectors. We recognize the importance of our work and our responsibility to ensure that our contributions to the field are conducted ethically, aiming to benefit society as a whole, democratize the visual landscape, and enrich it through responsible and judicious innovation.
199
+
200
+ # References
201
+
202
+ Achiam, J., Adler, S., Agarwal, S., Ahmad, L., Akkaya, I., Aleman, F. L., Almeida, D., Altenschmidt, J., Altman, S., Anadkat, S., et al. Gpt-4 technical report. arXiv preprint arXiv:2303.08774, 2023.
203
+ Anil, R., Dai, A. M., First, O., Johnson, M., Lepikhin, D., Passos, A., Shakeri, S., Taropa, E., Bailey, P., Chen, Z., et al. Palm 2 technical report. arXiv preprint arXiv:2305.10403, 2023.
204
+ Barnes, C. F., Rizvi, S. A., and Nasrabadi, N. M. Advances in residual vector quantization: A review. IEEE transactions on image processing, 5(2):226-262, 1996.
205
+ Brohan, A., Brown, N., Carbajal, J., Chebotar, Y., Chen, X., Choromanski, K., Ding, T., Driess, D., Dubey, A., Finn, C., et al. Rt-2: Vision-language-action models transfer web knowledge to robotic control. arXiv preprint arXiv:2307.15818, 2023.
206
+ Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J. D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. Language models are few-shot learners. Advances in neural information processing systems, 33: 1877-1901, 2020.
207
+ Cao, S., Yin, Y., Huang, L., Liu, Y., Zhao, X., Zhao, D., and Huang, K. Efficient-vqgan: Towards high-resolution
208
+
209
+ image generation with efficient vision transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 7368-7377, 2023.
210
+ Carlier, A., Danelljan, M., Alahi, A., and Timofte, R. Deepsvg: A hierarchical generative network for vector graphics animation. Advances in Neural Information Processing Systems, 33:16351-16361, 2020.
211
+ Chang, H., Zhang, H., Jiang, L., Liu, C., and Freeman, W. T. Maskgit: Masked generative image transformer. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11315-11325, 2022.
212
+ Chowdhery, A., Narang, S., Devlin, J., Bosma, M., Mishra, G., Roberts, A., Barham, P., Chung, H. W., Sutton, C., Gehrmann, S., et al. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311, 2022.
213
+ Chung, H. W., Hou, L., Longpre, S., Zoph, B., Tay, Y., Fedus, W., Li, E., Wang, X., Dehghani, M., Brahma, S., et al. Scaling instruction-finetuned language models. arXiv preprint arXiv:2210.11416, 2022.
214
+ Clouatre, L. and Demers, M. Figr: Few-shot image generation with reptile. arXiv preprint arXiv:1901.02199, 2019.
215
+ Dhariwal, P., Jun, H., Payne, C., Kim, J. W., Radford, A., and Sutskever, I. Jukebox: A generative model for music. arXiv preprint arXiv:2005.00341, 2020.
216
+ Esser, P., Rombach, R., and Ommer, B. Taming transformers for high-resolution image synthesis. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 12873-12883, 2021.
217
+ Ghosal, D., Majumder, N., Mehrish, A., and Poria, S. Text-to-audio generation using instruction-tuned llm and latent diffusion model. arXiv preprint arXiv:2304.13731, 2023.
218
+ Hessel, J., Holtzman, A., Forbes, M., Bras, R. L., and Choi, Y. Clipscore: A reference-free evaluation metric for image captioning. arXiv preprint arXiv:2104.08718, 2021.
219
+ Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., and Hochreiter, S. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems, 30, 2017.
220
+ Hu, Q., Zhang, G., Qin, Z., Cai, Y., Yu, G., and Li, G. Y. Robust semantic communications with masked vq-vae enabled codebook. IEEE Transactions on Wireless Communications, 2023.
221
+ Jain, A., Xie, A., and Abbeel, P. Vectorfusion: Text-to-svg by abstracting pixel-based diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1911-1920, 2023.
222
+
223
+ Kim, Y., Mo, S., Kim, M., Lee, K., Lee, J., and Shin, J. Biast-to-text: Debiasing unknown visual biases through language interpretation. arXiv preprint arXiv:2301.11104, 2023.
224
+ Kim, Z. M., Du, W., Raheja, V., Kumar, D., and Kang, D. Improving iterative text revision by learning where to edit from other revision tasks. arXiv preprint arXiv:2212.01350, 2022.
225
+ Kondratyuk, D., Yu, L., Gu, X., Lezama, J., Huang, J., Hornung, R., Adam, H., Akbari, H., Alon, Y., Birodkar, V., et al. Videopoet: A large language model for zero-shot video generation. arXiv preprint arXiv:2312.14125, 2023.
226
+ Lee, D., Kim, C., Kim, S., Cho, M., and HAN, W. S. Draft-and-revise: Effective image generation with contextual rq-transformer. Advances in Neural Information Processing Systems, 35:30127-30138, 2022.
227
+ Li, T.-M., Lukáč, M., Gharbi, M., and Ragan-Kelley, J. Differentiable vector graphics rasterization for editing and learning. ACM Transactions on Graphics (TOG), 39 (6):1-15, 2020.
228
+ Ma, X., Zhou, Y., Xu, X., Sun, B., Filev, V., Orlov, N., Fu, Y., and Shi, H. Towards layer-wise image vectorization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16314-16323, 2022.
229
+ Martinez, J., Hoos, H. H., and Little, J. J. Stacked quantizers for compositional vector compression. arXiv preprint arXiv:1411.2173, 2014.
230
+ 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.
231
+ Rajbhandari, S., Rasley, J., Ruwase, O., and He, Y. Zero: Memory optimizations toward training trillion parameter models. In SC20: International Conference for High Performance Computing, Networking, Storage and Analysis, pp. 1-16. IEEE, 2020.
232
+ Reddy, M. D. M., Basha, M. S. M., Hari, M. M. C., and Pechalaiah, M. N. Dall-e: Creating images from text. UGC Care Group I Journal, 8(14):71-75, 2021.
233
+ Rombach, R., Blattmann, A., Lorenz, D., Esser, P., and Ommer, B. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 10684-10695, 2022.
234
+
235
+ Singhal, K., Tu, T., Gottweis, J., Sayres, R., Wulczyn, E., Hou, L., Clark, K., Pfohl, S., Cole-Lewis, H., Neal, D., et al. Towards expert-level medical question answering with large language models. arXiv preprint arXiv:2305.09617, 2023.
236
+ Su, H., Liu, X., Niu, J., Cui, J., Wan, J., Wu, X., and Wang, N. Marvel: Raster gray-level manga vectorization via primitive-wise deep reinforcement learning. IEEE Transactions on Circuits and Systems for Video Technology, 2023.
237
+ Sun, Q., Yu, Q., Cui, Y., Zhang, F., Zhang, X., Wang, Y., Gao, H., Liu, J., Huang, T., and Wang, X. Generative pretraining in multimodality. arXiv preprint arXiv:2307.05222, 2023.
238
+ Tang, Z., Zhou, K., Wang, P., Ding, Y., Li, J., et al. Detoxify language model step-by-step. arXiv preprint arXiv:2308.08295, 2023.
239
+ 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.
240
+ Van Den Oord, A., Vinyals, O., et al. Neural discrete representation learning. Advances in neural information processing systems, 30, 2017.
241
+ Wang, C., Chen, S., Wu, Y., Zhang, Z., Zhou, L., Liu, S., Chen, Z., Liu, Y., Wang, H., Li, J., et al. Neural codec language models are zero-shot text to speech synthesizers. arXiv preprint arXiv:2301.02111, 2023.
242
+ Wang, Y., Pu, G., Luo, W., Wang, Y., Xiong, P., Kang, H., and Lian, Z. Aesthetic text logo synthesis via content-aware layout inferring. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2436-2445, 2022.
243
+ Wu, C., Liang, J., Ji, L., Yang, F., Fang, Y., Jiang, D., and Duan, N. Nüwa: Visual synthesis pre-training for neural visual world creation. In European conference on computer vision, pp. 720-736. Springer, 2022.
244
+ Wu, R., Su, W., Ma, K., and Liao, J. Iconshop: Text-guided vector icon synthesis with autoregressive transformers. ACM Transactions on Graphics (TOG), 42(6): 1-14, 2023a.
245
+ Wu, X., Sun, K., Zhu, F., Zhao, R., and Li, H. Human preference score: Better aligning text-to-image models with human preference. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 2096-2105, 2023b.
246
+
247
+ Xing, X., Zhou, H., Wang, C., Zhang, J., Xu, D., and Yu, Q. Svgdreamer: Text guided svg generation with diffusion model. arXiv preprint arXiv:2312.16476, 2023.
248
+ Yu, L., Lezama, J., Gundavarapu, N. B., Versari, L., Sohn, K., Minnen, D., Cheng, Y., Gupta, A., Gu, X., Hauptmann, A. G., et al. Language model beats diffusion-tokenizer is key to visual generation. arXiv preprint arXiv:2310.05737, 2023.
249
+ Zhang, T., Liu, H., Zhang, P., Cheng, Y., and Wang, H. Beyond pixels: Exploring human-readable SVG generation for simple images with vision language models. arXiv preprint arXiv:2311.15543, 2023.
250
+
251
+ # A. Evaluation Metrics
252
+
253
+ Here we will elaborate more meticulously on the setup of the evaluation.
254
+
255
+ # A.1. Automatic Evaluation Metrics
256
+
257
+ EDIT Score The EDIT Score calculates how many insertions, substitutions, and deletions are needed to make two strings identical. In the field of NLP, the Edit Score measures the similarity between two strings (Kim et al., 2022; Tang et al., 2023). In the task of SVG generation, we evaluate the quality of the generated SVG from the code perspective, i.e., the closer the generated SVG code is to the ground truth SVG, the higher the quality of the SVG path, indicating fewer repeated paths and missing paths. It is worth noting that we only test the direct SVG generation methods, including Iconshop and StrokeNUWA. For optimization-based methods, e.g., SD & LIVE and VectorFusion, which continuously optimize raster images and do not have a fixed ground truth SVG, it is not possible to evaluate with EDIT score. We convert all the SVGs into the code format, treat the codes as strings, and calculate the corresponding EDIT scores.
258
+
259
+ Recall Rate Based on our observations, we have noticed that for the majority of SVGs, some key paths and keywords match. For example, given the keyword "clock", the corresponding SVG should contain key SVG paths resembling clock hands. By identifying these key paths, one can roughly understand that the SVG represents a clock. Therefore, we design the Recall Score to measure how many key paths in the generated SVG can match the ground truth. Specifically, we convert both the generated SVG and the ground truth SVG into stroke tokens with VQ-Stroke and then calculate how many strokes in the generated SVG's corresponding stroke tokens appear in the ground truth using the following formula: $\text{Recall} = \frac{|P \cap \mathcal{G}|}{|\mathcal{G}|}$ , where $|P \cap \mathcal{G}|$ represents the number of overlapping stroke tokens between the generated stroke tokens $P$ and the ground truth stroke tokens $\mathcal{G}$ . We convert all SVGs into the stroke token format, subsequently computing the recall rate.
260
+
261
+ # A.2. Human Evaluation
262
+
263
+ Considering the potential bias and inaccuracies that automated metrics may introduce in evaluating SVGs, e.g., CLIP-Score (Kim et al., 2023), we organize a human evaluation process. In this human evaluation, we employ 10 evaluators and provide each with 100 evaluation samples. Each sample set included an SVG generated by StrokeNUWA and one generated by Iconshop. Evaluators are tasked with assessing the following aspects:
264
+
265
+ - Prompt Alignment: Whether the generated SVG aligns with the given prompt.
266
+ - Overall Quality: The general quality of the generated SVG, such as balance of content and clarity.
267
+ - Graphic Details: The presence of detailed elements in the generated SVG, such as intricacies outlined by curves.
268
+
269
+ Evaluators are instructed to evaluate StrokeNUWA against Iconshop in each metric, determining whether StrokeNUWA wins, ties, or loses against Iconshop. Before releasing the human evaluation cases, we conducted thorough checks to ensure there were no private information or problematic biases present in the cases. Additionally, we refrained from collecting personal information or inquiring about evaluators' private details during the annotation process.
270
+
271
+ # B. Additional Ablation Experiments
272
+
273
+ # B.1. Effectiveness of Different Textual Prompts
274
+
275
+ We study the effectiveness of different textual prompts on StrokeNUWA. Specifically, as shown in Fig. 10, we embed keywords into different textual prompt templates to guide SVG generation. These new prompts were then fed into the StrokeNUWA model to generate SVGs. It is worth mentioning that, for the sake of conciseness in illustrating the impact of different textual prompts, we employ the PI method as the SVG fixer and prompt the StokeNUWA with different textual prompts. We try five different textual prompts (including the one used in the main experiment). Notably, the first four templates place the keywords in different positions within the prompt, while the last one reconstructs the keywords into a natural language sentence using LLM. For instance, for the keywords "cloud" and "rain", we can rewrite them in natural language as: "Raindrops are falling from the cloud".
276
+
277
+ # Templates for Different Textual Prompts
278
+
279
+ # Template 1 (Utilize in the main experiment)
280
+
281
+ Generating SVG according to keywords: {Keywords}
282
+
283
+ # Template 2 (Shuffle the Keywords order)
284
+
285
+ Generating SVG according to keywords: {Shuffled Keywords}
286
+
287
+ # Template 3
288
+
289
+ Please generate an SVG that includes the following attributes: {Keywords}
290
+
291
+ # Template 4
292
+
293
+ Here are some keywords: $\{$ Keywords $\}$ , generate the corresponding SVG:
294
+
295
+ # Template 5 (Re-organize the keywords into natural language
296
+
297
+ {Natural language prompt including keywords}
298
+
299
+ Figure 10. Templates for different textual prompts.
300
+
301
+ Table 5. Effectiveness of Different Textual Prompts.
302
+
303
+ <table><tr><td rowspan="2">Prompt</td><td colspan="3">Visual Performance</td><td colspan="3">SVG Code Quality</td></tr><tr><td>FID (↓)</td><td>CLIPScore (↑)</td><td>HPS (↑)</td><td>Recall (↑) (Stoke Token)</td><td>EDIT (↓)</td><td>Optim / Pred Length (Avg)</td></tr><tr><td>Template 1</td><td>6.513</td><td>17.994</td><td>16.801</td><td>0.207</td><td>12,249.091</td><td>271.420</td></tr><tr><td>Template 2</td><td>6.612</td><td>18.113</td><td>16.942</td><td>0.211</td><td>12,223.724</td><td>274.006</td></tr><tr><td>Template 3</td><td>8.726</td><td>16.026</td><td>14.093</td><td>0.199</td><td>13,287.631</td><td>263.196</td></tr><tr><td>Template 4</td><td>11.607</td><td>13.852</td><td>9.097</td><td>0.101</td><td>19,167.086</td><td>181.059</td></tr><tr><td>Template 5</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr></table>
304
+
305
+ We report the StrokeNUWA performance with different textual prompts in Tab. 5. We can observe that if the textual prompt doesn't change much, i.e., it stays consistent with the training phase or has minor modifications (such as changing the order of keywords), the performance of the StrokeNUWA is not greatly affected and might even generate SVGs of higher quality (Template 2). However, if a new textual prompt is adopted, the position of the keywords becomes very important. If the keywords are still at the end of the textual prompt (Template 3), the model's performance shows a slight decrease across various metrics. However, suppose the keywords are not at the end (Template 4). In that case, StrokeNUWA fails to generate complex SVGs, resulting in failures on some complicated test samples and a significant drop in overall metrics. For the last case (Template 5), if keyword prompts are completely unused by StrokeNUWA during the training stage, i.e., the prompts during inference are entirely inconsistent with the prompts used during training, then StrokeNUWA can only generate a few simple SVGs, thus making the generated SVGs difficult to evaluate. We also provide some generated SVGs from StrokeNUWA under different textual prompts for reference in Fig. 12.
306
+
307
+ # B.2. Semantic Clusters of Strokes
308
+
309
+ We adopt the following configuration of VQ-Stroke (the depth of the residual vector quantization is 2, with compression rates of 2 and 4, respectively, and a vocabulary size of 4096, which is the model configuration used in the main experiment), and performed clustering on all stroke tokens in the stroke codebook.
310
+
311
+ We manually set the number of clusters to 10 categories and analyze them using the T-SNE method. We present the results of vocabulary clustering under the condition of a compression rate of 2 in Fig. 11, where we divide the clustering results into two types. Specifically, the cases in the right column of the above figure indicate that the distribution of these stroke tokens is very concentrated. These Stroke Tokens have very distinct features, such as representing Dots, Vertical Lines, or direction-specific short lines. In contrast, the cases in the left column represent strokes with less distinct features. This type of strokes includes various different categories of stroke types (for example, short/long strokes, direction-specific hooks, etc.). We believe that these types of strokes (on the left) constitute complex SVGs, and are greatly influenced by the vocabulary size set in VQ-Stroke. A larger vocabulary may learn more complex and layered strokes.
312
+
313
+ ![](images/7c1c16d07dd5706bf9a12e94bb56344f2ccb310babbe7235102f459481240557.jpg)
314
+ Figure 11. Semantic Clusters of Strokes
315
+
316
+ # C. SVG Generation with more Attributes
317
+
318
+ In order to incorporate more elements into the process of Stroke generation, we have expanded the Code to Matrix method (as described in section 3.2.1 of the original paper). Specifically, we have added three placeholders to the original matrix, so that Equation 1: $K_{ij} = f(C_{ij}) = (T,x_0,y_0,c_0^x,c_0^y,c_1^x,c_1^y,x_1,y_1)_{ij}$ becomes $(\mathcal{K}_i^j)' = f'(\mathcal{C}_i^j) = (T,\text{color}_i,\text{width}_i,\text{opacity}_i,x_0,y_0,c_0^x,c_0^y,c_1^x,c_1^y,x_1,y_1)_i^j$ . It's worth noting that the placeholders $(color_i, width_i, \text{and opacity}_i)$ here can be expanded to any number, which can be defined by the user and reflected to the SVG through rules. For simplicity of demonstration and validate the feasibility of adding more attributes into "stroke tokens", we insert three special placeholders: 1) color: to control the color of the SVG path; 2) width: to control the width of the SVG path; and 3) opacity: to control the transparency of the SVG path. Since the SVG dataset we used does not provide these parameters, we randomly generated some values for a toy experiment.
319
+
320
+ For clarity, we compare the predicted strokes from VQ-Stroke model under different settings in Fig. 13, where Raw predicted SVG only uses numerical coordinates as attributes, while Random Colored SVG fills the color attribute in the SVG Path using a rule-based method. The two sub-figures in the bottom of Fig. 13 show the results trained with **VQ-Stroke** with different vocabulary sizes and attributes, i.e., color, path width, and opacity.
321
+
322
+ We retrain the EDM model in the paper using the aforementioned stroke tokens which fused with 3 attributes. Finally, we show some generated cases in Fig. 14.
323
+
324
+ <table><tr><td></td><td></td><td></td></tr><tr><td>Template 1: Generate SVG according to keywords: Light Bulb, Emitting Light</td><td>Template 3: Please generate an SVG that includes the following attributes: Light Bulb, Emitting Light</td><td>Template 4: Here are some keywords: Light Bulb, Emitting Light, generate the corresponding SVG:</td></tr><tr><td></td><td></td><td></td></tr><tr><td>Template 1: Generate SVG according to keywords: Clock, Night</td><td>Template 3: Please generate an SVG that includes the following attributes: Clock, Night</td><td>Template 4: Here are some keywords: Clock, Night, generate the corresponding SVG:</td></tr><tr><td></td><td></td><td></td></tr><tr><td>Template 1: Generate SVG according to keywords: Rain, Weather</td><td>Template 3: Please generate an SVG that includes the following attributes: Rain, Weather</td><td>Template 4: Here are some keywords: Rain, Weather, generate the corresponding SVG:</td></tr><tr><td></td><td></td><td></td></tr><tr><td>Template 1: Generate SVG according to keywords: Car, Vehicle</td><td>Template 3: Please generate an SVG that includes the following attributes: Car, Vehicle</td><td>Template 4: Here are some keywords: Car, Vehicle, generate the corresponding SVG:</td></tr></table>
325
+
326
+ Figure 12. SVG cases generated by StrokeNUWA with different textual prompts.
327
+
328
+ ![](images/51ad5910da4cc59ca498a9b58f11aa8ab651dff940819ffffe1683078cba4026.jpg)
329
+ Figure 13. SVG reconstruction with more attributes.
330
+
331
+ ![](images/dd9e5ce02613507d9860ba73898ffd60dbf234aa225fc205f14c4713e8df21bf.jpg)
332
+ Figure 14. SVG generated by StrokeNUWA fused with more attributes.
2024/StrokeNUWA—Tokenizing Strokes for Vector Graphic Synthesis/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:884d552dac26f916327649d6bf0f30d4ef857c4531fa15587d19a9829fc2a75a
3
+ size 1375228
2024/StrokeNUWA—Tokenizing Strokes for Vector Graphic Synthesis/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/Structure Your Data_ Towards Semantic Graph Counterfactuals/a1df89bd-1d9a-4b7e-a93f-1969f3a0ca6c_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/Structure Your Data_ Towards Semantic Graph Counterfactuals/a1df89bd-1d9a-4b7e-a93f-1969f3a0ca6c_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/Structure Your Data_ Towards Semantic Graph Counterfactuals/a1df89bd-1d9a-4b7e-a93f-1969f3a0ca6c_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c5ea56d72ae7bb4e4655aed112d445543c4bfacbc9a7d81ab87488d4659b848f
3
+ size 9519962
2024/Structure Your Data_ Towards Semantic Graph Counterfactuals/full.md ADDED
The diff for this file is too large to render. See raw diff
 
2024/Structure Your Data_ Towards Semantic Graph Counterfactuals/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:df20189451c9131787057b27523c52fcdc6ad2d588025726becb3a3865e9e4e0
3
+ size 1739435
2024/Structure Your Data_ Towards Semantic Graph Counterfactuals/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/Structure-Aware E(3)-Invariant Molecular Conformer Aggregation Networks/ae9b8328-8568-45b8-b672-0bf3f4d9039b_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/Structure-Aware E(3)-Invariant Molecular Conformer Aggregation Networks/ae9b8328-8568-45b8-b672-0bf3f4d9039b_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/Structure-Aware E(3)-Invariant Molecular Conformer Aggregation Networks/ae9b8328-8568-45b8-b672-0bf3f4d9039b_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cf9ee52d5fc5872870e710aa6c8deb13b91be22e63eb640cbb2f6bf89a44287a
3
+ size 2967130
2024/Structure-Aware E(3)-Invariant Molecular Conformer Aggregation Networks/full.md ADDED
The diff for this file is too large to render. See raw diff
 
2024/Structure-Aware E(3)-Invariant Molecular Conformer Aggregation Networks/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7abccf6105db97f14bbfec596cc8564f00180a8742c500c17c56db087c104b6e
3
+ size 1213892
2024/Structure-Aware E(3)-Invariant Molecular Conformer Aggregation Networks/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/Structure-based drug design by denoising voxel grids/45f13b51-8d7b-47ac-9649-16ca362418b6_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/Structure-based drug design by denoising voxel grids/45f13b51-8d7b-47ac-9649-16ca362418b6_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/Structure-based drug design by denoising voxel grids/45f13b51-8d7b-47ac-9649-16ca362418b6_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:54617796c1c354fb0b0d8e9bb7b617608d8a66af97df2646095523cc89178498
3
+ size 9224409
2024/Structure-based drug design by denoising voxel grids/full.md ADDED
@@ -0,0 +1,461 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Structure-based drug design by denoising voxel grids
2
+
3
+ Pedro O. Pinheiro<sup>1</sup> Arian Jamasb<sup>1</sup> Omar Mahmood<sup>1</sup> Vishnu Sresht<sup>1</sup> Saeed Saremi<sup>1</sup>
4
+
5
+ # Abstract
6
+
7
+ We present VoxBind, a new score-based generative model for 3D molecules conditioned on protein structures. Our approach represents molecules as 3D atomic density grids and leverages a 3D voxel-denoising network for learning and generation. We extend the neural empirical Bayes formalism (Saremi & Hyvarinen, 2019) to the conditional setting and generate structure-conditioned molecules with a two-step procedure: (i) sample noisy molecules from the Gaussian-smoothed conditional distribution with underdamped Langevin MCMC using the learned score function and (ii) estimate clean molecules from the noisy samples with single-step denoising. Compared to the current state of the art, our model is simpler to train, significantly faster to sample from, and achieves better results on extensive in silico benchmarks—the generated molecules are more diverse, exhibit fewer steric clashes, and bind with higher affinity to protein pockets.
8
+
9
+ # 1. Introduction
10
+
11
+ The goal of structure-based drug design (SBDD) (Blundell, 1996; Anderson, 2003) is to generate molecules that bind with high affinity to specific 3D structures of target biomolecules. Traditional computational approaches, such as virtual screening, search over a library of molecules and score them to identify the best binders for a given target of interest (Lyu et al., 2019). However, random search is arguably very inefficient as the chemical space grows exponentially with molecular size (Fink et al., 2005).
12
+
13
+ Recently, many generative modeling methods have been proposed as alternatives to search-based SBDD (see Thomas et al. (2023) for a review). In this setting, the goal is to develop data-driven approaches that generate molecules
14
+
15
+ ![](images/6aca2aee2f77f07070ac990ad290f2f07a05c68cb52e7f6c16d7f03de6c6af27.jpg)
16
+ Figure 1. We are interested in sampling from $p(x|\xi)$ , the distribution of ligands given pocket $\xi$ . This is challenging due to the high-dimensionality of the data. Therefore, instead of (a) sampling directly from this distribution, we generate ligands in a two-step procedure: (b) sample $y$ from the Gaussian-smoothed distribution $p(y|\xi)$ and (c) estimate the ligand $\hat{x}$ from $y$ and $\xi$ .
17
+
18
+ (i.e., ligands) conditioned on 3D protein binding sites (i.e., pockets). Generative models have the promise of exploring the chemical space more efficiently and effectively than search-based approaches.
19
+
20
+ SBDD generative models typically represent molecules as discrete voxel grids or atomic point clouds. Voxel-based approaches (Wang et al., 2022a; Ragoza et al., 2022; Wang et al., 2022b) represent atoms (or electron densities) as continuous densities and molecules as a discretization of 3D space into voxel grids (a voxel is a discrete unit of volume). Point-cloud based approaches (e.g., Luo et al. (2021); Schneuing et al. (2022)) treat atoms as points in 3D Euclidean space and rely on graph neural network (GNN) architectures. Current state of the art methods in data-driven SBDD (Guan et al., 2023a;b) operate on point clouds and are based on E(3) equivariant diffusion models (Hoogeboom et al., 2022) conditioned on protein pockets: they sample points from a Gaussian prior and iteratively apply the learned reverse conditional diffusion process (over continuous coordinates and discrete atom types and bonds) to generate molecules.
21
+
22
+ There is a clear trade-off between the two data representation choices. On one hand, GNNs can leverage SE(3)-equivariance inductive bias more easily than architectures that operate on voxels (Geiger & Smidt, 2022; Weiler et al., 2018). On the other hand, they are known to be less expres
23
+
24
+ sive due to the message passing formalism (Xu et al., 2019; Morris et al., 2019; Pozdnyakov & Ceriotti, 2022). The expressivity of these models can be improved with higher-order message passing schemes (Batatia et al., 2022). However, they require additional computational cost and have not been applied to 3D generative models yet. Recently, it has been shown empirically that non-equivariant—but more expressive—models are competitive with equivariant models on different domains, from computer vision (Bai et al., 2021; Gruver et al., 2022) to molecule generation (Flam-Shepherd & Aspuru-Guzik, 2023; Pinheiro et al., 2023; Wang et al., 2023). In fact, equivariance can be learned from large data and strong data augmentations. Inspired by these findings, we propose a model for SBDD that prioritizes expressivity over SE(3)-equivariance inductive bias.
25
+
26
+ Our model, VoxBind, is a new voxel-based method for 3D ligand generation conditioned on pocket structures. The proposed model generates molecules by extending the neural empirical Bayes (NEB) framework (Saremi & Hyvärinen, 2019; Pinheiro et al., 2023) to the structure-conditional setting. Given a protein pocket $\xi$ , instead of sampling ligands $x$ directly from $p(x|\xi)$ , we follow a two-step procedure: (i) sample noisy molecules $y$ from the Gaussian-smoothed distribution $p(y|\xi)$ and (ii) estimate the clean ligand from $y$ and $\xi$ . Fig. 1 illustrates our approach. Sampling is done with Langevin Markov chain Monte Carlo (MCMC), which is known to work much better on the smoother distribution than on the original (Saremi & Hyvärinen, 2019). We train a conditional denoiser—a model that predicts a clean ligand, given a noisy version of it and its binding pocket—to approximate the conditional score function of the smoothed distribution and the ligand estimator, necessary for steps (i) and (ii), respectively.
27
+
28
+ VoxBind is fundamentally different than current state of the art, i.e., diffusion models on point clouds. First, voxelized representations allow us to use the same type of denoising architectures used in score-based generative models on images. These neural networks are very flexible, scalable and work well in many conditional generation applications (Rombach et al., 2022; Sahara et al., 2022a;b). Second, convolutional filters (and self-attention layers applied on regular grids) can arguably capture 3D patterns, surfaces and shape complementarity—useful features for structure conditioning—more effectively than message passing (see the many-body representation hypothesis discussed by Townshend et al. (2020)). Third, contrary to diffusion models, the noise process used in our approach does not displace atoms in space. This provides a natural way to avoid clashes between generated ligands and pockets. Finally, our approach only requires a single (fixed) noise level, making training and sampling considerably simpler.
29
+
30
+ These differences are reflected on empirical results:
31
+
32
+ VoxBind generates better ligands (conditioned on protein binding sites) on CrossDocked2020 (Francoeur et al., 2020), a standard dataset for this task. The molecules generated by our model bind with higher affinity to protein pockets (computed with standard docking score software), are more diverse, exhibit fewer steric clashes and lower strain energies.
33
+
34
+ Our contributions can be summarized as follows. We propose VoxBind: a new score-based generative model for structure-based drug design. The proposed method is new, simple and effective. We show that VoxBind outperforms current state of the art on an extensive number of metrics, while being significantly faster to generate samples.
35
+
36
+ # 2. Related work
37
+
38
+ # 2.1. Unconditional 3D molecule generation
39
+
40
+ Many recent 3D molecule generation methods represent atoms as points (with 3D coordinates, atom types and possibly other features) and molecules as a set of points. For instance, Gebauer et al. (2018; 2019); Luo & Ji (2022) propose autoregressive approaches to generation, where points (atoms) are sampled iteratively over time, while Kohler et al. (2020); Satorras et al. (2021) generate molecules using normalizing flows (Rezende & Mohamed, 2015). Hoogeboom et al. (2022) propose the equivariant diffusion model (EDM), a diffusion-based (Sohl-Dickstein et al., 2015) generative model that operates on point clouds. EDMs learn to denoise a diffusion process (operating on both continuous and categorical data) and generate molecules by iteratively applying the denoising network on an initial noise. Many follow-up work propose extensions to EDM (Huang et al., 2022; Vignac et al., 2023; Xu et al., 2023).
41
+
42
+ Ragoza et al. (2020) propose a different way to generate molecules: map atomic densities to discrete voxel grids and leverage computer vision techniques for generation. In particular, they propose a generation method based on variational autoencoders (Kingma & Welling, 2014). More recently, Pinheiro et al. (2023) propose VoxMol, a score-based generative model that operates on voxelized grids. They show that voxel-based representations achieve results comparable to point-cloud representations on unconditional molecule generation. Our work can be seen as an extension of VoxMol (and NEB) to the conditional generation setting.
43
+
44
+ # 2.2. Pocket-conditional molecule generation
45
+
46
+ The first methods proposed for this task represent molecules as 3D voxel grids and use 3D convnet architectures. For instance, Skalic et al. (2019) and Wang et al. (2022b) train models to generate ligand SMILES from voxelized pocket structures. Ragoza et al. (2022) uses conditional variational autoencoder to generate 3D ligands conditioned on vox-
47
+
48
+ elized pocket structures. Long et al. (2022) encodes molecular shapes with voxels and propose a model that generates molecular graphs conditioned on the voxelized shapes. Our method also utilizes voxelized molecules, but differs from previous work in terms of how we voxelize molecules, the network architecture and the generative model we use.
49
+
50
+ More recent methods, however, use point-cloud representations and SE(3)-equivariant graph neural networks. Luo & Ji (2022); Liu et al. (2022); Peng et al. (2022) propose conditional autoregressive methods that add atoms (and their corresponding bonds) one at a time, while Rozenberg et al. (2023) propose a method based on normalizing flows. Other authors propose methods that generate molecules by iteratively adding fragments conditioned either on ligand (Adams & Coley, 2022) or pocket (Zhang et al., 2023; Powers et al., 2023) shapes.
51
+
52
+ Current state of the art models for SBDD are based on pointcloud diffusion models. DiffSBDD (Schneuing et al., 2022) and TargetDiff (Guan et al., 2023a) adapt EDMs to the pocket-conditional generation setting. DecompDiff (Guan et al., 2023b) extends TargetDiff with three modifications: they decompose ligand into fragment priors, apply diffusion process on bonds (in addition to atom types and coordinates), and add guidance during generation process.
53
+
54
+ This work shows that we don't necessarily need point clouds or SE(3)-equivariant networks to achieve competitive results on structure-based drug design tasks. As we demonstrate in this paper, voxel-based representations—when coupled with a powerful generative model and an expressive network—can achieve state-of-the-art results.
55
+
56
+ # 2.3. Conditional image generation
57
+
58
+ Conditional image generation has been extremely successful and widely applied to many different computer vision tasks: text-to-image generation (Rombach et al., 2022), super-resolution (Saharia et al., 2022c), optical flow and depth estimation (Saxena et al., 2023), colorization (Saharia et al., 2022a), in-painting (Lugmayr et al., 2022) and semantic segmentation (Amit et al., 2021). All these methods share a commonality that inspired our approach: they adapt score-based generative models to the conditional setting by modifying the very expressive U-Net architecture (Ronneberger et al., 2015) to incorporate the conditioning signal.
59
+
60
+ # 3. Method
61
+
62
+ # 3.1. Voxelized molecules
63
+
64
+ We represent atoms as spherical densities in 3D space decaying exponentially with the square distance to their atomic center (see (10) in the appendix). Voxelized molecules are created by discretizing the space around atoms into voxel
65
+
66
+ grids, where the value at each voxel represents atomic occupancy. Voxels take values between 0 (far away from all atoms) and 1 (at the center of atoms). Ligands and pockets are each represented as cubic grids with side length $L \in \mathbb{N}$ . Each ligand grid and its corresponding pocket grid are centered around the center of mass of the ligand. We assume ligands have $c_{x}$ atom types and pockets have $c_{\xi}$ . Each atom type (element) is represented by a different grid channel (similar to R,G,B channels of images).
67
+
68
+ We consider a dataset with $n$ voxelized ligand-pocket binding pairs $\{(x,\xi)_i\}_{i = 1}^n$ , where $x \in \mathbb{R}^{d_x}$ is the voxelized ligand and $\xi \in \mathbb{R}^{d_{\xi}}$ the voxelized pocket with dimensions $d_{x} = c_{x}L^{3}$ and $d_{\xi} = c_{\xi}L^{3}$ , respectively. Following previous work (Pinheiro et al., 2023), we consider a fixed grid resolution of .25Å and a grid length $L = 64$ . Therefore, the grids in the dataset occupy a volume of $16^{3}$ cubic Ångströms. See Sec. A.1 (appendix) for further details on the voxelization procedure.
69
+
70
+ # 3.2. Conditional neural empirical Bayes
71
+
72
+ Let $X$ and $\Xi$ be the random variables associated with voxelized ligands and pockets, taking values in $\mathbb{R}^{d_x}$ and $\mathbb{R}^{d_{\xi}}$ , respectively, with the joint density $p(x,\xi)$ . Given $\Xi = \xi$ , we would like to learn the smoothed conditional score function $\nabla_y\log p(y|\xi)$ , where the smoothed conditional density $p(y|\xi)$ is obtained by convolving $p(x|\xi)$ with an isotropic Gaussian kernel:
73
+
74
+ $$
75
+ p (y | \xi) = \int p (y | x) p (x | \xi) d x, \tag {1}
76
+ $$
77
+
78
+ where
79
+
80
+ $$
81
+ p (y | x) = \frac {1}{\left(2 \pi \sigma^ {2}\right) ^ {d _ {x} / 2}} \exp \left(- \frac {\| y - x \| ^ {2}}{2 \sigma^ {2}}\right), \tag {2}
82
+ $$
83
+
84
+ equivalently $Y|x \sim \mathcal{N}(x, \sigma^2 I_{d_x})$ . The factorization (1) is mathematically equivalent to setting up the noise process such that conditioned on the ligand $x$ , the noisy ligand $y$ is independent of the pocket $\xi$ : $p(y|x, \xi) = p(y|x)$ . Below we see that due to this conditional independence the empirical Bayes results used in (Saremi & Hyvarinen, 2019) readily generalize to our conditional setting.
85
+
86
+ In particular, we would like to relate $\hat{x}(y|\xi)$ , the conditional least-squares Bayes estimator of $X$ given $(y,\xi)$ , to the smoothed conditional score function $g(\cdot|\xi)$ , defined by
87
+
88
+ $$
89
+ g (y | \xi) = \nabla_ {y} \log p (y | \xi). \tag {3}
90
+ $$
91
+
92
+ Due to our noise process given by (1), the conditional Bayes estimator $\hat{x} (y|\xi) = \mathbb{E}[X|y,\xi ]$ is given by
93
+
94
+ $$
95
+ \hat {x} (y | \xi) = \frac {\int x p (y | x) p (x | \xi) d x}{\int p (y | x) p (x | \xi) d x}. \tag {4}
96
+ $$
97
+
98
+ This leads to the following:
99
+
100
+ ![](images/53755491cb1cd0540c010d406a42184f0a04a9d3b20c663f6ba32bb7eb229944.jpg)
101
+ Figure 2. Conditional denoiser architecture. Given a ligand-pocket complex sample, we discretize each molecule resulting in the voxelized ligand $x$ and pocket $\xi$ . The ligand is corrupted by Gaussian noise with noise level $\sigma$ . The corrupted ligand and pocket are encoded into a common embedding space (with the same spatial dimensions as the inputs) with encoders $E_{\mathrm{lig}}$ and $E_{\mathrm{poc}}$ , respectively. The two representations are added together and forwarded through a 3D U-Net $U$ to recover the clean version of the ligand. To facilitate visualization, we threshold the grid values, $\hat{x} = \mathbb{1}_{\geq .1}(\hat{x})$ .
102
+
103
+ Proposition 1. Given the noise process (1) and (2), the conditional Bayes estimator (4) can be written in closed form in terms of the conditional score function (3):
104
+
105
+ $$
106
+ \hat {x} (y | \xi) = y + \sigma^ {2} g (y | \xi). \tag {5}
107
+ $$
108
+
109
+ Proof. The derivation is simple and similar to the known classical results (Robbins, 1956), but we provide it here for completeness. We start with the following property of the Gaussian kernel (2):
110
+
111
+ $$
112
+ \sigma^ {2} \nabla_ {y} p (y | x) = (x - y) p (y | x).
113
+ $$
114
+
115
+ We then multiply both sides of the above equation by $p(x|\xi)$ and integrate over $x$ . Since $\nabla_y$ and the integration over $x$ commute, using (1), we arrive at
116
+
117
+ $$
118
+ \sigma^ {2} \nabla_ {y} p (y | \xi) = \int x p (y | x) p (x | \xi) d x - y p (y | \xi).
119
+ $$
120
+
121
+ Eq. (5) follows through by dividing both sides of the above equation by $p(y|\xi)$ and using (1), (3), and (4).
122
+
123
+ Due to this extension, summarized by Proposition 1, the (unconditional) neural empirical Bayes framework (Saremi & Hyvarinen, 2019) can be readily adopted for both learning the conditional score function $\nabla_y\log p(y|\xi)$ and drawing approximate samples from $p(x|\xi)$ . By learning the conditional score function with a least-squares denoising objective we are able to sample from $p(y|\xi)$ using Langevin MCMC (walk), and also able to estimate clean ligands conditioned on the pocket using the Bayes estimator (jump), thus drawing approximate samples from $p(x|\xi)$ . We refer to this sampling scheme as conditional walk-jump sampling
124
+
125
+ (cWJS). The details on both learning and sampling are given next.
126
+
127
+ # 3.3. Conditional denoiser
128
+
129
+ From the perspective of learning $p(y|\xi)$ , the key property of (5) is the appearance of the score function (Hyvärinen, 2005) in the right hand side. This means that in setting up the learning objective we do not have to worry about the intractable partition function (Saremi & Hyvärinen, 2019). In this paper we parametrize the conditional denoiser, i.e., the left hand side of (5), from which the conditional score function is derived.
130
+
131
+ There are many ways to construct a conditional voxel denoiser. In this work we focus on a network design that is simple, scalable, and shows good empirical results. We follow the conditional image generation literature (see Sec. 2.3) and propose the following architecture: (i) encode the noisy ligand and the pocket with separate encoders, (ii) merge their representations and (iii) pass through an encoder-decoder architecture to predict clean sample. More precisely:
132
+
133
+ $$
134
+ \hat {x} _ {\theta} (y | \xi) = U _ {\theta_ {3}} \left(E _ {\operatorname {l i g}} (y; \theta_ {1}) + E _ {\operatorname {p o c}} (\xi ; \theta_ {2})\right), \tag {6}
135
+ $$
136
+
137
+ where $\hat{x}_{\theta}:\mathbb{R}^{d_x}\times \mathbb{R}^{d_\xi}\to \mathbb{R}^{d_x}$ is parameterized by $\theta = (\theta_{1},\theta_{2},\theta_{3})$ $E_{\mathrm{lig}}$ and $E_{\mathrm{poc}}$ encode the noisy ligand $y$ and pocket $\xi$ to a common representation $\mathbb{R}^{d_e}$ $d_{e} = c_{e}L^{3}$ , with the same spatial dimensions as input, and $U$ is a 3D U-Net. Fig. 2 shows an overview of the model architecture.
138
+
139
+ Training samples are generated by first sampling a ligand-pocket complex from the empirical distribution and voxelize each of them, resulting in the pair $(x,\xi)$ . We add Gaussian noise drawn from $\mathcal{N}(0,\sigma^2 I_{d_x})$ to the ligand: $y = x + \sigma \varepsilon$ , $\varepsilon \sim \mathcal{N}(0,I_{d_x})$ . The denoising network (6) takes the pair $(y,\xi)$ as input and should output $x$ , the clean ligand. The model is trained by minimizing the mean square error over all voxels in all voxelized ligands, i.e., by minimizing
140
+
141
+ ![](images/4f39640c7d8df2da5da9c59248c15d9a9885b25778cc08e034597b6421b17473.jpg)
142
+ Figure 3. Illustration of pocket-conditional walk-jump sampling chain. (a) First, we voxelize a given protein binding pocket. (b) Then, we sample noisy voxelized ligands (given the pocket) with Langevin MCMC and estimate clean samples with the estimator. (c) Finally, we recover the atomic coordinates from voxel grids. In this figure, jumps are done at every $\Delta k = 100$ walk steps.
143
+
144
+ ![](images/dc10fa1e77fc311403da544079628064192d74ab286c9a2a24c8a1fb9d6c6fb2.jpg)
145
+
146
+ Algorithm 1 cWJS, using the BAOAB scheme (Sachs et al., 2017, Algorithm 1) adapted for the conditional ULD (9).
147
+ 1: Input Learned conditional estimator $\hat{x}_{\theta}$ , score function $g_{\theta}$ (from (8)), noise level $\sigma$ , protein pocket $\xi$
148
+ 2: Input step size $\delta$ , friction $\gamma$ , steps taken $K$
149
+ 3: Output $\widehat{x}$
150
+ 4: $y_0 \sim \mathcal{N}(0, \sigma^2 I_{d_x}) + \mathcal{U}_{d_x}(0, 1)$
151
+ 5: $v_0 \gets 0$
152
+ 6: for $k = 0, \dots, K-1$ do
153
+ 7: $y_{k+1} \gets y_k + \frac{\delta}{2} v_k$
154
+ 8: $g \gets g_{\theta}(y_{k+1}|\xi)$
155
+ 9: $v_{k+1} \gets v_k + \frac{\delta}{2} g$
156
+ 10: $\varepsilon \sim \mathcal{N}(0, I_{d_x})$
157
+ 11: $v_{k+1} \gets e^{-\gamma \delta} v_{k+1} + \frac{\delta}{2} g + \sqrt{(1 - e^{-2\gamma \delta})} \varepsilon$
158
+ 12: $y_{k+1} \gets y_{k+1} + \frac{\delta}{2} v_{k+1}$
159
+ 13: end for
160
+ 14: $\hat{x} \gets \hat{x}_{\theta}(y_K|\xi)$
161
+
162
+ the following loss:
163
+
164
+ $$
165
+ \mathcal {L} (\theta) = \underset {\varepsilon \sim \mathcal {N} (0, I _ {d _ {x}})} {\mathbb {E} _ {(x, \xi) \sim p (x, \xi)}, \left\| \hat {x} _ {\theta} (x + \sigma \varepsilon | \xi) - x \right\| ^ {2}. \tag {7}
166
+ $$
167
+
168
+ Finally, following learning, we can approximate the score function of the pocket-conditional distribution using (5):
169
+
170
+ $$
171
+ g _ {\theta} (y | \xi) = \frac {1}{\sigma^ {2}} \left(\hat {x} _ {\theta} (y | \xi) - y\right). \tag {8}
172
+ $$
173
+
174
+ # 3.4. Conditional walk-jump sampling
175
+
176
+ We leverage the estimator (6), and the learned score function (8) to sample voxelized ligands conditioned on (voxelized) protein pockets. This is done by adapting the walk-jump scheme (Saremi & Hyvarinen, 2019; Pinheiro et al., 2023; Frey et al., 2024) to the conditional setting, resulting
177
+
178
+ in the following two-step approach, which we call conditional walk-jump sampling (cWJS) (see Algorithm 1):
179
+
180
+ (i) (walk step) Sample noisy ligands from $p(y|\xi)$ with Langevin MCMC. We consider the conditional form of the underdamped Langevin diffusion (ULD):
181
+
182
+ $$
183
+ d v _ {t} = - \gamma v _ {t} d t + g _ {\theta} \left(y _ {t} | \xi\right) d t + \sqrt {2 \gamma} d B _ {t}, \tag {9}
184
+ $$
185
+
186
+ $$
187
+ d y _ {t} = v _ {t} d t,
188
+ $$
189
+
190
+ where $(dB_{t})_{t\geq 0}$ is the standard Brownian motion in $\mathbb{R}^{d_x}$ and $\gamma$ is the friction. We use the discretization algorithm proposed by Sachs et al. (2017) to generate samples $y_{k}$ (the inner loop of Algorithm 1).
191
+
192
+ (ii) (jump step) At an arbitrary time step $K$ , typically after a burn-in time, we estimate clean molecules with the conditional estimator, i.e., $\hat{x}_K = \hat{x}_{\theta}(y_K|\xi)$ . Since jumps do not interact with the walks, this step can be moved to inner loop at the cost of memory (storing clean samples). More explanations are given below.
193
+
194
+ As we alluded to above, a key property of cWJS (which is borrowed from WJS) is that the jumps are decoupled from the walks (Saremi & Hyvärinen, 2019). Therefore, we can estimate samples at any arbitrary step of the MCMC chain. This is in contrast to diffusion models, where every sample requires a full MCMC chain to go from noise to sample. Fig. 3 illustrates the generation process starting from noise, estimating clean molecules (given the pocket) at each 100 steps.
195
+
196
+ Algorithm 1 describes a simple implementation of the ("de novo") conditional walk-jump sampling method: initialize a chain (lines 4-5), walk $K$ steps (lines 6-13) and jump (line 14) to estimate sample $\hat{x}$ , given pocket $\xi$ . We use the discretization scheme by (Sachs et al., 2017, Algorithm 1),
197
+
198
+ Table 1. Results on CrossDocked2020 test set. Arrows $\uparrow/\downarrow$ denote that higher/ lower numbers are better, respectively. For the last column, numbers close to Reference are better. Baseline results are taken from (Guan et al., 2023b). For each metric, we bold and underline the best and second best methods, respectively. Our results are shown with mean/standard deviation across 3 runs. This method uses different training assumptions and relies on (external) rule-based algorithms to generate samples.
199
+
200
+ <table><tr><td rowspan="2"></td><td colspan="2">VinaScore (↓)</td><td colspan="2">VinaMin (↓)</td><td colspan="2">VinaDock (↓)</td><td colspan="2">High aff. (%, ↑)</td><td colspan="2">QED (↑)</td><td colspan="2">SA (↑)</td><td colspan="2">Diversity (↑)</td><td colspan="2"># atoms / mol.</td></tr><tr><td>Avg.</td><td>Med.</td><td>Avg.</td><td>Med.</td><td>Avg.</td><td>Med.</td><td>Avg.</td><td>Med.</td><td>Avg.</td><td>Med.</td><td>Avg.</td><td>Med.</td><td>Avg.</td><td>Med.</td><td>Avg.</td><td>Med.</td></tr><tr><td>Reference</td><td>-6.36</td><td>-6.46</td><td>-6.71</td><td>-6.49</td><td>-7.45</td><td>-7.26</td><td>-</td><td>-</td><td>.48</td><td>.47</td><td>.73</td><td>.74</td><td>-</td><td>-</td><td>22.8</td><td>21.5</td></tr><tr><td>AR</td><td>-5.75</td><td>-5.64</td><td>-6.18</td><td>-5.88</td><td>-6.75</td><td>-6.62</td><td>37.9</td><td>31.0</td><td>.51</td><td>.50</td><td>.63</td><td>.63</td><td>.70</td><td>.70</td><td>17.6</td><td>16.0</td></tr><tr><td>Pocket2mol</td><td>-5.14</td><td>-4.70</td><td>-6.42</td><td>-5.82</td><td>-7.15</td><td>-6.79</td><td>48.4</td><td>51.0</td><td>.56</td><td>.57</td><td>.74</td><td>.75</td><td>.69</td><td>.71</td><td>17.7</td><td>15.0</td></tr><tr><td>DiffSBDD</td><td>-1.94</td><td>-4.24</td><td>-5.85</td><td>-5.94</td><td>-7.00</td><td>-6.90</td><td>46.3</td><td>47.2</td><td>.48</td><td>.48</td><td>.58</td><td>.57</td><td>.73</td><td>.72</td><td>24.0</td><td>23.0</td></tr><tr><td>TargetDiff</td><td>-5.47</td><td>-6.30</td><td>-6.64</td><td>-6.83</td><td>-7.80</td><td>-7.91</td><td>58.1</td><td>59.1</td><td>.48</td><td>.48</td><td>.58</td><td>.58</td><td>.72</td><td>.71</td><td>24.2</td><td>24.0</td></tr><tr><td>DecompDiff†</td><td>-5.67</td><td>-6.04</td><td>-7.04</td><td>-7.09</td><td>-8.39</td><td>-8.43</td><td>64.4</td><td>71.0</td><td>.45</td><td>.43</td><td>.61</td><td>.60</td><td>.68</td><td>.68</td><td>20.9</td><td>21.0</td></tr><tr><td rowspan="2">VoxBindσ=0.9</td><td>-6.94</td><td>-7.11</td><td>-7.54</td><td>-7.55</td><td>-8.30</td><td>-8.41</td><td>71.3</td><td>71.5</td><td>.57</td><td>.58</td><td>.70</td><td>.69</td><td>.73</td><td>.74</td><td>23.4</td><td>24.0</td></tr><tr><td>(±.00)</td><td>(±.04)</td><td>(±.01)</td><td>(±.04)</td><td>(±.02)</td><td>(±.01)</td><td>(±.24)</td><td>(±.00)</td><td>(±.00)</td><td>(±.00)</td><td>(±.00)</td><td>(±.00)</td><td>(±.00)</td><td>(±.00)</td><td>(±.1)</td><td>(±.0)</td></tr><tr><td rowspan="2">VoxBindσ=1.0</td><td>-6.63</td><td>-6.70</td><td>-7.12</td><td>-7.18</td><td>-7.82</td><td>-7.89</td><td>58.3</td><td>61.5</td><td>.55</td><td>.57</td><td>.69</td><td>.69</td><td>.75</td><td>.76</td><td>21.7</td><td>22.0</td></tr><tr><td>(±.03)</td><td>(±.02)</td><td>(±.02)</td><td>(±.03)</td><td>(±.01)</td><td>(±.01)</td><td>(±.02)</td><td>(±.00)</td><td>(±.03)</td><td>(±.00)</td><td>(±.00)</td><td>(±.00)</td><td>(±.00)</td><td>(±.00)</td><td>(±.1)</td><td>(±.0)</td></tr></table>
201
+
202
+ which requires the step size $\delta$ . Due to the decoupling of the jumps, line 14 in the algorithm can also be evaluated at the end of the inner loop $\hat{x}_{k + 1} \gets \hat{x}_{\theta}(y_{k + 1}|\xi)$ (or preferably not at every step, but at some desired frequency $\Delta k$ ), e.g., in Fig. 3 we set $\Delta k = 100$ .
203
+
204
+ Finally, we run the same peak detection post-processing of VoxMol (Pinheiro et al., 2023) to recover the atomic coordinates from the generated voxelized ligand. See Sec. A.2 (appendix) for more implementation details on how we perform sampling.
205
+
206
+ # 4. Experiments
207
+
208
+ # 4.1. Experimental setup
209
+
210
+ Dataset. We benchmark our model on Cross-Docked2020 (Francoeur et al., 2020), a popular dataset for pocket-conditional molecule generation. We follow previous work (Schneuing et al., 2022; Guan et al., 2023a,b) and use the pre-processing and splitting proposed by (Luo et al., 2021): the cross-docked dataset is reduced from 22.5M to 100,100 pairs of "high-quality" ligand-pocket pairs. The pockets are clustered (sequence identity $< 30\%$ using MMseqs2 (Steinegger & Söding, 2017)) and 100,000 and 100 ligand-pocket pairs are partitioned into the training and test sets, respectively. We take 100 samples from the training set as our hold-out validation set.
211
+
212
+ Ligands are represented with seven chemical elements (C, O, N, S, F, Cl and P) and protein pockets with four (C, O, N, S). Both molecules are modeled with implicit hydrogens. In the case of protein pockets, we consider all heavy atoms of every amino acid. Each ligand and its associated pocket are centered around the center of mass of the ligand and discretized on a cubic grid with length 64, resulting in tensors of dimensions $\mathbb{R}^{7\times 64\times 64\times 64}$ and $\mathbb{R}^{4\times 64\times 64\times 64}$ for ligand and pocket, respectively. During training, we apply random translation (uniform value between $[-1,1]$ Å on 3D coordi
213
+
214
+ nates) and rotation (uniform value between $[0,2\pi)$ on three Euler angles) to each ligand-protein training sample. These augmentations are applied to both molecules so that their relative pose remains unchanged.
215
+
216
+ Architecture. Encoders $E_{\mathrm{lig}}$ and $E_{\mathrm{poc}}$ map the voxelized molecules to a common embedding space with latent dimension $c_{e} = 16$ and same spatial dimensions, i.e., in $\mathbb{R}^{d_e}$ , $d_{e} = c_{e} \times 64^{3}$ . The encoders contain two residual blocks, each having two padded $3 \times 3 \times 3$ convolutional layers with 16 units followed by SiLU non-linearities (Elfwing et al., 2018). The two embeddings are added together and the merged representation goes through a 3D U-Net architecture (Ronneberger et al., 2015) which predict the clean ligand, of dimension $d_{x} = 7 \times 64^{3}$ . We use the same 3D U-Net architecture as in (Pinheiro et al., 2023), only modifying the dimensionality of the input and output. We train two versions of the model, one with noise level $\sigma = 0.9$ and another with $\sigma = 1.0$ .
217
+
218
+ The models are trained with batch size of 64, learning rate $10^{-5}$ and weight decay $10^{-2}$ . The weights are updated with AdamW optimizer (Loshchilov & Hutter, 2019) $(\beta_{1} = .9, \beta_{2} = .999)$ and exponential moving average with decay .999. Both models are trained for 340 epochs on four NVIDIA A100 GPUs (a total of ten days). For benchmarking purposes, we generate samples by repeatedly applying Algorithm 1, with $K = 500$ steps. We use $\delta = \sigma / 2$ and fix $\gamma = 1 / \delta$ , i.e., the "effective friction" (Saremi et al., 2023) is set to 1.
219
+
220
+ Baselines. We compare our method with various recent benchmarks for pocket-conditional ligand generation: two autoregressive models on point clouds (AR (Luo et al., 2021) and Pocket2Mol (Peng et al., 2022)) and three diffusion models applied on point clouds (DiffSBDD (Schneuing et al., 2022), TargetDiff (Guan et al., 2023a) and DecompDiff (Guan et al., 2023b)). Unlike other baselines, DecompDiff (the current state of the art) relies on a rule-based
221
+
222
+ ![](images/98e9015f1632592803240b6ed30c7365cf243f1cf9e49f19ca07c8ab3a48e3ff.jpg)
223
+ Figure 4. Example of generated ligands $\hat{x}_{i,k}$ given pocket $\xi_{i}$ . Each row represents a single chain of samples for a given protein pocket (1E3R, 2I2Z, 5CRZ from top to bottom). For each generated sample, we show the ligand-pocket complex and the generated voxelized molecule. The samples from each row are generated from the same MCMC chain. The provided ground-truth ligands are shown on the last column.
224
+
225
+ algorithm (AlphaSpace2, proposed by Rooklin et al. (2015)) to compute subpockets and decomposable priors during sampling. All methods with the exception of DecompDiff—including VoxBind—uses OpenBabel (O'Boyle et al., 2011) to assign bonds from generated atom coordinates.
226
+
227
+ Metrics. We evaluate performance using similar metrics as previous work $^2$ . For each method, we sample 100 ligands for each of the 100 protein pockets. We measure affinity with three metrics using AutoDock Vina (Eberhardt et al., 2021): VinaScore computes the binding affinity (docking score) of the molecule on its original generated pose, VinaMin performs a local energy minimization on the ligand followed by dock scoring, VinaDock performs full re-docking (search and scoring) between ligand and target. High affinity computes the percentage of generated molecules that has lower VinaDock score than the reference ligand. We measure drug-likeness, QED (Bickerton et al., 2012), and synthesizeability, SA (Ertl & Schuffenhauer, 2009), scores of generated molecules with RDKit (Landrum, 2016). Diversity is computed by averaging the Tanimoto distance (in RDKit fingerprints) of every pair of generated ligands per pocket (Bajusz et al., 2015). The # atoms / molecules is the average number of (heavy) atoms per molecules.
228
+
229
+ We also compute metrics proposed in PoseCheck (Harris et al., 2023) $^3$ . Steric clash computes the number of clashes between generated ligands and their associated pockets. Strain energy measures the difference between the internal energy of generated molecule's pose (without pocket) and a
230
+
231
+ ![](images/90975731983784339e9f5ba106d55f9c7391624c0b99c1a7b1a8e3c9db2021cf.jpg)
232
+ Figure 5. Median VinaScore and VinaDock (score on generated and redocked poses, respectively) of all generated molecules for each target on the test set (lower is better). Pockets are sorted by VoxBind $_{\sigma=0.9}$ 's score.
233
+
234
+ relaxed pose (computed using Universal Force Field (Rappé et al., 1992) within RDKit). Interaction fingerprints describe intramolecular interactions between the generated ligands and protein pockets. See (Harris et al., 2023) for more details about these metrics.
235
+
236
+ # 4.2. Results
237
+
238
+ Binding affinity. Table 1 compares models on Cross-Docked2020 test set in terms of binding affinity and molecular properties. For each metric, we compute the mean and the median over all generated molecules. The row Reference shows results of ground-truth ligands provided on the test set.
239
+
240
+ Our models achieve better results than TargetDiff (the best model trained under same assumptions) and DecompDiff (which relies on different training assumptions) in most metrics evaluated. The molecules generated by VoxBind $_{\sigma=0.9}$ and VoxBind $_{\sigma=1.0}$ have better binding affinity. In particular, our models generate molecules with better pose than
241
+
242
+ ![](images/0e2f35c854b7e8e0821bc049499e966c0a5d653e13231869a1f091623575301f.jpg)
243
+ Figure 6. The cumulative distribution function of strain energy of molecules on their generated pose.
244
+
245
+ other methods: their docking score with generated pose (VinaScore) is better/similar to that of methods after energy minimization (VinaMin).
246
+
247
+ Fig. 5 further compares our models with TargetDiff. It shows the median VinaScore and VinaDock (generated and redocked poses, respectively) of all generated molecules for each target on the test set. The generated molecules from VoxBind $_{\sigma=0.9}$ have better (computational) affinity on $73\%$ of tested protein pockets.
248
+
249
+ Molecular properties. Table 1 also shows results on molecular properties. VoxBind achieves better QED and SA than diffusion-based models. The molecules generated by our models are particularly more diverse than baselines.
250
+
251
+ We note that our models capture better the distribution of number of atoms per molecules than the baselines. The autoregressive models generate molecules considerably smaller than the reference, while the diffusion model baselines tend to sample larger molecules. Our models achieve similar numbers as DecompDiff without the extra sampling assumptions. Unlike diffusion-based approaches, our model captures this distribution implicitly and does not require sampling the number of atoms beforehand.
252
+
253
+ We also compare models in terms of ring statistics on Fig. 4 (appendix): we show the histogram of number of rings per molecule (top), the histograms of ring sizes (i.e., number of atoms per ring) (mid) and the histograms of fraction of aromatic atoms per molecule (bottom) for all generated molecules from different methods. In all cases, our models capture reference ring properties more favourably than baselines.
254
+
255
+ Molecular structures. First, we analyze the strain energies of molecules (as defined by PoseCheck (Harris et al., 2023)). Fig. 6 shows the cumulative distribution function (CDF) of strain energies (on the raw generate poses) for molecules from different models. The reference set has median strain energy of $102.5\mathrm{kcal / mol}$ , while the three best performing models, Pocket2Mol, $\mathrm{VoxBind}_{\sigma = 0.9}$ and $\mathrm{VoxBind}_{\sigma = 1.0}$ have 205.8, 161.9 and $188.3\mathrm{kcal / mol}$ , respectively. Fig. 11(a) (appendix) shows the CDF of strain energies after local minimization is performed on each
256
+
257
+ ![](images/1fe2802e86c15402a4204e6dc808da1ed3220cd97a5679643b7f4bd03458fc34.jpg)
258
+ Figure 7. Number of steric clashes (lower is better) for the reference set and for molecules generated by each model.
259
+
260
+ molecule. The strain energies are largely reduced, but conclusions remain unchanged: VoxBind's molecules has lower strain energies than those generated by diffusion models. Additionally, Fig. 12 and Fig. 13 (appendix) show boxplots of strain energy per rotatable bonds, for the generated and minimized poses respectively, of molecules generated by different method.
261
+
262
+ Next, we measure the consistency of rigid fragments/substructures (e.g., all carbons in a benzene ring should be in the same plane). We measure such consistency the same way as Guan et al. (2023a). First, we optimize each molecule with Merck molecular force field (MMFF) (Halgren, 1996). Then, we break the molecules into non-rotable fragments and, for each fragment, compute the RMSD between atoms coordinates before and after optimization. Fig. 11(b) (appendix) shows the RMSD for rigid fragments of different sizes. VoxBind models generate rigid fragments that are more consistent than those of other approaches.
263
+
264
+ Finally, we compare how models capture different atomic bond distances. Table 2 (appendix) shows the Jensen-Shannon divergence (JSD) between models and the reference set, for different types of bonds. We observe that VoxBind achieves lower JSD in most bond types, particularly double bonds and aromatic bonds. Moreover, we compare how models capture different atomic bond distances. Finally, Fig. 14 shows the frequency for the following four types of protein-ligand interactions considered by PoseCheck.
265
+
266
+ Steric clashes. Fig. 7 shows the number of steric clashes per ligand (on their generated poses). Our models generate ligands with less clashes than other methods (with the exception of AR, which perform poorly in all other metrics). In fact, $\mathrm{VoxBind}_{\sigma = 0.9}$ and $\mathrm{VoxBind}_{\sigma = 1.0}$ have mean clash score of 5.1 and 5.3, while AR, Pocket2Mol, DiffSBD, TargetDiff and DecompDiff have mean of 4.2, 5.8, 15.4, 10.8 and 7.1 clashes, respectively. The reference set, for comparison, has mean clash score of 4.7.
267
+
268
+ Sampling time. VoxBind is more efficient at sampling than other methods, sometimes an order of magnitude
269
+
270
+ ![](images/5570aa85b2101b889a643a76808ac2d3d75949eba98b06d3dcc9451f1c5ca539.jpg)
271
+ Figure 8. Effect of different noise level on (a) Vina metrics (VinaScore, VinaMin, VinaDock, lower is better), (b) molecular properties metrics (QED, SA and diversity, higher is better) and (c) number of atoms per molecules. In this experiment, we generate 100 molecules for the 100 pockets on validation set.
272
+
273
+ ![](images/83d186d9ae227d4e77975c2b21d6bee31dbb1a8b7e3bb8cdbd68cd128ebf5b5c.jpg)
274
+
275
+ ![](images/fe87f12c9978ad26aa21e3d243f4600e7b530f221dac21e8cf4982f3fb5c2b78.jpg)
276
+
277
+ faster. VoxBind takes, on average, 492.2 seconds to generate 100 valid molecules with one A100 GPU, while Pocket2Mol, TargetDiff and DecompDiff requires 2,544, 3,428 and 6,189 seconds respectively (baselines running times taken from Guan et al. (2023b)).
278
+
279
+ Qualitative results. Fig. 4, and Fig. 15, Fig. 16 on appendix show examples of generated ligands from our model.
280
+
281
+ # 4.3. Ablation studies
282
+
283
+ Noise level. The noise level is an important hyperparameter of our model. As the noise level increases, it becomes easier to sample from the smoothed distribution. However, denoising becomes harder. To find the best empirical noise level, we train our model with different noise levels (all other hyperparameters are kept the same). Then, we compare the quality of the samples conditioned on pockets from the validation set. Fig. 8 shows how different metrics change as the noise level changes. We found that $\sigma = .9$ and $\sigma = 1.0$ achieve the best results on the validation set and chose to report results with those two levels.
284
+
285
+ Data augmentation. We also train a version of VoxBind without data augmentation. In terms of molecular properties (QED and SA), the performance is very similar. However, we see a big difference in terms of binding affinity metrics. Fig. 9 (appendix) shows the median VinaScore of VoxBind trained with and without data augmentation for each target (we use $\sigma = 0.9$ in this experiment). The model trained with data augmentation has better affinity score on the generated poses on $85\%$ of the targets.
286
+
287
+ # 5. Conclusion
288
+
289
+ we present VoxBind, a new score-based generative model for SBDD. We extended the neural empirical Bayes formalism and the walk-jump sampling algorithm to the conditional setting (cWJS) and show that our model outperforms previous work on an extensive number of computational metrics on a popular benchmark, while being faster to generate samples.
290
+
291
+ Our approach is flexible and allows us to adapt sampling
292
+
293
+ to many practical SBDD settings, without any additional training. For example, if we start with a ligand that binds to the pocket of interest, we can initialize the MCMC chain with a smooth version of that ligand instead of noise. $^{4}$
294
+
295
+ The flexibility and expressivity of 3D U-Nets comes at the cost of increased memory consumption. Therefore, the volume in 3D space that we can process is bounded by GPU memory. As shown empirically, our approach works well for drug-like molecule generation. However, more work (e.g., on data representation and architecture) needs to be done to scale generation to larger molecules like nucleic acids and proteins. Additional future work includes better modeling of synthetic accessibility or integrating pocket dynamics into the generation process.
296
+
297
+ # Impact statement
298
+
299
+ Structure-based drug design is an important component in modern drug discovery research and development. This is a very long and challenging endeavor that involves many steps. In this paper we propose a new pocket-conditional generative model, which deals with one of these steps. There is still a lot of work that need to be done to validate these kinds of models in practice (e.g., wet-lab experimental validation, clinical trials, etc). That been said, if successful, advances in this field can directly impact quality of human health. Like many other modern powerful technologies, we need to ensure that these models are deployed in ways that are safe, ethical, accountable and exclusively beneficial to society.
300
+
301
+ # Acknowledgements
302
+
303
+ The authors are grateful to Charlie Harris for assistance in running the Posecheck benchmark. We also thank the President Design team for helpful discussions and Genentech's HPC team for providing a reliable environment to train/analyse models.
304
+
305
+ # References
306
+
307
+ Adams, K. and Coley, C. W. Equivariant shape-conditioned generation of 3D molecules for ligand-based drug design. arXiv:2210.04893, 2022.
308
+ Amit, T., Nachmani, E., Shaharbany, T., and Wolf, L. Segdiff: Image segmentation with diffusion probabilistic models. arXiv:2112.00390, 2021.
309
+ Anderson, A. C. The process of structure-based drug design. Chemistry & biology, 2003.
310
+ Bai, Y., Mei, J., Yuille, A. L., and Xie, C. Are transformers more robust than cnns? NeurIPS, 2021.
311
+ Bajusz, D., Racz, A., and Heberger, K. Why is tanimoto index an appropriate choice for fingerprint-based similarity calculations? Journal of cheminformatics, 2015.
312
+ Batatia, I., Kovacs, D. P., Simm, G., Ortner, C., and Csányi, G. Mace: Higher order equivariant message passing neural networks for fast and accurate force fields. Neurips, 2022.
313
+ Bickerton, G. R., Paolini, G. V., Besnard, J., Muresan, S., and Hopkins, A. L. Quantifying the chemical beauty of drugs. Nature chemistry, 2012.
314
+ Blundell, T. L. Structure-based drug design. Nature, 1996.
315
+ Eberhardt, J., Santos-Martins, D., Tillack, A. F., and Forli, S. Autodock vina 1.2.0: New docking methods, expanded force field, and python bindings. JCIM, 2021.
316
+ Elfwing, S., Uchibe, E., and Doya, K. Sigmoid-weighted linear units for neural network function approximation in reinforcement learning. Neural Networks, 2018.
317
+ Ertl, P. and Schuffenhauer, A. Estimation of synthetic accessibility score of drug-like molecules based on molecular complexity and fragment contributions. Journal of cheminformatics, 2009.
318
+ Fink, T., Bruggesser, H., and Reymond, J.-L. Virtual exploration of the small-molecule chemical universe below 160 daltons. Angewandte Chemie International Edition, 2005.
319
+ Flam-Shepherd, D. and Aspuru-Guzik, A. Language models can generate molecules, materials, and protein binding sites directly in three dimensions as xyz, cif, and pdb files. arXiv:2305.05708, 2023.
320
+ Francoeur, P. G., Masuda, T., Sunseri, J., Jia, A., Iovanisci, R. B., Snyder, I., and Koes, D. R. Three-dimensional convolutional neural networks and a cross-docked data set for structure-based drug design. Journal of chemical information and modeling, 2020.
321
+
322
+ Frey, N. C., Berenberg, D., Kleinhenz, J., Hotzel, I., Lafrance-Vanasse, J., Kelly, R. L., Wu, Y., Rajpal, A., Ra, S., Bonneau, R., Cho, K., Loukas, A., Gligorijevic, V., and Saremi, S. Protein discovery with discrete walk-jump sampling. In ICLR, 2024.
323
+ Gebauer, N., Gastegger, M., and Schutt, K. T. Generating equilibrium molecules with deep neural networks. arXiv:1810.11347, 2018.
324
+ Gebauer, N., Gastegger, M., and Schütt, K. Symmetry-adapted generation of 3D point sets for the targeted discovery of molecules. In NeurIPS, 2019.
325
+ Geiger, M. and Smidt, T. E3nn: Euclidean neural networks. arXiv:2207.09453, 2022.
326
+ Gruver, N., Finzi, M., Goldblum, M., and Wilson, A. G. The Lie derivative for measuring learned equivariance. arXiv:2210.02984, 2022.
327
+ Guan, J., Qian, W. W., Peng, X., Su, Y., Peng, J., and Ma, J. 3D equivariant diffusion for target-aware molecule generation and affinity prediction. *ICLR*, 2023a.
328
+ Guan, J., Zhou, X., Yang, Y., Bao, Y., Peng, J., Ma, J., Liu, Q., Wang, L., and Gu, Q. DecompDiff: Diffusion models with decomposed priors for structure-based drug design. In ICML, 2023b.
329
+ Halgren, T. A. Merck molecular force field. i. basis, form, scope, parameterization, and performance of mmff94. Journal of computational chemistry, 1996.
330
+ Harris, C., Didi, K., Jamasb, A. R., Joshi, C. K., Mathis, S. V., Lio, P., and Blundell, T. Benchmarking generated poses: How rational is structure-based drug design with generative models? arXiv:2308.0741, 2023.
331
+ Hoogeboom, E., Satorras, V. G., Vignac, C., and Welling, M. Equivariant diffusion for molecule generation in 3D. In ICML, 2022.
332
+ Huang, L., Zhang, H., Xu, T., and Wong, K.-C. Mdm: Molecular diffusion model for 3D molecule generation. arXiv:2209.05710, 2022.
333
+ Hyvarinen, A. Estimation of non-normalized statistical models by score matching. JMLR, 2005.
334
+ Kingma, D. P. and Welling, M. Auto-encoding variational Bayes. In ICLR, 2014.
335
+ Köhler, J., Klein, L., and Noé, F. Equivariant flows: exact likelihood generative learning for symmetric densities. In ICML, 2020.
336
+ Landrum, G. Rdkit: Open-source cheminformatics software, 2016. URL https://github.com/rdkit/rdkit/releases/tag/Release_2016_09_4.
337
+
338
+ Li, L., Li, C., and Alexov, E. On the modeling of polar component of solvation energy using smooth gaussian-based dielectric function. Journal of Theoretical and Computational Chemistry, 2014.
339
+ Liu, M., Luo, Y., Uchino, K., Maruhashi, K., and Ji, S. Generating 3D molecules for target protein binding. arXiv, 2022.
340
+ Long, S., Zhou, Y., Dai, X., and Zhou, H. Zero-shot 3d drug design by sketching and generating. NeurIPS, 2022.
341
+ Loshchilov, I. and Hutter, F. Decoupled weight decay regularization. In ICLR, 2019.
342
+ Lugmayr, A., Danelljan, M., Romero, A., Yu, F., Timofte, R., and Van Gool, L. Repaint: Inpainting using denoising diffusion probabilistic models. In CVPR, 2022.
343
+ Luo, S., Guan, J., Ma, J., and Peng, J. A 3D generative model for structure-based drug design. *NeurIPS*, 2021.
344
+ Luo, Y. and Ji, S. An autoregressive flow model for 3D molecular geometry generation from scratch. In ICLR, 2022.
345
+ Lyu, J., Wang, S., Balius, T. E., Singh, I., Levit, A., Moroz, Y. S., O'Meara, M. J., Che, T., Algaa, E., Tolmachova, K., et al. Ultra-large library docking for discovering new chemotypes. Nature, 2019.
346
+ Miyasawa, K. An empirical Bayes estimator of the mean of a normal population. Bull. Inst. Internat. Statistics, 1961.
347
+ Morris, C., Ritzert, M., Fey, M., Hamilton, W. L., Lenssen, J. E., Rattan, G., and Grohe, M. Weisfeiler and leman go neural: Higher-order graph neural networks. In AAAI, 2019.
348
+ O'Boyle, N. M., Banck, M., James, C. A., Morley, C., Vandermeersch, T., and Hutchison, G. R. Open babel: An open chemical toolbox. Journal of cheminformatics, 2011.
349
+ Orlando, G., Raimondi, D., Duran-Romana, R., Moreau, Y., Schymkowitz, J., and Rousseau, F. Pyuul provides an interface between biological structures and deep learning algorithms. Nature communications, 2022.
350
+ Peng, X., Luo, S., Guan, J., Xie, Q., Peng, J., and Ma, J. Pocket2mol: Efficient molecular sampling based on 3D protein pockets. In ICML, 2022.
351
+ Pinheiro, P. O., Rackers, J., Kleinhenz, J., Maser, M., Mahmood, O., Watkins, A. M., Ra, S., Sresht, V., and Saremi, S. 3D molecule generation by denoising voxel grids. In NeurIPS, 2023.
352
+
353
+ Powers, A. S., Yu, H. H., Suriana, P., Koodli, R. V., Lu, T., Paggi, J. M., and Dror, R. O. Geometric deep learning for structure-based ligand design. ACS Central Science, 2023.
354
+ Pozdnyakov, S. N. and Ceriotti, M. Incompleteness of graph convolutional neural networks for points clouds in three dimensions. arXiv:2201.07136, 2022.
355
+ Ragoza, M., Masuda, T., and Koes, D. R. Learning a continuous representation of 3D molecular structures with deep generative models. In Neurips, Structural Biology workshop, 2020.
356
+ Ragoza, M., Masuda, T., and Koes, D. R. Generating 3D molecules conditional on receptor binding sites with deep generative models. Chemical science, 2022.
357
+ Rappe, A. K., Casewit, C. J., Colwell, K., Goddard III, W. A., and Skiff, W. M. Uff, a full periodic table force field for molecular mechanics and molecular dynamics simulations. Journal of the American chemical society, 1992.
358
+ Rezende, D. and Mohamed, S. Variational inference with normalizing flows. In ICML, 2015.
359
+ Robbins, H. E. An empirical Bayes approach to statistics. In Proc. 3rd Berkeley Symp. Math. Statist. Probab., 1956, 1956.
360
+ Rombach, R., Blattmann, A., Lorenz, D., Esser, P., and Ommer, B. High-resolution image synthesis with latent diffusion models. In CVPR, 2022.
361
+ Ronneberger, O., Fischer, P., and Brox, T. U-Net: Convolutional networks for biomedical image segmentation. In MICCAI, 2015.
362
+ Rooklin, D., Wang, C., Katigbak, J., Arora, P. S., and Zhang, Y. Alphaspace: Fragment-centric topographical mapping to target protein-protein interaction interfaces. Journal of chemical information and modeling, 2015.
363
+ Rozenberg, E., Rivlin, E., and Freedman, D. Structure-based drug design via semi-equivariant conditional normalizing flows. In ICLR, Machine Learning for Drug Discovery workshop, 2023.
364
+ Sachs, M., Leimkuhler, B., and Danos, V. Langevin dynamics with variable coefficients and nonconservative forces: from stationary states to numerical methods. Entropy, 2017.
365
+ Saharia, C., Chan, W., Chang, H., Lee, C., Ho, J., Salimans, T., Fleet, D., and Norouzi, M. Palette: Image-to-image diffusion models. In SIGGRAPH, 2022a.
366
+
367
+ Saharia, C., Chan, W., Saxena, S., Li, L., Whang, J., Denton, E. L., Ghasemipour, K., Gontijo Lopes, R., Karagol Ayan, B., Salimans, T., Ho, J., Fleet, D. J., and Norouzi, M. Photorealistic text-to-image diffusion models with deep language understanding. In NeurIPS, 2022b.
368
+ Saharia, C., Ho, J., Chan, W., Salimans, T., Fleet, D. J., and Norouzi, M. Image super-resolution via iterative refinement. PAMI, 2022c.
369
+ Saremi, S. and Hyvarinen, A. Neural empirical Bayes. JMLR, 2019.
370
+ Saremi, S., Srivastava, R. K., and Bach, F. Universal smoothed score functions for generative modeling. arXiv:2303.11669, 2023.
371
+ Satorras, V. G., Hoogeboom, E., and Welling, M. E (n) equivariant graph neural networks. In ICML, 2021.
372
+ Saxena, S., Herrmann, C., Hur, J., Kar, A., Norouzi, M., Sun, D., and Fleet, D. J. The surprising effectiveness of diffusion models for optical flow and monocular depth estimation. arXiv:2306.01923, 2023.
373
+ Schneuing, A., Du, Y., Harris, C., Jamasb, A., Igashov, I., Du, W., Blundell, T., Lio, P., Gomes, C., Welling, M., et al. Structure-based drug design with equivariant diffusion models. arXiv:2210.13695, 2022.
374
+ Skalic, M., Jiménez, J., Sabbadin, D., and De Fabritiis, G. Shape-based generative modeling for de novo drug design. Journal of chemical information and modeling, 2019.
375
+ Sohl-Dickstein, J., Weiss, E., Maheswaranathan, N., and Ganguli, S. Deep unsupervised learning using nonequilibrium thermodynamics. In ICML, 2015.
376
+ Steinegger, M. and Söding, J. MMseqs2 enables sensitive protein sequence searching for the analysis of massive data sets. Nature biotechnology, 2017.
377
+ Thomas, M., Bender, A., and de Graaf, C. Integrating structure-based approaches in generative molecular design. Current Opinion in Structural Biology, 2023.
378
+ Townshend, R. J., Vogele, M., Suriana, P., Derry, A., Powers, A., Laloudakis, Y., Balachandar, S., Jing, B., Anderson, B., Eismann, S., et al. Atom3D: Tasks on molecules in three dimensions. NeurIPS, 2020.
379
+ Vignac, C., Osman, N., Toni, L., and Frossard, P. Midi: Mixed graph and 3D denoising diffusion for molecule generation. *ICLR*, MLDD workshop, 2023.
380
+ Wang, L., Bai, R., Shi, X., Zhang, W., Cui, Y., Wang, X., Wang, C., Chang, H., Zhang, Y., Zhou, J., et al. A pocket-based 3D molecule generative model fueled by experimental electron density. Scientific reports, 2022a.
381
+
382
+ Wang, M., Hsieh, C.-Y., Wang, J., Wang, D., Weng, G., Shen, C., Yao, X., Bing, Z., Li, H., Cao, D., et al. Relation: A deep generative model for structure-based de novo drug design. Journal of Medicinal Chemistry, 2022b.
383
+ Wang, Y., Elhag, A. A., Jaitly, N., Susskind, J. M., and Bautista, M. A. Generating molecular conformer fields. arXiv:2311.17932, 2023.
384
+ Weiler, M., Geiger, M., Welling, M., Boomsma, W., and Cohen, T. S. 3D steerable cnns: Learning rotationally equivariant features in volumetric data. *NeurIPS*, 2018.
385
+ Xu, K., Hu, W., Leskovec, J., and Jegelka, S. How powerful are graph neural networks? *ICLR*, 2019.
386
+ Xu, M., Powers, A., Dror, R., Ermon, S., and Leskovec, J. Geometric latent diffusion models for 3D molecule generation. In ICML, 2023.
387
+ Zhang, Z., Min, Y., Zheng, S., and Liu, Q. Molecule generation for target protein binding with structural motifs. In ICLR, 2023.
388
+
389
+ # A. Additional implementation details
390
+
391
+ # A.1. Voxelized molecules
392
+
393
+ We represent molecules as voxelized atomic densities. We follow the same approach as (Pinheiro et al., 2023), as it has been shown to work well in practice for drug-like molecule generation. We apply the same approach for ligands and protein pockets. First, we convert each atom (of each molecule) into 3D Gaussian-like densities:
394
+
395
+ $$
396
+ V _ {a} (d, r _ {a}) = \exp \left(- \frac {d ^ {2}}{(. 9 3 \cdot r _ {a}) ^ {2}}\right), \tag {10}
397
+ $$
398
+
399
+ where $V_{a}$ is defined as the fraction of occupied volume by atom $a$ of radius $r_a$ at distance $d$ from its center. We use radius $r_a = .5$ for all atom on ligand molecules (as in (Pinheiro et al., 2023)) and use the Van der Waals radii for pocket atoms. Then, we compute the occupancy of each voxel in the grid:
400
+
401
+ $$
402
+ \operatorname {O c c} _ {i, j, k} = 1 - \prod_ {n = 1} ^ {N _ {a}} \left(1 - V _ {a _ {n}} \left(\| C _ {i, j, k} - x _ {n} \|, r _ {a _ {n}}\right)\right), \tag {11}
403
+ $$
404
+
405
+ where $\{a_{n}\}_{n = 1}^{N_{a}}$ are the atoms of the molecule, $C_{i,j,k}$ are the coordinates (i,j,k) in the grid and $x_{n}$ is the coordinates of the center of atom $n$ (Li et al., 2014). Each atom type occupy a different channel grid (similar to R,G,B channels of images) and they take values between 0 and 1. We use a grid with $64^3$ voxels with resolution of .25A per voxel. We model hydrogens implicitly and consider seven chemical elements for ligands (C, O, N, S, F, Cl and P) and four for pockets (C, O, N, S). This results in voxel grids with dimensions $d_{x} = 7\times 64\times 64\times 64$ and $d_{z} = 4\times 64\times 64\times 64$ for ligand and protein protein pockets, respectively.
406
+
407
+ Every ligand and its pocket pair are centered around the center of the mass of the ligand. During training, each training sample is augmented random augmentation (applied to both ligand and pocket). These augmentations are made of random translation (uniform value between [-1,1] on 3D coordinates) and rotation (uniform value between $[0,2\pi)$ on three Euler angles). These augmentations are applied on the point cloud before voxelizing them. We use the python package PyUUL (Orlando et al., 2022) to generate the voxel grids from the raw molecules (.sdf or .pdb format).
408
+
409
+ # A.2. Sampling
410
+
411
+ The walk-jump sampling approach is very flexible and allows us to configure sampling in different ways. For example, we can choose the number of walk steps between jumps, the maximum number of walk steps per chain or the number of chains run in parallel. Different sampling hyperparameters can change the statistics of samples, e.g., we increase sampling speed and reduce diversity if we reduce the number of walk steps between jumps.
412
+
413
+ Therefore, we decided to fix a set of sampling hyperparameters for benchmark purposes. In all our experiments we generate samples in the following way (100 chains in parallel): (i) initialize a chain $y_0$ (from noise and a pocket) and walk 400 Langevin MCMC warm-up steps to get to $y_{400}$ , (ii) create a batch (size 100) with copies of the tensor $y_{400}$ (iii) walk 100 steps then jump to estimate a clean molecule at step $\hat{x}_{500}$ , (iv) return to step (i) and repeat until generate 100 valid samples. When sampling conditioned on pocket and ligand, we take 50 warm-up steps and 50 walk steps. We found this setting to provide a good trade-off in terms of performance/speed on validation set. However, it is by no means optimal and results can possibly be further improved by finding a better sampling recipe.
414
+
415
+ We extract the atomic coordinates from the generated voxelized grids following the same approach as (Pinheiro et al., 2023): we set all voxel values less than 0.1 to 0 then run a peak finding algorithm to get the 3D coordinates of each atom. The identity of the atom is the channel in the voxel grid. Once we have the set of atoms (types and coordinates), we follow previous work and use OpenBabel (O'Boyle et al., 2011) to assign bonds to the atoms.
416
+
417
+ The qualitative samples in this paper are sampled with 400 warm-up step followed by 100 steps for 10,000 steps on a single MCMC chain.
418
+
419
+ ![](images/cf92967815175f2bec33ebba7ed2617eff94d43b6fd2c9bf1872e6176ccb0aa1.jpg)
420
+ B. Additional results
421
+ Figure 9. Median VinaScore of all generated molecules for each target on the test set (sorted by VoxBind's score). We compare VoxBind trained with and without data augmentation with $\sigma = 0.9$ .
422
+
423
+ ![](images/8e3945269df726130c90bb8deb59629a71c8776e14eef559c70c4bfa02fd2d32.jpg)
424
+
425
+ ![](images/9f0fb8baaf2c3d163c1f7b9a44e93a349bc12f762cde41ebf94a9561d23bf84c.jpg)
426
+
427
+ ![](images/ae7a45e89b6e18f47ccc86c1d17af9cad07c4e4fd316ef22f330b735e79a1605.jpg)
428
+ Figure 10. Histograms showing (top) distributions ring sizes for all rings, (mid) distributions of number of rings per molecule and (bottom) distributions of fraction of aromatic atoms per molecule in all generated molecules from different methods. The underlying distribution from the reference is also shown in each plot.
429
+
430
+ Table 2. Jensen-Shannon divergence (↓) between reference and generated molecules' distributions of bond distances. The symbols “-”, “=”, “:” represent single bond, double bond and aromatic bond, respectively. For each metric, we **bold** and **underline** the best and second best methods, respectively.
431
+
432
+ <table><tr><td></td><td>C-C</td><td>C=C</td><td>C-N</td><td>C=N</td><td>C-O</td><td>C=O</td><td>C:C</td><td>C:N</td></tr><tr><td>AR</td><td>.609</td><td>.620</td><td>.474</td><td>.635</td><td>.492</td><td>.558</td><td>.451</td><td>.552</td></tr><tr><td>Pocket2Mol</td><td>.496</td><td>.561</td><td>.416</td><td>.629</td><td>.454</td><td>.516</td><td>.416</td><td>.487</td></tr><tr><td>TargetDiff</td><td>.369</td><td>.505</td><td>.363</td><td>.550</td><td>.421</td><td>.461</td><td>.263</td><td>.235</td></tr><tr><td>DecompDiff†</td><td>.359</td><td>.537</td><td>.344</td><td>.584</td><td>.376</td><td>.374</td><td>.251</td><td>.269</td></tr><tr><td>VoxBindσ=0.9</td><td>.372</td><td>.528</td><td>.351</td><td>.528</td><td>.400</td><td>.326</td><td>.215</td><td>.186</td></tr><tr><td>VoxBindσ=1.0</td><td>.357</td><td>.533</td><td>.354</td><td>.418</td><td>.354</td><td>.335</td><td>.210</td><td>.191</td></tr></table>
433
+
434
+ ![](images/55d669e0ebb3413a89cfacac7b96a5083d26e19c28d7d0019cf68b392be2ba18.jpg)
435
+ (a)
436
+
437
+ ![](images/b9b824fb36df5c0e4ad5ed0f7836b218ee069f9f87f1fdceeaa6b6299d64d9e9.jpg)
438
+ (b)
439
+
440
+ ![](images/63285f5663c1533c6dfe73274930f2c93d1c9d84f2b4a97c97a2c0e6d67ef601.jpg)
441
+ Figure 11. (a) The cumulative distribution function of strain energy of molecules after small force-field relaxation. As expected, the strain energies in this setting are much lower than with the raw generated poses. (b) Median RMSD $(\downarrow)$ between fragments of generated molecules before and after force-field optimization.
442
+ Figure 12. Boxplots of strain energies (lower is better) of generated molecules (on their generated poses) per number of rotatable bonds for all methods. Box color shows median strain value.
443
+
444
+ ![](images/564b40cb26e6a3d8ef309fd56540cd51b6da03a64941bc69c721ad8be1226f6c.jpg)
445
+ Figure 13. Boxplots of strain energies (lower is better) of generated molecules (after local minimization) per number of rotatable bonds for all methods. Box color shows median strain value.
446
+
447
+ ![](images/c1dd1358286637f93848a312bb0785b819f4411433511909e9cb4103e51d6fa1.jpg)
448
+
449
+ ![](images/076ba104d003766a31d35a4defd59051688862255c0de2e6808f5a7de7c709ce.jpg)
450
+
451
+ Figure 14. Protein-ligand interactions in generated poses (green) and redocked poses (orange). The frequency of (a) hydrogen bond acceptors, (b) hydrogen bond donors, (c) Van der Waals contacts and (d) hydrophobic interactions are shown.
452
+ ![](images/09ad6ed9f683c9beaf455c109e1355292f5b570b0b9e9081a2776b29debe25a7.jpg)
453
+ generated redocked
454
+
455
+ ![](images/00501fe36dd49ce2a88d3d4573096c96dad48c5fbe1186967b9edfbeac23b3bf.jpg)
456
+
457
+ ![](images/0caaa367085d42e95b3f7adeb1c153cdb5823d6cb1fcdfeba2e31951afd16c99.jpg)
458
+ Figure 15. Example of generated ligands $\hat{x}_{i,k}$ given pocket $\xi_{i}$ . Each row represents a single chain of samples for a given protein pocket (2i2z, $\log x$ , 3u57, 4j1c from top to bottom). The samples from each row are generated from the same MCMC chain. The provided ground-truth ligands are shown on the last column.
459
+
460
+ ![](images/ecb9c4f5ebe15853d68f09b924f7defbd7feca73e382d24c7ad782414d249230.jpg)
461
+ Figure 16. Example of generated ligands $\hat{x}_{i,k}$ given pocket $\xi_{i}$ . Each row represents a single chain of samples for a given protein pocket (5aks, 5crz, 511v, 1e8h from top to bottom). The samples from each row are generated from the same MCMC chain. The provided ground-truth ligands are shown on the last column.
2024/Structure-based drug design by denoising voxel grids/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:71f5fd24f2ba1098a3e934fdc5eaeb88d84e9b31e894150549c76a11f1c62444
3
+ size 1591792
2024/Structure-based drug design by denoising voxel grids/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/Structured Chemistry Reasoning with Large Language Models/97833c28-d860-4d9c-8354-3f2713827dbf_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/Structured Chemistry Reasoning with Large Language Models/97833c28-d860-4d9c-8354-3f2713827dbf_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/Structured Chemistry Reasoning with Large Language Models/97833c28-d860-4d9c-8354-3f2713827dbf_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b0a1ca6b6504113e540a944687593255ebb4606940a7978f8b855b8d1c5a0548
3
+ size 3282117
2024/Structured Chemistry Reasoning with Large Language Models/full.md ADDED
@@ -0,0 +1,395 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Structured Chemistry Reasoning with Large Language Models
2
+
3
+ Siru Ouyang<sup>1</sup> Zhuosheng Zhang<sup>2</sup> Bing Yan<sup>3</sup> Xuan Liu<sup>1</sup> Yejin Choi<sup>4,5</sup> Jiawei Han<sup>1</sup> Lianhui Qin<sup>5,6</sup>
4
+
5
+ # Abstract
6
+
7
+ Large Language Models (LLMs) excel in diverse areas, yet struggle with complex scientific reasoning, especially in the field of chemistry. Different from the simple chemistry tasks (e.g., molecule classification) addressed in previous studies, complex chemistry problems require not only vast knowledge and precise calculation, but also compositional reasoning about rich dynamic interactions of different concepts (e.g., temperature changes). Our study shows that even advanced LLMs, like GPT-4, can fail easily in different ways. Interestingly, the errors often stem not from a lack of domain knowledge within the LLMs, but rather from the absence of an effective reasoning structure that guides the LLMs to elicit the right knowledge, incorporate the knowledge in step-by-step reasoning, and iteratively refine results for further improved quality. On this basis, we introduce STRUCTCHEM, a simple yet effective prompting strategy that offers the desired guidance and substantially boosts the LLMs' chemical reasoning capability. Testing across four chemistry areas—quantum chemistry, mechanics, physical chemistry, and kinetics—STRUCTCHEM substantially enhances GPT-4's performance, with up to $30\%$ peak improvement. Our analysis also underscores the unique difficulties of precise grounded reasoning in science with LLMs, highlighting a need for more research in this area. Code is available at https://github.com/ozyyshr/StructChem.
8
+
9
+ # 1. Introduction
10
+
11
+ Artificial intelligence (AI) holds the promise of transforming the field of chemistry (Baum et al., 2021), impacting
12
+
13
+ *Equal contribution 1University of Illinois Urbana-Champaign 2Shanghai Jiao Tong University 3New York University 4University of Washington 5Allen Institute for AI 6University of California SanDiego. Correspondence to: Lianhui Qin <lianhui@ucsd.edu>.
14
+
15
+ Proceedings of the $41^{st}$ International Conference on Machine Learning, Vienna, Austria. PMLR 235, 2024. Copyright 2024 by the author(s).
16
+
17
+ ![](images/fa62b7b6f395b0428ac5ba7165e6dd0df98bf109374a96153754b89c8642c8fa.jpg)
18
+ Figure 1. Proportions $(\%)$ of four error types (#errors / #all-cases) for GPT-4 and STRUCTCHEM. STRUCTCHEM substantially reduces the reasoning error.
19
+
20
+ various sectors including industrial production (Öztürk et al., 2020), pharmaceuticals (Singhal et al., 2023), and education (Graulich et al., 2022). Recent studies have shown promising results of large language models (LLMs) solving simple chemistry problems (Figure 2(a)), such as molecule classification (Edwards et al., 2022) and property prediction (Yang et al., 2019; Feinberg et al., 2018).
21
+
22
+ On the other hand, however, more complex chemistry reasoning problems still pose significant challenges to frontier LLMs like GPT-4. As shown in Figure 2(b), a complex problem requires not only understanding individual concepts (e.g., molecule property) as in previous tasks, but rather their rich dynamic interactions in different contexts, involving extensive domain knowledge (e.g., chemical formulae $^{1}$ ), precise scientific computing, and compositional step-by-step reasoning. As a result, LLMs are prone to different forms of errors when solving these problems, such as applying incorrect knowledge, making miscalculations, or following flawed reasoning processes, as illustrated in Figure 2(c).
23
+
24
+ Interestingly, as shown in Figure 1 and discussed in Section 5, LLMs oftentimes have encoded necessary knowledge for a given chemistry problem. The key shortfall, however, lies in the absence of a sophisticated reasoning structure that helps elicit the relevant knowledge from the LLMs, and guides them to perform precise step-by-step reasoning with the knowledge.
25
+
26
+ Motivated by this, we introduce STRUCTCHEM, a sim
27
+
28
+ ![](images/9d39b159cff05410422690ca519c8218e7eea46b3a2ee0c38530fd67926f5c10.jpg)
29
+ Figure 2. The illustration of (a) simple chemistry problem, (b) complex chemistry problem sampled from SciBench (Wang et al., 2023a), and (c) the zero-shot response from GPT-4 with chain-of-thought (CoT) (Wei et al., 2022) for the complex chemistry problem. The error types are illustrated corresponding to the definition in Figure 1: (I) irrelevant knowledge, (II) incorrect knowledge, (III) reasoning error, (IV) calculation error. We randomly select 100 error cases of GPT-4 (CoT) in SciBench.
30
+
31
+ ple yet effective reasoning strategy providing structured guidance for LLMs to solve complex chemistry problems. STRUCTCHEM explicitly decomposes the reasoning into three phases: In the first phase, the LLM focuses on generating essential chemical formulae needed for the problem. The formulae knowledge provides a solid basis for the LLM to do grounded reasoning in subsequent phases. The second phase involves the LLM conducting a detailed, step-by-step reasoning based on the identified formulae, leading to a preliminary answer to the problem. The third phase then performs confidence-based review-and-refinement for the final answer. Crucially, the refinement process differs from recent self-verification methods (Madaan et al., 2023; Weng et al., 2022) which rely solely on prompting and can sometimes yield unreliable results (Section 5). Instead, our approach explicitly estimates a confidence score for each revision, and iteratively enhances the confidence level towards a final high-quality answer.
32
+
33
+ We conduct extensive experiments on four datasets of complex chemistry problems from different subfields, namely, quantum chemistry, quantum mechanics, physical chemistry, and chemistry kinetics. Experiments show that STRUCTCHEM greatly reduces the reasoning errors (Figure 1). It boosts the chemistry reasoning capability of advanced LLMs, including GPT-3.5 and GPT-4, leading to an average improvement of $8\%$ and a $30\%$ absolute improvement at maximum. In addition, using the generated reasoning from our approach with GPT-4, we finetune smaller LMs (Llama-2-13B and Vicuna-13B) and obtain strong improve
34
+
35
+ ment. This further validates STRUCTCHEM enables LLMs to generate high-quality chemistry reasoning. Our analysis studies the error patterns of LLMs on chemistry reasoning, which reveals the unique challenges in scientific problems and motivates future research towards more grounded and precise reasoning.
36
+
37
+ # 2. Related Work
38
+
39
+ # 2.1. Large Language Models for Chemistry
40
+
41
+ The emergence of LLMs has provided new possibilities in scientific domains (Ouyang et al., 2023), where a bunch of new benchmarks (Lu et al., 2022; Chen et al., 2023b) have emerged. As an important and challenging branch of scientific domains, chemistry-related research serges with the utilization of LLMs (Fang et al., 2023). Specifically, ChemCrow (Bran et al., 2023) is a general model that integrates multiple existing tools with LLMs to solve various downstream tasks. LLMs are also used to better the performance of specific chemistry applications, such as reaction prediction (Zhong et al., 2023; 2024), drug discovery (Edwards et al., 2023), and SMILES identification (Edwards et al., 2021). However, most previous works often target problems that require a single-hop retrieval of domain knowledge, without complex reasoning steps inherent. For example, find and list all the chemical entities in a given sentence. While the previous models excel in these approximate knowledge retrieval tasks, improving the abilities of LLMs to solve complex chemistry problems is still in a nascent stage, with
42
+
43
+ ![](images/0efdfea02a1f05d88a46eab06ddc3c825d678201c30b61df3debf438d969c3f4.jpg)
44
+ Figure 3. An in-depth illustration of the STRUCTCHEM framework. When tackling a chemistry problem, we first utilize a structured instruction approach, resulting in "formulae generation" $\mathcal{F}_0$ and "step-by-step reasoning" $\mathcal{R}_0$ . These generated segments are then fed to a thorough "confidence-based review-and-refinement" as initial input. The process is repeated $n$ times til getting reviewed formulae $\mathcal{F}_n$ and reasoning $\mathcal{R}_n$ . Each iteration is guided by incorporating confidence scores $C_i$ . $\rightarrow$ in "iterative review and refinement" denote the choice made for each iteration. Full instructions can be found in Figure 14.
45
+
46
+ SciBench (Wang et al., 2023a) being the initial benchmark.
47
+
48
+ # 2.2. Large Language Models for Reasoning
49
+
50
+ Engaging LLMs in a step-by-step thinking process has demonstrated enhanced performance in intricate reasoning tasks compared to the conventional single-step answer prediction. A typical step-by-step prompting approach is called chain-of-thought (CoT) (Wei et al., 2022). CoT directs the model to articulate the step-by-step thinking process as rationales prior to producing the final answer. Following this line, several optimized endeavors are made towards making LLMs better task solvers for more complicated problems. These efforts encompass automated demonstration construction (Zhang et al., 2023), improving self-consistency (Wang et al., 2023b), utilizing the structure of prompts (Yao et al., 2023; Besta et al., 2024), adopting iterative prompting (Zhou et al., 2023; Wang et al., 2022), and ensembling (Sun et al., 2023; Fu et al., 2023). The original focus of CoT approaches has primarily centered around arithmetic, commonsense, and logical reasoning problems (Wei et al., 2022; Kojima et al., 2022; Zhang et al., 2023). Recent investigations have sought to broaden the application of CoT in scientific domains (Lu et al., 2022; Wang et al., 2023a). Closely related to ours are works in the research line of modular prompting (Khot et al., 2023; Patel et al., 2022), which decomposes a complex task into several sub-tasks. The micro-level
51
+
52
+ decomposition varies from task to task. Different from them, we identified two fundamental components for solving complex chemistry problems as a general paradigm at a macro level. Another related line is the feedback mechanism (Madaan et al., 2023) that leverages feedback from LLMs before the final output. In contrast, we design a confidence-based review-and-refinement strategy and employed another LLM to provide feedback for multi-model collaboration. Notably, this approach will greatly alleviate the drawbacks of previous feedback frameworks, where correct answers risk being swayed by unfaithful feedback.
53
+
54
+ # 3. STRUCTCHEM Reasoning
55
+
56
+ Solving complex chemistry problems not only necessitates recognizing domain knowledge, such as formulae and calculations but also demands the ability to construct a careful step-by-step reasoning process based on the relevant knowledge. Existing popular reasoning methods, such as CoT and self-consistency, though exhibit notable strengths, often fall short in accurately identifying the related chemistry formulae and are susceptible to errors in reasoning steps, as expounded in Section 1.
57
+
58
+ To address the challenges above, we propose STRUCTCHEM. On a high level, STRUCTCHEM consists of three stages: (i) formulae generation that offers the basis for subsequent
59
+
60
+ grounded reasoning; (ii) step-by-step reasoning that makes multi-step derivations with the identified formulae for a preliminary answer; and (iii) confidence-based review-and-refinement that steers LLMs to progressively revise the previous phases for increasing confidence, leading to the final high-confidence answer. Figure 3 the overall framework.
61
+
62
+ # 3.1. Formulae Generation
63
+
64
+ Formulae serve as organized and abstracted representations of chemistry knowledge (Lachmy et al., 2022). When humans tackle intricate problems, the initial phase often involves seeking relevant knowledge as a foundation, especially for the field of chemistry (Taskin & Bernholt, 2014). Therefore, rather than directly starting to address the question, we seek formulae to solve the problem first. Given the fact that LLMs have indeed encoded much chemistry knowledge, it is often effective to elicit the knowledge from the parametric storage (Petroni et al., 2019). Therefore, STRUCTCHEM first instructs the LLM to articulate relevant formulae for task resolution, exemplified by formulae like "equilibrium constant" in Figure 4. To enhance the utility of these formulae in subsequent reasoning processes, we instruct the LLM not only to recite them but also to provide explanations for the variables they contain. For instance, as illustrated in Figure 2, the LLM needs to elucidate symbol $[\ast]$ as the molar concentrations.
65
+
66
+ # 3.2. Step-by-step Reasoning
67
+
68
+ Grounded on the generated formulae, the LLMs can then reason about the solution to the original question. To induce LLMs for more precise reasoning and calculation processes, we adopt program-of-thoughts (PoT) (Chen et al., 2023a) as demonstrated in Figure 5. The detailed calculation process is translated into Python codes, accompanied by the annotation lines for reasoning. Concretely, we feed the problem and the structured instruction into an LLM $\mathcal{M}$ as shown in the top of Figure 3. The generated results of this stage are formalized as $S_0 = (\{\mathcal{F}_0,C_0^f\} ,\{\mathcal{R}_0,C_0^r\})$ where $\mathcal{F}_0 = \{f_1,\dots,f_n\}$ denotes the formulae collected from Sec 3.1. $f_{n}$ is the $n$ -th formula that is related. Similarly, $\mathcal{R}_0$ denotes the reasoning process. The output samples of $\mathcal{F}_0$ and $\mathcal{R}_0$ could be found in Figure 4 and Figure 5. $C_0^f$ and $C_0^r$ are the confidence scores for each part that is going to be mentioned Sec 3.3.
69
+
70
+ # 3.3. Confidence-based Review-and-Refinement
71
+
72
+ The generated formulae and step-by-step reasoning are not always error-free. The cumulative errors in the formulae generation or step-by-step reasoning process can amplify and propagate throughout the entire generation, leading to wrong answers. Inspired by recent works of iterative prompting (Wang et al., 2022) and multi-model collaboration (Zheng et al., 2023), we employ the same LLM to conduct iteratively review-and-refine the previous iterations
73
+
74
+ # Instruction for formulae generation
75
+
76
+ Firstly, for "formulae retrieval", you need to identify the formulae explicitly and implicitly entailed in the problem context, together with the necessary explanations for variables in the formulae.
77
+
78
+ # Example
79
+
80
+ [Formula 1] $2N_{2}(g) + O_{2}(g)\rightarrow 2N_{2}O(g)$
81
+ [Formula 2] $K_{c} = \frac{[N_{2}O]^{a}}{([N_{2}]^{b}\times [O_{2}]^{c})}$ where $a,b,c$ are the coefficients of different matters and $[\star ]$ is the molarity of $\star$
82
+ [Formula 3] $M = \frac{n}{V},$ where $n$ is the mole, and $V$ is the volume in terms of liters.
83
+
84
+ Figure 4. Instruction for formulae generation (part of the structured instruction in Figure 3) and the output for problem in Figure 2.
85
+
86
+ # Instruction for reasoning process
87
+
88
+ Secondly, there is a "reasoning process" where you are required to reason step by step based on the identified formulae and problem context. Answer the question by implementing a solver function "def solver():" in Python.
89
+
90
+ # Example
91
+
92
+ def solver():
93
+
94
+ Based on [Formulae 3], calculate the molarity of gases entailed in the problem:
95
+
96
+ $$
97
+ N 2 O = 2. 0 0 / 2. 0 0 = 1, O 2 = 2. 5 0 / 2. 0 0 = 1. 2 5, \dots
98
+ $$
99
+
100
+ Calculate for [Formulae 2]
101
+
102
+ $$
103
+ a = 1, b = 2, c = 1
104
+ $$
105
+
106
+ ···
107
+
108
+ Figure 5. Instruction for reasoning process (part of the structured instruction in Figure 3) and the output for problem in Figure 2.
109
+
110
+ of generation. In each iteration, the LLM is instructed to revise the formulae and reasoning steps from the previous iteration.
111
+
112
+ During the review process, we found that there are chances when correct answers are swayed by incorrect ones after revision. This phenomenon echoes the recent findings (Stechly et al., 2023; Huang et al., 2024) questioning the correction ability of LLMs existing in prevalent works such as self-consistency (Wang et al., 2023b) and self-verification (Weng et al., 2022). To fix this, we estimate a confidence score $C_i$ on the revision process. Only a high-confidence revision is accepted for further refinement in the next iteration. The confidence assessment ensures each iteration makes meaningful progress towards final answers.
113
+
114
+ Specifically, we prompt the LLM to provide confidence scores $C_i$ on a scale of [0, 1] for the $i$ -th iteration. The review process starts with the generated formulae $\{\mathcal{F}_0, C_0^f\}$ , where $C_0^f$ is the initial score for formulae generation. During the iterative review process, we leverage the same LLM to judge whether the collected formulae are correct with the confidence score $C_i^f$ of its own prediction. Formulae with
115
+
116
+ Algorithm 1 Confidence-based Review-and-Refinement
117
+ Input: $S_0 = (\mathcal{F}_0, \mathcal{R}_0)$ , initial confidence score $C_0^f$ and $C_0^r$
118
+ LLM $\mathcal{M}$ , prompts $\{p_{rev}, p_{gen}\}$ , maximum iteration number $n$
119
+ Output: Final answer to the problem $P$ $\mathcal{F}_0 = \{f_1, \dots, f_n\}$ , $\mathcal{R}_0 = \mathcal{R}_0$
120
+ // initialize maximum confidence scores for iteration
121
+ $max_f \gets C_0^f$ , $max_r \gets C_0^r$
122
+ // review for collected formulae
123
+ for $i$ in 1,..., $n$ do
124
+ $(\mathcal{F}_i, C_i^f) \gets \mathcal{M}(p_{rev}||\mathcal{F}_{i-1})$
125
+ if $C_i^f < max_f$ then continue
126
+ $\mathcal{F} = \mathcal{F}_i$ , $max_f \gets C_i^f$
127
+ end for
128
+ // review for reasoning process
129
+ for $i$ in 1,..., $n$ do
130
+ $(\mathcal{R}_i, C_i^r) \gets \mathcal{M}(p_{rev}||\mathcal{F}||\mathcal{R}_{i-1})$
131
+ if $C_i^r < max_r$ then continue
132
+ $\mathcal{R} = \mathcal{R}_i$ , $max_r \gets C_i^r$
133
+ end for
134
+ return $\mathcal{M}(p_{gen}||\mathcal{F}||\mathcal{R})$
135
+
136
+ the highest confidence score are kept. We then repeat it for the reasoning process so that we get the most faithful generations for both parts. In this way, LLMs can select the most aligned combination of problem, formulae, and the reasoning process. The elements above are finally input into the same LLM to get the final answer. The overall pipeline of this stage is shown in Algorithm 1, where the prompts $\{p_{rev}, p_{gen}\}$ denote the instruction for "review" and "generation" with refined results.
137
+
138
+ # 4. Experiments
139
+
140
+ # 4.1. Setup
141
+
142
+ In our experiments, we use four datasets taken from SciBench (Wang et al., 2023a). The datasets cover a wide range of subfields including quantum chemistry, physical chemistry, kinetics, and matter, etc. The detailed distribution of subfields is shown in Figure 9. The four datasets are manually collected from college-level chemistry textbooks, and are selected to be more challenging with free-response answers. Each of the datasets is divided into two parts, $\mathcal{P}_w$ and $\mathcal{P}_s$ . Here $\mathcal{P}_w$ contains the majority number of problems that without solutions. Meanwhile, problems in $\mathcal{P}_s$ are coupled with solutions. The complexity of these datasets could also be proved by the average number of formulae entailed (around 2) and the average reasoning steps (around 5) generated by STRUCTCHEM needed to solve the problems. (Detailed distribution information could be found in Appendix B.)
143
+
144
+ Experiments are conducted under both zero-shot and few-shot settings. For the few-shot setting, the demonstrations are constructed with 3 examples randomly sampled from
145
+
146
+ $\mathcal{P}_s$ . We leverage GPT-3.5 (gpt-3.5-turbo) and GPT-4 (gpt-4-0315) as our backbone models. For each setting, we consider four baselines following the evaluation paradigm in SciBench (Full instructions are provided in Appendix A):
147
+
148
+ (i) Direct reasoning refers to directly feeding the problem into the model without any other instructions;
149
+ (ii) System instruction is originally developed by Wang et al. (2023a) which is tailored to the task and describes the types and categories of questions, along with instructions;
150
+ (iii) CoT follows the "step-by-step" prompting strategy that requires the model to output the "thinking process" first;
151
+ (iv) CoT-SC is an improved version of CoT with self-consistency (Wang et al., 2023b). It adds more rounds of CoT reasoning and outputs the most consistent results.
152
+ (v) ToT instructs the LLM to strategically explore (Yao et al., 2023), considering multiple different reasoning paths in a tree structure.
153
+ (vi) PoT leverages the idea of Program-of-Thoughts (PoT) (Chen et al., 2023a) which translates the solution into Python codes to improve the understanding and calculation ability of LLMs.
154
+
155
+ # 4.2. Implementation Details
156
+
157
+ We access the two LLMs, GPT-3.5 and GPT-4, with the OpenAI API. During our experiments, the temperature for generation is kept at 0 to ensure reproducibility and reduce potential variances. For baseline implementations, we follow the default settings in the corresponding papers. Specifically for CoT-SC, we set the temperature to 0.7, and the batch size of rationale to 20. For ToT, we set the temperature to 1.0, with "n_generate_samples" and "n_eavluate_samples" setting to 5. When doing the evaluation, we follow the previous work (Wang et al., 2023a) and compare the model outputs with the correct answers, allowing an absolute deviation of 0.1 for answers greater than 1 and a relative tolerance of 0.05 for answers less than 1. This guarantees a fair comparison with previous baseline models.
158
+
159
+ # 4.3. Results
160
+
161
+ Table 1 and 4 present the performance of all methods on the test set of the four datasets. We report the model performance in terms of accuracy scores. The best results are bolded. Based on the results, we have the following key observations:
162
+
163
+ (i) STRUCTCHEM achieves superior performance on almost all the datasets in both zero-shot and few-shot settings. Specifically, STRUCTCHEM achieves an absolute improvement of $+13.77$ and $+7.71$ in terms of the average score on few-shot settings, respectively, which is
164
+
165
+ Table 1. Results on the test sets for the four datasets, quan, chemnc, atkins, matter. We compare with baselines from two different settings, a zero-shot setting with no demonstrations and a few-shot setting with 3 demonstrations. We compute the accuracy scores with the approximation detailed in Section 4.3. The best results for each setting are highlighted in bold and the second-best results are underlined.
166
+
167
+ <table><tr><td rowspan="2">Methods</td><td colspan="4">GPT-3.5</td><td rowspan="2">Avg.</td><td colspan="4">GPT-4</td><td rowspan="2">Avg.</td></tr><tr><td>quan</td><td>chemmc</td><td>atkins</td><td>matter</td><td>quan</td><td>chemmc</td><td>atkins</td><td>matter</td></tr><tr><td colspan="11">Zero-shot setting</td></tr><tr><td>Direct Reasoning</td><td>5.88</td><td>28.21</td><td>8.41</td><td>4.08</td><td>11.65</td><td>8.82</td><td>25.64</td><td>14.95</td><td>18.37</td><td>16.95</td></tr><tr><td>System Instruction</td><td>8.82</td><td>20.51</td><td>4.67</td><td>2.04</td><td>9.01</td><td>14.71</td><td>23.08</td><td>27.10</td><td>22.45</td><td>21.84</td></tr><tr><td>CoT</td><td>2.94</td><td>23.08</td><td>6.54</td><td>10.20</td><td>10.69</td><td>14.71</td><td>43.59</td><td>28.04</td><td>20.41</td><td>26.69</td></tr><tr><td>PoT</td><td>0.0</td><td>7.69</td><td>0.0</td><td>2.04</td><td>2.43</td><td>11.76</td><td>20.51</td><td>25.23</td><td>16.33</td><td>18.46</td></tr><tr><td>STRUCTCHEM</td><td>5.88</td><td>15.38</td><td>9.35</td><td>12.24</td><td>10.71</td><td>20.59</td><td>38.46</td><td>31.78</td><td>24.49</td><td>30.11</td></tr><tr><td colspan="11">Few-shot setting</td></tr><tr><td>Direct Reasoning</td><td>5.88</td><td>23.08</td><td>9.35</td><td>8.16</td><td>11.62</td><td>14.71</td><td>28.21</td><td>20.69</td><td>14.29</td><td>19.48</td></tr><tr><td>System Instruction</td><td>11.76</td><td>15.38</td><td>5.61</td><td>4.08</td><td>9.21</td><td>17.65</td><td>30.77</td><td>15.87</td><td>12.24</td><td>19.13</td></tr><tr><td>CoT</td><td>8.82</td><td>20.51</td><td>8.41</td><td>6.12</td><td>10.97</td><td>17.65</td><td>46.15</td><td>21.05</td><td>26.53</td><td>27.85</td></tr><tr><td>CoT-SC</td><td>14.71</td><td>25.64</td><td>15.89</td><td>16.33</td><td>18.14</td><td>29.41</td><td>51.28</td><td>50.47</td><td>28.57</td><td>39.93</td></tr><tr><td>ToT</td><td>11.76</td><td>17.95</td><td>11.21</td><td>14.29</td><td>13.80</td><td>23.53</td><td>43.59</td><td>32.71</td><td>20.41</td><td>30.06</td></tr><tr><td>PoT</td><td>8.82</td><td>33.33</td><td>13.08</td><td>16.33</td><td>17.89</td><td>38.24</td><td>41.03</td><td>21.05</td><td>28.57</td><td>32.22</td></tr><tr><td>STRUCTCHEM</td><td>32.35</td><td>43.59</td><td>26.17</td><td>24.49</td><td>31.66</td><td>41.18</td><td>58.97</td><td>59.81</td><td>30.61</td><td>47.64</td></tr></table>
168
+
169
+ Table 2. Detailed statistics and information of the four datasets we experiment with. $\# \mathcal{P}_w$ and $\# \mathcal{P}_s$ refer to the number of data samples with and without solutions. “# F” means the average number of formulae entailed in the problem, and “# RS” denotes the average reasoning steps for each problem.
170
+
171
+ <table><tr><td>Datasets</td><td>Subfields/Topics</td><td>#Pw(Ps)</td><td>#F</td><td>#RS</td></tr><tr><td>quan</td><td>Quantum chemistry</td><td>34 (8)</td><td>1.93</td><td>3.94</td></tr><tr><td>chemmc</td><td>Quantum mechanics</td><td>39 (9)</td><td>1.88</td><td>3.95</td></tr><tr><td>atkins</td><td>Physical chemistry</td><td>107 (16)</td><td>1.65</td><td>4.33</td></tr><tr><td>matter</td><td>Chemistry kinetics</td><td>49 (10)</td><td>1.89</td><td>4.43</td></tr></table>
172
+
173
+ $43.49\%$ , and $19.31\%$ of relative improvement. The notable improvement demonstrates the effectiveness of our model in adapting to various scenarios by inducing chemistry knowledge and performing precise reasoning. The improvement brought by few-shot learning is also larger than the zero-shot setting. Compared with the best general prompt strategies, CoT-SC and ToT, STRUCTCHEM is still the best. Notably, ToT does not meet expectations, as it excels at solving problems requiring many reasoning steps but struggles with ones of this complexity.
174
+
175
+ (ii) STRUCTCHEM has shown effectiveness generally across different backbones. In addition, using GPT-4 as backbone models consistently outperforms GPT-3.5 backbones for all methods experimented by a large margin. Specifically, we found that STRUCTCHEM achieves more pronounced performance improvement with GPT-4 under the zero-shot setting, with $+3.42$ of accuracy improvement. However, when it comes to the few-shot setting, STRUCTCHEM works better with GPT-3.5. Given the fact that GPT-4 is a more powerful model than GPT-3.5, this result actually indicates a nuanced balance in terms of instruction-following ability and demonstrations. When
176
+
177
+ there is no demonstration available, the performance is more dependent on the inherent power of LLMs, where GPT-4 prevails. With enough demonstrations and detailed prompts, even weaker LLMs as GPT-3.5 could be powerful with STRUCTCHEM.
178
+
179
+ (iii) STRUCTCHEM delivers greater performance improvements on four datasets in few-shot settings compared to zero-shot settings. With GPT-4, the performance improvement brought by STRUCTCHEM is $+12.0$ more than the zero-shot setting. The reason could be twofold. One is the complexity of these datasets, because it is hard to directly output answers or solutions without any demonstrations as references. Another factor could be the format of solutions offered by STRUCTCHEM, which disentangles the solution with structured instructions. This format is hard to learn with no examples. Contrastively, we do not observe obvious differences in performance improvement brought by baselines for few-shot and zero-shot settings. This further shows STRUCTCHEM's ability to learn by analogy.
180
+
181
+ (iv) STRUCTCHEM achieves substantial performance gains in complex problems with extensive reasoning steps. Specifically, we found the performance on datasets chemmc and atkins is better than quan and matter with GPT-4 in few-shot setting. STRUCTCHEM performs particularly well on atkins dataset, with the accuracy scores doubling in almost all settings. We attribute the reason to the number of formulae in atkins. As shown in Table 2, atkins has the smallest average number of formulae, making it easier for formulae collection. However, it has a larger number of average reasoning steps. This verifies STRUCTCHEM's ability to deal with complicated reasoning processes.
182
+
183
+ (v) STRUCTCHEM is well instantiated with open-source LLMs. We also tested STRUCTCHEM with open-source
184
+
185
+ Table 3. Ablation studies for different components in STRUCTCHEM in both zero-shot and few-shot settings with the backbone model GPT-4. The accuracy scores are reported with all four datasets.
186
+
187
+ <table><tr><td rowspan="2">Methods</td><td colspan="4">Zero-shot</td><td rowspan="2">Avg.</td><td colspan="4">Few-shot</td><td rowspan="2">Avg.</td></tr><tr><td>quan</td><td>chemmc</td><td>atkins</td><td>matter</td><td>quan</td><td>chemmc</td><td>atkins</td><td>matter</td></tr><tr><td>structured instruction</td><td>23.53</td><td>35.90</td><td>39.25</td><td>18.37</td><td>29.26</td><td>32.35</td><td>51.28</td><td>53.27</td><td>28.57</td><td>41.37</td></tr><tr><td>+ review for F</td><td>26.47</td><td>38.46</td><td>40.19</td><td>18.37</td><td>30.87</td><td>32.35</td><td>48.71</td><td>54.55</td><td>30.61</td><td>41.56</td></tr><tr><td>+ review for R</td><td>23.53</td><td>41.03</td><td>41.12</td><td>22.45</td><td>32.03</td><td>35.29</td><td>51.28</td><td>54.55</td><td>30.61</td><td>42.93</td></tr><tr><td>+ confidence score</td><td>29.41</td><td>41.03</td><td>46.34</td><td>23.08</td><td>34.97</td><td>38.24</td><td>53.85</td><td>56.07</td><td>32.65</td><td>45.20</td></tr><tr><td>+ PoT</td><td>20.59</td><td>38.46</td><td>31.78</td><td>24.49</td><td>30.11</td><td>41.18</td><td>58.97</td><td>59.81</td><td>30.61</td><td>47.64</td></tr></table>
188
+
189
+ Table 4. Results of STRUCTCHEM with open-source LLMs, including Llama-2-7B and Llama-2-70B under the few-shot setting.
190
+
191
+ <table><tr><td>Methods</td><td>quan</td><td>chemmc</td><td>atkins</td><td>matter</td><td>Avg.</td></tr><tr><td>w/ Llama-2-7B</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>CoT</td><td>2.94</td><td>5.13</td><td>1.87</td><td>0.00</td><td>2.49</td></tr><tr><td>PoT</td><td>0.00</td><td>2.56</td><td>0.93</td><td>0.00</td><td>0.87</td></tr><tr><td>STRUCTCHEM</td><td>2.94</td><td>7.69</td><td>8.41</td><td>2.04</td><td>5.27</td></tr><tr><td>w/ Llama-2-70B</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>CoT</td><td>14.71</td><td>12.83</td><td>13.10</td><td>4.08</td><td>11.18</td></tr><tr><td>PoT</td><td>2.94</td><td>7.69</td><td>0.93</td><td>0.00</td><td>2.89</td></tr><tr><td>STRUCTCHEM</td><td>17.65</td><td>17.95</td><td>18.69</td><td>6.12</td><td>15.10</td></tr></table>
192
+
193
+ LLMs, specifically the Llama-2 series (Touvron et al., 2023), with results shown in Table 4. We found that STRUCTCHEM still outperforms strong baselines with both model scales. However, STRUCTCHEM does not perform that well with LLMs in smaller sizes such as Llama-2-7B. Potential reasons include the relatively weak instruction-following ability of these models and the complexity of the task itself.
194
+
195
+ # 5. Analysis
196
+
197
+ Intuitively, we want to validate the quality of produced chemistry reasoning processes. We first fine-tune smaller models using generated reasoning outputs. We then conduct a thorough ablation study of STRUCTCHEM' various components to gain a deeper understanding of its effectiveness. Additionally, an error analysis further offers insights about how to make STRUCTCHEM even better in the future.
198
+
199
+ # 5.1. Validating the Reasoning Quality
200
+
201
+ Our method STRUCTCHEM has shown strong improvement in accuracy over baselines. Here we further validate that STRUCTCHEM generates high-quality intermediate reasoning steps that increase answer accuracy. Specifically, we fine-tune smaller language models, Llama-2-13B-chat (Touvron et al., 2023) and Vicuna-13B (Chiang et al., 2023), on the reasoning steps generated by STRUCTCHEM and CoT, respectively. The rationale is that while a smaller model may already be equipped with some domain knowledge, it typically lacks the capability for step-by-step reasoning in complex chemistry problems—a skill that emerges pre
202
+
203
+ dominantly in larger-scale models. By fine-tuning smaller models with the generated reasoning steps, we essentially teach them to perform this advanced reasoning. Intuitively, using higher-quality fine-tuning data would lead to better performance in the small models.
204
+
205
+ To collect fine-tuning data, we first instruct GPT-4 to generate another 1,000 problems with 3 problems sampled from SciBench as demonstrations. To encourage diversity, we set the generation temperature as 1.0 and filter out problems that have 5-gram or larger overlapping with existing generated problems. Then, we use STRUCTCHEM for providing the solutions to all 1,000 problems as the paired training data. Additionally, we compare two other baselines: (i) Fine-tuning model on the original data, which only consists of the original problem statement and the direct answer, formatted as "[problem] The answer is therefore [answer]"; (ii) Pure zero-shot inference, where given the problem as input, the model outputs a direct answer without any fine-tuning.
206
+
207
+ The fine-tuning process is based on LoRA (Hu et al., 2022), a parameter-efficient fine-tuning method. For details on training and problem generation, please refer to Appendix C.
208
+
209
+ Results are shown in Table 5. The vanilla version falls short in solving such complex chemistry problems, as shown by their zero-shot performance on four datasets. Training only on the original problem and answer pairs does not bring much improvement compared with direct inference. Finetuning with data generated by STRUCTCHEM, on the other hand, brings more than $20\%$ absolute improvement. Finetuning based on STRUCTCHEM is superior to fine-tuning with CoT, demonstrating that STRUCTCHEM can produce detailed reasoning at a higher quality.
210
+
211
+ # 5.2. Ablation Study
212
+
213
+ To understand why STRUCTCHEM works particularly well, we ablate STRUCTCHEM with add-ons from different components. Table 3 summarizes the experimental results.
214
+
215
+ Firstly, both "structured instruction" and "iterative review and refinement" are significant in contributing to the performance of STRUCTCHEM for zero-shot and few-shot settings. Specifically, removing the confidence score and iterative review resulted in a decrease of 2.27 and 3.83, respectively.
216
+
217
+ Table 5. Fine-tuning results with generations from STRUCTCHEM as training data on two open-source models. The accuracy scores are reported with all four datasets.
218
+
219
+ <table><tr><td rowspan="2">Methods</td><td colspan="4">Llama-2-13B-chat</td><td rowspan="2">Avg.</td><td colspan="4">Vicuna-13B</td><td rowspan="2">Avg.</td></tr><tr><td>quan</td><td>chemmc</td><td>atkins</td><td>matter</td><td>quan</td><td>chemmc</td><td>atkins</td><td>matter</td></tr><tr><td>Zero-shot inference</td><td>0.0</td><td>0.0</td><td>0.0</td><td>2.04</td><td>0.51</td><td>5.88</td><td>2.56</td><td>3.74</td><td>0.0</td><td>3.05</td></tr><tr><td>Original</td><td>0.0</td><td>5.13</td><td>0.0</td><td>0.0</td><td>1.28</td><td>8.82</td><td>5.13</td><td>2.80</td><td>2.04</td><td>4.70</td></tr><tr><td>CoT</td><td>8.82</td><td>17.95</td><td>9.35</td><td>8.16</td><td>11.07</td><td>11.76</td><td>15.38</td><td>8.41</td><td>6.12</td><td>10.42</td></tr><tr><td>STRUCTCHEM</td><td>14.71</td><td>30.77</td><td>20.56</td><td>20.41</td><td>21.61</td><td>17.65</td><td>33.33</td><td>18.69</td><td>20.41</td><td>22.52</td></tr></table>
220
+
221
+ ![](images/dd401de529140cd80be6a22816e0a572e39aa2e9f9bb134a0ffac33306abee15.jpg)
222
+ Figure 6. Error analysis of four error categories across all datasets (y-axis) in terms of error proportions (x-axis). The results are for STRUCTCHEM w/o PoT to exclude the influence of external tools.
223
+
224
+ It is worth noting that while iterative refinement indeed contributes to the performance, our strategy of structured instruction is strong enough and demonstrates comparative performance with strong baselines such as CoT. When removing iterative review for formulae $\mathcal{F}$ alone, the performance drops by a large margin, which is comparable to removing the whole iterative review process. This shows the effectiveness of iterative review for formulae collection and the importance of domain knowledge when solving.
225
+
226
+ Also, though PoT helps with precise calculation and improves performance, STRUCTCHEM without PoT still outperforms the strongest baselines. We also note that in the zero-shot setting, STRUCTCHEM without PoT achieves even stronger performance. Although PoT indeed helps with the accuracy of calculations, it does not make up for the disadvantage of instruction-following ability in the zero-shot setting. By adding a few demonstrations for few-shot PoT, this disadvantage was made up for.
227
+
228
+ # 5.3. Error Analysis
229
+
230
+ We conduct a manual analysis of all the 113 error cases for STRUCTCHEM without PoT with GPT-4 as the backbone for few-shot setting across four datasets. Error types are defined as corresponding to the two processes of "formulae generation" and "step-by-step reasoning". The analysis is done by 3 Ph.D. students with a chemistry background.
231
+
232
+ For "formulae generation", we define two types of errors that are related to this process. Irrelevant knowledge indicates that the formulae collected are not relevant to solving the problem. For example, solving a problem requires Broglie formula but LLM collects Wavelength formula. Incorrect knowledge refers to the incorrectness inherent in the formula itself. $K_{c} = \frac{[N_{2}O]}{[N_{2}]\times [O_{2}]}$ in Figure 2 is one such example. For "step-by-step reasoning", we also have two error cases as follows. Reasoning error refers to the errors made during the intermediate reasoning steps. For example, in Figure 2, the model fails to reason the correct relations of different gases during the reaction $O_{2} + N_{2}\rightarrow N_{2}O$ . Calculation error means the mathematical computation mistakes made when doing the reasoning process.
233
+
234
+ The results are shown in Figure 6, where we plot the proportion for every error type of each dataset. We have the following key observations:
235
+
236
+ (i) STRUCTCHEM are more likely to generate irrelevant formulae than inaccurate ones. On average, only $13.7\%$ of the total errors are caused by incorrect forms of formulae compared with an average of $25.9\%$ of irrelevant ones. The irrelevance rate is slightly higher than that of GPT-4 (CoT) as shown in Figure 1. A potential reason is that STRUCTCHEM could focus on the irrelevant formulae collected in the first phase. For the entire formulae collection process, although STRUCTCHEM sometimes retrieve irrelevant formulae for solving a problem, the formulae are less likely to be incorrect themselves.
237
+ (ii) Formulae being relevant probably is more important than being correct. We observed that the "Irrelevance" rate is relatively low for atkins and chemmc datasets, although they may have higher "incorrectness" rate. This is potentially another explanation of why performance in Table 1 is particularly high for these two datasets compared with the rest two datasets, since the formulae collection process serves as a necessary condition for conducting correct reasoning processes further.
238
+ (iii) Complex reasoning ability is still the bottleneck of LLMs. Although STRUCTCHEM drastically decreases the reasoning error as shown in Figure 1, “reasoning error” still takes up to around $35.0\%$ of all error cases. For chemistry
239
+
240
+ ![](images/929f30baa6ba77fc02bfd39396893d618c39a680c3526aeff5d2d02ef9e49f6b.jpg)
241
+ Figure 7. Cost-effectiveness analysis. The size of each dot is proportional to the average number of inferences by each method. The y-axis denotes the average accuracy across four datasets.
242
+
243
+ problems that entail multiple elements interacting in a complex environment, the ability to reason out the relations among objects becomes crucial.
244
+
245
+ (iv) Preciseness is important for solving complex chemistry problems. Without PoT, the case of "calculation error" still occupies a large portion of around a quarter. Even a single step of calculation error could lead to wrong answers in chemistry reasoning problems.
246
+
247
+ # 5.4. Cost-Effectiveness Analysis
248
+
249
+ By introducing STRUCTCHEM, we manage to reduce the costs associated with complex chemistry problems while achieving comparable or even superior performance. We conduct experiments in the few-shot setting with GPT-4 as the backbone. We define cost as the sum of tokens for instruction, demonstrations, and output. Based on results illustrated in Figure 7, we can see that the performance increase brought by STRUCTCHEM is actually a little larger compared to CoT and PoT considering the ratio of tokens consumption. CoT-SC, while achieving the most competitive results among baselines, actually consumes more tokens and requires around twice the amount of function calls. STRUCTCHEM's substantial improvement does not rely on the consumption of tokens.
250
+
251
+ # 6. Conclusion and Discussion
252
+
253
+ This paper introduces STRUCTCHEM, a new reasoning structure that guides LLMs to solve complex chemistry problems. STRUCTCHEM explicitly decomposes the reasoning into three critical phrases, including formulae generation by LLMs that offers the basis for grounded reasoning, step-by-step reasoning that makes derivations with the identified formulae for a preliminary answer, and confidence-based review-and-refinement that steers LLMs to progressively re
254
+
255
+ vise the previous phases, leading to the final high-confidence answer. Extensive experiments on four datasets of complex chemistry problems from different subfields of chemistry show that STRUCTCHEM significantly boosts the chemistry reasoning capability of different LLMs. In addition, we fine-tune smaller LMs (e.g., Vicuna-13B) using the generated reasoning from our approach with GPT-4 and obtain strong improvement. Future work could continue to investigate incorporating external, up-to-date knowledge sources and performing retrieval to ensure the quality of the formulae generation. Or designing strategies to transfer and distill chemistry reasoning knowledge from LLMs to smaller LMs.
256
+
257
+ # Acknowledgements
258
+
259
+ Research was supported in part by US DARPA KAIROS Program No. FA8750-19-2-1004, National Science Foundation IIS-19-56151, and the Molecule Maker Lab Institute: An AI Research Institutes program supported by NSF under Award No. 2019897. Any opinions, findings, conclusions, or recommendations expressed herein are those of the authors and do not necessarily represent the views, either expressed or implied, of DARPA, the National Science Foundation, or the U.S. Government.
260
+
261
+ # Impact Statement
262
+
263
+ The impact of this paper lies in its significant contribution to improving the ability of Large Language Models (LLMs), like GPT-4, in the domain of complex chemistry reasoning. The introduction of STRUCTCHEM not only elevates the LLMs' performance in chemical reasoning tasks but also demonstrates the potential to integrate with other reasoning tools and strategies, thereby pushing the boundaries of what artificial intelligence can achieve in the realm of scientific inquiry. This advancement opens up new avenues for using LLMs in scientific research, education, and industry, where they can assist in acting as teaching agents, conducting experiments, or even in developing new materials and drugs. Furthermore, by highlighting the ongoing challenges and the need for further research in precise, grounded reasoning with LLMs, the paper sets a new direction for future work in AI and machine learning, encouraging a deeper investigation into how AI can more effectively mimic human-like reasoning in scientific domains. Overall, we do not foresee any major risks or negative societal impacts of our work. All the datasets we experiment with are publicly available online. We followed the licenses when conducting experiments on publicly available datasets and human annotations. We will open-source this project upon acceptance to facilitate future research, especially for small research groups or institutions with relatively fewer resources of LLMs.
264
+
265
+ # References
266
+
267
+ Atkins, P., De Paula, J., and Friedman, R. Physical chemistry: quanta, matter, and change. Oxford University Press, USA, 2014.
268
+ Atkins, P., De Paula, J., and Keeler, J. Atkins' physical chemistry. Oxford university press, 2023.
269
+ Baum, Z. J., Yu, X., Ayala, P. Y., Zhao, Y., Watkins, S. P., and Zhou, Q. Artificial intelligence in chemistry: current trends and future directions. Journal of Chemical Information and Modeling, 61(7):3197-3212, 2021.
270
+ Besta, M., Blach, N., Kubicek, A., Gerstenberger, R., Gianinazzi, L., Gajda, J., Lehmann, T., Podstawski, M., Niewiadomski, H., Nczyk, P., and Hoefler, T. Graph of Thoughts: Solving Elaborate Problems with Large Language Models. Proceedings of the AAAI Conference on Artificial Intelligence, 38(16): 17682-17690, Mar 2024. doi: 10.1609/aaai.v38i16.29720. URL https://ojs.aaaai.org/index.php/AAAI/article/view/29720.
271
+ Bran, A. M., Cox, S., White, A. D., and Schwaller, P. Chem-crow: Augmenting large-language models with chemistry tools. arXiv preprint arXiv:2304.05376, 2023.
272
+ Chen, W., Ma, X., Wang, X., and Cohen, W. W. Program of thoughts prompting: Disentangling computation from reasoning for numerical reasoning tasks. Transactions on Machine Learning Research, 2023a. ISSN 2835-8856. URL https://openreview.net/forum?id=YfZ4ZPt8zd.
273
+ Chen, W., Yin, M., Ku, M., Lu, P., Wan, Y., Ma, X., Xu, J., Wang, X., and Xia, T. TheoremQA: A theorem-driven question answering dataset. In Bouamor, H., Pino, J., and Bali, K. (eds.), Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pp. 7889-7901, Singapore, December 2023b. Association for Computational Linguistics. doi: 10.18653/v1/2023.emnlp-main.489. URL https://aclanthology.org/2023.emnlp-main.489.
274
+ Chiang, W.-L., Li, Z., Lin, Z., Sheng, Y., Wu, Z., Zhang, H., Zheng, L., Zhuang, S., Zhuang, Y., Gonzalez, J. E., Stoica, I., and Xing, E. P. Vicuna: An open-source chatbot impressing gpt-4 with $90\%$ * chatgpt quality, March 2023. URL https://lmsys.org/blog/2023-03-30-vicuna/.
275
+ Edwards, C., Zhai, C., and Ji, H. Text2Mol: Cross-modal molecule retrieval with natural language queries. In Moens, M.-F., Huang, X., Specia, L., and Yih, S. W.-t. (eds.), Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 595-607,
276
+
277
+ Online and Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.emnlp-main.47. URL https://aclanthology.org/2021.emnlp-main.47.
278
+ Edwards, C., Lai, T., Ros, K., Honke, G., Cho, K., and Ji, H. Translation between molecules and natural language. arXiv preprint arXiv:2204.11817, 2022.
279
+ Edwards, C. N., Naik, A., Khot, T., Burke, M. D., Ji, H., and Hope, T. Synergpt: In-context learning for personalized drug synergy prediction and drug design. *bioRxiv*, pp. 2023–07, 2023.
280
+ Fang, Y., Liang, X., Zhang, N., Liu, K., Huang, R., Chen, Z., Fan, X., and Chen, H. Mol-instructions: A large-scale biomolecular instruction dataset for large language models. arXiv preprint arXiv:2306.08018, 2023.
281
+ Feinberg, E. N., Sur, D., Wu, Z., Husic, B. E., Mai, H., Li, Y., Sun, S., Yang, J., Ramsundar, B., and Pande, V. S. Potentialnet for molecular property prediction. ACS central science, 4(11):1520-1530, 2018.
282
+ Fu, Y., Peng, H., Sabharwal, A., Clark, P., and Khot, T. Complexity-based prompting for multi-step reasoning. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=yf1icZHC-19.
283
+ Graulich, N., Rost, M., Schultz, M., and Gallardo-Williams, M. To read is the challenge - insights from 100 days, 100 papers reading challenge in chemistry education research. Journal of Chemical Education, 99(10):3364-3369, 2022.
284
+ Hair, J., Black, W., Babin, B., Anderson, R., and Tatham, R. Pearson prentice-hall; upper saddle river, nj. Multivariate data analysis.[Google Scholar], 2009.
285
+ Hu, E. J., yelong shen, Wallis, P., Allen-Zhu, Z., Li, Y., Wang, S., Wang, L., and Chen, W. LoRA: Low-rank adaptation of large language models. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=nZeVKeefYf9.
286
+ Huang, J., Chen, X., Mishra, S., Zheng, H. S., Yu, A. W., Song, X., and Zhou, D. Large language models cannot self-correct reasoning yet. In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=IkmD3fKBPQ.
287
+ Khot, T., Trivedi, H., Finlayson, M., Fu, Y., Richardson, K., Clark, P., and Sabharwal, A. Decomposed prompting: A modular approach for solving complex tasks. In The Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda,
288
+
289
+ May 1-5, 2023. OpenReview.net, 2023. URL https://openreview.net/pdf?id=_nGgzQjzaRy.
290
+ Kojima, T., Gu, S. S., Reid, M., Matsuo, Y., and Iwasawa, Y. Large language models are zero-shot reasoners. Advances in neural information processing systems, 35: 22199-22213, 2022.
291
+ Lachmy, R., Pyatkin, V., Manevich, A., and Tsarfaty, R. Draw me a flower: Processing and grounding abstraction in natural language. Transactions of the Association for Computational Linguistics, 10:1341-1356, 2022. doi: 10. 1162/tacl_a_00522. URL https://aclanthology. org/2022.tacl-1.77.
292
+ Lu, P., Mishra, S., Xia, T., Qiu, L., Chang, K.-W., Zhu, S.-C., Tafjord, O., Clark, P., and Kalyan, A. Learn to explain: Multimodal reasoning via thought chains for science question answering. In The 36th Conference on Neural Information Processing Systems (NeurIPS), 2022.
293
+ Madaan, A., Tandon, N., Gupta, P., Hallinan, S., Gao, L., Wiegreffe, S., Alon, U., Dziri, N., Prabhumoye, S., Yang, Y., Welleck, S., Majumder, B. P., Gupta, S., Yazdanbakhsh, A., and Clark, P. Self-refine: Iterative refinement with self-feedback. CoRR, abs/2303.17651, 2023. doi: 10.48550/ARXIV.2303.17651. URL https://doi.org/10.48550/arXiv.2303.17651.
294
+ McQuarrie, D. A. Quantum chemistry. University Science Books, 2008.
295
+ Ouyang, S., Wang, S., Liu, Y., Zhong, M., Jiao, Y., Iter, D., Pryzant, R., Zhu, C., Ji, H., and Han, J. The shifted and the overlooked: A task-oriented investigation of user-GPT interactions. In The 2023 Conference on Empirical Methods in Natural Language Processing, 2023. URL https://openreview.net/forum?id=qS1ip2dGH0.
296
+ Öztürk, H., Özgür, A., Schwaller, P., Laino, T., and Ozkirimli, E. Exploring chemical space using natural language processing methodologies for drug discovery. *Drug Discovery Today*, 25(4):689-705, 2020.
297
+ Patel, P., Mishra, S., Parmar, M., and Baral, C. Is a question decomposition unit all we need? In Goldberg, Y., Kozareva, Z., and Zhang, Y. (eds.), Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pp. 4553-4569, Abu Dhabi, United Arab Emirates, December 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.emnlp-main.302. URL https://aclanthology.org/2022.emnlp-main.302.
298
+ Petroni, F., Rocktäschel, T., Riedel, S., Lewis, P., Bakhtin, A., Wu, Y., and Miller, A. Language models as knowledge bases? In Inui, K., Jiang, J., Ng, V., and Wan, X.
299
+
300
+ (eds.), Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 2463-2473, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1250. URL https://aclanthology.org/D19-1250.
301
+ Singhal, K., Azizi, S., Tu, T., Mahdavi, S. S., Wei, J., Chung, H. W., Scales, N., Tanwani, A., Cole-Lewis, H., Pfohl, S., et al. Large language models encode clinical knowledge. Nature, 620(7972):172-180, 2023.
302
+ Stechly, K., Marquez, M., and Kambhampati, S. Gpt-4 doesn't know it's wrong: An analysis of iterative prompting for reasoning problems. arXiv preprint arXiv:2310.12397, 2023.
303
+ Sun, Z., Wang, X., Tay, Y., Yang, Y., and Zhou, D. Recitation-augmented language models. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id=-cqvvvb-NkI.
304
+ Taskin, V. and Bernholt, S. Students' understanding of chemical formulae: A review of empirical research. International Journal of Science Education, 36(1):157-185, 2014.
305
+ Touvron, H., Martin, L., Stone, K., Albert, P., Almahairi, A., Babaei, Y., Bashlykov, N., Batra, S., Bhargava, P., Bhosale, S., et al. Llama 2: Open foundation and finetuned chat models. arXiv preprint arXiv:2307.09288, 2023.
306
+ Wang, B., Deng, X., and Sun, H. Iteratively prompt pretrained language models for chain of thought. In Goldberg, Y., Kozareva, Z., and Zhang, Y. (eds.), Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, pp. 2714-2730, Abu Dhabi, United Arab Emirates, December 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.emnlp-main.174. URL https://aclanthology.org/2022.emnlp-main.174.
307
+ Wang, X., Hu, Z., Lu, P., Zhu, Y., Zhang, J., Subramaniam, S., Loomba, A. R., Zhang, S., Sun, Y., and Wang, W. Scibench: Evaluating college-level scientific problem-solving abilities of large language models. arXiv preprint arXiv:2307.10635, 2023a.
308
+ Wang, X., Wei, J., Schuurmans, D., Le, Q. V., Chi, E. H., Narang, S., Chowdhery, A., and Zhou, D. Self-consistency improves chain of thought reasoning in language models. In The Eleventh International Conference on Learning Representations, 2023b. URL https://openreview.net/forum?id=1PL1NIMMrw.
309
+
310
+ Wei, J., Wang, X., Schuurmans, D., Bosma, M., Ichter, B., Xia, F., Chi, E. H., Le, Q. V., and Zhou, D. Chain-of-thought prompting elicits reasoning in large language models. In NeurIPS, 2022. URL https://openreview.net/forum?id=VjQlMeSB_J.
311
+ Weng, Y., Zhu, M., He, S., Liu, K., and Zhao, J. Large language models are reasoners with self-verification. arXiv preprint arXiv:2212.09561, 2022.
312
+ Yang, K., Swanson, K., Jin, W., Coley, C., Eiden, P., Gao, H., Guzman-Perez, A., Hopper, T., Kelley, B., Mathea, M., et al. Analyzing learned molecular representations for property prediction. Journal of chemical information and modeling, 59(8):3370-3388, 2019.
313
+ Yao, S., Yu, D., Zhao, J., Shafran, I., Griffiths, T. L., Cao, Y., and Narasimhan, K. R. Tree of thoughts: Deliberate problem solving with large language models. In Thirty-seventh Conference on Neural Information Processing Systems, 2023. URL https://openreview.net/forum?id=5Xc1ecxO1h.
314
+ Zhang, Z., Zhang, A., Li, M., and Smola, A. Automatic chain of thought prompting in large language models. In The Eleventh International Conference on Learning Representations (ICLR 2023), 2023.
315
+ Zheng, L., Chiang, W., Sheng, Y., Zhuang, S., Wu, Z., Zhuang, Y., Lin, Z., Li, Z., Li, D., Xing, E. P., Zhang, H., Gonzalez, J. E., and Stoica, I. Judging llm-as-a-judge with mt-bench and chatbot arena. CoRR, abs/2306.05685, 2023. doi: 10.48550/ARXIV.2306.05685. URL https://doi.org/10.48550/arXiv.2306.05685.
316
+ Zhong, M., Ouyang, S., Jiang, M., Hu, V., Jiao, Y., Wang, X., and Han, J. ReactIE: Enhancing chemical reaction extraction with weak supervision. In Rogers, A., Boyd-Graber, J., and Okazaki, N. (eds.), Findings of the Association for Computational Linguistics: ACL 2023, pp. 12120-12130, Toronto, Canada, July 2023. Association for Computational Linguistics. doi: 10.18653/v1/2023.findings-acl.767. URL https://aclanthology.org/2023.findings-acl.767.
317
+ Zhong, X., Du, Y., Ouyang, S., Zhong, M., Luo, T., Ho, Q., Peng, H., Ji, H., and Han, J. Actionie: Action extraction from scientific literature with programming languages. In the Association for Computational Linguistics: ACL 2024. Association for Computational Linguistics, August 2024.
318
+ Zhou, D., Schärli, N., Hou, L., Wei, J., Scales, N., Wang, X., Schuurmans, D., Cui, C., Bousquet, O., Le, Q. V., and Chi, E. H. Least-to-most prompting enables complex reasoning in large language models. In The Eleventh International Conference on Learning Representations,
319
+
320
+ 2023. URL https://openreview.net/forum? id=WZH7099tqfM.
321
+
322
+ # A. Prompts used for baseline methods in Section 4.
323
+
324
+ In this section, we provide the detailed prompts used for experiments.
325
+
326
+ ![](images/57e59abd7d3acd6144c009105c208e632670a7fa36c985dc4c1689c24df52ccf.jpg)
327
+ Figure 8. Distribution of four datasets in terms of the reasoning steps.
328
+
329
+ System Prompt Please provide a clear and step-by-step solution for a scientific problem in the category of Chemistry. The problem will specify the unit of measurement, which should not be included in the answer. Express the final answer as a decimal number with three digits after the decimal point. Conclude the answer by stating "The answer is therefore [ANSWER]."
330
+
331
+ Program-of-Thought Prompt Please provide a clear and step-by-step solution for a scientific problem in the category of Chemistry. The problem will specify the unit of measurement. Please translate the solution steps into Python code and encase the Python code within triple backticks for clarity.
332
+
333
+ Template-guided Prompt The full prompt for "formulae generation" and "step-by-step reasoning" is composed of four stages, general instruction, output format, demonstrations, and trigger. The complete view of the prompt is shown in Figure 14.
334
+
335
+ # B. Distribution of datasets
336
+
337
+ The detailed distribution of four datasets in terms of reasoning steps is shown in Fig 8. We can see that the majority of the samples have reasoning steps spanning [3, 5]. Some samples even have reasoning steps of 8, which demonstrate the complexity of these datasets.
338
+
339
+ # C. Details for Section 5.3
340
+
341
+ Instruction for problem generation Please help me to generate complex and difficult chemistry problems that include but are not limited to the fields of physical chemistry,
342
+
343
+ ![](images/5039201b85eae52faef48ddc2aba1a8f2d5caf669a27c068e7889ba5cd2628ef.jpg)
344
+ Figure 9. Quantum chemistry (quan) (Hair et al., 2009) provides an exploration of equilibrium, structure, and reactions. Chemistry kinetics (matter) (Atkins et al., 2014) combines physics and mathematics, spanning through quantum mechanics and atomic structure. Quantum mechanics (chemmc) (McQuarrie, 2008) covers quantum mechanics and the applications in chemical bonding. Physical chemistry (atkins) (Atkins et al., 2023) provides explorations of equilibrium, structure, and reactions. We leverage GPT-4 to annotate each data sample in these datasets for the specific subfields.
345
+
346
+ quantum chemistry, thermodynamics, atomic chemistry, molecular, etc. To help you better understand, I provide the following examples: [demonstrations]. Following the above examples, please help me with this task and generate three problems that satisfy my requirements. Make sure the generated problems are reasonable and complex for solving.
347
+
348
+ Training details We use LLaMA-2-13B-chat (Touvron et al., 2023) and Vicuna-13B-v1.3 (Chiang et al., 2023) as backbone models and finetune them with the LoRA approach (Hu et al., 2022). During training, we configure the batch size to 8 and the maximum learning rate to 1e-4 with a 0.03 warmup ratio. For all the experiments, the LoRA $r$ is set to 8, and we apply a dropout rate of 0.05. We keep these hyperparameters the same for a fair comparison. We train the models with 10 epochs and it takes around 1 hour to train on a single NVIDIA A6000 GPU. During the inference process, we also adhere to the same set of parameters: a temperature of 0.1, top_p of 0.75, top_k of 40, 4 beams, and a maximum generation length of 2,048.
349
+
350
+ # D. Examples of error type in Section 5.2
351
+
352
+ To help better understand the error category listed in Section 5.3, we provide one example for each category in Figure 12, Figure 13.
353
+
354
+ <table><tr><td>Problem</td><td>The J = 2 → 3 rotational transition in a certain diatomic molecule occurs at 126.4 GHz, where 1 GHz = 109 Hz. Find the frequency of the J = 5 → 6absorption in this molecule.</td></tr><tr><td>Formula retrieval:
355
+ [Formula 1] E = 2B(J + 1), where B is the rotational constant,...
356
+ [Formula 2] E = hv, where h is the Planck&#x27;s constant,...
357
+ Reasoning:
358
+ [Step 1] Calculate the energy difference for transition from 2 to 3.
359
+ ΔE2→3 = hv2→3 = 6.626 × 10-34 J s · 126.4 × 109 Hz
360
+ [Step 2] Calculate the rotational constant B. Using energy difference and initial rotational quantum number ΔE2→3 = 2B(2 + 1), hence B = ΔE2→3/6
361
+ [Step 3] Calculate the energy difference for transition from 5 to 6 ΔE5→6 = 2B(5 + 1)
362
+ [Step 4] ...</td><td></td></tr><tr><td>Correct</td><td>252.8 V</td></tr></table>
363
+
364
+ Figure 10. An example of a reasoning error. The red highlighted expression is deduced from the given formula. Instead of solving for difference, it directly plug the value for calculating energy. The correct expression for the first one should be $\Delta E_{2\rightarrow 3} = 2B(3 + 1) - 2B(2 + 1)$ .
365
+
366
+ <table><tr><td>Problem</td><td>Take nitrogen to be a van der Waals gas with a = 1.352 dm6 atm mol-2and b = 0.0387 dm3 mol-1, and calculate ΔHm when the pressure on the gas is decreased from 500 atm to 1.00 atm at 300 K . For a van der Waals gas, μ = ((2a/RT) - b)/Cp,m. Assume Cp,m = 7/2R.</td></tr><tr><td>Answer</td><td>Formula retrieval:
367
+ [Formula 1] μ = ((2a/RT) - b)/Cp,m, given formula for a van der ...
368
+ [Formula 2] ΔHm = ∫ μdP, general formula for calculating change in enthalpy with
369
+ [Formula 3] ...
370
+ Reasoning:
371
+ [Step 1] ...</td></tr><tr><td>Correct</td><td>+3.59 KJ/mol</td></tr></table>
372
+
373
+ Figure 11. An example of a factual error. The red highlighted expression is the wrong form to calculate. The correct formulae should be $\int_{p}^{p'} dH_m$ , which could be further converted to $H_m qx = H_m(v' - d)$ .
374
+
375
+ <table><tr><td>Problem</td><td>Through what potential must a proton initially fall so that its de Broglie wavelength is 1.0×10-10m?</td></tr><tr><td>Answer</td><td>Formula retrieval:
376
+ [Formula 1] λ = h/p, where λ is the de Broglie wavelength,...
377
+ [Formula 2] K = qV, where k is the kinetic energy,...
378
+ [Formula 3] K = 1/2mv2, where m is the mass of the particle,...
379
+ Reasoning:
380
+ [Step 1] Calculate the momentum of the proton using the de Broglie wavelength formula. p = h/λ = 6.626×10-34×1.0×10-10 = 6.626×10-24 kg m s-1
381
+ [Step 2] Calculate the kinetic energy of the proton using its momentum. K = p2/2m = (6.626×10-34)2/2(1.673×10-27) = 1.381×10-17 J
382
+ [Step 3] Calculate the potential difference using the kinetic energy formula. V = K/q = 1.381×10-17/1.602×10-19 = 86.2 V</td></tr><tr><td>Correct</td><td>0.082 V</td></tr></table>
383
+
384
+ Figure 12. An example of a calculation error. The red highlighted expression is wrongly calculated. If calculated correctly, we will get $K = 1.312 \times 10^{-20}$ , which yields the correct answer.
385
+
386
+ <table><tr><td>Problem</td><td>Use the D0value of H2(4.478eV) and the D0value of H2+(2.651eV) to calculate the first ionization energy of H2 (that is, the energy needed to remove an electron from H2). The unit is eV.</td></tr><tr><td>Answer</td><td>Formula retrieval:
387
+ [Formula 1]E1 = D0(H2) - D0(H2+), where E1 is the first ionization energy,...
388
+ Reasoning:
389
+ [Step 1] Substitute the given values into the formulae and calculate the first ionization energy E1 = 1.827 eV</td></tr><tr><td>Correct</td><td>15.43 eV</td></tr></table>
390
+
391
+ Figure 13. An example of a principle error. The red highlighted expression is wrongly collected. The correct formulae should be $E_{1} = D_{0}(H_{2}) - D_{0}(H_{2}^{+}) + I(H)$ .
392
+
393
+ <table><tr><td>Instruction</td><td>Please provide a clear and step-by-step solution for a scientific problem in the categories of Chemistry, Physics, or Mathematics. The problem will specify the unit of measurement, which should not be included in the answer. Express the final answer as a decimal number with three digits after the decimal point. Conclude the answer by stating &quot;The answer is therefore boxed[[ANSWER]]. For each instance, you need to three things. Firstly, for &quot;formulae retrieval&quot;, you need to identify the formulae explicitly and implicitly entailed in the problem context. Then there is a &quot;reasoning/calculus process&quot; where you are required to reason step by step based on the identified formulae and problem context. Finally, conclude the answer. For each problem, the output format should incorporate the following components in the corresponding format:</td></tr><tr><td>Output Format</td><td>**Formulae retrieval:** [Formula 1] (the formula required to solve the problem) [Formula 2] (the second formula required to solve the problem, if any) ... [Formula n] (the n-th formula required to solve the problem, if any) **Reasoning/calculus process:** [step 1] (the first step for solving this problem) ....... [step n] (the n-th step for solving the problem, if any) **Answer conclusion:** [answer] The answer is therefore boxed{[ANSWER]}.</td></tr><tr><td>Demonstration (5 samples)</td><td>To clearly explain the task, we provide the following example: Problem: Assume that all gases are perfect and that data refer to 298.15 K unless otherwise stated. Calculate the change in chemical potential of a perfect gas when its pressure is increased isothermally from $1.8\mathbf{\backslash m} \mathbf{a} \mathbf{h} \mathbf{r} \mathbf{m} \{\sim \mathbf{a} \mathbf{t} \mathbf{m}\} \mathbf{\zeta}$ to $29.5\mathbf{\backslash m} \mathbf{a} \mathbf{h} \mathbf{r} \mathbf{m} \{\sim \mathbf{a} \mathbf{t} \mathbf{m}\} \mathbf{\zeta}$ at $40^{\wedge}\{\mathbf{\backslash c} \mathbf{r} \mathbf{c}\} \mathbf{\backslash m} \mathbf{a} \mathbf{h} \mathbf{r} \mathbf{m}\{C\} \mathbf{\zeta}$. The unit of the answer is $\mathbb{S}\backslash\mathbf{m} \mathbf{a} \mathbf{h} \mathbf{r} \mathbf{m}\{k\mathbf{J}\} \backslash \mathbf{m} \mathbf{a} \mathbf{h} \mathbf{r} \mathbf{m}\{l\mathbf{o}\} \wedge \{-1\} \mathbf{\zeta}$. Response: In order to solve this problem, we will use the formula for the change in chemical potential \(\backslash\) \(\backslash\)Delta \(\backslash \mathbf{mu}\backslash\)) of a perfect gas due to a change in pressure. Given that the temperature is constant (isothermal), the chemical potential of a perfect gas is given by: **Formula retrieval:** [text{[Formula 1]} \quad quad\Delta\text{mu}=RT\backslashln\left(\frac{frac{P_2}}{P_1}\right)\left[\right] where: -\backslash(\backslashDelta\backslash\mathbf{mu})\text{ is the change in chemical potential}, -\backslash(R\backslash)\text{ is the universal gas constant }(\backslash8.314\backslash,\text{ text{J}}\backslash,\text{ text{mol}}\wedge\{-1\}\backslash,\text{ text{K}}\wedge\{-1\}\)), -\(\backslash(T\backslash)\) is the absolute temperature in Kelvin, -\(\backslash(P_1\backslash)\) is the initial pressure, -\(\backslash(P_2\backslash)\) is the final pressure. **Reasoning/calculus process:** [step 1] Convert the temperature from Celsius to Kelvin. To convert from Celsius to Kelvin, we add 273.15 to the Celsius temperature. [T=40^{\wedge}\{\text{circ}\} \text{text{C}}+273.15\backslash,\text{text{K}}\}]\) [T=313.15\,\text{text{K}}\}] [step 2] Substitute the given values into the formula. [P_1=1.8\,\text{text{atm}}\}] [P_2=29.5\,\text{text{atm}}\}] [Delta\mu=8.314\,\text{text{J}}\backslash,\text{text{mol}}\wedge\{-1\}\backslash,\text{text{K}}\wedge\{-1\}\cdot313.15\backslash,\text{text{K}}\cdot\ln\left(\frac{frac{29.5\backslash\text{text{atm}}}\right)\{1.8\backslash,\text{text{atm}}\} \text{right}\)] [step 3] Calculate the natural logarithm and proceed with the calculation. [Delta\mu=8.314\,\text{text{J}}\backslash,\text{text{mol}}\wedge\{-1\}\backslash,\text{text{K}}\wedge\{-1\}\cdot313.15\backslash,\text{text{K}}\cdot\ln(16.389)\}] [Delta\mu=8.314\,\text{text{J}}\backslash,\text{text{mol}}\wedge\{-1\}\backslash,\text{text{K}}\wedge\{-1\}\cdot313.15\backslash,\text{text{K}}\cdot\ln(2.799\backslash]\) [Delta\mu=7293.269\,\text{text{J}}\backslash,\text{text{mol}}\wedge\{-1\}\)] [step 4] Convert the result from Joules per mole to kilojoules per mole (1 kJ=1000 J). [Delta\mu=7.293\,\text{text{kJ}}\backslash,\text{text{mol}}\wedge\{-1\}\] **Answer conclusion:** [text{answer] The answer is therefore }boxed{7.293\backslash,\text{text{kJ}}\backslash,\text{text{mol}}\wedge\{-1\}\backslash]</td></tr><tr><td>Trigger</td><td>Following the above examples, please help me solve the following problem. Remember to strictly follow the output format.</td></tr></table>
394
+
395
+ Figure 14. Full prompt used for generation.
2024/Structured Chemistry Reasoning with Large Language Models/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:61880bfc5ebe10eaeb689a26898936fc604bd8a87263745f06dbd28cd091bae6
3
+ size 1201380
2024/Structured Chemistry Reasoning with Large Language Models/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/Structured Inverse-Free Natural Gradient Descent_ Memory-Efficient & Numerically-Stable KFAC/e1fd546c-4cbd-40c9-add1-283fc66a87ce_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/Structured Inverse-Free Natural Gradient Descent_ Memory-Efficient & Numerically-Stable KFAC/e1fd546c-4cbd-40c9-add1-283fc66a87ce_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/Structured Inverse-Free Natural Gradient Descent_ Memory-Efficient & Numerically-Stable KFAC/e1fd546c-4cbd-40c9-add1-283fc66a87ce_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c35b7e0fc6cee3ab17daea6b436336dc39200ae77e3ffcd8dfa6fd597344c15f
3
+ size 809550
2024/Structured Inverse-Free Natural Gradient Descent_ Memory-Efficient & Numerically-Stable KFAC/full.md ADDED
@@ -0,0 +1,724 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Structured Inverse-Free Natural Gradient Descent: Memory-Efficient & Numerically-Stable KFAC
2
+
3
+ Wu Lin $^{*1}$ Felix Dangel $^{*1}$ Runa Eschenhagen $^{2}$ Kirill Neklyudov $^{1}$ Agustinus Kristiadi $^{1}$ Richard E. Turner $^{2}$ Alireza Makhzani $^{13}$
4
+
5
+ # Abstract
6
+
7
+ Second-order methods such as KFAC can be useful for neural net training. However, they are often memory-inefficient since their preconditioning Kronecker factors are dense, and numerically unstable in low precision as they require matrix inversion or decomposition. These limitations render such methods unpopular for modern mixed-precision training. We address them by (i) formulating an inverse-free KFAC update and (ii) imposing structures in the Kronecker factors, resulting in structured inverse-free natural gradient descent (SINGD). On modern neural networks, we show that SINGD is memory-efficient and numerically robust, in contrast to KFAC, and often outperforms AdamW even in half precision. Our work closes a gap between first- and second-order methods in modern low-precision training.
8
+
9
+ # 1. Introduction
10
+
11
+ The continuing success of deep learning (DL) is—to a large extent—powered by scaling up computational power (Thompson et al., 2020) to increase the number of trainable neural network (NN) parameters. Contemporary natural language processing (Radford et al., 2019; Brown et al., 2020; Touvron et al., 2023) and computer vision (Dehghani et al., 2023) models often consist of billions of parameters, and will likely grow further in the future. To compensate for increasing computational demands, many training pipelines use lower precision data types (Micikevicius et al., 2018) and memory-efficient first-order optimizers like SGD (Robbins & Monro, 1951) or Adam(W) (Kingma & Ba, 2015; Loshchilov & Hutter, 2019).
12
+
13
+ Second-order methods, like natural gradient descent (NGD,
14
+
15
+ *Equal contribution 1Vector Institute 2University of Cambridge 3University of Toronto. Correspondence to: Wu Lin <yorker.lin@gmail.com>.
16
+
17
+ Proceedings of the $41^{st}$ International Conference on Machine Learning, Vienna, Austria. PMLR 235, 2024. Copyright 2024 by the author(s).
18
+
19
+ Amari, 1998), leverage curvature information which has many applications in DL: It is useful for improving training dynamics (Martens & Grosse, 2015; Ottawa et al., 2023), pruning (Wang et al., 2019), understanding the influence of training examples (Bae et al., 2022), and uncertainty estimation (Zhang et al., 2018; Immer et al., 2021; Daxberger et al., 2021). One major obstacle why those methods are rarely used is their higher memory consumption and iteration cost.
20
+
21
+ The perhaps most common concept to scale second-order methods for DL is Kronecker-factored approximate curvature (KFAC, Heskes, 2000; Martens & Grosse, 2015) which approximates the Fisher's block diagonals via Kronecker products. The KFAC optimizer built on top of this curvature approximation, and its variants such as George et al. (2018) show promising results for medium-sized NNs (e.g. Osawa et al., 2023), its usefulness is often limited by (i) memory consumption, and (ii) the use of low-precision floating-point (FP) training that renders matrix decompositions/inversions required to pre-condition the gradient numerically unstable.
22
+
23
+ Recently, Lin et al. (2023) proposed an inverse-free Kronecker-factored natural gradient descent (INGD) algorithm that replaces matrix inversion with subtraction in a matrix logarithm space. Their update is purely based on matrix multiplications and therefore numerically stable in single-precision (FP-32); however, it is unclear whether this extends to half-precision (BFP-16). Furthermore, INGD has not been derived from the popular natural gradient approaches for DL. It is unclear if and how the method is connected to the predominant KFAC optimizer. Also, INGD does not improve over KFAC's memory complexity since its Kronecker factors are dense matrices of the same size. And lastly, INGD has only been tested on convolution-based models and it is unclear whether it is useful for training modern transformer-based architectures (Vaswani et al., 2017).
24
+
25
+ Here, we extend INGD to lower its computational cost and theoretically resolve its connection to other approximate NGD methods for DL (overview in Figure 2): First, we show that a special case of INGD recovers the KFAC method. This allows us to effectively perform KFAC updates in an inverse-free fashion. We call this modification of INGD inverse-free KFAC (IKFAC). Second, we exploit an alge
26
+
27
+ ![](images/8a3209d00016012fde14d82b877befcfc90717f3c64d76e48651c2c015c9907e.jpg)
28
+ Figure 1: CIFAR-100 experiments on VGG net. Left/Center: Our methods (IKFAC and SINGD) outperform AdamW and perform stably in FP-32 and BFP-16—unlike KFAC—as they do not require matrix inversions. IKFAC effectively performs KFAC updates and achieves similar performance in FP-32. For this task, replacing the dense Kronecker factors (INGD = SINGD-Dense) with diagonal ones (SINGD-Diag) does not harm performance while reducing cost. Right: Memory consumption. Removing Riemannian momentum (IKFAC) or using structured Kronecker factors (SINGD-Diag) reduces INGD's memory in FP-32 and BFP-16. In BFP-16, SINGD-Diag achieves AdamW's memory consumption (dashed line).
29
+
30
+ ![](images/a49d94707200e251a37e5f072ee16e68bf6337ad0982fdef94627982b19bc2c5.jpg)
31
+
32
+ ![](images/51ee85c71c383c05fdd94286762c99b9cd79d4b7b5b708f0cf60044ae6377cd1.jpg)
33
+
34
+ braic structure in the matrix logarithm space and propose structure-preserving updates to maintain sparse structures on Kronecker factors. This significantly reduces memory and leads to a novel, scalable second-order optimization algorithm we call structured inverse-free natural gradient descent (SINGD) which contains INGD and IKFAC as special cases. We evaluate SINGD on convolution- and transformer-based models and show that it can (i) outperform SGD and AdamW while using as little memory as the latter thanks to structured Kronecker factors and (ii) yield better performance than KFAC while being stable in half-precision:
35
+
36
+ (a) We bridge the gap between INGD (Lin et al., 2023) and the original KFAC (Martens & Grosse, 2015), whose matrix inversions are unstable in low precision. Thereby, we effectively make KFAC inverse-free and amenable to low-precision training (Figure 1, left/center).
37
+ (b) We impose various structures (block-diagonal, low-rank, Toeplitz, hierarchical) on INGD's Kronecker factors, allowing them to be sparse to lower the memory consumption and run time (Figure 1, right and Table 1). Unlike many existing second-order methods tailored to a form of structure, our proposed update rule (Figure 4) is unified, efficient, and inverse-free for a range of structures. We analyze the impact of structures on downstream performance and find that structures with considerably lower memory consumption (even lower than AdamW) can yield competitive performance.
38
+ (c) Unlike other second-order methods, we show that SINGD can stably train a range of modern architectures (transformers, CNNs, GNNs) in BFP-16. In contrast to first-order methods which are often useful in narrower
39
+
40
+ Table 1: Training times and memory consumption for the optimizers shown in Figure 1 (parenthesized values are normalized relative to SGD; our methods are marked with an asterisk). INGD has $80\%$ time and $30\%$ memory overhead compared to SGD. In contrast, our SINGD-Diag only has $30\%$ time and $2\%$ memory overhead. This means that by using structures we can reduce INGD's time overhead by more than half, and basically eliminate its memory overhead compared to first-order competitors.
41
+
42
+ <table><tr><td>Method</td><td>Peak memory [GiB]</td><td>Training time [min]</td></tr><tr><td>SGD (BFP-16)</td><td>2.63 (1.00 x)</td><td>18.5 (1.00 x)</td></tr><tr><td>AdamW (BFP-16)</td><td>2.69 (1.02 x)</td><td>19.7 (1.07 x)</td></tr><tr><td>SINGD-Diag* (BFP-16)</td><td>2.67 (1.02 x)</td><td>23.8 (1.29 x)</td></tr><tr><td>IKFAC* (BFP-16)</td><td>3.18 (1.21 x)</td><td>34.0 (1.84 x)</td></tr><tr><td>INGD (BFP-16)</td><td>3.39 (1.29 x)</td><td>34.1 (1.84 x)</td></tr><tr><td>KFAC (FP-32)</td><td>4.00 (1.52 x)</td><td>83.2 (4.49 x)</td></tr></table>
43
+
44
+ scopes (SGD is best for CNNs, AdamW is best for transformers), SINGD works well and outperforms SGD and AdamW in many cases (see Section 4).
45
+
46
+ Our work closes a gap between first- and second-order methods in modern low precision neural network training<sup>1</sup>.
47
+
48
+ # 2. Preliminaries
49
+
50
+ We first introduce the necessary ingredients to establish a connection between INGD and KFAC, which are derived from different perspectives. We start by describing Newton's method since both methods can be seen as approxi
51
+
52
+ ![](images/aa5b248fdf3748bbe2ac15ec002e728e27bc695a1822a3b80871a2acd4120e5f.jpg)
53
+ Figure 2: Existing methods and their relation to our proposed methods. IKFAC behaves like KFAC (Theorem 1), but is numerically stable in low precision. In contrast to IKFAC, INGD has Riemannian momenta and adaptive damping and curvature, which can yield better performance in practice (Section 4). INGD is equivalent to SINGD with unstructured Kronecker factors (SINGD-Dense). Structured Kronecker factors reduce memory and computational cost.
54
+
55
+ mate Newton methods using NGD. NN training often corresponds to an unconstrained minimization problem. Consider training a NN for image classification. Given a set of $N$ examples $\{y_i,\mathbf{x}_i\}_{i = 1}^N$ with labels $y_{i}$ and images $\mathbf{x}_i$ , the optimization problem is
56
+
57
+ $$
58
+ \min _ {\mu} \ell (\boldsymbol {\mu}; \mathbf {y}, \mathbf {X}) := \min _ {\mu} \sum_ {i = 1} ^ {N} c \left(y _ {i}, f \left(\boldsymbol {\mu}; \mathbf {x} _ {i}\right)\right), \tag {1}
59
+ $$
60
+
61
+ where $\mathbf{y} := (y_1, \ldots, y_N)$ , $\mathbf{X} := (\mathbf{x}_1, \ldots, \mathbf{x}_N)$ , and $\hat{y}_i := f(\boldsymbol{\mu}; \mathbf{x}_i)$ is a NN that outputs a predicted label $\hat{y}_i$ for an image $\mathbf{x}_i$ . Parameters $\boldsymbol{\mu}$ denote learnable weights of the NN and $c(y_i, \hat{y}_i)$ is a differentiable loss function to measure the difference between a true label $y_i$ and a predicted label $\hat{y}_i$ . To solve Equation (1), Newton's method follows the update
62
+
63
+ $$
64
+ \boldsymbol {\mu} \leftarrow \boldsymbol {\mu} - \mathbf {S} ^ {- 1} \left(\nabla_ {\boldsymbol {\mu}} \ell (\boldsymbol {\mu}; \mathbf {y}, \mathbf {X})\right), \tag {2}
65
+ $$
66
+
67
+ where $\mathbf{S} := \nabla_{\mu}^{2}\ell(\boldsymbol{\mu};\mathbf{y},\mathbf{X})$ is the Hessian of the loss.
68
+
69
+ # 2.1. KFAC: Approximate NGD for MLE
70
+
71
+ Computing the Hessian, as required by Newton's method, is usually intractable for NNs. NGD uses a Fisher information matrix (FIM) instead of the Hessian by reformulating problem (1) as maximum likelihood estimation (MLE) of $p(\mathbf{y} \mid \boldsymbol{\mu}, \mathbf{X}) = \prod_{i} p(y_{i} \mid \boldsymbol{\mu}, \mathbf{x}_{i})$ , where $p(y_{i} \mid \boldsymbol{\mu}, \mathbf{x}_{i}) \coloneqq \exp(-c(y_{i}, f(\boldsymbol{\mu}, \mathbf{x}_{i})))$ . The maximization problem $\max_{\boldsymbol{\mu}} p(\mathbf{y} \mid \boldsymbol{\mu}, \mathbf{X})$ is equivalent to the MLE problem
72
+
73
+ $$
74
+ \min _ {\mu} - \log p (\mathbf {y} \mid \boldsymbol {\mu}, \mathbf {X}) = \min _ {\mu} \ell (\boldsymbol {\mu}; \mathbf {y}, \mathbf {X}). \tag {3}
75
+ $$
76
+
77
+ This formulation allows to exploit additional statistical structures such as the FIM which is defined as shown below (Kunstner et al., 2019), where we assume a label $y$ is sampled from the likelihood $p(y \mid \mu, \mathbf{x}_i)$ given an image $\mathbf{x}_i$ . With $\mathbf{s}_i(y) \coloneqq \log p(y \mid \mu, \mathbf{x}_i)$ , we have
78
+
79
+ $$
80
+ \begin{array}{l} F (\boldsymbol {\mu}) := \sum_ {i = 1} ^ {N} _ {N} \mathbb {E} _ {y \sim p (y | \mu , x _ {i})} \left[ \nabla_ {\mu} \mathbf {s} _ {i} (y) \left(\nabla_ {\mu} \mathbf {s} _ {i} (y)\right) ^ {\top} \right] \tag {4} \\ = \sum_ {i = 1} ^ {N} \mathbb {E} _ {y \sim p (y | \mu , x _ {i})} \left[ - \nabla_ {\mu} ^ {2} \mathbf {s} _ {i} (y) \right]. \\ \end{array}
81
+ $$
82
+
83
+ For ubiquitous loss functions like the mean-squared error and cross-entropy, and more generally, many members of
84
+
85
+ the exponential family with natural parameterization, the FIM coincides with the generalized Gauss-Newton (GGN) matrix (Wang, 2010; Martens, 2014), a common approximation of the Hessian in deep learning (Schraudolph, 2002; Botev et al., 2017). This relationship connects NGD to Newton's method. A common approximation of the FIM/GGN and Hessian is the so-called empirical Fisher $\hat{F} (\pmb {\mu})$ , which replaces the samples $y$ from the model's predictive distribution in Equation (4) with the empirical data labels $y_{i}$ :
86
+
87
+ $$
88
+ \begin{array}{l} \hat {F} (\boldsymbol {\mu}) := \sum_ {i = 1} ^ {N} \nabla_ {\boldsymbol {\mu}} \mathbf {s} _ {i} (y _ {i}) \left(\nabla_ {\boldsymbol {\mu}} \mathbf {s} _ {i} (y _ {i})\right) ^ {\top} \\ \approx - \sum_ {i = 1} ^ {N} \nabla_ {\mu} ^ {2} \mathbf {s} _ {i} (y _ {i}) = \mathbf {S}. \\ \end{array}
89
+ $$
90
+
91
+ While there is no clear theoretical justification for this Hessian approximation (Kunstner et al., 2019), it simplifies the implementation, reduces cost, and has been shown to work well in practice (Graves, 2011; Osawa et al., 2019). This approximation is also known as Fisher's scoring with observed FIM for nonlinear models (Osborne, 1992; Smyth, 1996; 2015). With this, we can formulate an NGD update with the empirical FIM $\hat{F}(\mu)$ to approximate Newton's method as
92
+
93
+ $$
94
+ \begin{array}{l} \boldsymbol {\mu} \leftarrow \boldsymbol {\mu} - \beta (\hat {F} (\boldsymbol {\mu})) ^ {- 1} \nabla_ {\boldsymbol {\mu}} \ell (\boldsymbol {\mu}; \mathbf {y}, \mathbf {X}) \\ \approx \boldsymbol {\mu} - \beta \mathbf {S} ^ {- 1} \nabla_ {\boldsymbol {\mu}} \ell (\boldsymbol {\mu}; \mathbf {y}, \mathbf {X}). \\ \end{array}
95
+ $$
96
+
97
+ We call this update NGD for MLE.
98
+
99
+ KFAC (Heskes, 2000; Martens & Grosse, 2015) is the probably most common second-order optimizer in DL. The KFAC algorithm is based on a Kronecker-factored approximation of the Fisher, which is also sometimes referred to as KFAC. Here, we refer to the algorithm as KFAC or KFAC method and to the approximation as Kronecker approximation; we will consider the empirical Fisher's Kronecker approximation. It approximates the per-layer FIM with a Kronecker-factored block $\tilde{F}_l$ for each layer $l$ of the net. This approximation has first been derived for linear layers, later for convolutional (Grosse & Martens, 2016) and recurrent layers (Martens et al., 2018), and recently been generalized to all linear layers that use weight sharing (Eschenhagen et al., 2023), e.g. graph neural networks
100
+
101
+ and transformers. A block is given by $\tilde{F}_l(\pmb{\mu}) \coloneqq \mathbf{U}_l \otimes \mathbf{G}_l$ , with $\mathbf{U}_l \coloneqq \mathbf{u}_l \mathbf{u}_l^\top \in \mathbb{R}^{d_i \times d_i}$ and $\mathbf{G}_l \coloneqq \mathbf{g}_l \mathbf{g}_l^\top \in \mathbb{R}^{d_o \times d_o}$ , where $\mathbf{u}_l \in \mathbb{R}^{d_i}$ is the $l$ th layer's input and $\mathbf{g}_l \in \mathbb{R}^{d_o}$ is the gradient of the loss w.r.t. the layer's output. We suppress the dependence on the parameters $\pmb{\mu}$ and the input $\mathbf{x}_i$ and, for simplicity, assume no weight sharing. KFAC also uses exponential moving averages $(\beta_1)$ over $\mathbf{U}$ and $\mathbf{G}$ (yielding $\mathbf{S}_K, \mathbf{S}_C$ ) and damping $\lambda$ , see Figure 3.
102
+
103
+ While the Kronecker approximation enables more efficient gradient preconditioning, KFAC needs to store the dense Kronecker factors $\mathbf{S}_K$ and $\mathbf{S}_C$ and invert them at every preconditioner update. The run time overhead is usually amortized by updating the preconditioner less frequently, but this can cause instabilities, especially in low-precision settings. Second, the Kronecker factors introduce significant memory overhead, which poses issues in large models. Since low-precision training is becoming the standard norm in fields like natural language processing, these issues will become more apparent in modern DL. There are multiple numerical concerns when using KFAC or variants thereof in low precision. In PyTorch (Paszke et al., 2019) and JAX (Bradbury et al., 2018) implementations, all tensors must be casted into FP-32 as (B)FP-16 matrix inverses/decompositions are not supported. Moreover, $\mathbf{g}_l$ has to be rescaled to avoid over- or under-flows when calculating $\mathbf{G}_l$ . Memory consumption has previously been addressed through diagonal or block-diagonal versions of $\mathbf{U}_l$ , $\mathbf{G}_l$ (Zhang et al., 2018; Grosse et al., 2023). However, it is unclear if these simple structures maintain downstream performance.
104
+
105
+ # 2.2. INGD: Approximate NGD for Bayesian estimation
106
+
107
+ Derived from Bayesian principles, INGD (Lin et al., 2023) directly approximates the Hessian inverse. We first introduce two ingredients INGD builds on: the Bayesian learning rule (BLR, Khan & Lin, 2017; Zhang et al., 2018; Khan et al., 2018; Osaka et al., 2019; Lin et al., 2020; Khan & Rue, 2021; Tan, 2022) and an inverse-free second-order method from Lin et al. (2021). By the BLR, Newton's method to solve the MLE (3) can be seen as another natural-gradient update to solve a variational inference (VI) problem with a delta approximation (Khan & Rue, 2021). This interpretation allows to view a precision matrix in the variational problem as Hessian estimation in the MLE problem. Thus, Lin et al. (2021) suggest reparameterizing the Hessian as the precision of the Gaussian posterior in a matrix logarithm space and exploiting the parameterization invariance of natural gradients to obtain an inverse-free update.
108
+
109
+ BLR Consider a Bayesian problem formulation, where NN weights are random variables. We denote these weights by new parameters $\mathbf{w}$ since random variables are no longer learnable and use a variational Gaussian distribution to approximate the posterior over the random variables. Its mean
110
+
111
+ and precision will be treated as the learnable weights $\mu$ and the Hessian estimation $\mathbf{S}$ in Newton's step (2).
112
+
113
+ The VI problem considered in the learning rule is defined as $\min_{\tau} - \mathcal{L}(\tau)$ with the evidence lower bound (ELBO)
114
+
115
+ $$
116
+ \begin{array}{l} \mathcal {L} (\boldsymbol {\tau}) := \mathbb {E} _ {w \sim q (w | \tau)} \left[ \log p (\mathbf {w}) + \log p (\mathbf {y} \mid \mathbf {w}, \mathbf {X}) \right] \tag {5} \\ + H _ {q} (\boldsymbol {\tau}). \\ \end{array}
117
+ $$
118
+
119
+ $\pmb{\tau} = \{\pmb{\mu}, \mathbf{S}\}$ are the learnable parameters of the variational Gaussian distribution $q(\mathbf{w} \mid \pmb{\tau}) = \mathcal{N}(\mathbf{w} \mid \pmb{\mu}, \mathbf{S})$ with mean $\pmb{\mu}$ and precision $\mathbf{S}$ . The likelihood $p(\mathbf{y} \mid \mathbf{w}, \mathbf{X}) = \exp(-\ell(\mathbf{w}; \mathbf{y}, \mathbf{X}))$ takes the same form as in the MLE setting while the prior $p(\mathbf{w}) \propto \exp(-R(\mathbf{w}))$ is defined by a regularizer $R(\mathbf{w}) \geq 0$ . To recover the MLE problem, we consider an uninformative prior $p(\mathbf{w})$ (i.e., $R(\mathbf{w}) = 0$ ). $H_{q}(\pmb{\tau}) := \mathbb{E}_{w \sim q}[-\log q]$ is the entropy of $q(\mathbf{w} \mid \pmb{\tau})$ .
120
+
121
+ Similar to the MLE case, the Bayesian formulation allows to exploit additional statistical structures in form of another FIM, which is that of the variational Gaussian defined as
122
+
123
+ $$
124
+ \begin{array}{l} F (\boldsymbol {\tau}) := \mathbb {E} _ {w \sim q (w | \tau)} \left[ \nabla_ {\tau} \log q (\mathbf {w} \mid \boldsymbol {\tau}) \nabla_ {\tau} ^ {\top} \log q (\mathbf {w} \mid \boldsymbol {\tau}) \right] \\ = - \mathbb {E} _ {w \sim q} \left[ \nabla_ {\tau} ^ {2} \log q (\mathbf {w} \mid \boldsymbol {\tau}) \right], \\ \end{array}
125
+ $$
126
+
127
+ and has a closed-form expression. This FIM should not be confused with the FIM used for MLE (4).
128
+
129
+ Under the BLR, we perform NGD updates not only on $\pmb{\mu}$ but also on S. Khan & Rue (2021) formulate a step with the exact FIM $F(\tau)$ and stepsize $\beta > 0$ to update $\pmb{\tau} = \{\pmb{\mu}, \mathbf{S}\}$ ,
130
+
131
+ $$
132
+ \boldsymbol {\tau} \leftarrow \boldsymbol {\tau} - \beta \Big (F (\boldsymbol {\tau}) \Big) ^ {- 1} \nabla_ {\boldsymbol {\tau}} \left(- \mathcal {L} (\boldsymbol {\tau})\right).
133
+ $$
134
+
135
+ This is the NGD update for BLR, vis-à-vis for MLE. Following Khan & Nielsen (2018), the update simplifies to
136
+
137
+ $$
138
+ \mathbf {S} \leftarrow (1 - \beta) \mathbf {S} + \beta \mathbb {E} _ {w \sim q (w | \mu , S)} \left[ \nabla_ {w} ^ {2} \ell (\mathbf {w}; \mathbf {y}, \mathbf {X}) \right],
139
+ $$
140
+
141
+ $$
142
+ \pmb {\mu} \gets \pmb {\mu} - \beta \mathbf {S} ^ {- 1} \mathbb {E} _ {w \sim q (w | \mu , S)} \left[ \nabla_ {w} \ell (\mathbf {w}; \mathbf {y}, \mathbf {X}) \right].
143
+ $$
144
+
145
+ Further simplifying expectations with a delta approximation (highlighted in red) at mean $\mu$ , we obtain
146
+
147
+ $$
148
+ \mathbf {S} \leftarrow (1 - \beta) \mathbf {S} + \beta \nabla_ {\mu} ^ {2} \ell (\boldsymbol {\mu}; \mathbf {y}, \mathbf {X}),
149
+ $$
150
+
151
+ $$
152
+ \boldsymbol {\mu} \leftarrow \boldsymbol {\mu} - \beta \mathbf {S} ^ {- 1} \nabla_ {\boldsymbol {\mu}} \ell (\boldsymbol {\mu}; \mathbf {y}, \mathbf {X}).
153
+ $$
154
+
155
+ which recovers Newton's method in (2) for $\beta = 1$ .
156
+
157
+ Removing inversion Lin et al. (2021) reparameterize the precision matrix $\mathbf{S}$ in a matrix logarithm space and perform natural gradient updates in this space, which transforms inversion into subtraction. One can go back directly to the original space, without explicitly inverting a matrix, via a truncated matrix exponential. The method is inverse-free and, since NGs are parameterization invariant, Newton-like.
158
+
159
+ # KFAC (Martens & Grosse, 2015)
160
+
161
+ 1: Each $T$ iter, update $\mathbf{S}_K$ , $\mathbf{S}_C$ Obtain $\mathbf{U} \otimes \mathbf{G}$ to approximate $\nabla_{\mu}^{2}\ell(\boldsymbol{\mu})$
162
+
163
+ $$
164
+ \mathbf {S} _ {K} \leftarrow \left(1 - \beta_ {1}\right) \mathbf {S} _ {K} + \beta_ {1} \mathbf {U}
165
+ $$
166
+
167
+ $$
168
+ \mathbf {S} _ {C} \leftarrow \left(1 - \beta_ {1}\right) \mathbf {S} _ {C} + \beta_ {1} \mathbf {G}
169
+ $$
170
+
171
+ $$
172
+ \mathbf {S} _ {K} ^ {- 1} \leftarrow \left(\mathbf {S} _ {K} + \lambda \mathbf {I} _ {d _ {i}}\right) ^ {- 1}
173
+ $$
174
+
175
+ $$
176
+ \mathbf {S} _ {C} ^ {- 1} \leftarrow \left(\mathbf {S} _ {C} + \lambda \mathbf {I} _ {d _ {o}}\right) ^ {- 1}
177
+ $$
178
+
179
+ 2: $\mathbf{m}_{\mu} \gets \alpha_{2}\mathbf{m}_{\mu} + \mathbf{S}_{C}^{-1}\mathrm{vec}^{-1}(\mathbf{g})\mathbf{S}_{K}^{-1} + \gamma \mathrm{vec}^{-1}(\boldsymbol{\mu})$
180
+ 3: $\pmb{\mu} \gets \pmb{\mu} - \beta_{2}\mathrm{vec}(\mathbf{m}_{\mu})$
181
+
182
+ # IKFAC (ours)
183
+
184
+ $$
185
+ \text {O b t a i n} \mathbf {U} \otimes \mathbf {G} \text {t o a p p r o x i m a t e} \nabla_ {\mu} ^ {2} \ell (\boldsymbol {\mu})
186
+ $$
187
+
188
+ $$
189
+ \mathbf {m} _ {K} \leftarrow 0 \mathbf {m} _ {K} + \frac {1}{2 d _ {o}} \left(d _ {o} \mathbf {H} _ {K} + \lambda d _ {o} \mathbf {K} ^ {\top} \mathbf {K} - d _ {o} \mathbf {I} _ {d _ {i}}\right)
190
+ $$
191
+
192
+ $$
193
+ \mathbf {m} _ {C} \leftarrow 0 \mathbf {m} _ {C} + \frac {1}{2 d _ {i}} \left(d _ {i} \mathbf {H} _ {C} + \lambda d _ {i} \mathbf {C} ^ {\top} \mathbf {C} - d _ {i} \mathbf {I} _ {d _ {o}}\right)
194
+ $$
195
+
196
+ $$
197
+ \mathbf {K} \leftarrow \mathbf {K} \left(\mathbf {I} _ {d _ {i}} - \beta_ {1} \mathbf {m} _ {K}\right)
198
+ $$
199
+
200
+ $$
201
+ \mathbf {C} \leftarrow \mathbf {C} \left(\mathbf {I} _ {d _ {o}} - \beta_ {1} \mathbf {m} _ {C}\right)
202
+ $$
203
+
204
+ 1: Each $T$ iters, update $\mathbf{m}_K$ , $\mathbf{m}_C$ , $\mathbf{K}$ , $\mathbf{C}$
205
+ 2: $\mathbf{m}_{\mu} \gets \alpha_{2}\mathbf{m}_{\mu} + \mathbf{C}\mathbf{C}^{\top}\mathrm{vec}^{-1}(\mathbf{g})\mathbf{K}\mathbf{K}^{\top} + \gamma \mathrm{vec}^{-1}(\pmb{\mu})$
206
+ 3: $\pmb{\mu} \gets \pmb{\mu} - \beta_{2}\mathrm{vec}(\mathbf{m}_{\mu})$
207
+
208
+ Figure 3: Comparison between KFAC and IKFAC update for one weight matrix $\mathrm{vec}^{-1}(\pmb{\mu}) \in \mathbb{R}^{d_o \times d_i}$ . The flattened gradient is $\mathbf{g} \coloneqq \nabla_{\mu} \ell(\pmb{\mu}) \in \mathbb{R}^{d_o d_i}$ and $\mathrm{vec}^{-1}(\mathbf{g}) \in \mathbb{R}^{d_o \times d_i}$ is its matrix reshape. IKFAC uses $\mathbf{H}_K \coloneqq \mathbf{K}^\top \mathbf{U}\mathbf{K}$ and $\mathbf{H}_C \coloneqq \mathbf{C}^\top \mathbf{G}\mathbf{C}$ to incorporate the Kronecker curvature $\mathbf{U}$ and $\mathbf{G}$ . Both methods use momentum buffers $\mathbf{m}_{\mu}$ for the weight-decayed update direction with momentum $\alpha_2$ and weight decay $\gamma$ , and a learning rate $\beta_2$ for the parameter update. (Left) KFAC uses an exponentially moving average with decay $1 - \beta_1$ to accumulate the Kronecker factors and applies a damping term $\lambda\mathbf{I}$ before inversion to handle potential singularities in $\mathbf{S}_K$ , $\mathbf{S}_C$ . (Right) In contrast to KFAC, IKFAC directly approximates $(\mathbf{S}_K + \lambda\mathbf{I})^{-1}$ and $(\mathbf{S}_C + \lambda\mathbf{I})^{-1}$ by $\mathbf{KK}^\top$ and $\mathbf{CC}^\top$ . The pre-conditioner update is a modification of INGD (Lin et al., 2023) and the changes—zero Riemannian momentum, and non-adaptive damping and curvature—are highlighted in red.
209
+
210
+ # INGD (Lin et al., 2023)
211
+
212
+ 1: Each $T$ iterations, update $\mathbf{m}_K,\mathbf{m}_C,\mathbf{K},\mathbf{C}$
213
+
214
+ $$
215
+ \begin{array}{l} \text {O b t a i n} \mathbf {U} \otimes \mathbf {G} \text {t o a p p r o x i m a t e} \nabla_ {\mu} ^ {2} \ell (\boldsymbol {\mu}) \\ \mathbf {m} _ {K} \leftarrow \alpha_ {1} \mathbf {m} _ {K} + \frac {1}{2 d _ {o}} \left(\operatorname {T r} \left(\mathbf {H} _ {C}\right) \mathbf {H} _ {K} + c ^ {2} \mathbf {K} ^ {\top} \mathbf {K} - d _ {o} \mathbf {I} _ {d _ {i}}\right) \\ \mathbf {m} _ {C} \leftarrow \alpha_ {1} \mathbf {m} _ {C} + \frac {1}{2 d _ {i}} \left(\operatorname {T r} \left(\mathbf {H} _ {K}\right) \mathbf {H} _ {C} + \kappa^ {2} \mathbf {C} ^ {\top} \mathbf {C} - d _ {i} \mathbf {I} _ {d _ {o}}\right) \\ \mathbf {K} \leftarrow \mathbf {K} \left(\mathbf {I} _ {d _ {i}} - \beta_ {1} \mathbf {m} _ {K}\right) \\ \mathbf {C} \leftarrow \mathbf {C} \left(\mathbf {I} _ {d _ {o}} - \beta_ {1} \mathbf {m} _ {C}\right) \\ \end{array}
216
+ $$
217
+
218
+ 2: $\mathbf{m}_{\mu} \gets \alpha_{2}\mathbf{m}_{\mu} + \mathbf{C}\mathbf{C}^{\top}\mathrm{vec}^{-1}(\mathbf{g})\mathbf{K}\mathbf{K}^{\top} + \gamma \mathrm{vec}^{-1}(\boldsymbol{\mu})$
219
+ 3: $\pmb{\mu} \gets \pmb{\mu} - \beta_{2}\mathrm{vec}(\mathbf{m}_{\mu})$
220
+
221
+ # SINGD (ours)
222
+
223
+ $$
224
+ \text {O b t a i n} \mathbf {U} \otimes \mathbf {G} \text {t o a p p r o x i m a t e} \nabla_ {\mu} ^ {2} \ell (\boldsymbol {\mu})
225
+ $$
226
+
227
+ $$
228
+ \hat {\mathcal {L}} _ {m _ {K}} \gets \alpha_ {1} \hat {\mathcal {L}} _ {m _ {K}} + \frac {1}{2 d _ {o}} \hat {\Pi} _ {K} (\mathrm {T r} (\mathbf {H} _ {\hat {\mathcal {L}} _ {C}}) \mathbf {H} _ {\hat {\mathcal {L}} _ {K}} + c ^ {2} (\hat {\mathcal {L}} _ {K}) ^ {\top} \hat {\mathcal {L}} _ {K} - d _ {o} \mathbf {I} _ {d _ {i}})
229
+ $$
230
+
231
+ $$
232
+ \hat {\mathcal {L}} _ {m _ {C}} \leftarrow \alpha_ {1} \hat {\mathcal {L}} \mathbf {m} _ {C} + \frac {1}{2 d _ {i}} \hat {\Pi} _ {C} \left(\operatorname {T r} \left(\mathbf {H} _ {\hat {\mathcal {L}} _ {K}}\right) \mathbf {H} _ {\hat {\mathcal {L}} _ {C}} + \kappa^ {2} \left(\hat {\mathcal {L}} _ {C}\right) ^ {\top} \hat {\mathcal {L}} _ {C} - d _ {i} \mathbf {I} _ {d _ {o}}\right)
233
+ $$
234
+
235
+ $$
236
+ \hat {\mathcal {L}} _ {K} \leftarrow \hat {\mathcal {L}} _ {K} \left(\mathbf {I} _ {d _ {i}} - \beta_ {1} \hat {\mathcal {L}} _ {m _ {K}}\right)
237
+ $$
238
+
239
+ $$
240
+ \hat {\mathcal {L}} _ {C} \leftarrow \hat {\mathcal {L}} _ {C} \left(\mathbf {I} _ {d _ {o}} - \beta_ {1} \hat {\mathcal {L}} _ {m _ {C}}\right)
241
+ $$
242
+
243
+ 1: Each $T$ iterations, update $\hat{\mathcal{L}}_{m_K},\hat{\mathcal{L}}_{m_C},\hat{\mathcal{L}}_K,\hat{\mathcal{L}}_C$
244
+ 2: $\mathbf{m}_{\mu} \gets \alpha_{2}\mathbf{m}_{\mu} + \hat{\mathcal{L}}_{C}(\hat{\mathcal{L}}_{C})^{\top}\mathrm{vec}^{-1}(\mathbf{g})\hat{\mathcal{L}}_{K}(\hat{\mathcal{L}}_{K})^{\top} + \gamma \mathrm{vec}^{-1}(\boldsymbol{\mu})$
245
+ 3: $\pmb{\mu} \gets \pmb{\mu} - \beta_{2}\mathrm{vec}(\mathbf{m}_{\mu})$
246
+
247
+ Figure 4: Comparison of a single weight matrix's update between INGD and our extension—SINGD—via structured Kronecker factors. (Left) INGD features Riemannian momentum $(\alpha_{1})$ , adaptive curvature $(\mathrm{Tr}(\mathbf{H}_{C}), \mathrm{Tr}(\mathbf{H}_{K}))$ , adaptive damping $(c^{2} := \lambda \mathrm{Tr}(\mathbf{C}^{\top}\mathbf{C}), \kappa^{2} := \lambda \mathrm{Tr}(\mathbf{K}^{\top}\mathbf{K}))$ , and correlated updates of $\mathbf{K}$ and $\mathbf{C}$ ( $\mathbf{m}_{K}, \mathbf{m}_{C}$ ). The pre-conditioner matrices are updated with a learning rate $\beta_{1}$ , and the optimizer keeps a momentum buffer on the weight-decayed update with momentum $\alpha_{2}$ and weight decay $\gamma$ . The learning rate for the parameters is $\beta_{2}$ . (Right) SINGD's update is similar but each Kronecker factor and its momentum $(\bullet)$ is replaced by its structured version $(\hat{\mathcal{L}}_{\bullet}$ , e.g. (block-)diagonal); likewise in the computation of $c^{2}, \kappa^{2}, \mathbf{H}_{K}$ , and $\mathbf{H}_{C}$ . When updating the momenta, their structure is preserved through a subspace projection map $\hat{\Pi}_{\bullet}(\cdot)$ that restores $\hat{\mathcal{L}}_{\bullet}$ 's structure from a dense symmetric matrix $\cdot$ (e.g. taking the (block) diagonal). Importantly, we can efficiently compute the extraction map without expanding its argument in dense form, which reduces memory and run time. The extension of IKFAC to SIKFAC is analogous. One of the notable elements of INGD and SINGD is that they are scale invariant to the choice of the Kronecker approximation (see Appendix E) as the approximation is not unique.
248
+
249
+ The first step is to express the precision matrix $\mathbf{S}$ using a nonsingular square matrix $\mathbf{A}$ as $\mathbf{S} = \mathbf{A}^{-\top}\mathbf{A}^{-1}$ and perform a natural gradient step using the exact FIM in a tangent space (denoted by $\mathbf{M}$ ) of $\mathbf{A}_t$ at iteration $t$ . We then construct a new map as $\mathbf{A} \coloneqq \phi(\mathbf{A}_t, \mathbf{M}) \coloneqq \mathbf{A}_t\mathrm{Expm}(1/2\mathbf{M})$ using both the current point $\mathbf{A}_t$ and $\mathbf{M}$ as input, where $\mathrm{Expm}(\mathbf{N}) = \mathbf{I} + \sum_{j=1}^{\infty}\mathbf{N}^j / j!$ is the matrix exponential. Observe that $\mathbf{M}$ stays in a matrix logarithm space. At each iteration $t$ , we use a new matrix logarithm space associated to $\mathbf{A}_t$ and generate a new origin $\mathbf{M}_0 = \mathbf{0}$ in this space to represent $\mathbf{A}_t$ since $\mathbf{A}_t \equiv \phi(\mathbf{A}_t, \mathbf{0}) = \mathbf{A}_t\mathrm{Expm}(1/2\mathbf{M}_0)$ . The map $\phi$ is a local reparameterization map that takes not only $\mathbf{M}$ but also $\mathbf{A}_t$ as input. Thanks to this map, the Fisher block is locally orthonormalized (Lin et al., 2023) at origin $\mathbf{M}_0$ . Since we
250
+
251
+ used the origin to represent $\mathbf{A}_t$ in the local coordinate $\mathbf{M}$ , a natural gradient step becomes a (Euclidean) gradient step in the space of $\mathbf{M}$ , which makes it easy to add Riemannian momentum (Lin et al., 2023) into the structured positive-definite matrix $\mathbf{S}$ . This allows to perform updates in the logarithmic space of $\mathbf{M}$ and avoid matrix inversions:
252
+
253
+ $$
254
+ \mathbf {M} \leftarrow \mathbf {M} _ {0} - \beta \mathbf {N},
255
+ $$
256
+
257
+ $$
258
+ \boldsymbol {\mu} \leftarrow \boldsymbol {\mu} - \beta \mathbf {A} _ {t + 1} \mathbf {A} _ {t + 1} ^ {\top} \nabla_ {\mu} \ell (\boldsymbol {\mu}; \mathbf {y}, \mathbf {X}), \tag {6}
259
+ $$
260
+
261
+ where $\mathbf{A}_{t + 1}\coloneqq \phi (\mathbf{A}_t,\mathbf{M}) = \mathbf{A}_t\mathrm{Expm}(1 / 2\mathbf{M})$ and $\mathbf{N}\coloneqq \mathbf{A}_t^\top \nabla_\mu^2\ell (\pmb {\mu};\mathbf{y},\mathbf{X})\mathbf{A}_t - \mathbf{I}$ . Equation (6) is a Newton-like update without matrix inverse. To see that, we can reexpress the update of $\mathbf{A}$ in terms of $\mathbf{S}$ and use properties of the
262
+
263
+ matrix exponential function,
264
+
265
+ $$
266
+ \begin{array}{l} \mathbf {S} _ {t + 1} = \mathbf {A} _ {t + 1} ^ {- T} \mathbf {A} _ {t + 1} ^ {- 1} = \mathbf {A} _ {t} ^ {- T} \operatorname {E x p m} (\beta \mathbf {N}) \mathbf {A} _ {t} ^ {- 1} \\ = (1 - \beta) \mathbf {S} _ {t} + \beta \nabla_ {\mu} ^ {2} \ell (\boldsymbol {\mu}; \mathbf {y}, \mathbf {X}) + O (\beta^ {2}). \\ \end{array}
267
+ $$
268
+
269
+ Next, we can construct a structured precision matrix $\mathbf{S}$ as a structured Hessian estimation using a sparse non-singular matrix $\mathbf{A}$ . As we will discuss in Section 3.2, it is essential to update $\mathbf{M}$ to preserve sparsity in $\mathbf{A}$ . The space of $\mathbf{M}$ as a tangent/logarithm space of $\mathbf{A}$ allows us to efficiently impose sparse structures on $\mathbf{A}$ without requiring the Hessian $\nabla_{\mu}^{2}\ell (\boldsymbol{\mu};\mathbf{y},\mathbf{X})$ or a Hessian approximation to be sparse or structured. This is different from another inverse-free method (Tan, 2022) that considers directly performing NGD updates of $\mathbf{A}$ instead of $\mathbf{M}$ , where $\mathbf{A}$ must be restricted to a (triangular) Cholesky factor. This does not preserve sparsity in $\mathbf{A}$ unless the Hessian or its approximation admits a special structure, which is usually not the case in DL problems.
270
+
271
+ INGD Our work is built on INGD (Figure 4) where $\mathbf{A} = \mathbf{K} \otimes \mathbf{C}$ is factorized into two Kronecker factors. The exact FIM under this parameterization is singular due to a correlation between $\mathbf{K}$ and $\mathbf{C}$ : the Kronecker factorization is not unique. Lin et al. (2023) propose a (non-singular) block-diagonal approximated FIM by ignoring the correlation in the original FIM and perform NGD with this block-diagonal FIM on tangent spaces of the factors. Riemannian momentum is further introduced in the update of $\mathbf{K}$ and $\mathbf{C}$ . They use the Kronecker approximation discussed in Section 2.1 to approximate the Hessian $\nabla_{\mu}^{2}\ell(\boldsymbol{\mu};\mathbf{y},\mathbf{X})$ and truncate the matrix exponential to obtain a purely matrix-multiplication based update scheme. It is unclear how INGD is related to KFAC which uses another Kronecker factorization $\mathbf{S} = \mathbf{S}_K \otimes \mathbf{S}_C$ . INGD also remains memory-inefficient due to the use of dense Kronecker factors. The authors only consider and evaluate it on convolution-based models in single precision. It remains unclear whether INGD is useful to train transformer-based models, and in half-precision.
272
+
273
+ # 3. Structured inverse-free NGD
274
+
275
+ Inspired by INGD, we propose an inverse-free KFAC update as a specific setting of INGD to address KFAC's numerical instability in low precision. We show that this scheme effectively recovers KFAC. We then address the memory inefficiency of KFAC and INGD for training transformer-based models by extending INGD with structures.
276
+
277
+ # 3.1. Inverse-free KFAC Updates for Numerical Stability
278
+
279
+ We first propose a new inverse-free update to mimic the behavior of the KFAC update; we call this update IKFAC. We then show that IKFAC corresponds to a specific setting of INGD. This bridges the gap between INGD and KFAC and sheds light on the difference between both methods.
280
+
281
+ Inspired by INGD, we replace matrix inversion with matrix subtraction in a matrix logarithm space, then go back to the original space without explicitly inverting any matrix using a truncated matrix exponential map. The IKFAC update is related to the KFAC update as we will use $\mathbf{K}\mathbf{K}^{\top}$ and $\mathbf{C}\mathbf{C}^{\top}$ to approximate the inverse Kronecker factors $(\mathbf{S}_K + \lambda \mathbf{I})^{-1}$ and $(\mathbf{S}_C + \lambda \mathbf{I})^{-1}$ in KFAC, respectively. We propose the following IKFAC update with learning rate $\beta_{1}$ for $\mathbf{K}$ and $\mathbf{C}$ using a truncated matrix exponential
282
+
283
+ $$
284
+ \begin{array}{l} \mathbf {K} ^ {\text {n e w}} \leftarrow \mathbf {K} \left(\mathbf {I} - \beta_ {1} / 2 \mathbf {m} _ {K}\right), \\ \mathbf {G} ^ {\text {n e w}} = \mathbf {G} \left(\mathbf {I} - \frac {\partial \mathbf {J}}{\partial t} + \mathbf {v} _ {\text {o u t}}\right) \end{array} \tag {7}
285
+ $$
286
+
287
+ $$
288
+ \mathbf {C} ^ {\text {n e w}} \leftarrow \mathbf {C} \left(\mathbf {I} - \beta_ {1} / 2 \mathbf {m} _ {C}\right),
289
+ $$
290
+
291
+ where $\mathbf{H}_K\coloneqq \mathbf{K}^\top \mathbf{U}\mathbf{K}$ , $\mathbf{H}_C\coloneqq \mathbf{C}^\top \mathbf{G}\mathbf{C}$ , $\mathbf{m}_K\coloneqq \mathbf{H}_K + \lambda \mathbf{K}^\top \mathbf{K} - \mathbf{I}$ , $\mathbf{m}_C\coloneqq \mathbf{H}_C + \lambda \mathbf{C}^\top \mathbf{C} - \mathbf{I}$ . This update is inverse and matrix-decomposition-free. Since we truncate the matrix exponential $\mathrm{Expm}(-\beta_1 / 2\mathbf{m}_K)\approx (\mathbf{I} - \beta_1 / 2\mathbf{m}_K)$ , $\mathbf{m}_K$ indeed stays in a matrix logarithm space (see Appendix C). The logarithm space allows to impose structural constraints on $\mathbf{K}$ we discuss in Section 3.2.
292
+
293
+ The following theorem—proof in Appendix D—formally shows that $\mathbf{KK}^{\top}$ used in IKFAC is an approximation of $(\mathbf{S}_K + \lambda \mathbf{I})^{-1}$ in KFAC at every step even with a truncated matrix exponential. Similarly, $\mathbf{CC}^{\top}$ is an approximation of $(\mathbf{S}_C + \lambda \mathbf{I})^{-1}$ . Thus, IKFAC effectively recovers KFAC up to a first-order accuracy.
294
+
295
+ Theorem 1. If $\mathbf{K}$ is updated according to the IKFAC scheme (Figure 3) with the truncation of the matrix exponential and these two updates use the same initialization and the same sequence of curvature matrices $\mathbf{U}$ , then the product $\mathbf{KK}^{\top}$ has a first-order accuracy of the KFAC update of $(\mathbf{S}_K + \lambda \mathbf{I})^{-1}$ at each iteration, i.e., $\mathbf{KK}^{\top} = (\mathbf{S}_K + \lambda \mathbf{I})^{-1} + O(\beta_1^2)$ .
296
+
297
+ Theorem 1 trivially extends to diagonal and block-diagonal structures. I.e., KFAC with diagonal or block-diagonal Kronecker factors is equivalent to IKFAC with diagonal or block-diagonal structure up to first order in $\beta_{1}$ .
298
+
299
+ Now, we show that IKFAC is a specific case of INGD, whose update of $\mathbf{K}$ without Riemannian momentum $(\alpha_{1} = 0)$ is
300
+
301
+ $$
302
+ \mathbf {K} ^ {\mathrm {n e w}} \leftarrow \mathbf {K} \left[ \mathbf {I} _ {d _ {i}} - \frac {\beta_ {1}}{2 d _ {o}} \left(\operatorname {T r} (\mathbf {H} _ {C}) \mathbf {H} _ {K} + \lambda \operatorname {T r} (\mathbf {C} ^ {\top} \mathbf {C}) \mathbf {K} ^ {\top} \mathbf {K} - d _ {o} \mathbf {I} _ {d _ {i}}\right) \right] \tag {8}
303
+ $$
304
+
305
+ Since $\mathrm{Tr}(\mathbf{I}_{d_o}) = d_o$ , $\mathbf{H}_C \in \mathbb{R}^{d_o \times d_o}$ , $\mathbf{C} \in \mathbb{R}^{d_o \times d_o}$ , and $\mathbf{K} \in \mathbb{R}^{d_i \times d_i}$ , we can obtain IKFAC from INGD by simply replacing $\mathrm{Tr}(\mathbf{H}_C)$ and $\mathrm{Tr}(\mathbf{C}^\top \mathbf{C})$ with $\mathrm{Tr}(\mathbf{I}_{d_o})$ :
306
+
307
+ $$
308
+ \mathbf {K} ^ {\text {n e w}} \leftarrow \mathbf {K} \left[ \mathbf {I} _ {d _ {i}} - \frac {\beta_ {1}}{2 d _ {o}} \left(\operatorname {T r} \left(\mathbf {I} _ {d _ {o}}\right) \mathbf {H} _ {K} + \lambda \operatorname {T r} \left(\mathbf {I} _ {d _ {o}}\right) \mathbf {K} ^ {\top} \mathbf {K} - d _ {o} \mathbf {I} _ {d _ {i}}\right) \right]. \tag {9}
309
+ $$
310
+
311
+ This sheds light on the difference between both methods. In IKFAC (see Appendix C for details), $\mathbf{H}_K$ and $\lambda \mathbf{K}^{\top}\mathbf{K}$ are used for incorporating KFAC's curvature $\mathbf{U}$ and damping $\lambda \mathbf{I}$ , respectively. In contrast, the curvature and damping are adaptively incorporated in INGD using $(\mathrm{Tr}(\mathbf{H}_C) / d_o)\mathbf{H}_K$ and $(\lambda \mathrm{Tr}(\mathbf{C}^{\top}\mathbf{C}) / d_o)\mathbf{K}^{\top}\mathbf{K}$ . The updates of $\mathbf{K}$ and $\mathbf{C}$ are
312
+
313
+ Table 2: Subspaces of the logarithm space and their projection maps $\hat{\Pi}(\mathbf{M})$ , where $\mathbf{M}$ is a symmetric matrix. The hierarchical structure is constructed by replacing the diagonal matrix $\mathbf{D}_{22}$ in the rank- $\mathbf{k}$ upper-triangular structure with another rank- $\mathbf{k}$ triangular matrix $\begin{bmatrix} \mathbf{A}_{22} & 0 \\ \mathbf{A}_{23} & \mathbf{A}_{33} \end{bmatrix}$ for a better approximation.
314
+
315
+ <table><tr><td>Subspace of the log (Lie-algebraic) space</td><td>Matrix Lie sub-group structure in K</td><td>Subspace projection map Π(M)</td></tr><tr><td>[ a1,1 a2,1 a2,2 ... 0 ]a1,1 a2,1 a2,2 ... 0 ]a1,1 a1,2 ... a1,di,di]</td><td>Lower-triangular (Tril.)</td><td>[ m1,1 0 ... 0 2m2,1 m2,2 ... 0 ]: ... ... ... 2mdi,1 2mdi,2 ... mdi,di]</td></tr><tr><td>[ A11 0 ... 0 ]0 A22 ... 0 ]: ... ... 0 ]0 0 ... Aqq]</td><td>(Block) Diagonal (block size k)</td><td>[ M11 0 ... 0 0 M22 ... 0 ]: ... ... ... 0 0 ... Mqq]</td></tr><tr><td>[ A11 A12 A13 0 A22 0 ]A22 is diag., A11 ∈ Rd2×d2, A33 ∈ Rd3×d3</td><td>Hierarchical (k := d2 + d3)</td><td>[ M11 2M12 2M13 0 Diag(M22) 0 0 2M32 M33]</td></tr><tr><td>[ A11 A12 0 D22 ]D22 is diag., A11 ∈ Rk×k</td><td>Rank-k upper-triangular</td><td>[ M11 2M12 0 Diag(M22) ]</td></tr><tr><td>[ a0 a1 a2 ... a(di-1) 0 a0 a1 ... 0 ]Upper-triangular Toeplitz (Triu-Toepl.)</td><td>Upper-triangular Toeplitz (Triu-Toepl.)</td><td>[ b0 2b1 2b2 ... 2b(di-1) 0 b0 2b1 ... 2b2 0 ... ... 0 b0 ]bj := 1/di-j ∑ki=1di-jmk,k+j</td></tr></table>
316
+
317
+ ![](images/d955952aff783bb181441da2b8e55ec35c7705dee663e3ba1ceb349f99c9bc69.jpg)
318
+ Figure 5: Illustration of structured matrices (Kronecker factors) supported by SINGD, their self-outer product (approximate inverse Hessian factor), and its inverse (approximate Hessian factor). With rank-one triangular matrices $\mathbf{K}$ , we can easily impose a low-rank structure on $\mathbf{KK}^{\top}$ or $(\mathbf{KK}^{\top})^{-1}$ ; the latter is difficult to achieve with other approaches.
319
+
320
+ correlated in INGD due to the trace terms, while $\mathbf{K}$ and $\mathbf{C}$ are updated independently in IKFAC—just like $\mathbf{S}_K$ and $\mathbf{S}_C$ in KFAC. These trace terms are needed to satisfy the orthonormalization condition of the Fisher matrix (Lin et al., 2023). They make INGD and SINGD scale-invariant to the Kronecker approximation (see Appendix E) as the approximation is not unique. In contrast, KFAC and IKFAC are not scale-invariant. The trace terms together with Riemannian momentum $(\alpha_1 > 0)$ are missing in KFAC and IKFAC. Our experiments show that they can contribute to stability.
321
+
322
+ # 3.2. Sparse Kronecker Factors for Reducing Memory
323
+
324
+ Now, we extend INGD to reduce its memory and iteration cost. Existing sparse KFAC methods use (block-)diagonal structures for $\mathbf{S}_K$ and $\mathbf{S}_C$ (Zhang et al., 2019; Grosse et al., 2023). In contrast, we propose using sparse Kronecker factors $\mathbf{K}$ and $\mathbf{C}$ in INGD and exploiting Lie-algebraic properties in the logarithm space and algebraic sparsity of
325
+
326
+ the Kronecker factors. This enables more flexible structures (Figure 5) that potentially achieve better downstream performance than (block-)diagonal structures in $\mathbf{S}_K$ , $\mathbf{S}_C$ .
327
+
328
+ Other related works are Lie group preconditioners (Li, 2018; 2022) derived from directly approximating the Hessian. However, these methods can be computationally expensive and numerically unstable due to sampling random weights, using Hessian-vector products (Pearlmutter, 1994), and solving linear systems that are unstable in low precision. Our approach is sampling-free and inverse-free.
329
+
330
+ We want to construct sparse factors $\mathbf{K}$ and $\mathbf{C}$ without requiring the Kronecker/Hessian approximation $(\mathbf{U} \otimes \mathbf{G})$ to be further sparse or structured. Imposing sparsity often leads to a complicated FIM which makes it difficult to perform NGD due to the FIM inversion. It is essential to update $\mathbf{m}_K$ as the logarithm space of $\mathbf{K}$ to impose sparsity on $\mathbf{K}$ as the FIM in this (moving) coordinate $\mathbf{m}_K$ is simplified and becomes an identity matrix due to the orthonormalization condition.
331
+
332
+ ![](images/1969bc1c3597cc95b6a595c78edc0240330e6f4b3b4c815bd24501f6e523a683.jpg)
333
+ Figure 6: Test error curves for mixed-precision training in the transformer-based models with BFP-16 on datasets 'CIFAR-100' and 'ImageWoof-10'. SINGD performs as well as INGD while being memory efficient and, including IKFAC and INGD as special cases, outperforms AdamW in most of the cases. We omit KFAC since it performs unstably in BFP-16. The hierarchical structure often performs as well as the dense structure and outperforms the block-diagonal structure.
334
+
335
+ ![](images/4ab2dc4754e263552488df3cd7546f052fb11efbee7a67a2db9054396f153ed5.jpg)
336
+
337
+ ![](images/79293b11cf1410d6222bd67db9c77048c831166f4336eff25664be2d0c58cbc4.jpg)
338
+
339
+ ![](images/f216b12bb47589a7bd9b9504fd7dad7485d0deccf102d4d12a3c1bc3623dfd3e.jpg)
340
+
341
+ This condition (Lin et al., 2023) makes it easy for us to impose a range of sparse structures on $\mathbf{K}$ through a unified and inverse-free update rule (Figure 4) since we can avoid inverting the Fisher block regarding the sparse structures. We also exploit the algebraic sparsity in these structures to make our rule more efficient than INGD (Table 3).
342
+
343
+ We exploit Lie-algebraic properties in the log space of $\mathbf{m}_K$ to construct sparse structures of $\mathbf{K}$ . As a general design principle, we consider structures of $\mathbf{K}$ preserved under (i) elementwise matrix operations (subtraction and scalar multiplication) and (ii) matrix multiplication, which are needed for our updates. Concretely, we construct a new local reparameterization for $\mathbf{K}$ at iteration $t$ via
344
+
345
+ $$
346
+ \mathbf {K} := \psi (\mathbf {K} _ {t}, \mathbf {m} _ {K}) := \mathbf {K} _ {t} \mathrm {E x p m} \left(\frac {1}{\sqrt {2 d _ {i}}} \hat {\Pi} _ {K} (\mathbf {m} _ {K})\right),
347
+ $$
348
+
349
+ where $\hat{\Pi}_K(\mathbf{m}_K)$ projects the dense $\mathbf{m}_K$ to a subspace (identically for $\mathbf{C}$ , but potentially using a different structure $\hat{\Pi}_C$ ).
350
+
351
+ Many popular structures such as tri-diagonal matrices do not satisfy our requirements as they are not closed under matrix multiplication. Moreover, it can be difficult to construct the projection map to satisfy the orthonormalization condition. One subspace structure satisfying the requirements are upper/lower triangular matrices. The subspace projection $\hat{\Pi}_K$ is a weighted extraction map since projecting the logarithm space onto a subspace is like projecting a dense square matrix onto a triangular matrix. Technically, we use
352
+
353
+ $$
354
+ \mathbf {A} := \mathbf {K} _ {t} \mathrm {E x p m} \left(\frac {\hat {\Pi} _ {K} (\mathbf {m} _ {K})}{\sqrt {2 d _ {i}}}\right) \otimes \mathbf {C} _ {t}
355
+ $$
356
+
357
+ to update $\mathbf{K}$ at iteration $t$ , treating $\mathbf{C}_t$ and $\mathbf{K}_t$ as constants. Given a subspace $\Omega_K \subset \mathbb{R}^{d_i \times d_i}$ in the matrix logarithm
358
+
359
+ space, the subspace projection map $\hat{\Pi}_K: \mathrm{Sym}^{d_i \times d_i} \mapsto \Omega_K$ is specified by satisfying the local orthonormalization condition of the Fisher block regarding $\mathbf{m}_K$ :
360
+
361
+ $$
362
+ F | _ {m _ {K} = \mathbf {0}} := - \mathbb {E} _ {w \sim q} \left[ \nabla_ {m _ {K}} ^ {2} \log q (\mathbf {w} \mid \boldsymbol {\mu}, \mathbf {S}) \right] | _ {m _ {K} = \mathbf {0}} = \mathbf {I},
363
+ $$
364
+
365
+ with the variational Gaussian $q(\mathbf{w} \mid \boldsymbol{\mu}, \mathbf{S})$ with mean $\boldsymbol{\mu}$ , precision $\mathbf{S} \coloneqq \mathbf{A}^{-\top} \mathbf{A}^{-1}$ and $\mathrm{Sym}^{d_i \times d_i}$ the set of symmetric square real matrices. Similarly, we can obtain $\hat{\Pi}_C$ for $\mathbf{C}$ .
366
+
367
+ We consider several sparsities and block extensions of triangular matrices illustrated in Figure 5. E.g., the subspace projection map for a diagonal structure simply extracts diagonal entries of its input. As a non-trivial example, the subspace projection map for a lower-triangular structure extracts lower-triangular entries of its input and multiplies the entries below the main diagonal by 2. Table 2 summarizes structures and their projection maps mathematically.
368
+
369
+ Using such a subspace and its projection map, we obtain a structured INGD update (Figure 4), and similar for IKFAC. Our approach allows to use more expressive structures than the block-diagonal structure shown in Figure 5, e.g. low-rank, flexible hierarchical, and Toeplitz structures. While existing methods mainly support low-rank structures. For an efficient implementation, we only compute and store nonzero entries of $\hat{\Pi}_K(\mathbf{m}_K)$ and $\mathbf{K}$ without explicitly forming dense matrices. These structures lower not only memory consumption (Table 4), but also the iteration cost (Table 3).
370
+
371
+ # 4. Experiments
372
+
373
+ We evaluate SINGD on convolutional, transformer, and graph NNs, using mixed-precision training in BFP-16 with KFAC-reduce (Eschenhagen et al., 2023) and numerical tricks (Dangel, 2023) to further reduce memory consump
374
+
375
+ ![](images/c432c17357eee53e760ad1bd7f8935000e2d08e5c5e812c525a967c63fd560ea.jpg)
376
+ Figure 7: Test error curves for mixed-precision training in CNN and GNN models on datasets 'ImageWoof-10', 'CIFAR-100' and 'Cora'. 'Rep-ViT' is a CNN model inspired by transformers. SINGD performs as well as INGD while being memory efficient. SINGD including IKFAC and INGD as special cases, outperforms AdamW on all the models. The diagonal structure can perform as well as the dense structure on these models. KFAC only appears in the rightmost plot since it performs unstably in the other plots due to numerical issues in half-precision settings.
377
+
378
+ tion and iteration cost for convolutions. The performance metric is test error. To be memory-efficient, we consider SINGD with sparse structures such as 'diagonal', 'block-diagonal', and 'hierarchical'. We also consider IKFAC, INGD (recall SINGD with dense structure becomes INGD), and AdamW as baselines. All methods except KFAC directly support training in BFP-16. For KFAC, we have to transform a matrix into FP-32 and then transform its inverse into BFP-16. We find that KFAC performs unstably in BFP-16. For 'VGG' and 'ConvMixer', we also consider SGD as a strong baseline, We fix momentum to 0.9 and tune other hyper-parameters of each optimizer using random search. For 'VGG' and 'ConvMixer', we decrease the learning rate $\beta_{2}$ every 40 epochs. For 'GNN', we use a constant learning rate; all other models use a cosine learning rate schedule. We consider KFAC as a strong baseline for the GNN as suggested by Izadi et al. (2020). We train the GNN in FP-32 so that KFAC performs stably. The search space for the random search can be found in Table 5 in Appendix B.
379
+
380
+ From Figure 6 and 7, we can observe that SINGD, including IKFAC and INGD as special cases, outperforms AdamW in many cases. SINGD works well for mixed-precision training. We do not show KFAC in the plots as it performs unstably due to numerical issues. We also observe that the hierarchical structure often performs as well as the dense structure (INGD) on all the models. In several cases, the hierarchical structure outperforms the block-diagonal and diagonal structures. However, on the models shown in Figure 7, even the diagonal structure can perform as well as the dense one. Thus, we can reduce INGD's memory consumption and make SINGD as competitive as AdamW. We also train a ViT model on "ImageNet-100" to demonstrate the superior performance of SINGD over AdamW in large-scale
381
+
382
+ settings (see Figure 9 in Appendix B).
383
+
384
+ # 5. Conclusion
385
+
386
+ We propose an inverse-free, memory-efficient natural gradient descent method—SINGD—which addresses the numerical instability and memory inefficiency of second-order methods like KFAC (Martens & Grosse, 2015). The algorithm is an extension of the inverse-free natural gradient (INGD) method from Lin et al. (2023), whose update relies only on matrix multiplications. We theoretically establish the algorithm's relation to KFAC by showing that a modification of INGD effectively performs KFAC-like updates and further improve its memory efficiency through sparse Kronecker factors. We showed that SINGD supports low-precision training and often outperforms AdamW on transformer-based models. Our work expands the scope of second-order methods to training transformer-based NNs and in low precision, making them more widely applicable.
387
+
388
+ # Acknowledgements
389
+
390
+ Resources used in preparing this research were provided, in part, by the Province of Ontario, the Government of Canada through CIFAR, and companies sponsoring Vector Institute. Runa Eschenhagen is supported by ARM and the Cambridge Trust. Richard E. Turner is supported by Google, Amazon, ARM, Improbable and EPSRC grant EP/T005386/1.
391
+
392
+ # Impact Statement
393
+
394
+ This paper presents work whose goal is to advance the field of Machine Learning. There are many potential societal
395
+
396
+ consequences of our work, none which we feel must be specifically highlighted here.
397
+
398
+ # References
399
+
400
+ Amari, S.-I. Natural gradient works efficiently in learning. Neural computation, 10(2):251-276, 1998.
401
+ Bae, J., Ng, N., Lo, A., Ghassemi, M., and Grosse, R. B. If influence functions are the answer, then what is the question? In NeurIPS, 2022.
402
+ Botev, A., Ritter, H., and Barber, D. Practical Gauss-Newton optimisation for deep learning. In ICML, 2017.
403
+ Bradbury, J., Frostig, R., Hawkins, P., Johnson, M. J., Leary, C., Maclaurin, D., Necula, G., Paszke, A., VanderPlas, J., Wanderman-Milne, S., and Zhang, Q. JAX: composable transformations of Python+NumPy programs, 2018. URL http://github.com/google/jax.
404
+ Brown, T., Mann, B., Ryder, N., Subbiah, M., Kaplan, J. D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. Language models are few-shot learners. In NeurIPS, 2020.
405
+ Dangel, F. Convolutions through the lens of tensor networks. arXiv 2307.02275, 2023.
406
+ Daxberger, E., Kristiadi, A., Immer, A., Eschenhagen, R., Bauer, M., and Hennig, P. Laplace redux—effortless Bayesian deep learning. In NeurIPS, 2021.
407
+ Dehghani, M., Djolonga, J., Mustafa, B., Padlewski, P., Heek, J., Gilmer, J., Steiner, A. P., Caron, M., Geirhos, R., Alabdulmohsin, I., et al. Scaling vision transformers to 22 billion parameters. In ICML, 2023.
408
+ Eschenhagen, R., Immer, A., Turner, R. E., Schneider, F., and Hennig, P. Kronecker-Factored Approximate Curvature for modern neural network architectures. In NeurIPS, 2023.
409
+ George, T., Laurent, C., Bouthillier, X., Ballas, N., and Vincent, P. Fast approximate natural gradient descent in a kronecker factored eigenbasis. In NeurIPS, 2018.
410
+ Graves, A. Practical variational inference for neural networks. In NeurIPS, 2011.
411
+ Grosse, R. and Martens, J. A kronecker-factored approximate fisher matrix for convolution layers. In ICML, 2016.
412
+ Grosse, R., Bae, J., Anil, C., Elhage, N., Tamkin, A., Tajdini, A., Steiner, B., Li, D., Durmus, E., Perez, E., et al. Studying large language model generalization with influence functions. arXiv preprint arXiv:2308.03296, 2023.
413
+
414
+ Hassani, A., Walton, S., Shah, N., Abuduweili, A., Li, J., and Shi, H. Escaping the big data paradigm with compact transformers. arXiv preprint arXiv:2104.05704, 2021.
415
+ Hatamizadeh, A., Yin, H., Heinrich, G., Kautz, J., and Molchanov, P. Global context vision transformers. In International Conference on Machine Learning, pp. 12633-12646. PMLR, 2023.
416
+ Heskes, T. On "natural" learning and pruning in multilayered perceptrons. Neural Computation, 12(4), 2000.
417
+ Immer, A., Bauer, M., Fortuin, V., Ratsch, G., and Emtiyaz, K. M. Scalable marginal likelihood estimation for model selection in deep learning. In ICML, 2021.
418
+ Izadi, M. R., Fang, Y., Stevenson, R., and Lin, L. Optimization of graph neural networks with natural gradient descent. In 2020 IEEE international conference on big data (big data), pp. 171-179. IEEE, 2020.
419
+ Khan, M. and Lin, W. Conjugate-computation variational inference: Converting variational inference in non-conjugate models to inferences in conjugate models. In Artificial Intelligence and Statistics, pp. 878-887, 2017.
420
+ Khan, M. E. and Nielsen, D. Fast yet Simple NaturalGradient Descent for Variational Inference in Complex Models. arXiv preprint arXiv:1807.04489, 2018.
421
+ Khan, M. E. and Rue, H. The bayesian learning rule. arXiv preprint arXiv:2107.04562, 2021.
422
+ Khan, M. E., Nielsen, D., Tangkaratt, V., Lin, W., Gal, Y., and Srivastava, A. Fast and scalable Bayesian deep learning by weight-perturbation in Adam. In ICML, 2018.
423
+ Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015.
424
+ Kipf, T. N. and Welling, M. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
425
+ Kunstner, F., Balles, L., and Hennig, P. Limitations of the empirical Fisher approximation for natural gradient descent. In NeurIPS, 2019.
426
+ Li, X. Black box lie group preconditioners for sgd. arXiv preprint arXiv:2211.04422, 2022.
427
+ Li, X.-L. Preconditioner on matrix lie group for sgd. In International Conference on Learning Representations, 2018.
428
+ Lin, W., Schmidt, M., and Khan, M. E. Handling the positive-definite constraint in the bayesian learning rule. In ICML, 2020.
429
+
430
+ Lin, W., Nielsen, F., Emtiyaz, K. M., and Schmidt, M. Tractable structured natural-gradient descent using local parameterizations. In ICML, 2021.
431
+ Lin, W., Durisseaux, V., Leok, M., Nielsen, F., Khan, M. E., and Schmidt, M. Simplifying momentum-based positive-definite submanifold optimization with applications to deep learning. In ICML, 2023.
432
+ Liu, Z., Lin, Y., Cao, Y., Hu, H., Wei, Y., Zhang, Z., Lin, S., and Guo, B. Swin transformer: Hierarchical vision transformer using shifted windows. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 10012-10022, 2021.
433
+ Loshchilov, I. and Hutter, F. Decoupled weight decay regularization. In ICLR, 2019.
434
+ Lu, Z., Xie, H., Liu, C., and Zhang, Y. Bridging the gap between vision transformers and convolutional neural networks on small datasets. Advances in Neural Information Processing Systems, 35:14663-14677, 2022.
435
+ Martens, J. New insights and perspectives on the natural gradient method. JMLR, 21(146), 2014.
436
+ Martens, J. and Grosse, R. Optimizing neural networks with Kronecker-factored approximate curvature. In ICML, 2015.
437
+ Martens, J., Ba, J., and Johnson, M. Kronecker-factored curvature approximations for recurrent neural networks. In ICLR, 2018.
438
+ 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 (ICLR), 2018.
439
+ Osawa, K., Swaroop, S., Khan, M. E. E., Jain, A., Eschenhagen, R., Turner, R. E., and Yokota, R. Practical deep learning with Bayesian principles. In NeurIPS, 2019.
440
+ Osawa, K., Li, S., and Hoefler, T. PipeFisher: Efficient training of large language models using pipelining and Fisher information matrices. In MLSys, 2023.
441
+ Osborne, M. R. Fisher's method of scoring. International Statistical Review/Revue Internationale de Statistique, pp. 99-117, 1992.
442
+ Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., et al. PyTorch: An imperative style, high-performance deep learning library. In NeurIPS, 2019.
443
+ Pearlmutter, B. A. Fast exact multiplication by the Hessian. Neural Computation, 1994.
444
+
445
+ 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.
446
+ Robbins, H. and Monro, S. A Stochastic Approximation Method. The Annals of Mathematical Statistics, 1951.
447
+ Schraudolph, N. N. Fast curvature matrix-vector products for second-order gradient descent. Neural computation, 14(7), 2002.
448
+ Simonyan, K. and Zisserman, A. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
449
+ Smyth, G. K. Partitioned algorithms for maximum likelihood and other non-linear estimation. Statistics and Computing, 6:201-216, 1996.
450
+ Smyth, G. K. Optimization and nonlinear equations. Statistics reference online, 1:1-9, 2015.
451
+ Tan, L. S. Analytic natural gradient updates for cholesky factor in gaussian variational approximation. arXiv preprint arXiv:2109.00375, 2022.
452
+ Thompson, N. C., Greenewald, K., Lee, K., and Manso, G. F. The computational limits of deep learning. 2020.
453
+ Touvron, H., Lavril, T., Izacard, G., Martinet, X., Lachaux, M.-A., Lacroix, T., Roziere, B., Goyal, N., Hambro, E., Azhar, F., et al. LLaMA: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023.
454
+ Trockman, A. and Kolter, J. Z. Patches are all you need? Transactions on Machine Learning Research, 2023.
455
+ Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., and Polosukhin, I. Attention is all you need. In NIPS, 2017.
456
+ Wang, A., Chen, H., Lin, Z., Pu, H., and Ding, G. Repvit: Revisiting mobile cnn from vit perspective. arXiv preprint arXiv:2307.09283, 2023.
457
+ Wang, C., Grosse, R., Fidler, S., and Zhang, G. Eigendamage: Structured pruning in the kronecker-factored eigenbasis. In ICML, 2019.
458
+ Wang, Y. Fisher scoring: An interpolation family and its Monte Carlo implementations. Comput. Stat. Data Anal., 54(7), 2010.
459
+ Zhang, G., Sun, S., Duvenaud, D., and Grosse, R. Noisy natural gradient as variational inference. In ICML, 2018.
460
+ Zhang, G., Li, L., Nado, Z., Martens, J., Sachdeva, S., Dahl, G. E., Shallue, C. J., and Grosse, R. B. Which algorithmic choices matter at which batch sizes? Insights from a noisy quadratic model. In NeurIPS, 2019.
461
+
462
+ # A. space and time complexity
463
+
464
+ <table><tr><td></td><td>Method</td><td>△μ (descent direction)</td><td>Update S_K or K</td><td>Update S_C or C</td><td>∇μl (BackProp)</td></tr><tr><td rowspan="7">Iteration Cost</td><td>KFAC</td><td>O(d_i^2d_o+d_o^2d_i)</td><td>O(1/T(md_i^2+d_i^3))</td><td>O(1/T(md_o^2+d_o^3))</td><td>O(mdi d_o)</td></tr><tr><td>INGD/SINGD (Dense)</td><td>O(d_i^2d_o+d_o^2d_i)</td><td>O(1/T(md_i^2+d_i^3))</td><td>O(1/T(md_o^2+d_o^3))</td><td>O(mdi d_o)</td></tr><tr><td>SINGD (Block-Diag. with block size k)</td><td>O(kd_id_o)</td><td>O(1/T(kmd_i))</td><td>O(1/T(kmd_o))</td><td>O(mdi d_o)</td></tr><tr><td>SINGD (Toeplitz)</td><td>O(d_id_o log(d_id_o))</td><td>O(1/T(md_id_log(d_i))</td><td>O(1/T(md_id_log(d_o))</td><td>O(mdi d_o)</td></tr><tr><td>SINGD (Rank-1 Triangular)</td><td>O(d_id_o)</td><td>O(1/T(md_i))</td><td>O(1/T(md_o))</td><td>O(mdi d_o)</td></tr><tr><td>SINGD (Hierarchical with parameter k)</td><td>O(kd_id_o)</td><td>O(1/T(kmd_i))</td><td>O(1/T(kmd_o))</td><td>O(mdi d_o)</td></tr><tr><td>AdamW</td><td>O(d_id_o)</td><td>NA</td><td>NA</td><td>O(mdi d_o)</td></tr></table>
465
+
466
+ Table 3: Iteration cost for a non-weight-sharing layer, where $m$ is the size of a mini-batch and $\mathbf{\mu } \in {\mathbb{R}}^{{d}_{i} \times {d}_{o}}$ is a learnable weight matrix. We assume factors $\mathbf{K}$ and $\mathbf{C}$ use the same structure.
467
+
468
+ <table><tr><td></td><td>Method</td><td>∇μl ⊙ ∇μl</td><td>SK or K</td><td>SC or C</td></tr><tr><td rowspan="7">Memory Usage</td><td>KFAC</td><td>NA</td><td>O(d2i)</td><td>O(d2o)</td></tr><tr><td>INGD/SINGD (Dense)</td><td>NA</td><td>O(d2i)</td><td>O(d2o)</td></tr><tr><td>SINGD (Block-Diag. with block size k)</td><td>NA</td><td>O(kd1i)</td><td>O(kdo)</td></tr><tr><td>SINGD (Toeplitz)</td><td>NA</td><td>O(di)</td><td>O(do)</td></tr><tr><td>SINGD (Rank-1 Triangular)</td><td>NA</td><td>O(di)</td><td>O(do)</td></tr><tr><td>SINGD (Hierarchical with parameter k)</td><td>NA</td><td>O(kd1i)</td><td>O(kdo)</td></tr><tr><td>AdamW</td><td>O(di do)</td><td>NA</td><td>NA</td></tr></table>
469
+
470
+ # B. Details of the Experiments
471
+
472
+ To demonstrate the robustness and memory efficiency of our method, we consider image classification tasks with transformer-based models such as "Compact-ViT" (Hassani et al., 2021), "Swin-ViT" (Liu et al., 2021), "GC-ViT" (Hatamizadeh et al., 2023), and "HDVT" (Lu et al., 2022). We also consider convolution-based models such as "VGG" (Simonyan & Zisserman, 2014), "ConvMixer" (Trockman & Kolter, 2023), and "Rep-ViT" (Wang et al., 2023). We train these models on datasets "CIFAR-100" and "ImageWoof-10". Note that "Rep-ViT" is a CNN model inspired by transformers while "Compact-ViT" is a data-efficient transformer using convolutional tokenization. We also consider a graph convolution model (Kipf & Welling, 2016) denoted by "GNN" for node classification on dataset "Cora". We also train a ViT model on "ImageNet-100" (https://www.kaggle.com/datasets/ambityga/imagenet100) to demonstrate the performance of SINGD in large-scale settings (see Fig. 9).
473
+
474
+ # B.1. Hyper-parameter Tuning
475
+
476
+ Table 4: Additional Storage
477
+
478
+ <table><tr><td>Hyperparameter</td><td>Meaning</td><td>KFAC/IKFAC/SINGD in Figure 4 and 8</td><td>AdamW in Figure 8</td></tr><tr><td>β2</td><td>Standard stepsize</td><td>Tuned</td><td>Tuned</td></tr><tr><td>α2</td><td>Standard momentum weight</td><td>0.9</td><td>0.9</td></tr><tr><td>γ</td><td>(L2) weight decay</td><td>Tuned</td><td>Tuned</td></tr><tr><td>λ</td><td>Damping</td><td>Tuned</td><td>Tuned</td></tr><tr><td>β1</td><td>Stepsize for preconditioner</td><td>Tuned</td><td>Tuned</td></tr><tr><td>α1</td><td>Riemannian Momentum</td><td>(SINGD only) Tuned</td><td>NA</td></tr></table>
479
+
480
+ Table 5: Hyperparameters used for a random search.
481
+
482
+ Table 6: Peak memory and run time of different optimizers for GCViT on ImageWoof10 (Figure 6, right). Parenthesized values are normalized relative to SGD. For this vision transformer task, we observe that the backpropagation dominates both run time and memory. In this setting, all our methods as well as INGD have basically no run time and memory overhead compared to the first-order methods. INGD and our proposed methods are even able to beat AdamW and SGD in terms of test error. INGD, KFAC and SINGD update their preconditioner every $T = 5$ iterations.
483
+
484
+ <table><tr><td>Method</td><td>Peak memory [GiB]</td><td>Training time [min]</td></tr><tr><td>SGD (BFP-16)</td><td>15.6 (1.00 x)</td><td>190 (1.00 x)</td></tr><tr><td>AdamW (BFP-16)</td><td>15.7 (1.00 x)</td><td>191 (1.01 x)</td></tr><tr><td>SINGD-Diag* (BFP-16)</td><td>15.8 (1.02 x)</td><td>200 (1.06 x)</td></tr><tr><td>IKFAC* (BFP-16)</td><td>16.0 (1.02 x)</td><td>197 (1.04 x)</td></tr><tr><td>INGD (BFP-16)</td><td>16.0 (1.02 x)</td><td>203 (1.07 x)</td></tr><tr><td>KFAC (FP-32)</td><td>16.0 (1.02 x)</td><td>359 (1.89 x)</td></tr></table>
485
+
486
+ # INGD
487
+
488
+ 1: Each $T$ iter., update $\mathbf{m}_K, \mathbf{m}_C, \mathbf{K}, \mathbf{C}$
489
+ Obtain $\pmb{\mu}_{AA} \otimes \pmb{\mu}_{GG}$ to approximate $\nabla_{\mu}^{2}\ell(\pmb{\mu})$ $\mathbf{m}_K \leftarrow \alpha_1\mathbf{m}_K + \frac{\beta_1}{2d}(\mathrm{Tr}(\mathbf{H}_C)\mathbf{H}_K + c^2\mathbf{K}^T\mathbf{K} - d\mathbf{I}_p)$ $\mathbf{m}_C \leftarrow \alpha_1\mathbf{m}_C + \frac{\beta_1}{2p}(\mathrm{Tr}(\mathbf{H}_K)\mathbf{H}_C + \kappa^2\mathbf{C}^T\mathbf{C} - p\mathbf{I}_d)$ $\mathbf{K} \leftarrow \mathbf{KExpm}(-\mathbf{m}_K) \approx \mathbf{K}(\mathbf{I}_p - \mathbf{m}_K)$ $\mathbf{C} \leftarrow \mathbf{CExpm}(-\mathbf{m}_C) \approx \mathbf{C}(\mathbf{I}_d - \mathbf{m}_C)$
490
+
491
+ 2: $\mathbf{M}_{\mu} \leftarrow \alpha_{2}\mathbf{M}_{\mu} + \mathbf{C}\mathbf{C}^{T}\mathrm{vec}^{-1}(\nabla_{\mu}\ell (\pmb{\mu}))\mathbf{K}\mathbf{K}^{T} + \gamma \mathrm{vec}^{-1}(\pmb{\mu})$
492
+ 3: $\pmb{\mu} \leftarrow \pmb{\mu} - \beta_{2}\mathrm{vec}(\mathbf{M}_{\mu})$
493
+
494
+ # AdamW Optimizer
495
+
496
+ 1: At iter. $t$ , update $\mathbf{m}_s, \mathbf{s}$ Use $(\nabla_{\mu} \ell(\boldsymbol{\mu}))^2$ to approximate $\operatorname{diag}(\nabla_{\mu}^2 \ell(\boldsymbol{\mu}))$ $\mathbf{m}_s \gets (1 - \beta_1) \mathbf{m}_s + \beta_1 (\nabla_{\mu} \ell(\boldsymbol{\mu}))^2$ $\mathbf{s}^2 \gets \frac{\mathbf{m}_s}{(1 - (1 - \beta_1)^t)}$ $\mathbf{s} \gets \sqrt{\mathbf{s}^2} + \lambda$
497
+ 2: $\mathbf{m}_{\mu} \gets \alpha_{2}\mathbf{m}_{\mu} + (1 - \alpha_{2})\nabla_{\mu}\ell(\boldsymbol{\mu})$ $\mathbf{M}_{\mu} \gets \mathbf{s}^{-1}\mathbf{m}_{\mu} / (1 - \alpha_{2}^{t})$
498
+ 3: $\mu \leftarrow \mu -\beta_{2}\mathbf{M}_{\mu} + \gamma \mu$
499
+
500
+ ![](images/6531b1aefd29628e16edc015a94eae8657b4d945544ceeca3ea82ac9c3b81af2.jpg)
501
+ Figure 8: Baseline methods in the same notation for a hyperparameter search.
502
+ Figure 9: Test error curves for mixed-precision training on a GCViT model on dataset 'ImageNet-100'. SINGD has a similar iteration cost as AdamW while achieving better performance.
503
+
504
+ # C. Connection between IKFAC and KFAC
505
+
506
+ To relate to the KFAC method, we now show that $\mathbf{K}^{\mathrm{new}}\left(\mathbf{K}^{\mathrm{new}}\right)^{\top}$ is an approximation of $\left(\mathbf{S}_K^{\mathrm{new}} + \lambda \mathbf{I}\right)^{-1}$ at a new step of our scheme. For simplicity, we first assume $\mathbf{KK}^{\top}$ exactly equals to $(\mathbf{S}_K^{\mathrm{cur}} + \lambda \mathbf{I})^{-1}$ at the current step. Later, we will relax this assumption and prove that $\mathbf{KK}^{\top}$ is an approximation of $(\mathbf{S}_K + \lambda \mathbf{I})^{-1}$ at every step as stated in Theorem 1. For notation simplicity, we denote $\bar{\mathbf{S}}_K\coloneqq \mathbf{S}_K + \lambda \mathbf{I}$ . The update of $\mathbf{S}_K$ with damping $\lambda \mathbf{I}$ can be reexpressed as an update of $\bar{\mathbf{S}}_K$ :
507
+
508
+ $$
509
+ \left(\mathbf {S} _ {K} ^ {\text {n e w}} + \lambda \mathbf {I}\right) = \bar {\mathbf {S}} _ {K} ^ {\text {n e w}} \leftarrow \left(1 - \beta_ {1}\right) \bar {\mathbf {S}} _ {K} ^ {\text {c u r}} + \beta_ {1} \left(\mathbf {U} + \lambda \mathbf {I}\right).
510
+ $$
511
+
512
+ Since $\hat{\mathbf{S}}_K^{\mathrm{cur}} = \mathbf{K}^{-T}\mathbf{K}^{-1}$ by our assumption, we can express update of $\mathbf{S}_K$ in terms of $\mathbf{K}$ as follows.
513
+
514
+ $$
515
+ \bar {\mathbf {S}} _ {K} ^ {\text {n e w}} \leftarrow (1 - \beta_ {1}) \bar {\mathbf {S}} _ {K} ^ {\text {c u r}} + \beta_ {1} (\mathbf {U} + \lambda \mathbf {I}) = \mathbf {K} ^ {- T} \left(\mathbf {I} + \beta_ {1} \left(\mathbf {K} ^ {\top} \mathbf {U} \mathbf {K} + \lambda \mathbf {K} ^ {\top} \mathbf {K} - \mathbf {I}\right)\right) \mathbf {K} ^ {- 1} = \mathbf {K} ^ {- T} (\mathbf {I} + \beta_ {1} \mathbf {m} _ {K}) \mathbf {K} ^ {- 1}
516
+ $$
517
+
518
+ $\bar{\mathbf{S}}_K^{\mathrm{new}}$ in the KFAC update can be approximated as below, where we consider $\mathbf{I} + \beta_{1}\mathbf{m}_{K}$ as an ap-
519
+
520
+ proximate of the matrix exponential $\mathrm{Expm}(\beta_1\mathbf{m}_K)\approx \mathbf{I} + \beta_1\mathbf{m}_K$ and notice that $\mathbf{m}_K$ is symmetric.
521
+
522
+ $$
523
+ \bar {\mathbf {S}} _ {K} ^ {\mathrm {n e w}} = \mathbf {K} ^ {- T} \left(\mathbf {I} + \beta_ {1} \mathbf {m} _ {K}\right) \mathbf {K} ^ {- 1} \approx \mathbf {K} ^ {- T} \mathrm {E x p m} \left(\beta_ {1} \mathbf {m} _ {K}\right) \mathbf {K} ^ {- 1} = \mathbf {K} ^ {- T} \mathrm {E x p m} \left(\frac {\beta_ {1}}{2} \mathbf {m} _ {K}\right) ^ {\top} \mathrm {E x p m} \left(\frac {\beta_ {1}}{2} \mathbf {m} _ {K}\right) \mathbf {K} ^ {- 1}.
524
+ $$
525
+
526
+ Informally, we can see that $\mathbf{K}^{\mathrm{new}}\big(\mathbf{K}^{\mathrm{new}}\big)^\top$ approximates $\left(\bar{\mathbf{S}}_K^{\mathrm{new}}\right)^{-1}$ by using the matrix exponential. We can see that $\mathbf{m}_K$ stays in a matrix logarithm space.
527
+
528
+ $$
529
+ \left(\mathbf {\bar {S}} _ {K} ^ {\mathrm {n e w}}\right) ^ {- 1} \approx \mathbf {K} \mathrm {E x p m} \left(- \frac {\beta_ {1}}{2} \mathbf {m} _ {K}\right) \mathrm {E x p m} \left(- \frac {\beta_ {1}}{2} \mathbf {m} _ {K}\right) ^ {\top} \mathbf {K} ^ {\top} \approx \mathbf {K} \left(\mathbf {I} - \frac {\beta_ {1}}{2} \mathbf {m} _ {K}\right) \left(\mathbf {I} - \frac {\beta_ {1}}{2} \mathbf {m} _ {K}\right) ^ {T} \mathbf {K} ^ {\top} = \mathbf {K} ^ {\mathrm {n e w}} \left(\mathbf {K} ^ {\mathrm {n e w}}\right) ^ {\top}
530
+ $$
531
+
532
+ Theorem 1 formally shows that $\mathbf{K}\mathbf{K}^{\top}$ used in our update is an approximation of $\left(\mathbf{S}_K + \lambda \mathbf{I}\right)^{-1}$ in the KFAC update for every step even when the truncation of the matrix exponential is employed.
533
+
534
+ # D. Proof of Theorem 1
535
+
536
+ We first consider the following lemmas in order to prove Theorem 1.
537
+
538
+ Recall that we denote $\bar{\mathbf{S}}_K\coloneqq \mathbf{S}_K + \lambda \mathbf{I}$ . For notation simplicity, we will drop the subscript $K$ in this section and use $\bar{\mathbf{S}}_t$ to denote $\bar{\mathbf{S}}_K$ at iteration $t$ . Notice that $\bar{\mathbf{S}}_t$ is non-singular at each iteration $t$ so that we can inverse it in the original KFAC update (see Figure 3).
539
+
540
+ Lemma D.1. Consider the following update in the original KFAC update at iteration $t$ .
541
+
542
+ $$
543
+ \bar {\mathbf {S}} _ {t} := (1 - \beta_ {1}) \bar {\mathbf {S}} _ {t - 1} + \beta_ {1} (\hat {\mathbf {U}} _ {t - 1} + \lambda \mathbf {I})
544
+ $$
545
+
546
+ where $\mathbf{S}_t$ is the factor $\mathbf{S}_K$ used in the original KFAC update, $\beta_{1}$ is known as the weight of the moving average, and $\hat{\mathbf{U}}_{t - 1}$ is a curvature matrix.
547
+
548
+ The initial factor $\bar{\mathbf{S}}_0$ can be decomposed as $\bar{\mathbf{S}}_0 = \hat{\mathbf{K}}_0^{-T}\hat{\mathbf{K}}_0^{-1}$ since $\bar{\mathbf{S}}_0$ as a preconditioning factor is symmetric positive definite.
549
+
550
+ Define $\hat{\mathbf{N}}_i\coloneqq \hat{\mathbf{K}}_0^T\hat{\mathbf{U}}_i\hat{\mathbf{K}}_0 + \lambda \hat{\mathbf{K}}_0^T\hat{\mathbf{K}}_0 - \mathbf{I}.$
551
+
552
+ The Kronecker factor can be reexpressed as
553
+
554
+ $$
555
+ \bar {\mathbf {S}} _ {t} = \hat {\mathbf {K}} _ {0} ^ {- T} \left(\mathbf {I} + \beta_ {1} \sum_ {i = 0} ^ {t - 1} \hat {\mathbf {N}} _ {i}\right) \hat {\mathbf {K}} _ {0} ^ {- 1} + O (\beta_ {1} ^ {2})
556
+ $$
557
+
558
+ Lemma D.2. Consider the following update in our inverse-free KFAC at iteration $t$ .
559
+
560
+ $$
561
+ \mathbf {K} _ {t} := \mathbf {K} _ {t - 1} \left(\mathbf {I} - \frac {\beta_ {1}}{2} \left(\mathbf {K} _ {t - 1} ^ {\top} \mathbf {U} _ {t - 1} \mathbf {K} _ {t - 1} + \lambda \mathbf {K} _ {t - 1} ^ {\top} \mathbf {K} _ {t - 1} - \mathbf {I}\right)\right)
562
+ $$
563
+
564
+ where $\mathbf{K}_{t - 1}^{\top}\mathbf{U}_{t - 1}\mathbf{K}_{t - 1}$ is used in our update and $\mathbf{U}_{t - 1}$ is a curvature matrix.
565
+
566
+ Define $\mathbf{N}_i\coloneqq \mathbf{K}_i^\top \mathbf{U}_i\mathbf{K}_i + \lambda \mathbf{K}_i^\top \mathbf{K}_i - \mathbf{I}$
567
+
568
+ Our update of $\mathbf{K}$ can be reexpressed as
569
+
570
+ $$
571
+ \mathbf {K} _ {t} = \mathbf {K} _ {0} \left(\mathbf {I} - \frac {\beta_ {1}}{2} \sum_ {i = 0} ^ {t - 1} \mathbf {N} _ {i}\right) + O \left(\beta_ {1} ^ {2}\right)
572
+ $$
573
+
574
+ Moreover, the product $\mathbf{KK}^{\top}$ can be reexpressed as
575
+
576
+ $$
577
+ \mathbf {K} _ {t} \mathbf {K} _ {t} ^ {\top} = \mathbf {K} _ {0} \left(\mathbf {I} - \beta_ {1} \sum_ {i = 0} ^ {t - 1} \mathbf {N} _ {i}\right) \mathbf {K} _ {0} ^ {\top} + O (\beta_ {1} ^ {2})
578
+ $$
579
+
580
+ Lemma D.3 is useful to establish a relationship between the KFAC update and our inverse-free update.
581
+
582
+ Lemma D.3. If we use the same sequence of curvature matrices in both the original KFAC update and our update such as $\hat{\mathbf{U}}_i = \mathbf{U}_i$ for each iteration $i$ and $\hat{\mathbf{K}}_0 = \mathbf{K}_0$ are used on the initialization, we have the following expression.
583
+
584
+ $$
585
+ \mathbf {N} _ {i} = \hat {\mathbf {N}} _ {i} + O (\beta_ {1})
586
+ $$
587
+
588
+ Similarly, we have the following result for $\mathbf{C}$ .
589
+
590
+ Theorem 2. The product $\mathbf{CC}^{\top}$ has a first-order accuracy of the KFAC update of $(\mathbf{S}_C + \lambda \mathbf{I})^{-1}$ at each iteration if the update of $\mathbf{C}$ is updated according to Figure 3 with the truncation of the matrix exponential and these two updates use the same initialization and the same sequence of curvature matrices $\mathbf{G}$ .
591
+
592
+ $$
593
+ \mathbf {C C} ^ {\top} = \left(\mathbf {S} _ {C} + \lambda \mathbf {I}\right) ^ {- 1} + O \left(\beta_ {1} ^ {2}\right)
594
+ $$
595
+
596
+ # D.1. Proof of Lemma D.1
597
+
598
+ We prove the lemma by induction. We first show the base case when $t = 1$ . By definition, we have
599
+
600
+ $$
601
+ \begin{array}{l} \bar {\mathbf {S}} _ {1} = \left(1 - \beta_ {1}\right) \bar {\mathbf {S}} _ {0} + \beta_ {1} \left(\hat {\mathbf {U}} _ {0} + \lambda \mathbf {I}\right) (10) \\ = \left(1 - \beta_ {1}\right) \hat {\mathbf {K}} _ {0} ^ {- T} \hat {\mathbf {K}} _ {0} ^ {- 1} + \beta_ {1} \left(\hat {\mathbf {U}} _ {0} + \lambda \mathbf {I}\right) (11) \\ = \hat {\mathbf {K}} _ {0} ^ {- T} \left[ \mathbf {I} + \beta_ {1} \underbrace {\left(\hat {\mathbf {K}} _ {0} ^ {T} \hat {\mathbf {U}} _ {0} \hat {\mathbf {K}} _ {0} + \lambda \hat {\mathbf {K}} _ {0} ^ {T} \hat {\mathbf {K}} _ {0} - \mathbf {I}\right)} _ {= \mathbf {N} _ {0}} \right] \hat {\mathbf {K}} _ {0} ^ {- 1} (12) \\ = \hat {\mathbf {K}} _ {0} ^ {- T} \left[ \mathbf {I} + \beta_ {1} \hat {\mathbf {N}} _ {0} \right] \hat {\mathbf {K}} _ {0} ^ {- 1} (13) \\ \end{array}
602
+ $$
603
+
604
+ Thus, the claim holds when $t = 1$ .
605
+
606
+ Suppose, the claim holds when $t = n$ . By the claim, we have
607
+
608
+ $$
609
+ \bar {\mathbf {S}} _ {n} = \hat {\mathbf {K}} _ {0} ^ {- T} \left(\mathbf {I} + \beta_ {1} \sum_ {i = 0} ^ {n - 1} \hat {\mathbf {N}} _ {i}\right) \hat {\mathbf {K}} _ {0} ^ {- 1} + O \left(\beta_ {1} ^ {2}\right) \tag {14}
610
+ $$
611
+
612
+ Now, we consider the case when $t = n + 1$ . Notice that
613
+
614
+ $$
615
+ \begin{array}{l} (1 - \beta_ {1}) \bar {\mathbf {S}} _ {n} = \hat {\mathbf {K}} _ {0} ^ {- T} \left(\mathbf {I} + \beta_ {1} \sum_ {i = 0} ^ {n - 1} \hat {\mathbf {N}} _ {i} - \beta_ {1} \mathbf {I} + O (\beta_ {1} ^ {2})\right) \hat {\mathbf {K}} _ {0} ^ {- 1} + O (\beta_ {1} ^ {2}) \\ = \hat {\mathbf {K}} _ {0} ^ {- T} \left(\mathbf {I} + \beta_ {1} \sum_ {i = 0} ^ {n - 1} \hat {\mathbf {N}} _ {i} - \beta_ {1} \mathbf {I}\right) \hat {\mathbf {K}} _ {0} ^ {- 1} + O (\beta_ {1} ^ {2}) \\ \end{array}
616
+ $$
617
+
618
+ By the definition of $\hat{\mathbf{S}}_{n + 1}$ , we have
619
+
620
+ $$
621
+ \begin{array}{l} \bar {\mathbf {S}} _ {n + 1} = \left(1 - \beta_ {1}\right) \bar {\mathbf {S}} _ {n} + \beta_ {1} \left(\hat {\mathbf {U}} _ {n} + \lambda \mathbf {I}\right) (15) \\ = \hat {\mathbf {K}} _ {0} ^ {- T} \left(\mathbf {I} + \beta_ {1} \sum_ {i = 0} ^ {n - 1} \hat {\mathbf {N}} _ {i} \underbrace {- \beta_ {1} \mathbf {I} + \beta_ {1} \hat {\mathbf {K}} _ {0} ^ {T} \hat {\mathbf {U}} _ {n} \hat {\mathbf {K}} _ {0} + \beta_ {1} \lambda \hat {\mathbf {K}} _ {0} ^ {T} \hat {\mathbf {K}} _ {0}} _ {= \beta_ {1} \hat {\mathbf {N}} _ {n}}\right) \hat {\mathbf {K}} _ {0} ^ {- 1} + O \left(\beta_ {1} ^ {2}\right) (16) \\ = \hat {\mathbf {K}} _ {0} ^ {- T} \left(\mathbf {I} + \beta_ {1} \sum_ {i = 0} ^ {n} \hat {\mathbf {N}} _ {i}\right) \hat {\mathbf {K}} _ {0} ^ {- 1} + O \left(\beta_ {1} ^ {2}\right) (17) \\ \end{array}
622
+ $$
623
+
624
+ which is exactly the claim when $t = n + 1$ .
625
+
626
+ Thus, by induction, the claim holds.
627
+
628
+ # D.2. Proof of Lemma D.2
629
+
630
+ We prove the lemma by induction. We first show the base case when $t = 1$ . By definition, we have
631
+
632
+ $$
633
+ \mathbf {K} _ {1} = \mathbf {K} _ {0} \left(\mathbf {I} - \frac {\beta_ {1}}{2} \underbrace {\left(\mathbf {K} _ {0} ^ {\top} \mathbf {U} _ {0} \mathbf {K} _ {0} + \lambda \mathbf {K} _ {0} ^ {\top} \mathbf {K} _ {0} - \mathbf {I}\right)} _ {= \mathbf {N} _ {0}}\right) \tag {18}
634
+ $$
635
+
636
+ Thus, the claim holds when $t = 1$ .
637
+
638
+ Suppose, the claim holds when $t = n$ . By the claim, we have
639
+
640
+ $$
641
+ \mathbf {K} _ {n} = \mathbf {K} _ {0} \left(\mathbf {I} - \frac {\beta_ {1}}{2} \sum_ {i = 0} ^ {n - 1} \mathbf {N} _ {i}\right) + O \left(\beta_ {1} ^ {2}\right) \tag {19}
642
+ $$
643
+
644
+ Now, we consider the case when $t = n + 1$ . Notice that
645
+
646
+ $$
647
+ \begin{array}{l} \mathbf {K} _ {n + 1} = \mathbf {K} _ {n} \left(\mathbf {I} - \frac {\beta_ {1}}{2} \underbrace {\left(\mathbf {K} _ {n} ^ {\top} \mathbf {U} _ {n} \mathbf {K} _ {n} + \lambda \mathbf {K} _ {n} ^ {\top} \mathbf {K} _ {n} - \mathbf {I}\right)} _ {= \mathbf {N} _ {n}}\right) (20) \\ = \underbrace {\mathbf {K} _ {0} \left(\mathbf {I} - \frac {\beta_ {1}}{2} \sum_ {i = 0} ^ {n - 1} \mathbf {N} _ {i}\right)} _ {= \mathbf {K} _ {n} - O \left(\beta_ {1} ^ {2}\right)} \left(\mathbf {I} - \frac {\beta_ {1}}{2} \mathbf {N} _ {n}\right) + O \left(\beta_ {1} ^ {2}\right) (21) \\ = \mathbf {K} _ {0} \left(\mathbf {I} - \frac {\beta_ {1}}{2} \sum_ {i = 0} ^ {n - 1} \mathbf {N} _ {i} - \frac {\beta_ {1}}{2} \mathbf {N} _ {n} + O \left(\beta_ {1} ^ {2}\right)\right) + O \left(\beta_ {1} ^ {2}\right) (22) \\ = \mathbf {K} _ {0} \left(\mathbf {I} - \frac {\beta_ {1}}{2} \sum_ {i = 0} ^ {n} \mathbf {N} _ {i}\right) + O \left(\beta_ {1} ^ {2}\right) (23) \\ \end{array}
648
+ $$
649
+
650
+ which is exactly the claim when $t = n + 1$ .
651
+
652
+ Thus, by induction, the claim holds.
653
+
654
+ Notice that $\mathbf{N}_i$ by definition is symmetric. It is easy to see that
655
+
656
+ $$
657
+ \begin{array}{l} \mathbf {K} _ {t} \mathbf {K} _ {t} ^ {\top} = \mathbf {K} _ {0} \left(\mathbf {I} - \frac {\beta_ {1}}{2} \sum_ {i = 0} ^ {t - 1} \mathbf {N} _ {i}\right) \left(\mathbf {I} - \frac {\beta_ {1}}{2} \sum_ {i = 0} ^ {t - 1} \mathbf {N} _ {i}\right) ^ {\top} \mathbf {K} _ {0} ^ {\top} + O \left(\beta_ {1} ^ {2}\right) (24) \\ = \mathbf {K} _ {0} \left(\mathbf {I} - \frac {\beta_ {1}}{2} \sum_ {i = 0} ^ {t - 1} \mathbf {N} _ {i}\right) \left(\mathbf {I} - \frac {\beta_ {1}}{2} \sum_ {i = 0} ^ {t - 1} \mathbf {N} _ {i}\right) \mathbf {K} _ {0} ^ {\top} + O \left(\beta_ {1} ^ {2}\right) (25) \\ = \mathbf {K} _ {0} \left(\mathbf {I} - \beta_ {1} \sum_ {i = 0} ^ {t - 1} \mathbf {N} _ {i}\right) \mathbf {K} _ {0} ^ {\top} + O \left(\beta_ {1} ^ {2}\right) (26) \\ \end{array}
658
+ $$
659
+
660
+ Thus, the claim also holds.
661
+
662
+ # D.3. Proof of Lemma D.3
663
+
664
+ We first show the base case when $t = 0$ . By the assumption, we have $\mathbf{K}_0 = \hat{\mathbf{K}}_0$ . Similarly, we have $\mathbf{U}_0 = \hat{\mathbf{U}}_0$ by the assumption.
665
+
666
+ By definition, we have
667
+
668
+ $$
669
+ \begin{array}{l} \mathbf {N} _ {0} = \mathbf {K} _ {0} ^ {\top} \mathbf {U} _ {0} \mathbf {K} _ {0} + \lambda \mathbf {K} _ {0} ^ {\top} \mathbf {K} _ {0} - \mathbf {I} (27) \\ = \hat {\mathbf {K}} _ {0} ^ {\top} \hat {\mathbf {U}} _ {0} \hat {\mathbf {K}} _ {0} + \lambda \hat {\mathbf {K}} _ {0} ^ {\top} \hat {\mathbf {K}} _ {0} - \mathbf {I} (28) \\ = \hat {\mathbf {N}} _ {0} (29) \\ \end{array}
670
+ $$
671
+
672
+ Thus, the claim holds when $t = 0$ .
673
+
674
+ When $t > 0$ , we can use Lemma D.2 to obtain the claim. Notice that
675
+
676
+ $$
677
+ \begin{array}{l} \mathbf {N} _ {n + 1} = \mathbf {K} _ {n + 1} ^ {\top} \mathbf {U} _ {n + 1} \mathbf {K} _ {n + 1} + \lambda \mathbf {K} _ {n + 1} ^ {\top} \mathbf {K} _ {n + 1} - \mathbf {I} (30) \\ = \left(\mathbf {I} - \frac {\beta_ {1}}{2} \sum_ {i = 0} ^ {n} \mathbf {N} _ {i}\right) ^ {\top} \mathbf {K} _ {0} ^ {\top} \left(\mathbf {U} _ {n + 1} + \lambda \mathbf {I}\right) \mathbf {K} _ {0} \left(\mathbf {I} - \frac {\beta_ {1}}{2} \sum_ {i = 0} ^ {n} \mathbf {N} _ {i}\right) - \mathbf {I} + O \left(\beta_ {1} ^ {2}\right) (\text {L e m m a} 2) (31) \\ = \mathbf {K} _ {0} ^ {\top} \left(\mathbf {U} _ {n + 1} + \lambda \mathbf {I}\right) \mathbf {K} _ {0} + O \left(\beta_ {1}\right) + O \left(\beta_ {1} ^ {2}\right) (32) \\ = \hat {\mathbf {K}} _ {0} ^ {\top} \left(\hat {\mathbf {U}} _ {n + 1} + \lambda \mathbf {I}\right) \hat {\mathbf {K}} _ {0} + O \left(\beta_ {1}\right) (\text {A s s u m p t i o n}) (33) \\ = \tilde {\mathbf {N}} _ {n + 1} + O \left(\beta_ {1}\right) (34) \\ \end{array}
678
+ $$
679
+
680
+ # D.4. Proof of Theorem 1
681
+
682
+ It is sufficient to show that the following claim holds at iteration $t$ since $\bar{\mathbf{S}}_t$ is non-singular.
683
+
684
+ $$
685
+ \mathbf {K} _ {t} \mathbf {K} _ {t} ^ {\top} \bar {\mathbf {S}} _ {t} = \mathbf {I} + O (\beta_ {1} ^ {2})
686
+ $$
687
+
688
+ where we use $\bar{\mathbf{S}}_t$ to denote $\bar{\mathbf{S}}_K$ at iteration $t$ .
689
+
690
+ By assumptions, we know that Lemmas D.1, D.2, D.3 hold. Moreover, we have $\mathbf{K}_0 = \hat{\mathbf{K}}_0$ . Thus, we have
691
+
692
+ $$
693
+ \begin{array}{l} \mathbf {K} _ {t} \mathbf {K} _ {t} ^ {\top} \bar {\mathbf {S}} _ {t} = \mathbf {K} _ {0} \left(\mathbf {I} - \beta_ {1} \sum_ {i = 0} ^ {t - 1} \mathbf {N} _ {i}\right) \mathbf {K} _ {0} ^ {\top} \bar {\mathbf {S}} _ {t} + O \left(\beta_ {1} ^ {2}\right) (\text {b y L e m m a D . 2}) (35) \\ = \mathbf {K} _ {0} \left(\mathbf {I} - \beta_ {1} \sum_ {i = 0} ^ {t - 1} \mathbf {N} _ {i}\right) \mathbf {K} _ {0} ^ {\top} \hat {\mathbf {K}} _ {0} ^ {- T} \left(\mathbf {I} + \beta_ {1} \sum_ {i = 0} ^ {t - 1} \hat {\mathbf {N}} _ {i}\right) \hat {\mathbf {K}} _ {0} ^ {- 1} + O \left(\beta_ {1} ^ {2}\right) (\text {b y L e m m a D . 1}) (36) \\ = \hat {\mathbf {K}} _ {0} \left(\mathbf {I} - \beta_ {1} \sum_ {i = 0} ^ {t - 1} \hat {\mathbf {N}} _ {i} + O \left(\beta_ {1} ^ {2}\right)\right) \left(\mathbf {I} + \beta_ {1} \sum_ {i = 0} ^ {t - 1} \hat {\mathbf {N}} _ {i}\right) \hat {\mathbf {K}} _ {0} ^ {- 1} + O \left(\beta_ {1} ^ {2}\right) (\text {b y L e m m a D . 3}) (37) \\ = \hat {\mathbf {K}} _ {0} \mathbf {I} \hat {\mathbf {K}} _ {0} ^ {- 1} + O \left(\beta_ {1} ^ {2}\right) (38) \\ = \mathbf {I} + O \left(\beta_ {1} ^ {2}\right) (39) \\ \end{array}
694
+ $$
695
+
696
+ # E. Invariance of INGD and SINGD
697
+
698
+ INGD and SINGD are scale invariant to the choice of the Kronecker approximation while KFAC and IKFAC are not. Recall that we use the following Kronecker approximation to approximate the Hessian.
699
+
700
+ $$
701
+ \mathbf {U} \otimes \mathbf {G} \approx \nabla_ {\mu} ^ {2} \ell (\boldsymbol {\mu})
702
+ $$
703
+
704
+ However, such an approximation is not unique. We can consider an equivalent approximation such as
705
+
706
+ $$
707
+ \left(\alpha \mathbf {U}\right) \otimes \left(\alpha^ {- 1} \mathbf {G}\right) \approx \nabla_ {\mu} ^ {2} \ell (\boldsymbol {\mu})
708
+ $$
709
+
710
+ where $\alpha \neq 0$ can be any arbitrary non-zero scalar.
711
+
712
+ INGD is invariant since the update scheme involving the approximation is scale invariant: $\mathrm{Tr}(\mathbf{H}_C)\mathbf{H}_K = \mathrm{Tr}(\mathbf{C}^T\mathbf{G}\mathbf{C})\mathbf{K}^T\mathbf{U}\mathbf{K} = \mathrm{Tr}(\mathbf{C}^T (\alpha^{-1}\mathbf{G})\mathbf{C})\mathbf{K}^T (\alpha \mathbf{U})\mathbf{K}$ . The invariance is also preserved in SINGD since structures and their subspace projection maps are closed under scalar multiplications.
713
+
714
+ In contrast, the updates of KFAC and IKFAC are not scale invariant. As an example, we consider using curvature approximations $\mathbf{U}$ and $(\alpha \mathbf{U})$ to update $\mathbf{S}_K^{-1}$ in KFAC, and denote the updated $\mathbf{S}_K^{-1}$ by $\hat{\mathbf{S}}_K^{-1}$ and $\bar{\mathbf{S}}_K^{-1}$ , respectively. As shown below, we cannot recover $\hat{\mathbf{S}}_K^{-1}$ from $\bar{\mathbf{S}}_K^{-1}$ by scale transformations and thus, the KFAC update is not scale invariant.
715
+
716
+ $$
717
+ \hat {\mathbf {S}} _ {K} ^ {- 1} = \left[ (1 - \beta_ {1}) \hat {\mathbf {S}} _ {K} + \beta_ {1} \mathbf {U} + \lambda \mathbf {I} \right] ^ {- 1} \neq \left[ (1 - \beta_ {1}) \bar {\mathbf {S}} _ {K} + \beta_ {1} (\alpha \mathbf {U}) + \lambda \mathbf {I} \right] ^ {- 1} = \bar {\mathbf {S}} _ {K} ^ {- 1}
718
+ $$
719
+
720
+ An attempt to make the update of $\mathbf{S}_K$ invariant is to set the damping weight to be $\alpha \lambda$ . However, the update of $\mathbf{S}_C$ requires us to set the damping weight to be $\alpha^{-1}\lambda$ as shown below. Thus, it is impossible to make KFAC invariant without introducing individual damping weights.
721
+
722
+ $$
723
+ \hat {\mathbf {S}} _ {C} ^ {- 1} = \left[ (1 - \beta_ {1}) \hat {\mathbf {S}} _ {C} + \beta_ {1} \mathbf {G} + \lambda \mathbf {I} \right] ^ {- 1} \neq \left[ (1 - \beta_ {1}) \bar {\mathbf {S}} _ {C} + \beta_ {1} (\alpha^ {- 1} \mathbf {G}) + \lambda \mathbf {I} \right] ^ {- 1} = \bar {\mathbf {S}} _ {C} ^ {- 1}
724
+ $$
2024/Structured Inverse-Free Natural Gradient Descent_ Memory-Efficient & Numerically-Stable KFAC/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2d774d8e20d634ec48c237f24411a978dd2c29dbc65537b75c82c7b3cd6e639d
3
+ size 1117836
2024/Structured Inverse-Free Natural Gradient Descent_ Memory-Efficient & Numerically-Stable KFAC/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/Studying K-FAC Heuristics by Viewing Adam through a Second-Order Lens/3ec91fc3-a978-4b4a-9944-ec3b1d79464d_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/Studying K-FAC Heuristics by Viewing Adam through a Second-Order Lens/3ec91fc3-a978-4b4a-9944-ec3b1d79464d_model.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/Studying K-FAC Heuristics by Viewing Adam through a Second-Order Lens/3ec91fc3-a978-4b4a-9944-ec3b1d79464d_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:4e42e30e88845fb58d283b5abcef705f384c0d1e2a5c7b2ea6fd6322ba4a25c6
3
+ size 9215227
2024/Studying K-FAC Heuristics by Viewing Adam through a Second-Order Lens/full.md ADDED
The diff for this file is too large to render. See raw diff
 
2024/Studying K-FAC Heuristics by Viewing Adam through a Second-Order Lens/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6460c1ab501e155a730d065a7011618ec9b8b377d59e135ed56e4ceb225fbc52
3
+ size 3076684
2024/Studying K-FAC Heuristics by Viewing Adam through a Second-Order Lens/layout.json ADDED
The diff for this file is too large to render. See raw diff
 
2024/StyDeSty_ Min-Max Stylization and Destylization for Single Domain Generalization/06c19bcc-2231-4a64-bfd0-084f8b84c002_content_list.json ADDED
The diff for this file is too large to render. See raw diff