ZHANGYUXUAN-zR commited on
Commit
d2c983a
·
verified ·
1 Parent(s): 3b26fb0

Add files using upload-large-folder tool

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 +184 -0
  2. parse/dev/0LXEvcD3dB/0LXEvcD3dB_middle.json +0 -0
  3. parse/dev/2uAaGwlP_V/2uAaGwlP_V.md +340 -0
  4. parse/dev/2uAaGwlP_V/2uAaGwlP_V_content_list.json +1443 -0
  5. parse/dev/2uAaGwlP_V/2uAaGwlP_V_middle.json +0 -0
  6. parse/dev/2uAaGwlP_V/2uAaGwlP_V_model.json +0 -0
  7. parse/dev/401LFvBGIb/401LFvBGIb.md +308 -0
  8. parse/dev/401LFvBGIb/401LFvBGIb_content_list.json +910 -0
  9. parse/dev/401LFvBGIb/401LFvBGIb_middle.json +0 -0
  10. parse/dev/401LFvBGIb/401LFvBGIb_model.json +0 -0
  11. parse/dev/E01k9048soZ/E01k9048soZ.md +0 -0
  12. parse/dev/E01k9048soZ/E01k9048soZ_content_list.json +0 -0
  13. parse/dev/E01k9048soZ/E01k9048soZ_middle.json +0 -0
  14. parse/dev/E01k9048soZ/E01k9048soZ_model.json +0 -0
  15. parse/dev/ECvgmYVyeUz/ECvgmYVyeUz.md +559 -0
  16. parse/dev/ECvgmYVyeUz/ECvgmYVyeUz_content_list.json +0 -0
  17. parse/dev/ECvgmYVyeUz/ECvgmYVyeUz_middle.json +0 -0
  18. parse/dev/ECvgmYVyeUz/ECvgmYVyeUz_model.json +0 -0
  19. parse/dev/LPB2BFZvncQ/LPB2BFZvncQ.md +827 -0
  20. parse/dev/LPB2BFZvncQ/LPB2BFZvncQ_content_list.json +0 -0
  21. parse/dev/LPB2BFZvncQ/LPB2BFZvncQ_middle.json +0 -0
  22. parse/dev/LPB2BFZvncQ/LPB2BFZvncQ_model.json +0 -0
  23. parse/dev/NudBMY-tzDr/NudBMY-tzDr.md +536 -0
  24. parse/dev/NudBMY-tzDr/NudBMY-tzDr_content_list.json +0 -0
  25. parse/dev/NudBMY-tzDr/NudBMY-tzDr_middle.json +0 -0
  26. parse/dev/NudBMY-tzDr/NudBMY-tzDr_model.json +0 -0
  27. parse/dev/RecZ9nB9Q4/RecZ9nB9Q4.md +0 -0
  28. parse/dev/RecZ9nB9Q4/RecZ9nB9Q4_content_list.json +0 -0
  29. parse/dev/RecZ9nB9Q4/RecZ9nB9Q4_middle.json +0 -0
  30. parse/dev/RecZ9nB9Q4/RecZ9nB9Q4_model.json +0 -0
  31. parse/dev/Uynr3iPhksa/Uynr3iPhksa.md +325 -0
  32. parse/dev/Uynr3iPhksa/Uynr3iPhksa_content_list.json +1731 -0
  33. parse/dev/Uynr3iPhksa/Uynr3iPhksa_middle.json +0 -0
  34. parse/dev/Uynr3iPhksa/Uynr3iPhksa_model.json +0 -0
  35. parse/dev/ZBESeIUB5k/ZBESeIUB5k.md +0 -0
  36. parse/dev/ZBESeIUB5k/ZBESeIUB5k_content_list.json +0 -0
  37. parse/dev/ZBESeIUB5k/ZBESeIUB5k_middle.json +0 -0
  38. parse/dev/ZBESeIUB5k/ZBESeIUB5k_model.json +0 -0
  39. parse/dev/aa8KsqfTPa/aa8KsqfTPa.md +240 -0
  40. parse/dev/aa8KsqfTPa/aa8KsqfTPa_content_list.json +1222 -0
  41. parse/dev/c5Inzw6giM/c5Inzw6giM.md +327 -0
  42. parse/dev/c5Inzw6giM/c5Inzw6giM_content_list.json +1043 -0
  43. parse/dev/c5Inzw6giM/c5Inzw6giM_middle.json +0 -0
  44. parse/dev/c5Inzw6giM/c5Inzw6giM_model.json +0 -0
  45. parse/dev/hQwb-lbM6EL/hQwb-lbM6EL_content_list.json +0 -0
  46. parse/dev/nJJjv0JDJju/nJJjv0JDJju.md +383 -0
  47. parse/dev/nJJjv0JDJju/nJJjv0JDJju_content_list.json +1782 -0
  48. parse/dev/nJJjv0JDJju/nJJjv0JDJju_middle.json +0 -0
  49. parse/dev/nJJjv0JDJju/nJJjv0JDJju_model.json +0 -0
  50. parse/dev/peZSbfNnBp4/peZSbfNnBp4.md +274 -0
.gitattributes CHANGED
@@ -4755,3 +4755,187 @@ parse/train/ByeL1R4FvS/ByeL1R4FvS_layout.pdf filter=lfs diff=lfs merge=lfs -text
4755
  parse/train/ByeL1R4FvS/ByeL1R4FvS_origin.pdf filter=lfs diff=lfs merge=lfs -text
4756
  parse/train/rkfOvGbCW/rkfOvGbCW_span.pdf filter=lfs diff=lfs merge=lfs -text
4757
  parse/train/rkfOvGbCW/rkfOvGbCW_origin.pdf filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4755
  parse/train/ByeL1R4FvS/ByeL1R4FvS_origin.pdf filter=lfs diff=lfs merge=lfs -text
4756
  parse/train/rkfOvGbCW/rkfOvGbCW_span.pdf filter=lfs diff=lfs merge=lfs -text
4757
  parse/train/rkfOvGbCW/rkfOvGbCW_origin.pdf filter=lfs diff=lfs merge=lfs -text
4758
+ parse/train/rkfOvGbCW/rkfOvGbCW_layout.pdf filter=lfs diff=lfs merge=lfs -text
4759
+ parse/train/r1DPFCyA-/r1DPFCyA-_layout.pdf filter=lfs diff=lfs merge=lfs -text
4760
+ parse/train/r1DPFCyA-/r1DPFCyA-_origin.pdf filter=lfs diff=lfs merge=lfs -text
4761
+ parse/train/r1DPFCyA-/r1DPFCyA-_span.pdf filter=lfs diff=lfs merge=lfs -text
4762
+ parse/train/ee6W5UgQLa/ee6W5UgQLa_span.pdf filter=lfs diff=lfs merge=lfs -text
4763
+ parse/train/ee6W5UgQLa/ee6W5UgQLa_origin.pdf filter=lfs diff=lfs merge=lfs -text
4764
+ parse/train/ee6W5UgQLa/ee6W5UgQLa_layout.pdf filter=lfs diff=lfs merge=lfs -text
4765
+ parse/train/EAdJEN8xKUl/EAdJEN8xKUl_layout.pdf filter=lfs diff=lfs merge=lfs -text
4766
+ parse/train/EAdJEN8xKUl/EAdJEN8xKUl_span.pdf filter=lfs diff=lfs merge=lfs -text
4767
+ parse/train/EAdJEN8xKUl/EAdJEN8xKUl_origin.pdf filter=lfs diff=lfs merge=lfs -text
4768
+ parse/train/BJ9fZNqle/BJ9fZNqle_origin.pdf filter=lfs diff=lfs merge=lfs -text
4769
+ parse/train/BJ9fZNqle/BJ9fZNqle_span.pdf filter=lfs diff=lfs merge=lfs -text
4770
+ parse/train/BJ9fZNqle/BJ9fZNqle_layout.pdf filter=lfs diff=lfs merge=lfs -text
4771
+ parse/train/rkaqxm-0b/rkaqxm-0b_origin.pdf filter=lfs diff=lfs merge=lfs -text
4772
+ parse/train/rkaqxm-0b/rkaqxm-0b_span.pdf filter=lfs diff=lfs merge=lfs -text
4773
+ parse/train/rkaqxm-0b/rkaqxm-0b_layout.pdf filter=lfs diff=lfs merge=lfs -text
4774
+ parse/train/S1viikbCW/S1viikbCW_origin.pdf filter=lfs diff=lfs merge=lfs -text
4775
+ parse/train/S1viikbCW/S1viikbCW_layout.pdf filter=lfs diff=lfs merge=lfs -text
4776
+ parse/train/S1viikbCW/S1viikbCW_span.pdf filter=lfs diff=lfs merge=lfs -text
4777
+ parse/train/H1Yp-j1Cb/H1Yp-j1Cb_span.pdf filter=lfs diff=lfs merge=lfs -text
4778
+ parse/train/H1Yp-j1Cb/H1Yp-j1Cb_layout.pdf filter=lfs diff=lfs merge=lfs -text
4779
+ parse/train/H1Yp-j1Cb/H1Yp-j1Cb_origin.pdf filter=lfs diff=lfs merge=lfs -text
4780
+ parse/train/1GTpBZvNUrk/1GTpBZvNUrk_origin.pdf filter=lfs diff=lfs merge=lfs -text
4781
+ parse/train/1GTpBZvNUrk/1GTpBZvNUrk_layout.pdf filter=lfs diff=lfs merge=lfs -text
4782
+ parse/train/1GTpBZvNUrk/1GTpBZvNUrk_span.pdf filter=lfs diff=lfs merge=lfs -text
4783
+ parse/train/6NFBvWlRXaG/6NFBvWlRXaG_span.pdf filter=lfs diff=lfs merge=lfs -text
4784
+ parse/train/6NFBvWlRXaG/6NFBvWlRXaG_layout.pdf filter=lfs diff=lfs merge=lfs -text
4785
+ parse/train/6NFBvWlRXaG/6NFBvWlRXaG_origin.pdf filter=lfs diff=lfs merge=lfs -text
4786
+ parse/train/3ZeGLibhFo0/3ZeGLibhFo0_span.pdf filter=lfs diff=lfs merge=lfs -text
4787
+ parse/train/3ZeGLibhFo0/3ZeGLibhFo0_origin.pdf filter=lfs diff=lfs merge=lfs -text
4788
+ parse/train/3ZeGLibhFo0/3ZeGLibhFo0_layout.pdf filter=lfs diff=lfs merge=lfs -text
4789
+ parse/train/IhiU6AJYpDs/IhiU6AJYpDs_layout.pdf filter=lfs diff=lfs merge=lfs -text
4790
+ parse/train/IhiU6AJYpDs/IhiU6AJYpDs_origin.pdf filter=lfs diff=lfs merge=lfs -text
4791
+ parse/train/IhiU6AJYpDs/IhiU6AJYpDs_span.pdf filter=lfs diff=lfs merge=lfs -text
4792
+ parse/train/NiM9Q7Z95z/NiM9Q7Z95z_layout.pdf filter=lfs diff=lfs merge=lfs -text
4793
+ parse/train/NiM9Q7Z95z/NiM9Q7Z95z_origin.pdf filter=lfs diff=lfs merge=lfs -text
4794
+ parse/train/NiM9Q7Z95z/NiM9Q7Z95z_span.pdf filter=lfs diff=lfs merge=lfs -text
4795
+ parse/train/Pg13X3rETW/Pg13X3rETW_layout.pdf filter=lfs diff=lfs merge=lfs -text
4796
+ parse/train/Pg13X3rETW/Pg13X3rETW_span.pdf filter=lfs diff=lfs merge=lfs -text
4797
+ parse/train/Pg13X3rETW/Pg13X3rETW_origin.pdf filter=lfs diff=lfs merge=lfs -text
4798
+ parse/train/Nl7VO_Y7K4Q/Nl7VO_Y7K4Q_layout.pdf filter=lfs diff=lfs merge=lfs -text
4799
+ parse/train/Nl7VO_Y7K4Q/Nl7VO_Y7K4Q_span.pdf filter=lfs diff=lfs merge=lfs -text
4800
+ parse/train/Nl7VO_Y7K4Q/Nl7VO_Y7K4Q_origin.pdf filter=lfs diff=lfs merge=lfs -text
4801
+ parse/train/H1l_gA4KvH/H1l_gA4KvH_span.pdf filter=lfs diff=lfs merge=lfs -text
4802
+ parse/train/H1l_gA4KvH/H1l_gA4KvH_layout.pdf filter=lfs diff=lfs merge=lfs -text
4803
+ parse/train/H1l_gA4KvH/H1l_gA4KvH_origin.pdf filter=lfs diff=lfs merge=lfs -text
4804
+ parse/train/rkgyS0VFvr/rkgyS0VFvr_origin.pdf filter=lfs diff=lfs merge=lfs -text
4805
+ parse/train/rkgyS0VFvr/rkgyS0VFvr_span.pdf filter=lfs diff=lfs merge=lfs -text
4806
+ parse/train/rkgyS0VFvr/rkgyS0VFvr_layout.pdf filter=lfs diff=lfs merge=lfs -text
4807
+ parse/train/rJTKKKqeg/rJTKKKqeg_origin.pdf filter=lfs diff=lfs merge=lfs -text
4808
+ parse/train/rJTKKKqeg/rJTKKKqeg_span.pdf filter=lfs diff=lfs merge=lfs -text
4809
+ parse/train/rJTKKKqeg/rJTKKKqeg_layout.pdf filter=lfs diff=lfs merge=lfs -text
4810
+ parse/train/CRFSrgYtV7m/CRFSrgYtV7m_span.pdf filter=lfs diff=lfs merge=lfs -text
4811
+ parse/train/CRFSrgYtV7m/CRFSrgYtV7m_origin.pdf filter=lfs diff=lfs merge=lfs -text
4812
+ parse/train/CRFSrgYtV7m/CRFSrgYtV7m_layout.pdf filter=lfs diff=lfs merge=lfs -text
4813
+ parse/train/HyY0Ff-AZ/HyY0Ff-AZ_layout.pdf filter=lfs diff=lfs merge=lfs -text
4814
+ parse/train/HyY0Ff-AZ/HyY0Ff-AZ_span.pdf filter=lfs diff=lfs merge=lfs -text
4815
+ parse/train/HyY0Ff-AZ/HyY0Ff-AZ_origin.pdf filter=lfs diff=lfs merge=lfs -text
4816
+ parse/train/5L8XMh667qz/5L8XMh667qz_layout.pdf filter=lfs diff=lfs merge=lfs -text
4817
+ parse/train/5L8XMh667qz/5L8XMh667qz_origin.pdf filter=lfs diff=lfs merge=lfs -text
4818
+ parse/train/5L8XMh667qz/5L8XMh667qz_span.pdf filter=lfs diff=lfs merge=lfs -text
4819
+ parse/train/SJ_-Nx3jz/SJ_-Nx3jz_span.pdf filter=lfs diff=lfs merge=lfs -text
4820
+ parse/train/SJ_-Nx3jz/SJ_-Nx3jz_layout.pdf filter=lfs diff=lfs merge=lfs -text
4821
+ parse/train/SJ_-Nx3jz/SJ_-Nx3jz_origin.pdf filter=lfs diff=lfs merge=lfs -text
4822
+ parse/train/h1-ilmYbdea/h1-ilmYbdea_origin.pdf filter=lfs diff=lfs merge=lfs -text
4823
+ parse/train/h1-ilmYbdea/h1-ilmYbdea_span.pdf filter=lfs diff=lfs merge=lfs -text
4824
+ parse/train/h1-ilmYbdea/h1-ilmYbdea_layout.pdf filter=lfs diff=lfs merge=lfs -text
4825
+ parse/train/BJlyznAcFm/BJlyznAcFm_layout.pdf filter=lfs diff=lfs merge=lfs -text
4826
+ parse/train/BJlyznAcFm/BJlyznAcFm_span.pdf filter=lfs diff=lfs merge=lfs -text
4827
+ parse/train/BJlyznAcFm/BJlyznAcFm_origin.pdf filter=lfs diff=lfs merge=lfs -text
4828
+ parse/train/OMNB1G5xzd4/OMNB1G5xzd4_layout.pdf filter=lfs diff=lfs merge=lfs -text
4829
+ parse/train/OMNB1G5xzd4/OMNB1G5xzd4_origin.pdf filter=lfs diff=lfs merge=lfs -text
4830
+ parse/train/OMNB1G5xzd4/OMNB1G5xzd4_span.pdf filter=lfs diff=lfs merge=lfs -text
4831
+ parse/train/JWRRBHFPKTJ/JWRRBHFPKTJ_span.pdf filter=lfs diff=lfs merge=lfs -text
4832
+ parse/train/JWRRBHFPKTJ/JWRRBHFPKTJ_origin.pdf filter=lfs diff=lfs merge=lfs -text
4833
+ parse/train/JWRRBHFPKTJ/JWRRBHFPKTJ_layout.pdf filter=lfs diff=lfs merge=lfs -text
4834
+ parse/train/ByxAcjCqt7/ByxAcjCqt7_origin.pdf filter=lfs diff=lfs merge=lfs -text
4835
+ parse/train/ByxAcjCqt7/ByxAcjCqt7_span.pdf filter=lfs diff=lfs merge=lfs -text
4836
+ parse/train/ByxAcjCqt7/ByxAcjCqt7_layout.pdf filter=lfs diff=lfs merge=lfs -text
4837
+ parse/train/H1lma24tPB/H1lma24tPB_span.pdf filter=lfs diff=lfs merge=lfs -text
4838
+ parse/train/H1lma24tPB/H1lma24tPB_origin.pdf filter=lfs diff=lfs merge=lfs -text
4839
+ parse/train/H1lma24tPB/H1lma24tPB_layout.pdf filter=lfs diff=lfs merge=lfs -text
4840
+ parse/train/SygvTcYee/SygvTcYee_span.pdf filter=lfs diff=lfs merge=lfs -text
4841
+ parse/train/SygvTcYee/SygvTcYee_layout.pdf filter=lfs diff=lfs merge=lfs -text
4842
+ parse/train/SygvTcYee/SygvTcYee_origin.pdf filter=lfs diff=lfs merge=lfs -text
4843
+ parse/train/3Wp8HM2CNdR/3Wp8HM2CNdR_layout.pdf filter=lfs diff=lfs merge=lfs -text
4844
+ parse/train/3Wp8HM2CNdR/3Wp8HM2CNdR_origin.pdf filter=lfs diff=lfs merge=lfs -text
4845
+ parse/train/3Wp8HM2CNdR/3Wp8HM2CNdR_span.pdf filter=lfs diff=lfs merge=lfs -text
4846
+ parse/train/SJeqs6EFvB/SJeqs6EFvB_layout.pdf filter=lfs diff=lfs merge=lfs -text
4847
+ parse/train/SJeqs6EFvB/SJeqs6EFvB_span.pdf filter=lfs diff=lfs merge=lfs -text
4848
+ parse/train/SJeqs6EFvB/SJeqs6EFvB_origin.pdf filter=lfs diff=lfs merge=lfs -text
4849
+ parse/train/txC1ObHJ0wB/txC1ObHJ0wB_layout.pdf filter=lfs diff=lfs merge=lfs -text
4850
+ parse/train/txC1ObHJ0wB/txC1ObHJ0wB_span.pdf filter=lfs diff=lfs merge=lfs -text
4851
+ parse/train/txC1ObHJ0wB/txC1ObHJ0wB_origin.pdf filter=lfs diff=lfs merge=lfs -text
4852
+ parse/train/r1drp-WCZ/r1drp-WCZ_span.pdf filter=lfs diff=lfs merge=lfs -text
4853
+ parse/train/r1drp-WCZ/r1drp-WCZ_origin.pdf filter=lfs diff=lfs merge=lfs -text
4854
+ parse/train/r1drp-WCZ/r1drp-WCZ_layout.pdf filter=lfs diff=lfs merge=lfs -text
4855
+ parse/train/Aeo-xqtb5p/Aeo-xqtb5p_origin.pdf filter=lfs diff=lfs merge=lfs -text
4856
+ parse/train/Aeo-xqtb5p/Aeo-xqtb5p_span.pdf filter=lfs diff=lfs merge=lfs -text
4857
+ parse/train/Aeo-xqtb5p/Aeo-xqtb5p_layout.pdf filter=lfs diff=lfs merge=lfs -text
4858
+ parse/train/HyGIdiRqtm/HyGIdiRqtm_layout.pdf filter=lfs diff=lfs merge=lfs -text
4859
+ parse/train/HyGIdiRqtm/HyGIdiRqtm_origin.pdf filter=lfs diff=lfs merge=lfs -text
4860
+ parse/train/HyGIdiRqtm/HyGIdiRqtm_span.pdf filter=lfs diff=lfs merge=lfs -text
4861
+ parse/train/ry4S90l0b/ry4S90l0b_origin.pdf filter=lfs diff=lfs merge=lfs -text
4862
+ parse/train/ry4S90l0b/ry4S90l0b_span.pdf filter=lfs diff=lfs merge=lfs -text
4863
+ parse/train/ry4S90l0b/ry4S90l0b_layout.pdf filter=lfs diff=lfs merge=lfs -text
4864
+ parse/train/BJgGhiR5KX/BJgGhiR5KX_span.pdf filter=lfs diff=lfs merge=lfs -text
4865
+ parse/train/BJgGhiR5KX/BJgGhiR5KX_origin.pdf filter=lfs diff=lfs merge=lfs -text
4866
+ parse/train/BJgGhiR5KX/BJgGhiR5KX_layout.pdf filter=lfs diff=lfs merge=lfs -text
4867
+ parse/train/rkxtNaNKwr/rkxtNaNKwr_origin.pdf filter=lfs diff=lfs merge=lfs -text
4868
+ parse/train/rkxtNaNKwr/rkxtNaNKwr_layout.pdf filter=lfs diff=lfs merge=lfs -text
4869
+ parse/train/rkxtNaNKwr/rkxtNaNKwr_span.pdf filter=lfs diff=lfs merge=lfs -text
4870
+ parse/train/nVZtXBI6LNn/nVZtXBI6LNn_origin.pdf filter=lfs diff=lfs merge=lfs -text
4871
+ parse/train/nVZtXBI6LNn/nVZtXBI6LNn_span.pdf filter=lfs diff=lfs merge=lfs -text
4872
+ parse/train/nVZtXBI6LNn/nVZtXBI6LNn_layout.pdf filter=lfs diff=lfs merge=lfs -text
4873
+ parse/train/S1l66nNFvB/S1l66nNFvB_origin.pdf filter=lfs diff=lfs merge=lfs -text
4874
+ parse/train/S1l66nNFvB/S1l66nNFvB_span.pdf filter=lfs diff=lfs merge=lfs -text
4875
+ parse/train/S1l66nNFvB/S1l66nNFvB_layout.pdf filter=lfs diff=lfs merge=lfs -text
4876
+ parse/train/1G6jPa9SKYG/1G6jPa9SKYG_layout.pdf filter=lfs diff=lfs merge=lfs -text
4877
+ parse/train/1G6jPa9SKYG/1G6jPa9SKYG_origin.pdf filter=lfs diff=lfs merge=lfs -text
4878
+ parse/train/1G6jPa9SKYG/1G6jPa9SKYG_span.pdf filter=lfs diff=lfs merge=lfs -text
4879
+ parse/train/dwJyEMPZ04I/dwJyEMPZ04I_origin.pdf filter=lfs diff=lfs merge=lfs -text
4880
+ parse/train/dwJyEMPZ04I/dwJyEMPZ04I_layout.pdf filter=lfs diff=lfs merge=lfs -text
4881
+ parse/train/dwJyEMPZ04I/dwJyEMPZ04I_span.pdf filter=lfs diff=lfs merge=lfs -text
4882
+ parse/train/Bkab5dqxe/Bkab5dqxe_origin.pdf filter=lfs diff=lfs merge=lfs -text
4883
+ parse/train/Bkab5dqxe/Bkab5dqxe_layout.pdf filter=lfs diff=lfs merge=lfs -text
4884
+ parse/train/Bkab5dqxe/Bkab5dqxe_span.pdf filter=lfs diff=lfs merge=lfs -text
4885
+ parse/train/HJxkvlBtwH/HJxkvlBtwH_span.pdf filter=lfs diff=lfs merge=lfs -text
4886
+ parse/train/HJxkvlBtwH/HJxkvlBtwH_layout.pdf filter=lfs diff=lfs merge=lfs -text
4887
+ parse/train/HJxkvlBtwH/HJxkvlBtwH_origin.pdf filter=lfs diff=lfs merge=lfs -text
4888
+ parse/train/BJgqQ6NYvB/BJgqQ6NYvB_span.pdf filter=lfs diff=lfs merge=lfs -text
4889
+ parse/train/BJgqQ6NYvB/BJgqQ6NYvB_origin.pdf filter=lfs diff=lfs merge=lfs -text
4890
+ parse/train/BJgqQ6NYvB/BJgqQ6NYvB_layout.pdf filter=lfs diff=lfs merge=lfs -text
4891
+ parse/train/BbikqBWZTGB/BbikqBWZTGB_span.pdf filter=lfs diff=lfs merge=lfs -text
4892
+ parse/train/BbikqBWZTGB/BbikqBWZTGB_origin.pdf filter=lfs diff=lfs merge=lfs -text
4893
+ parse/train/BbikqBWZTGB/BbikqBWZTGB_layout.pdf filter=lfs diff=lfs merge=lfs -text
4894
+ parse/train/HJgS7p4FPH/HJgS7p4FPH_span.pdf filter=lfs diff=lfs merge=lfs -text
4895
+ parse/train/HJgS7p4FPH/HJgS7p4FPH_origin.pdf filter=lfs diff=lfs merge=lfs -text
4896
+ parse/train/HJgS7p4FPH/HJgS7p4FPH_layout.pdf filter=lfs diff=lfs merge=lfs -text
4897
+ parse/train/c0O9vBVSvIl/c0O9vBVSvIl_layout.pdf filter=lfs diff=lfs merge=lfs -text
4898
+ parse/train/c0O9vBVSvIl/c0O9vBVSvIl_origin.pdf filter=lfs diff=lfs merge=lfs -text
4899
+ parse/train/c0O9vBVSvIl/c0O9vBVSvIl_span.pdf filter=lfs diff=lfs merge=lfs -text
4900
+ parse/train/BJxQxeBYwH/BJxQxeBYwH_layout.pdf filter=lfs diff=lfs merge=lfs -text
4901
+ parse/train/BJxQxeBYwH/BJxQxeBYwH_span.pdf filter=lfs diff=lfs merge=lfs -text
4902
+ parse/train/BJxQxeBYwH/BJxQxeBYwH_origin.pdf filter=lfs diff=lfs merge=lfs -text
4903
+ parse/train/l-PrrQrK0QR/l-PrrQrK0QR_origin.pdf filter=lfs diff=lfs merge=lfs -text
4904
+ parse/train/l-PrrQrK0QR/l-PrrQrK0QR_span.pdf filter=lfs diff=lfs merge=lfs -text
4905
+ parse/train/l-PrrQrK0QR/l-PrrQrK0QR_layout.pdf filter=lfs diff=lfs merge=lfs -text
4906
+ parse/train/r1aPbsFle/r1aPbsFle_layout.pdf filter=lfs diff=lfs merge=lfs -text
4907
+ parse/train/r1aPbsFle/r1aPbsFle_origin.pdf filter=lfs diff=lfs merge=lfs -text
4908
+ parse/train/r1aPbsFle/r1aPbsFle_span.pdf filter=lfs diff=lfs merge=lfs -text
4909
+ parse/train/Wz-t1oOTWa/Wz-t1oOTWa_span.pdf filter=lfs diff=lfs merge=lfs -text
4910
+ parse/train/Wz-t1oOTWa/Wz-t1oOTWa_layout.pdf filter=lfs diff=lfs merge=lfs -text
4911
+ parse/train/Wz-t1oOTWa/Wz-t1oOTWa_origin.pdf filter=lfs diff=lfs merge=lfs -text
4912
+ parse/train/HkwZSG-CZ/HkwZSG-CZ_layout.pdf filter=lfs diff=lfs merge=lfs -text
4913
+ parse/train/HkwZSG-CZ/HkwZSG-CZ_origin.pdf filter=lfs diff=lfs merge=lfs -text
4914
+ parse/train/HkwZSG-CZ/HkwZSG-CZ_span.pdf filter=lfs diff=lfs merge=lfs -text
4915
+ parse/train/BysvGP5ee/BysvGP5ee_origin.pdf filter=lfs diff=lfs merge=lfs -text
4916
+ parse/train/BysvGP5ee/BysvGP5ee_span.pdf filter=lfs diff=lfs merge=lfs -text
4917
+ parse/train/BysvGP5ee/BysvGP5ee_layout.pdf filter=lfs diff=lfs merge=lfs -text
4918
+ parse/train/ryxnY3NYPS/ryxnY3NYPS_layout.pdf filter=lfs diff=lfs merge=lfs -text
4919
+ parse/train/ryxnY3NYPS/ryxnY3NYPS_origin.pdf filter=lfs diff=lfs merge=lfs -text
4920
+ parse/train/ryxnY3NYPS/ryxnY3NYPS_span.pdf filter=lfs diff=lfs merge=lfs -text
4921
+ parse/train/HkxTwkrKDB/HkxTwkrKDB_span.pdf filter=lfs diff=lfs merge=lfs -text
4922
+ parse/train/HkxTwkrKDB/HkxTwkrKDB_layout.pdf filter=lfs diff=lfs merge=lfs -text
4923
+ parse/train/HkxTwkrKDB/HkxTwkrKDB_origin.pdf filter=lfs diff=lfs merge=lfs -text
4924
+ parse/train/_4VxORHq-0g/_4VxORHq-0g_layout.pdf filter=lfs diff=lfs merge=lfs -text
4925
+ parse/train/_4VxORHq-0g/_4VxORHq-0g_span.pdf filter=lfs diff=lfs merge=lfs -text
4926
+ parse/train/_4VxORHq-0g/_4VxORHq-0g_origin.pdf filter=lfs diff=lfs merge=lfs -text
4927
+ parse/train/HyXBcYg0b/HyXBcYg0b_span.pdf filter=lfs diff=lfs merge=lfs -text
4928
+ parse/train/HyXBcYg0b/HyXBcYg0b_layout.pdf filter=lfs diff=lfs merge=lfs -text
4929
+ parse/train/HyXBcYg0b/HyXBcYg0b_origin.pdf filter=lfs diff=lfs merge=lfs -text
4930
+ parse/train/H1gBhkBFDH/H1gBhkBFDH_span.pdf filter=lfs diff=lfs merge=lfs -text
4931
+ parse/train/H1gBhkBFDH/H1gBhkBFDH_layout.pdf filter=lfs diff=lfs merge=lfs -text
4932
+ parse/train/H1gBhkBFDH/H1gBhkBFDH_origin.pdf filter=lfs diff=lfs merge=lfs -text
4933
+ parse/train/rJIN_4lA-/rJIN_4lA-_layout.pdf filter=lfs diff=lfs merge=lfs -text
4934
+ parse/train/rJIN_4lA-/rJIN_4lA-_span.pdf filter=lfs diff=lfs merge=lfs -text
4935
+ parse/train/rJIN_4lA-/rJIN_4lA-_origin.pdf filter=lfs diff=lfs merge=lfs -text
4936
+ parse/train/rklMnyBtPB/rklMnyBtPB_layout.pdf filter=lfs diff=lfs merge=lfs -text
4937
+ parse/train/rklMnyBtPB/rklMnyBtPB_span.pdf filter=lfs diff=lfs merge=lfs -text
4938
+ parse/train/rklMnyBtPB/rklMnyBtPB_origin.pdf filter=lfs diff=lfs merge=lfs -text
4939
+ parse/train/S1x4ghC9tQ/S1x4ghC9tQ_origin.pdf filter=lfs diff=lfs merge=lfs -text
4940
+ parse/train/S1x4ghC9tQ/S1x4ghC9tQ_span.pdf filter=lfs diff=lfs merge=lfs -text
4941
+ parse/train/S1x4ghC9tQ/S1x4ghC9tQ_layout.pdf filter=lfs diff=lfs merge=lfs -text
parse/dev/0LXEvcD3dB/0LXEvcD3dB_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/2uAaGwlP_V/2uAaGwlP_V.md ADDED
@@ -0,0 +1,340 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # DPM-Solver: A Fast ODE Solver for Diffusion Probabilistic Model Sampling in Around 10 Steps
2
+
3
+ Cheng $\mathbf { L } \mathbf { u } ^ { \dagger }$ , Yuhao Zhou†, Fan Bao†, Jianfei $\mathbf { C h e n } ^ { \dagger * }$ , Chongxuan $\mathbf { L i } ^ { \dagger }$ , Jun Zhu†∗ †Dept. of Comp. Sci. & Tech., Institute for AI, BNRist Center, THBI Lab †Tsinghua-Bosch Joint ML Center, Tsinghua University, Beijing, 100084 China ‡Gaoling School of Artificial Intelligence, Renmin University of China, ‡Beijing Key Laboratory of Big Data Management and Analysis Methods, Beijing, China {lucheng.lc15, yuhaoz.cs}@gmail.com; bf19@mails.tsinghua.edu.cn chongxuanli@ruc.edu.cn; {jianfeic, dcszj}@tsinghua.edu.cn
4
+
5
+ # Abstract
6
+
7
+ Diffusion probabilistic models (DPMs) are emerging powerful generative models. Despite their high-quality generation performance, DPMs still suffer from their slow sampling as they generally need hundreds or thousands of sequential function evaluations (steps) of large neural networks to draw a sample. Sampling from DPMs can be viewed alternatively as solving the corresponding diffusion ordinary differential equations (ODEs). In this work, we propose an exact formulation of the solution of diffusion ODEs. The formulation analytically computes the linear part of the solution, rather than leaving all terms to black-box ODE solvers as adopted in previous works. By applying change-of-variable, the solution can be equivalently simplified to an exponentially weighted integral of the neural network. Based on our formulation, we propose DPM-Solver, a fast dedicated high-order solver for diffusion ODEs with the convergence order guarantee. DPM-Solver is suitable for both discrete-time and continuous-time DPMs without any further training. Experimental results show that DPM-Solver can generate high-quality samples in only 10 to 20 function evaluations on various datasets. We achieve $4 . 7 0 \ : \mathrm { F I D }$ in 10 function evaluations and 2.87 FID in 20 function evaluations on the CIFAR10 dataset, and a $4 \sim 1 6 \times$ speedup compared with previous state-of-the-art training-free samplers on various datasets.2
8
+
9
+ # 1 Introduction
10
+
11
+ Diffusion probabilistic models (DPMs) [1–3] are emerging powerful generative models with promising performance on many tasks, such as image generation [4, 5], video generation [6], text-to-image generation [7], speech synthesis [8, 9] and lossless compression [10]. DPMs are defined by discretetime random processes [1, 2] or continuous-time stochastic differential equations (SDEs) [3], which learn to gradually remove the noise added to the data points. Compared with the widely-used generative adversarial networks (GANs) [11] and variational auto-encoders (VAEs) [12], DPMs can not only compute exact likelihood [3], but also achieve even better sample quality for image generation [4]. However, to obtain high-quality samples, DPMs usually need hundreds or thousands of sequential steps of large neural network evaluations, thereby resulting in a much slower sampling speed than the single-step GANs or VAEs. Such inefficiency is becoming a critical bottleneck for the adoption of DPMs in downstream tasks, leading to an urgent request to design fast samplers for DPMs.
12
+
13
+ ![](images/4d6dd94407a2a26c38622fe661183fe6ba98b37b4ec1a90af34b958f1acc3ac9.jpg)
14
+ Figure 1: Samples by DDIM [19] with 10, 15, 20, 100 number of function evaluations (NFE), and DPM-Solver (ours) with only 10 NFE, using the pre-trained DPMs on ImageNet $2 5 6 \times 2 5 6$ with classifier guidance [4].
15
+
16
+ Existing fast samplers for DPMs can be divided into two categories. The first category includes knowledge distillation [13, 14] and noise level or sample trajectory learning [15–18]. Such methods require a possibly expensive training stage before they can be used for efficient sampling. Furthermore, their applicability and flexibility might be limited. It might require nontrivial effort to adapt the method to different models, datasets, and number of sampling steps. The second category consists of training-free [19–21] samplers, which are suitable for all pre-trained DPMs in a simple plug-andplay manner. Training-free samplers include adopting implicit [19] or analytical [21] generation process, advanced differential equation (DE) solvers [3, 20, 22–24] and dynamic programming [18]. However, these methods still require $\sim 5 0$ function evaluations [21] to generate high-quality samples (comparable to those generated by plain samplers in about 1000 function evaluations), thereby are still time-consuming.
17
+
18
+ In this work, we bring the efficiency of training-free samplers to a new level to produce high-quality samples in the “few-step sampling” regime, where the sampling can be done within around 10 steps of sequential function evaluations. We tackle the alternative problem of sampling from DPMs as solving the corresponding diffusion ordinary differential equations (ODEs) of DPMs, and carefully examine the structure of diffusion ODEs. Diffusion ODEs have a semi-linear structure — they consist of a linear function of the data variable and a nonlinear function parameterized by neural networks. Such structure is omitted in previous training-free samplers [3, 20], which directly use black-box DE solvers. To utilize the semi-linear structure, we derive an exact formulation of the solutions of diffusion ODEs by analytically computing the linear part of the solutions, avoiding the corresponding discretization error. Furthermore, by applying change-of-variable, the solutions can be equivalently simplified to an exponentially weighted integral of the neural network. Such integral is very special and can be efficiently approximated by the numerical methods for exponential integrators [25].
19
+
20
+ Based on our formulation of solutions, we propose DPM-Solver, a fast dedicated solver for diffusion ODEs by approximating the above integral. Specifically, we propose first-order, second-order and third-order versions of DPM-Solver with convergence order guarantees. We further propose an adaptive step size schedule for DPM-Solver. In general, DPM-Solver is applicable to both continuoustime and discrete-time DPMs, and also conditional sampling with classifier guidance [4]. Fig. 1 demonstrates the speedup performance of a Denoising Diffusion Implicit Models (DDIM) [19] baseline and DPM-Solver, which shows that DPM-Solver can generate high-quality samples with as few as 10 function evaluations and is much faster than DDIM on the ImageNet 256x256 dataset [26]. Our additional experimental results show that DPM-Solver can greatly improve the sampling speed of both discrete-time and continuous-time DPMs, and it can achieve excellent sample quality in around 10 function evaluations, which is much faster than all previous training-free samplers of DPMs.
21
+
22
+ # 2 Diffusion Probabilistic Models
23
+
24
+ We review diffusion probabilistic models and their associated differential equations in this section.
25
+
26
+ # 2.1 Forward Process and Diffusion SDEs
27
+
28
+ Assume that we have a $D$ -dimensional random variable $\pmb { x } _ { 0 } \in \mathbb { R } ^ { D }$ with an unknown distribution $q _ { 0 } ( { \pmb x } _ { 0 } )$ . Diffusion Probabilistic Models (DPMs) [1–3, 10] define a forward process $\{ \pmb { x } _ { t } \} _ { t \in [ 0 , T ] }$ with $T > 0$ starting with $\scriptstyle { \mathbf { { \mathit { x } } } } _ { 0 }$ , such that for any $t \in [ 0 , T ]$ , the distribution of $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ conditioned on $\scriptstyle { \mathbf { { \mathit { x } } } } _ { 0 }$ satisfies
29
+
30
+ $$
31
+ \begin{array} { r } { q _ { 0 t } ( \pmb { x } _ { t } | \pmb { x } _ { 0 } ) = \mathcal { N } ( \pmb { x } _ { t } | \alpha ( t ) \pmb { x } _ { 0 } , \sigma ^ { 2 } ( t ) \pmb { I } ) , } \end{array}
32
+ $$
33
+
34
+ where $\alpha ( t ) , \sigma ( t ) \in \mathbb { R } ^ { + }$ are differentiable functions of $t$ with bounded derivatives, and we denote them as $\alpha _ { t } , \sigma _ { t }$ for simplicity. The choice for $\alpha _ { t }$ and $\sigma _ { t }$ is referred to as the noise schedule of a DPM. Let $q _ { t } ( \pmb { x } _ { t } )$ denote the marginal distribution of $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ , DPMs choose noise schedules to ensure that $q _ { T } ( \pmb { x } _ { T } ) \overset { \cdot } { \approx } \dot { \mathcal { N } } ( \pmb { x } _ { T } | \mathbf { 0 } , \tilde { \sigma } ^ { 2 } \pmb { I } )$ for some $\tilde { \sigma } > 0$ , and the signal-to-noise-ratio (SNR) $\alpha _ { t } ^ { 2 } / \sigma _ { t } ^ { 2 }$ is strictly decreasing w.r.t. $t$ [10]. Moreover, Kingma et al. [10] prove that the following stochastic differential equation (SDE) has the same transition distribution $q _ { 0 t } ( \pmb { x } _ { t } | \pmb { x } _ { 0 } )$ as in Eq. (2.1) for any $t \in [ 0 , T ]$ :
35
+
36
+ $$
37
+ \mathrm { d } \pmb { x } _ { t } = f ( t ) \pmb { x } _ { t } \mathrm { d } t + g ( t ) \mathrm { d } \pmb { w } _ { t } , \quad \pmb { x } _ { 0 } \sim q _ { 0 } ( \pmb { x } _ { 0 } ) ,
38
+ $$
39
+
40
+ where ${ \pmb w } _ { t } \in \mathbb { R } ^ { D }$ is the standard Wiener process, and
41
+
42
+ $$
43
+ f ( t ) = \frac { \mathrm { d } \log \alpha _ { t } } { \mathrm { d } t } , \quad g ^ { 2 } ( t ) = \frac { \mathrm { d } \sigma _ { t } ^ { 2 } } { \mathrm { d } t } - 2 \frac { \mathrm { d } \log \alpha _ { t } } { \mathrm { d } t } \sigma _ { t } ^ { 2 } .
44
+ $$
45
+
46
+ Under some regularity conditions, Song et al. [3] show that the forward process in Eq. (2.2) has an equivalent reverse process from time $T$ to $0$ , starting with the marginal distribution $q _ { T } ( { \pmb x } _ { T } )$ :
47
+
48
+ $$
49
+ \mathrm { d } \pmb { x } _ { t } = [ f ( t ) \pmb { x } _ { t } - g ^ { 2 } ( t ) \nabla _ { \pmb { x } } \log q _ { t } ( \pmb { x } _ { t } ) ] \mathrm { d } t + g ( t ) \mathrm { d } \bar { \pmb { w } } _ { t } , \quad \pmb { x } _ { T } \sim q _ { T } ( \pmb { x } _ { T } ) ,
50
+ $$
51
+
52
+ where $\bar { \mathbf { \nabla } } \bar { \mathbf { \nabla } } \bar { \mathbf { \nabla } } \bar { \mathbf { \nabla } } \bar { \mathbf { \nabla } } \bar { \mathbf { \nabla } } \bar { \mathbf { w } } _ { t }$ is a standard Wiener process in the reverse time. The only unknown term in Eq. (2.4) is the score function $\nabla _ { \pmb { x } } \log q _ { t } ( \pmb { x } _ { t } )$ at each time $t$ . In practice, DPMs use a neural network $\epsilon _ { \theta } ( x _ { t } , t )$ parameterized by $\theta$ to estimate the scaled score function: $- \sigma _ { t } \nabla _ { \pmb { x } } \log q _ { t } ( \pmb { x } _ { t } )$ . The parameter $\theta$ is optimized by minimizing the following objective [2, 3]:
53
+
54
+ $$
55
+ \begin{array} { l } { \displaystyle \mathcal { L } ( \theta ; \omega ( t ) ) : = \frac { 1 } { 2 } \int _ { 0 } ^ { T } \omega ( t ) \mathbb { E } _ { q _ { t } ( \mathbf { \Delta x } _ { t } ) } \Big [ \| \epsilon _ { \theta } ( \mathbf { x } _ { t } , t ) + \sigma _ { t } \nabla _ { \mathbf { x } } \log q _ { t } ( \mathbf { \Delta x } _ { t } ) \| _ { 2 } ^ { 2 } \Big ] \mathrm { d } t } \\ { \displaystyle \qquad = \frac { 1 } { 2 } \int _ { 0 } ^ { T } \omega ( t ) \mathbb { E } _ { q _ { 0 } ( \mathbf { x } _ { 0 } ) } \mathbb { E } _ { q ( \epsilon ) } \Big [ \| \epsilon _ { \theta } ( \mathbf { x } _ { t } , t ) - \epsilon \| _ { 2 } ^ { 2 } \Big ] \mathrm { d } t + C , } \end{array}
56
+ $$
57
+
58
+ where $\omega ( t )$ is a weighting function, $\epsilon \sim q ( \epsilon ) = \mathcal { N } ( \epsilon | \mathbf { 0 } , I )$ , ${ \pmb x } _ { t } = \alpha _ { t } { \pmb x } _ { 0 } + \sigma _ { t } { \pmb \epsilon }$ , and $C$ is a constant independent of $\theta$ . As $\epsilon _ { \theta } ( x _ { t } , t )$ can also be regarded as predicting the Gaussian noise added to $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ , it is usually called the noise prediction model. Since the ground truth of $\epsilon _ { \theta } ( x _ { t } , t )$ is $- \sigma _ { t } \nabla _ { \pmb { x } } \log q _ { t } ( \pmb { x } _ { t } )$ , DPMs replace the score function in Eq. (2.4) by $- \mathbf { \epsilon } \mathbf { \epsilon } \bar { \mathbf { \alpha } } ( \mathbf { x } _ { t } , t ) / \sigma _ { t }$ and define a parameterized reverse process (diffusion $S D E$ ) from time $T$ to $0$ , starting with $\pmb { x } _ { T } \overset { \cdot } { \sim } \mathcal { N } ( \mathbf { 0 } , \tilde { \sigma } ^ { 2 } \pmb { I } )$ :
59
+
60
+ $$
61
+ \mathrm { d } x _ { t } = \left[ f ( t ) x _ { t } + \frac { g ^ { 2 } ( t ) } { \sigma _ { t } } \epsilon _ { \theta } ( x _ { t } , t ) \right] \mathrm { d } t + g ( t ) \mathrm { d } \bar { w } _ { t } , \quad x _ { T } \sim \mathcal { N } ( \mathbf { 0 } , \tilde { \sigma } ^ { 2 } I ) .
62
+ $$
63
+
64
+ Samples can be generated from DPMs by solving the diffusion SDE in Eq. (2.5) with numerical solvers, which discretize the SDE from $T$ to 0. Song et al. [3] proved that the traditional ancestral sampling method for DPMs [2] can be viewed as a first-order SDE solver for Eq. (2.5). However, these first-order methods usually need hundreds of or thousands of function evaluations to converge [3], leading to extremely slow sampling speed.
65
+
66
+ # 2.2 Diffusion (Probability Flow) ODEs
67
+
68
+ When discretizing SDEs, the step size is limited by the randomness of the Wiener process [27, Chap. 11]. A large step size (small number of steps) often causes non-convergence, especially in high dimensional spaces. For faster sampling, one can consider the associated probability flow ODE [3], which has the same marginal distribution at each time $t$ as that of the SDE. Specifically, for DPMs, Song et al. [3] proved that the probability flow ODE of Eq. (2.4) is
69
+
70
+ $$
71
+ \frac { \mathrm { d } \pmb { x } _ { t } } { \mathrm { d } t } = f ( t ) \pmb { x } _ { t } - \frac { 1 } { 2 } g ^ { 2 } ( t ) \nabla _ { \pmb { x } } \log q _ { t } ( \pmb { x } _ { t } ) , \quad \pmb { x } _ { T } \sim q _ { T } ( \pmb { x } _ { T } ) ,
72
+ $$
73
+
74
+ where the marginal distribution of $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ is also $q _ { t } ( \pmb { x } _ { t } )$ . By replacing the score function with the noise prediction model, Song et al. [3] defined the following parameterized ODE (diffusion $O D E$ ):
75
+
76
+ $$
77
+ \frac { \mathrm { d } \pmb { x } _ { t } } { \mathrm { d } t } = \pmb { h } _ { \theta } ( \pmb { x } _ { t } , t ) : = f ( t ) \pmb { x } _ { t } + \frac { g ^ { 2 } ( t ) } { 2 \sigma _ { t } } \epsilon _ { \theta } ( \pmb { x } _ { t } , t ) , \quad \pmb { x } _ { T } \sim \mathcal { N } ( \mathbf { 0 } , \tilde { \sigma } ^ { 2 } \mathbf { I } ) .
78
+ $$
79
+
80
+ Samples can be drawn by solving the ODE from $T$ to 0. Comparing with SDEs, ODEs can be solved with larger step sizes as they have no randomness. Furthermore, we can take advantage of efficient numerical ODE solvers to accelerate the sampling. Song et al. [3] used the RK45 ODE solver [28] for the diffusion ODEs, which generates samples in $\sim 6 0$ function evaluations to reach comparable quality with a 1000-step SDE solver for Eq. (2.5) on the CIFAR-10 dataset [29]. However, existing general-purpose ODE solvers still cannot generate satisfactory samples in the few-step $\sim 1 0$ steps) sampling regime. To the best of our knowledge, there is still a lack of training-free samplers for DPMs in the few-step sampling regime, and the sampling speed of DPMs is still a critical issue.
81
+
82
+ # 3 Customized Fast Solvers for Diffusion ODEs
83
+
84
+ As highlighted in Sec. 2.2, discretizing SDEs is generally difficult in high dimensions [27, Chap. 11] and it is hard to converge within few steps. In contrast, ODEs are easier to solve, yielding a potential for fast samplers. However, as mentioned in Sec. 2.2, the general black-box ODE solver used in previous work [3] empirically fails to converge in few steps. This motivates us to design a dedicated solver for diffusion ODEs to enable fast and high-quality few-step sampling. We start with a detailed investigation of the specific structure of diffusion ODEs.
85
+
86
+ # 3.1 Simplified Formulation of Exact Solutions of Diffusion ODEs
87
+
88
+ The key insight of this work is that given an initial value $\mathbf { \delta } _ { \mathbf { \mathcal { X } } _ { s } }$ at time $s > 0$ , the solution $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ at each time $t < s$ of diffusion ODEs in Eq. (2.7) can be simplified into a very special exact formulation which can be efficiently approximated.
89
+
90
+ Our first key observation is that a part of the solution $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ can be exactly computed by considering the particular structure of diffusion ODEs. The r.h.s. of diffusion ODEs in Eq. (2.7) consists of two parts: the part $f ( t ) x _ { t }$ is a linear function of $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ , and the other part $\frac { g ^ { 2 } ( t ) } { 2 \sigma _ { t } } \epsilon _ { \theta } ( \pmb { x } _ { t } , t )$ is generally a nonlinear function of $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ because of the neural network $\epsilon _ { \theta } ( x _ { t } , t )$ . This type of ODE is referred to as semi-linear ODE. The black-box ODE solvers adopted by previous work [3] are ignorant of this semi-linear structure as they take the whole $h _ { \theta } ( x _ { t } , \bar t ) $ in Eq. (2.7) as the input, which causes discretization errors of both the linear and nonlinear term. We note that for semi-linear ODEs, the solution at time $t$ can be exactly formulated by the “variation of constants” formula [30]:
91
+
92
+ $$
93
+ \pmb { x } _ { t } = e ^ { \int _ { s } ^ { t } f ( \tau ) \mathrm { d } \tau } \pmb { x } _ { s } + \int _ { s } ^ { t } \left( e ^ { \int _ { \tau } ^ { t } f ( r ) \mathrm { d } r } \frac { g ^ { 2 } \big ( \tau \big ) } { 2 \sigma _ { \tau } } \epsilon _ { \theta } ( \pmb { x } _ { \tau } , \tau ) \right) \mathrm { d } \tau .
94
+ $$
95
+
96
+ This formulation decouples the linear part and the nonlinear part. In contrast to black-box ODE solvers, the linear part is now exactly computed, which eliminates the approximation error of the linear term. However, the integral of the nonlinear part is still complicated because it couples the coefficients about the noise schedule (i.e., $f ( \tau ) , g ( \tau ) \bar { , } \sigma _ { \tau } )$ and the complex neural network $\epsilon _ { \theta }$ , which is still hard to approximate.
97
+
98
+ Our second key observation is that the integral of the nonlinear part can be greatly simplified by introducing a special variable. Let $\lambda _ { t } : = \log \bar { ( \alpha _ { t } / \sigma _ { t } ) }$ (one half of the log-SNR), then $\lambda _ { t }$ is a strictly decreasing function of $t$ (due to the definition of DPMs as discussed in Sec. 2.1). We can rewrite $g ( t )$ in Eq. (2.3) as
99
+
100
+ $$
101
+ g ^ { 2 } ( t ) = \frac { \mathrm { d } \sigma _ { t } ^ { 2 } } { \mathrm { d } t } - 2 \frac { \mathrm { d } \log { \alpha _ { t } } } { \mathrm { d } t } \sigma _ { t } ^ { 2 } = 2 \sigma _ { t } ^ { 2 } \left( \frac { \mathrm { d } \log { \sigma _ { t } } } { \mathrm { d } t } - \frac { \mathrm { d } \log { \alpha _ { t } } } { \mathrm { d } t } \right) = - 2 \sigma _ { t } ^ { 2 } \frac { \mathrm { d } \lambda _ { t } } { \mathrm { d } t } .
102
+ $$
103
+
104
+ Combining with $f ( t ) = \mathrm { d } \log \alpha _ { t } / \mathrm { d } t$ in Eq. (2.3), we can rewrite Eq. (3.1) as
105
+
106
+ $$
107
+ \pmb { x } _ { t } = \frac { \alpha _ { t } } { \alpha _ { s } } \pmb { x } _ { s } - \alpha _ { t } \int _ { s } ^ { t } \left( \frac { \mathrm { d } \lambda _ { \tau } } { \mathrm { d } \tau } \right) \frac { \sigma _ { \tau } } { \alpha _ { \tau } } \pmb { \epsilon } _ { \theta } ( \pmb { x } _ { \tau } , \tau ) \mathrm { d } \tau .
108
+ $$
109
+
110
+ As $\lambda ( t ) = \lambda _ { t }$ is a strictly decreasing function of $t$ , it has an inverse function $t _ { \lambda } ( \cdot )$ satisfying $t = t _ { \lambda } ( \lambda ( t ) )$ . We further change the subscripts of $_ { \textbf { \em x } }$ and $\epsilon _ { \theta }$ from $t$ to $\lambda$ and denote $\hat { \pmb x } _ { \lambda } : = \pmb x _ { t _ { \lambda } ( \lambda ) }$ $\hat { \epsilon } _ { \boldsymbol { \theta } } ( \hat { x } _ { \lambda } , \lambda ) : = \epsilon _ { \boldsymbol { \theta } } ( x _ { t _ { \lambda } ( \lambda ) } , t _ { \lambda } ( \lambda ) )$ . Rewrite Eq. (3.3) by “change-of-variable” for $\lambda$ , then we have:
111
+
112
+ Proposition 3.1 (Exact solution of diffusion ODEs). Given an initial value $\mathbf { \delta } _ { \mathbf { \mathcal { X } } _ { s } }$ at time $s > 0$ , the solution $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ at time $t \in [ 0 , s ]$ of diffusion ODEs in Eq. (2.7) is:
113
+
114
+ $$
115
+ \pmb { x } _ { t } = \frac { \alpha _ { t } } { \alpha _ { s } } \pmb { x } _ { s } - \alpha _ { t } \int _ { \lambda _ { s } } ^ { \lambda _ { t } } e ^ { - \lambda } \hat { \pmb { \epsilon } } _ { \theta } ( \hat { \pmb { x } } _ { \lambda } , \lambda ) \mathrm { d } \lambda .
116
+ $$
117
+
118
+ We call the integral $\begin{array} { r } { \int e ^ { - \lambda } \hat { \epsilon } _ { \theta } ( \hat { \pmb x } _ { \lambda } , \lambda ) \mathrm { d } \lambda } \end{array}$ the exponentially weighted integral of $\scriptstyle { \hat { \epsilon } } _ { \theta }$ , which is very special and highly related to the exponential integrators in the literature of ODE solvers [25]. To the best of our knowledge, such formulation has not been revealed in prior work of diffusion models.
119
+
120
+ Eq. (3.4) provides a new perspective for approximating the solutions of diffusion ODEs. Specifically, given $\mathbf { \delta } _ { \mathbf { \mathcal { X } } _ { s } }$ at time $s$ , According to Eq. (3.4), approximating the solution at time $t$ is equivalent to directly approximating the exponentially weighted integral of $\hat { \epsilon } _ { \theta }$ from $\lambda _ { s }$ to $\lambda _ { t }$ , which avoids the error of the linear terms and is well-studied in the literature of exponential integrators [25, 31]. Based on this insight, we propose fast solvers for diffusion ODEs, as detailed in the following sections.
121
+
122
+ # 3.2 High-Order Solvers for Diffusion ODEs
123
+
124
+ In this section, we propose high-order solvers for diffusion ODEs with convergence order guarantee by leveraging our proposed solution formulation Eq. (3.4). The proposed solvers and analysis are highly motivated by the methods of exponential integrators [25, 31] in the ODE literature.
125
+
126
+ Specifically, given an initial value $\mathbf { \nabla } _ { \mathbf { x } _ { T } }$ at time $T$ and $M + 1$ time steps $\{ t _ { i } \} _ { i = 0 } ^ { M }$ decreasing from $t _ { 0 } = T$ to $t _ { M } = 0$ . Let $\tilde { \mathbf { x } } _ { t _ { 0 } } = \mathbf { x } _ { T }$ be the initial value. The proposed solvers use $M$ steps to iteratively compute a sequence $\{ \tilde { { \pmb { x } } } _ { t _ { i } } \} _ { i = 0 } ^ { M }$ to approximate the true solutions at time steps $\{ t _ { i } \} _ { i = 0 } ^ { M }$ . In particular, the last iterate $\tilde { \boldsymbol { x } } _ { t _ { M } }$ approximates the true solution at time 0.
127
+
128
+ In order to reduce the approximation error between $\tilde { \pmb { x } } _ { t _ { M } }$ and the true solution at time 0, we need to reduce the approximation error for each $\tilde { \mathbf { x } } _ { t _ { i } }$ at every step [30]. Starting with the previous value $\tilde { \pmb { x } } _ { t _ { i - 1 } }$ at time $t _ { i - 1 }$ , according to Eq. (3.4), the exact solution $\pmb { x } _ { t _ { i - 1 } t _ { i } }$ at time $t _ { i }$ is given by
129
+
130
+ $$
131
+ \pmb { x } _ { t _ { i - 1 } t _ { i } } = \frac { \alpha _ { t _ { i } } } { \alpha _ { t _ { i - 1 } } } \tilde { \pmb { x } } _ { t _ { i - 1 } } - \alpha _ { t _ { i } } \int _ { \lambda _ { t _ { i - 1 } } } ^ { \lambda _ { t _ { i } } } e ^ { - \lambda } \hat { \pmb { \epsilon } } _ { \theta } ( \hat { \pmb { x } } _ { \lambda } , \lambda ) \mathrm { d } \lambda .
132
+ $$
133
+
134
+ Therefore, to compute the value $\tilde { \boldsymbol { x } } _ { t _ { i } }$ for approximating $\pmb { x } _ { t _ { i - 1 } t _ { i } }$ , we need to approximate the exponentially weighted integral of $\hat { \epsilon } _ { \theta }$ from $\lambda _ { t _ { i - 1 } }$ to $\lambda _ { t _ { i } }$ . Denote $h _ { i } : = \lambda _ { t _ { i } } - \lambda _ { t _ { i - 1 } }$ , and $\hat { \epsilon } _ { \theta } ^ { ( n ) } ( \hat { { \mathbf x } } _ { \lambda } , \lambda ) \mathrel { \mathop : } =$ dnϵˆθ(xˆλ,λ)dλn as the n-th order total derivative of ϵˆθ(xˆλ, λ) w.r.t. λ. For k ≥ 1, the (k − 1)-th order Taylor expansion of $\hat { \epsilon } _ { \theta } ( \hat { \pmb x } _ { \lambda } , \lambda )$ w.r.t. $\lambda$ at $\lambda _ { t _ { i - 1 } }$ is
135
+
136
+ $$
137
+ \hat { \epsilon } _ { \theta } ( \hat { x } _ { \lambda } , \lambda ) = \sum _ { n = 0 } ^ { k - 1 } \frac { ( \lambda - \lambda _ { t _ { i - 1 } } ) ^ { n } } { n ! } \hat { \epsilon } _ { \theta } ^ { ( n ) } ( \hat { x } _ { \lambda _ { t _ { i - 1 } } } , \lambda _ { t _ { i - 1 } } ) + \mathcal { O } ( ( \lambda - \lambda _ { t _ { i - 1 } } ) ^ { k } ) ,
138
+ $$
139
+
140
+ Substituting the above Taylor expansion into Eq. (3.5) yields
141
+
142
+ $$
143
+ \pmb { x } _ { t _ { i - 1 } t _ { i } } = \frac { \alpha _ { t _ { i } } } { \alpha _ { t _ { i - 1 } } } \tilde { \pmb { x } } _ { t _ { i - 1 } } - \alpha _ { t _ { i } } \sum _ { n = 0 } ^ { k - 1 } \hat { \pmb { \epsilon } } _ { \theta } ^ { ( n ) } ( \hat { \pmb { x } } _ { { \pmb { \lambda } } _ { t _ { i - 1 } } } , \lambda _ { t _ { i - 1 } } ) \int _ { \lambda _ { t _ { i - 1 } } } ^ { \lambda _ { t _ { i } } } e ^ { - \lambda } \frac { ( \lambda - \lambda _ { t _ { i - 1 } } ) ^ { n } } { n ! } \mathrm { d } \lambda + \mathcal { O } ( h _ { i } ^ { k + 1 } ) ,
144
+ $$
145
+
146
+ where the integral $\begin{array} { r } { \int e ^ { - \lambda } \frac { ( \lambda - \lambda _ { t _ { i - 1 } } ) ^ { n } } { n ! } \mathrm { d } \lambda } \end{array}$ can be analytically computed by repeatedly applying $n$ times of integration-by-parts (see Appendix B.2). Therefore, to approximate $\pmb { x } _ { t _ { i - 1 } t _ { i } }$ , we only need to approximate the $n$ -th order total derivatives $\hat { \epsilon } _ { \theta } ^ { ( n ) } ( \hat { \pmb { x } } _ { \lambda } , \lambda )$ for $n \leq k - 1$ , which is a well-studied problem in the ODE literature [31, 32]. By dropping the $\mathcal { O } ( h _ { i } ^ { k + 1 } )$ error term and approximating the first $( k - 1 )$ -th total derivatives with the “stiff order conditions” [31, 32], we can derive $k$ -th-order ODE solvers for diffusion ODEs. We name such solvers as DPM-Solver overall, and DPM-Solver- $k$ for a specific order $k$ . Here we take $k = 1$ for demonstration. In this case, Eq. (3.6) becomes
147
+
148
+ $$
149
+ \begin{array} { l } { \displaystyle { \boldsymbol { x } } _ { t _ { i - 1 } \to t _ { i } } = \frac { \alpha _ { t _ { i } } } { \alpha _ { t _ { i - 1 } } } \tilde { \boldsymbol { x } } _ { t _ { i - 1 } } - \alpha _ { t _ { i } } \epsilon _ { \theta } ( \tilde { \boldsymbol { x } } _ { t _ { i - 1 } } , t _ { i - 1 } ) \int _ { \lambda _ { t _ { i - 1 } } } ^ { \lambda _ { t _ { i } } } e ^ { - \lambda } \mathrm { d } \lambda + \mathcal { O } ( h _ { i } ^ { 2 } ) } \\ { \displaystyle = \frac { \alpha _ { t _ { i } } } { \alpha _ { t _ { i - 1 } } } \tilde { \boldsymbol { x } } _ { t _ { i - 1 } } - \sigma _ { t _ { i } } ( e ^ { h _ { i } } - 1 ) \epsilon _ { \theta } ( \tilde { \boldsymbol { x } } _ { t _ { i - 1 } } , t _ { i - 1 } ) + \mathcal { O } ( h _ { i } ^ { 2 } ) . } \end{array}
150
+ $$
151
+
152
+ By dropping the high-order error term $\mathcal { O } ( h _ { i } ^ { 2 } )$ , we can obtain an approximation for $\pmb { x } _ { t _ { i - 1 } t _ { i } }$ . As $k = 1$ here, we call this solver DPM-Solver- $^ { l }$ , and the detailed algorithm is as following.
153
+
154
+ DPM-Solver-1. Given an initial value $\mathbf { \nabla } _ { \mathbf { x } _ { T } }$ and $M + 1$ time steps $\{ t _ { i } \} _ { i = 0 } ^ { M }$ decreasing from $t _ { 0 } = T$ to $t _ { M } = 0$ . Starting with $\tilde { \mathbf { x } } _ { t _ { 0 } } = \mathbf { x } _ { T }$ , the sequence $\{ \tilde { { x } } _ { t _ { i } } \} _ { i = 1 } ^ { M }$ is computed iteratively as follows:
155
+
156
+ $$
157
+ \tilde { \boldsymbol { x } } _ { t _ { i } } = \frac { \alpha _ { t _ { i } } } { \alpha _ { t _ { i - 1 } } } \tilde { \boldsymbol { x } } _ { t _ { i - 1 } } - \sigma _ { t _ { i } } ( e ^ { h _ { i } } - 1 ) \boldsymbol { \epsilon } _ { \boldsymbol { \theta } } ( \tilde { \boldsymbol { x } } _ { t _ { i - 1 } } , t _ { i - 1 } ) , \quad \mathrm { w h e r e ~ } h _ { i } = \lambda _ { t _ { i } } - \lambda _ { t _ { i - 1 } } .
158
+ $$
159
+
160
+ For $k \geq 2$ , approximating the first $k$ terms of the Taylor expansion needs additional intermediate points between $t$ and $s$ [31]. The derivation is more technical so we defer it to Appendix B. Below we propose algorithms for $k = 2 , 3$ and name them as DPM-Solver-2 and DPM-Solver-3, respectively.
161
+
162
+ # Algorithm 1 DPM-Solver-2.
163
+
164
+ Require: initial value $\mathbf { \nabla } _ { \mathbf { \mathcal { X } } T }$ , time steps $\{ t _ { i } \} _ { i = 0 } ^ { M }$ , model $\epsilon _ { \theta }$
165
+
166
+ # Algorithm 2 DPM-Solver-3.
167
+
168
+ Require: initial value $\mathbf { \nabla } _ { \mathbf { \mathcal { X } } T }$ , time steps $\{ t _ { i } \} _ { i = 0 } ^ { M }$ , model $\epsilon _ { \theta }$
169
+
170
+ $$
171
+ \begin{array} { r l } & { \quad _ { s 2 i - 1 } _ { t _ { \lambda } } ( \overline { { \lambda } } _ { t _ { i - 1 } } + r _ { 1 } h _ { i } ) , \quad s _ { 2 i } t _ { \lambda } ( \lambda _ { t _ { i - 1 } } + r _ { 2 } h _ { i } ) } \\ & { u _ { 2 i - 1 } \frac { \alpha _ { s _ { 2 i - 1 } } } { \alpha _ { t _ { i - 1 } } } \tilde { x } _ { t _ { i - 1 } } - \sigma _ { s _ { 2 i - 1 } } ( e ^ { r _ { 1 } h _ { i } } - 1 ) \epsilon _ { \theta } ( \tilde { x } _ { t _ { i - 1 } } , t _ { i - 1 } ) } \\ & { D _ { 2 i - 1 } \epsilon _ { \theta } ( u _ { 2 i - 1 } , s _ { 2 i - 1 } ) - \epsilon _ { \theta } ( \tilde { x } _ { t _ { i - 1 } } , t _ { i - 1 } ) } \\ & { u _ { 2 i } \frac { \alpha _ { s _ { 2 i } } } { \alpha _ { t _ { i - 1 } } } \tilde { x } _ { t _ { i - 1 } } - \sigma _ { s _ { 2 i } } ( e ^ { r _ { 2 } h _ { i } } - 1 ) \epsilon _ { \theta } ( \tilde { x } _ { t _ { i - 1 } } , t _ { i - 1 } ) - \frac { \sigma _ { s _ { 2 i } } r _ { 2 } } { r _ { 1 } } ( \frac { e ^ { r _ { 2 } h _ { i } } - 1 } { r _ { 2 } h _ { i } } - 1 ) D _ { 2 i - 1 } } \\ & { D _ { 2 i } \epsilon _ { \theta } ( u _ { 2 i } , s _ { 2 i } ) - \epsilon _ { \theta } ( \tilde { x } _ { t _ { i - 1 } } , t _ { i - 1 } ) } \\ & { \tilde { x } _ { t _ { i } } \frac { \alpha _ { t _ { i } } } { \alpha _ { t _ { i - 1 } } } \tilde { x } _ { t _ { i - 1 } } - \sigma _ { t _ { i } } ( e ^ { h _ { i } } - 1 ) \epsilon _ { \theta } ( \tilde { x } _ { t _ { i - 1 } } , t _ { i - 1 } ) - \frac { \sigma _ { t _ { i } } } { r _ { 2 } } ( \frac { e ^ { h _ { i } } - 1 } { h } - 1 ) D _ { 2 i } } \end{array}
172
+ $$
173
+
174
+ 10: return $\tilde { \pmb { x } } _ { t _ { M } }$
175
+
176
+ Here, $t _ { \lambda } ( \cdot )$ is the inverse function of $\lambda ( t )$ , which has an analytical formulation for the practical noise schedule used in [2, 16], as shown in Appendix D. The chosen intermediate points are $( s _ { i } , \pmb { u } _ { i } )$ for DPM-Solver-2 and $\left( s _ { 2 i - 1 } , { \pmb u } _ { 2 i - 1 } \right)$ and $( s _ { 2 i } , { \pmb u } _ { 2 i } )$ for DPM-Solver-3. As shown in the algorithm, DPM-Solver- $k$ requires $k$ function evaluations per step for $k = 1 , 2 , 3$ . Despite the more expensive steps, higher-order solvers $( k = 2 , 3$ ) are usually more efficient since they require much fewer steps to converge, due to their higher convergence order. We show that DPM-Solver- $k$ is $k$ -th-order solver, as stated in the following theorem. The proof is in Appendix B.
177
+
178
+ Theorem 3.2 (DPM-Solver- $k$ as a $k$ -th-order solver). Assume $\epsilon _ { \theta } ( x _ { t } , t )$ follows the regularity conditions detailed in Appendix B.1, then for $k = 1 , 2 , 3$ , DPM-Solver- $k$ is a $k$ -th order solver for diffusion ODEs, i.e., for the sequence $\{ \tilde { \pmb { x } } _ { t _ { i } } \} _ { i = 1 } ^ { M }$ computed by DPM-Solver- $k$ , the approximation error at time 0 satisfies $\tilde { \pmb { x } } _ { t _ { M } } - \pmb { x } _ { 0 } = \mathcal { O } ( h _ { \operatorname* { m a x } } ^ { k } )$ , where $h _ { m a x } = \mathrm { m a x } _ { 1 \leq i \leq M } ( \lambda _ { t _ { i } } - \lambda _ { t _ { i - 1 } } )$ .
179
+
180
+ Finally, solvers with $k \geq 4$ need much more intermediate points as shown by previous work [31, 32] for exponential integrators. Therefore, we only consider $k$ from 1 to 3 in this work, while leaving the solvers with higher $k$ for future study.
181
+
182
+ # 3.3 Step Size Schedule
183
+
184
+ The proposed solvers in Sec. 3.2 need to specify the time steps $\{ t _ { i } \} _ { i = 0 } ^ { M }$ in advance. We propose two choices of the time step schedule. One choice is handcrafted, which is to uniformly split the interval $[ \lambda _ { T } , \lambda _ { 0 } ]$ , i.e. $\begin{array} { r } { \lambda _ { t _ { i } } = \dot { \lambda _ { T } } + \frac { i } { M } ( \lambda _ { 0 } - \lambda _ { T } ) } \end{array}$ , $i = 0 , \ldots , M$ . Note that this is different from previous work [2, 3] which chooses uniform steps for $t _ { i }$ . Empirically, DPM-Solver with uniform time steps $\lambda _ { t _ { i } }$ can already generate quite good samples in few steps, where results are listed in Appendix E. As the other choice, we propose an adaptive step size algorithm, which dynamically adjusts the step size by combining different orders of DPM-Solver. The adaptive algorithm is inspired by [20] and we defer its implementation details to Appendix C.
185
+
186
+ For few-step sampling, we need to use up all the number of function evaluations (NFE). When the NFE is not divisible by 3, we firstly apply DPM-Solver-3 as much as possible, and then add a single step of DPM-Solver-1 or DPM-Solver-2 (dependent on the reminder of $K$ divided by 3), as detailed in Appendix D. In the subsequent experiments, we use such combination of solvers with the uniform step size schedule for $\mathrm { N F E } \leq 2 0$ , and otherwise the adaptive step size schedule.
187
+
188
+ # 3.4 Sampling from Discrete-Time DPMs
189
+
190
+ Discrete-time DPMs [2] train the noise prediction model at $N$ fixed time steps $\{ t _ { n } \} _ { n = 1 } ^ { N }$ , and the noise prediction model is parameterized by $\tilde { \epsilon } _ { \theta } ( { \boldsymbol x } _ { n } , n )$ for $n = 0 , \ldots , N - 1$ , where each ${ \pmb x } _ { n }$ is corresponding to the value at time $t _ { n + 1 }$ . We can transform the discrete-time noise prediction model to the continuous version by letting $\begin{array} { r } { \epsilon _ { \theta } ( x , t ) : = \tilde { \epsilon } _ { \theta } ( x , \frac { ( N - 1 ) t } { T } ) } \end{array}$ , for all $\pmb { x } \in \mathbb { R } ^ { d } , t \in [ 0 , T ]$ . Note that the input time of $\tilde { \epsilon } _ { \theta }$ may not be integers, but we find that the noise prediction model can still work well, and we hypothesize that it is because of the smooth time embeddings (e.g., position embeddings [2]). By such reparameterization, the noise prediction model can adopt the continuous-time steps as input, and thus we can also use DPM-Solver for fast sampling.
191
+
192
+ # 4 Comparison with Existing Fast Sampling Methods
193
+
194
+ Here, we discuss the relationship and highlight the difference between DPM-Solver and existing ODE-based fast sampling methods for DPMs. We further briefly discuss the advantage of training-free samplers over those training-based ones.
195
+
196
+ # 4.1 DDIM as DPM-Solver-1
197
+
198
+ Denoising Diffusion Implicit Models (DDIM) [19] design a deterministic method for fast sampling from DPMs. For two adjacent time steps $t _ { i - 1 }$ and $t _ { i }$ , assume that we have a solution $\tilde { \boldsymbol { x } } _ { t _ { i - 1 } }$ at time $t _ { i - 1 }$ , then a single step of DDIM from time $t _ { i - 1 }$ to time $t _ { i }$ is
199
+
200
+ $$
201
+ \tilde { \pmb { x } } _ { t _ { i } } = \frac { \alpha _ { t _ { i } } } { \alpha _ { t _ { i - 1 } } } \tilde { \pmb { x } } _ { t _ { i - 1 } } - \alpha _ { t _ { i } } \left( \frac { \sigma _ { t _ { i - 1 } } } { \alpha _ { t _ { i - 1 } } } - \frac { \sigma _ { t _ { i } } } { \alpha _ { t _ { i } } } \right) \epsilon _ { \theta } ( \tilde { \pmb { x } } _ { t _ { i - 1 } } , t _ { i - 1 } ) .
202
+ $$
203
+
204
+ Although motivated by entirely different perspectives, we show that the updates of DPM-Solver-1 and Denoising Diffusion Implicit Models (DDIM) [19] are identical. By the definition of $\lambda$ , we have $\frac { \sigma _ { t _ { i - 1 } } } { \alpha _ { t _ { i - 1 } } } = e ^ { - \lambda _ { t _ { i - 1 } } ^ { - } }$ and $\begin{array} { r } { \frac { \sigma _ { t _ { i } } } { \alpha _ { t _ { i } } } = e ^ { - \lambda _ { t _ { i } } } } \end{array}$ . Plugging these and $h _ { i } = \lambda _ { t _ { i } } - \lambda _ { t _ { i - 1 } }$ to Eq. (4.1) results in exactly a step of DPM-Solver-1 in Eq. (3.7). However, the semi-linear ODE formulation of DPM-Solver allows for principled generalization to higher-order solvers and convergence order analysis.
205
+
206
+ Recent work [13] also show that DDIM is a first-order discretization of diffusion ODEs by differentiating both sides of Eq. (4.1). However, they cannot explain the difference between DDIM and the first-order Euler discretization of diffusion ODEs. In contrast, by showing that DDIM is a special case of DPM-Solver, we reveal that DDIM makes full use of the semi-linearity of diffusion ODEs, which explains its superiority over traditional Euler methods.
207
+
208
+ # 4.2 Comparison with Traditional Runge-Kutta Methods
209
+
210
+ One can obtain a high-order solver by directly applying traditional explicit Runge-Kutta (RK) methods to the diffusion ODE in Eq. (2.7). Specifically, RK methods write the solution of Eq. (2.7) in the
211
+
212
+ Table 1: FID ↓ on CIFAR-10 for different orders of Runge-Kutta (RK) methods and DPM-Solvers, varying the number of function evaluations (NFE). For RK methods, we evaluate diffusion ODEs w.r.t. both $t$ (Eq. (2.7)) and $\lambda$ (Eq. (E.1)). We use uniform step size in $t$ for RK (t), and uniform step size in $\lambda$ for RK $( \lambda )$ and DPM-Solvers.
213
+
214
+ <table><tr><td>Sampling method\NFE</td><td>12</td><td>18</td><td>24</td><td>30</td><td>36</td><td>42</td><td>48</td></tr><tr><td>RK2 (t)</td><td>16.40</td><td>7.25</td><td>3.90</td><td>3.63</td><td>3.58</td><td>3.59</td><td>3.54</td></tr><tr><td>RK2(入)</td><td>107.81</td><td>42.04</td><td>17.71</td><td>7.65</td><td>4.62</td><td>3.58</td><td>3.17</td></tr><tr><td>DPM-Solver-2</td><td>5.28</td><td>3.43</td><td>3.02</td><td>2.85</td><td>2.78</td><td>2.72</td><td>2.69</td></tr><tr><td>RK3 (t)</td><td>48.75</td><td>21.86</td><td>10.90</td><td>6.96</td><td>5.22</td><td>4.56</td><td>4.12</td></tr><tr><td>RK3 (入)</td><td>34.29</td><td>4.90</td><td>3.50</td><td>3.03</td><td>2.85</td><td>2.74</td><td>2.69</td></tr><tr><td>DPM-Solver-3</td><td>6.03</td><td>2.90</td><td>2.75</td><td>2.70</td><td>2.67</td><td>2.65</td><td>2.65</td></tr></table>
215
+
216
+ following integral form:
217
+
218
+ $$
219
+ { \bf { x } } _ { t } = { \bf { x } } _ { s } + \int _ { s } ^ { t } h _ { \theta } ( { \bf { x } } _ { \tau } , \tau ) \mathrm { { d } } \tau = { \bf { x } } _ { s } + \int _ { s } ^ { t } \left( f ( \tau ) { \bf { x } } _ { \tau } + \frac { g ^ { 2 } ( \tau ) } { 2 \sigma _ { \tau } } \epsilon _ { \theta } ( { \bf { x } } _ { \tau } , \tau ) \right) \mathrm { { d } } \tau ,
220
+ $$
221
+
222
+ and use some intermediate time steps between $[ t , s ]$ and combine the evaluations of $h _ { \theta }$ at these time steps to approximate the whole integral. The approximation error of explicit RK methods depends on $h _ { \theta }$ , which consists of the error corresponding to both the linear term $f ( \tau ) x _ { \tau }$ and the nonlinear noise prediction model $\epsilon _ { \theta }$ . However, the error of the linear term may increase exponentially because the exact solution of the linear term has an exponential coefficient (as shown in Eq. (3.1)). There are many empirical evidence [25, 31] showing that directly using explicit RK methods for semi-linear ODEs may suffer from unstable numerical issues for large step size. We also demonstrate the empirical difference of the proposed DPM-Solver and the traditional explicit RK methods in Sec. 5.1, which shows that DPM-Solver have smaller discretization errors than the RK methods with the same order.
223
+
224
+ # 4.3 Training-based Fast Sampling Methods for DPMs
225
+
226
+ Samplers that need extra training or optimization include knowledge distillation [13, 14], learning the noise level or variance [15, 16, 33], and learning the noise schedule or sample trajectory [17, 18]. Although the progressive distillation method [13] can obtain a fast sampler within 4 steps, it needs further training costs and loses part of the information in the original DPM (e.g., after distillation, the noise prediction model cannot predict the noise (score function) at every time step between $[ 0 , T ] )$ . In contrast, training-free samplers can keep all the information of the original model, and thereby can be directly extended to the conditional sampling by combining the original model and an external classifier [4] (e.g. see Appendix D for the conditional sampling with classifier guidance).
227
+
228
+ Beyond directly designing fast samplers for DPMs, several works also propose novel types of DPMs which supports faster sampling. For instance, defining a low-dimensional latent variable for DPMs [34]; designing special diffusion processes with bounded score functions [35]; combining GANs with the reverse process of DPMs [36]. The proposed DPM-Solver may also be suitable for accelerating the sampling of these DPMs, and we leave them for future work.
229
+
230
+ # 5 Experiments
231
+
232
+ In this section, we show that as a training-free sampler, DPM-Solver can greatly speedup the sampling of existing pre-trained DPMs, including both continuous-time and discrete-time ones, with both linear noise schedule [2, 19] and cosine noise schedule [16]. We vary different number of function evaluations (NFE) which is the number of calls to the noise prediction model $\epsilon _ { \theta } ( x _ { t } , t )$ , and compare the sample quality between DPM-Solver and other methods. For each experiment, We draw 50K samples and use the widely adopted FID score [37] to evaluate the sample quality, where lower FID usually implies better sample quality.
233
+
234
+ Unless explicitly mentioned, we always use the solver combination with the uniform step size schedule in Sec. 3.3 if the NFE budget is less than 20, and otherwise the DPM-Solver-3 with the adaptive step size schedule in Sec. 3.3. We refer to Appendix D for other implementation details of DPM-Solver and Appendix E for detailed settings.
235
+
236
+ ![](images/4e1bcabdec913d95ec9ff692dca4450fca481c16e793a3c86ffe1cf469e22305.jpg)
237
+ Figure 2: Sample quality measured by FID $\downarrow$ of different sampling methods for DPMs on CIFAR-10 with both continuous-time and discrete-time models, CelebA 64x64, ImageNet 64x64, ImageNet $1 2 8 \mathrm { x } 1 2 8$ and LSUN bedroom $2 5 6 \times 2 5 6$ with discrete-time models, varying the number of function evaluations (NFE). The method $^ { \dag } { \bf G } { \bf G } { \bf D } { \bf M }$ [18] needs extra training to optimize the sample trajectory, while other methods are training-free. To get the strongest baseline, we use the quadratic step size for DDIM on CelebA, which has a better FID than that of the uniform step size in the original paper [19].
238
+
239
+ # 5.1 Comparison with Continuous-Time Sampling Methods
240
+
241
+ We firstly compare DPM-Solver with other continuous-time sampling methods for DPMs. The compared methods include the Euler-Maruyama discretization for diffusion SDEs [3], the adaptive step size solver for diffusion SDEs [20] and the RK methods for diffusion ODEs [3, 28] in Eq. (2.7). We compare these methods for sampling from a pre-trained continuous-time “VP deep” model [3] on the CIFAR-10 dataset [29] with the linear noise schedule.
242
+
243
+ Fig. 2a shows the efficiency of compared solvers. We use uniform time steps with 50, 200, 1000 NFE for the diffusion SDE with Euler discretization, and vary the tolerance hyperparameter [3, 20] for the adaptive step size SDE solver [20] and RK45 ODE solver [28] to control the NFE. DPM-Solver can generate good sample quality within around 10 NFE, while other solvers have large discretization error even in 50 NFE, which shows that DPM-Solver can achieve ${ \sim } 5 $ speedup of the previous best solver. In particular, we achieve 4.70 FID with 10 NFE, 3.75 FID with 12 NFE, 3.24 FID with 15 NFE, and 2.87 FID with 20 NFE, which is the fastest sampler on CIFAR-10.
244
+
245
+ As an ablation study, we also compare the second-order and third-order DPM-Solver and RK methods, as shown in Table 1. We compare RK methods for diffusion ODEs w.r.t. both time $t$ in Eq. (2.7) and half-log-SNR $\lambda$ by applying change-of-variable (see detailed formulations in Appendix E.1). The results show that given the same NFE, the sample quality of DPM-Solver is consistently better than RK methods with the same order. The superior efficiency of DPM-Solver is particularly evident in the few-step regime under 15 NFE, where RK methods have rather large discretization errors. This is mainly because DPM-Solver analytically computes the linear term, avoiding the corresponding discretization error. Besides, the higher order DPM-Solver-3 converges faster than DPM-Solver-2, which matches the order analysis in Theorem 3.2.
246
+
247
+ # 5.2 Comparison with Discrete-Time Sampling Methods
248
+
249
+ We use the method in Sec. 3.4 for using DPM-Solver in discrete-time DPMs, and then compare DPM-Solver with other discrete-time training-free samplers, including DDPM [2], DDIM [19], Analytic-DDPM [21], Analytic-DDIM [21], PNDM [22], FastDPM [38] and Itô-Taylor [24]. We also compare with GGDM [18], which uses the same pre-trained model but needs further training for the sampling trajectory. We compare the sample quality by varying NFE from 10 to 1000.
250
+
251
+ Specifically, we use the discrete-time model trained by $L _ { \mathrm { s i m p l e } }$ in [2] on the CIFAR-10 dataset with linear noise schedule; the discrete-time model in [19] on CelebA 64x64 [39] with linear noise schedule; the discrete-time model trained by $L _ { \mathrm { h y b r i d } }$ in [16] on ImageNet 64x64 [26] with cosine noise schedule; the discrete-time model with classifier guidance in [4] on ImageNet 128x128 [26] with linear noise schedule; the discrete-time model in [4] on LSUN bedroom $2 5 6 \times 2 5 6$ [40] with linear noise schedule. For the models trained on ImageNet, we only use their “mean” model and omit the “variance” model. As shown in Fig. 2, on all datasets, DPM-Solver can obtain reasonable samples within 12 steps (FID 4.65 on CIFAR-10, FID 3.71 on CelebA 64x64 and FID 19.97 on ImageNet 64x64, FID 4.08 on ImageNet $1 2 8 \mathbf { x } 1 2 8 _ { \rho }$ ), which is $4 \sim 1 6 \times$ faster than the previous fastest training-free sampler. DPM-Solver even outperforms GGDM, which requires additional training.
252
+
253
+ # 6 Conclusions
254
+
255
+ We tackle the problem of fast and training-free sampling from DPMs. We propose DPM-Solver, a fast dedicated training-free solver of diffusion ODEs for fast sampling of DPMs in around 10 steps of function evaluations. DPM-Solver leverages the semi-linearity of diffusion ODEs and it directly approximates a simplified formulation of exact solutions of diffusion ODEs, which consists of an exponentially weighted integral of the noise prediction model. Inspired by numerical methods for exponential integrators, we propose first-order, second-order and third-order DPMSolver to approximate the exponentially weighted integral of noise prediction models with theoretical convergence guarantee. We propose both handcrafted and adaptive step size schedule, and apply DPM-Solver for both continuous-time and discrete-time DPMs. Our experimental results show that DPM-Solver can generate high-quality samples in around 10 function evaluations on various datasets, and it can achieve $4 \sim 1 6 \times$ speedup compared with previous state-of-the-art training-free samplers.
256
+
257
+ Limitations and broader impact Despite the promising speedup performance, DPM-Solver is designed for fast sampling, which may be not suitable for accelerating the likelihood evaluations of DPMs. Besides, compared to the commonly-used GANs, diffusion models with DPM-Solver are still not fast enough for real-time applications. In addition, like other deep generative models, DPMs may be used to generate adverse fake contents, and the proposed solver may further amplify the potential undesirable influence of deep generative models for malicious applications.
258
+
259
+ # Acknowledgements
260
+
261
+ This work was supported by National Key Research and Development Project of China (No. 2021ZD0110502); NSF of China Projects (Nos. 62061136001, 61620106010, 62076145, U19B2034, U1811461, U19A2081, 6197222, 62106120); Beijing NSF Project (No. JQ19016); Beijing Outstanding Young Scientist Program NO. BJJWZYJH012019100020098; a grant from Tsinghua Institute for Guo Qiang; the NVIDIA NVAIL Program with GPU/DGX Acceleration; the High Performance Computing Center, Tsinghua University; the Fundamental Research Funds for the Central Universities, and the Research Funds of Renmin University of China (22XNKJ13). J.Z is also supported by the XPlorer Prize.
262
+
263
+ # References
264
+
265
+ [1] J. Sohl-Dickstein, E. Weiss, N. Maheswaranathan, and S. Ganguli, “Deep unsupervised learning using nonequilibrium thermodynamics,” in International Conference on Machine Learning. PMLR, 2015, pp. 2256–2265.
266
+ [2] J. Ho, A. Jain, and P. Abbeel, “Denoising diffusion probabilistic models,” in Advances in Neural Information Processing Systems, vol. 33, 2020, pp. 6840–6851.
267
+ [3] Y. Song, J. Sohl-Dickstein, D. P. Kingma, A. Kumar, S. Ermon, and B. Poole, “Score-based generative modeling through stochastic differential equations,” in International Conference on Learning Representations, 2021.
268
+ [4] P. Dhariwal and A. Q. Nichol, “Diffusion models beat GANs on image synthesis,” in Advances in Neural Information Processing Systems, vol. 34, 2021, pp. 8780–8794.
269
+ [5] C. Meng, Y. Song, J. Song, J. Wu, J.-Y. Zhu, and S. Ermon, “SDEdit: Image synthesis and editing with stochastic differential equations,” in International Conference on Learning Representations, 2022.
270
+ [6] J. Ho, T. Salimans, A. Gritsenko, W. Chan, M. Norouzi, and D. J. Fleet, “Video diffusion models,” arXiv preprint arXiv:2204.03458, 2022.
271
+ [7] A. Ramesh, P. Dhariwal, A. Nichol, C. Chu, and M. Chen, “Hierarchical text-conditional image generation with CLIP latents,” arXiv preprint arXiv:2204.06125, 2022.
272
+ [8] N. Chen, Y. Zhang, H. Zen, R. J. Weiss, M. Norouzi, and W. Chan, “Wavegrad: Estimating gradients for waveform generation,” in International Conference on Learning Representations, 2021.
273
+ [9] N. Chen, Y. Zhang, H. Zen, R. J. Weiss, M. Norouzi, N. Dehak, and W. Chan, “Wavegrad 2: Iterative refinement for text-to-speech synthesis,” in International Speech Communication Association, 2021, pp. 3765–3769.
274
+ [10] D. P. Kingma, T. Salimans, B. Poole, and J. Ho, “Variational diffusion models,” in Advances in Neural Information Processing Systems, 2021.
275
+ [11] I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. C. Courville, and Y. Bengio, “Generative adversarial nets,” in Advances in Neural Information Processing Systems, vol. 27, 2014, pp. 2672–2680.
276
+ [12] D. P. Kingma and M. Welling, “Auto-encoding variational bayes,” in International Conference on Learning Representations, 2014.
277
+ [13] T. Salimans and J. Ho, “Progressive distillation for fast sampling of diffusion models,” in International Conference on Learning Representations, 2022.
278
+ [14] E. Luhman and T. Luhman, “Knowledge distillation in iterative generative models for improved sampling speed,” arXiv preprint arXiv:2101.02388, 2021.
279
+ [15] R. San-Roman, E. Nachmani, and L. Wolf, “Noise estimation for generative diffusion models,” arXiv preprint arXiv:2104.02600, 2021.
280
+ [16] A. Q. Nichol and P. Dhariwal, “Improved denoising diffusion probabilistic models,” in International Conference on Machine Learning. PMLR, 2021, pp. 8162–8171.
281
+ [17] M. W. Lam, J. Wang, R. Huang, D. Su, and D. Yu, “Bilateral denoising diffusion models,” arXiv preprint arXiv:2108.11514, 2021.
282
+ [18] D. Watson, W. Chan, J. Ho, and M. Norouzi, “Learning fast samplers for diffusion models by differentiating through sample quality,” in International Conference on Learning Representations, 2022.
283
+ [19] J. Song, C. Meng, and S. Ermon, “Denoising diffusion implicit models,” in International Conference on Learning Representations, 2021.
284
+ [20] A. Jolicoeur-Martineau, K. Li, R. Piché-Taillefer, T. Kachman, and I. Mitliagkas, “Gotta go fast when generating data with score-based models,” arXiv preprint arXiv:2105.14080, 2021.
285
+ [21] F. Bao, C. Li, J. Zhu, and B. Zhang, “Analytic-DPM: An analytic estimate of the optimal reverse variance in diffusion probabilistic models,” in International Conference on Learning Representations, 2022.
286
+ [22] L. Liu, Y. Ren, Z. Lin, and Z. Zhao, “Pseudo numerical methods for diffusion models on manifolds,” in International Conference on Learning Representations, 2022.
287
+ [23] V. Popov, I. Vovk, V. Gogoryan, T. Sadekova, M. Kudinov, and J. Wei, “Diffusion-based voice conversion with fast maximum likelihood sampling scheme,” in International Conference on Learning Representations, 2022.
288
+ [24] H. Tachibana, M. Go, M. Inahara, Y. Katayama, and Y. Watanabe, “Itô-Taylor sampling scheme for denoising diffusion probabilistic models using ideal derivatives,” arXiv preprint arXiv:2112.13339, 2021.
289
+ [25] M. Hochbruck and A. Ostermann, “Exponential integrators,” Acta Numerica, vol. 19, pp. 209–286, 2010.
290
+ [26] J. Deng, W. Dong, R. Socher, L. Li, K. Li, and L. Fei-Fei, “ImageNet: A large-scale hierarchical image database,” in 2009 IEEE Conference on Computer Vision and Pattern Recognition. IEEE, 2009, pp. 248–255.
291
+ [27] P. E. Kloeden and E. Platen, Numerical Solution of Stochastic Differential Equations. Springer, 1992.
292
+ [28] J. R. Dormand and P. J. Prince, “A family of embedded Runge-Kutta formulae,” Journal of computational and applied mathematics, vol. 6, no. 1, pp. 19–26, 1980.
293
+ [29] A. Krizhevsky, “Learning multiple layers of features from tiny images,” Tech. Rep., 2009.
294
+ [30] K. Atkinson, W. Han, and D. E. Stewart, Numerical solution of ordinary differential equations. John Wiley & Sons, 2011, vol. 108.
295
+ [31] M. Hochbruck and A. Ostermann, “Explicit exponential Runge-Kutta methods for semilinear parabolic problems,” SIAM Journal on Numerical Analysis, vol. 43, no. 3, pp. 1069–1090, 2005.
296
+ [32] V. T. Luan, “Efficient exponential Runge-Kutta methods of high order: Construction and implementation,” BIT Numerical Mathematics, vol. 61, no. 2, pp. 535–560, 2021.
297
+ [33] F. Bao, C. Li, J. Sun, J. Zhu, and B. Zhang, “Estimating the optimal covariance with imperfect mean in diffusion probabilistic models,” arXiv preprint arXiv:2206.07309, 2022.
298
+ [34] A. Vahdat, K. Kreis, and J. Kautz, “Score-based generative modeling in latent space,” in Advances in Neural Information Processing Systems, vol. 34, 2021, pp. 11 287–11 302.
299
+ [35] T. Dockhorn, A. Vahdat, and K. Kreis, “Score-based generative modeling with critically-damped Langevin diffusion,” in International Conference on Learning Representations, 2022.
300
+ [36] Z. Xiao, K. Kreis, and A. Vahdat, “Tackling the generative learning trilemma with denoising diffusion GANs,” in International Conference on Learning Representations, 2022.
301
+ [37] M. Heusel, H. Ramsauer, T. Unterthiner, B. Nessler, and S. Hochreiter, “GANs trained by a two time-scale update rule converge to a local Nash equilibrium,” in Advances in Neural Information Processing Systems, I. Guyon, U. von Luxburg, S. Bengio, H. M. Wallach, R. Fergus, S. V. N. Vishwanathan, and R. Garnett, Eds., vol. 30, 2017, pp. 6626–6637.
302
+ [38] Z. Kong and W. Ping, “On fast sampling of diffusion probabilistic models,” arXiv preprint arXiv:2106.00132, 2021.
303
+ [39] Z. Liu, P. Luo, X. Wang, and X. Tang, “Deep learning face attributes in the wild,” in Proceedings of the IEEE International Conference on Computer Vision, 2015, pp. 3730–3738.
304
+ [40] F. Yu, A. Seff, Y. Zhang, S. Song, T. Funkhouser, and J. Xiao, “LSUN: Construction of a large-scale image dataset using deep learning with humans in the loop,” arXiv preprint arXiv:1506.03365, 2015.
305
+ [41] Y. Song, C. Durkan, I. Murray, and S. Ermon, “Maximum likelihood training of score-based diffusion models,” in Advances in Neural Information Processing Systems, vol. 34, 2021, pp. 1415–1428.
306
+ [42] K. Yang, J. Yau, L. Fei-Fei, J. Deng, and O. Russakovsky, “A study of face obfuscation in ImageNet,” arXiv preprint arXiv:2103.06191, 2021.
307
+
308
+ # Checklist
309
+
310
+ 1. For all authors...
311
+
312
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
313
+ (b) Did you describe the limitations of your work? [Yes] See section 6.
314
+ (c) Did you discuss any potential negative societal impacts of your work? [Yes] See section 6.
315
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
316
+
317
+ 2. If you are including theoretical results...
318
+
319
+ (a) Did you state the full set of assumptions of all theoretical results? [Yes] See Appendix B. (b) Did you include complete proofs of all theoretical results? [Yes] See Appendix B.
320
+
321
+ 3. If you ran experiments...
322
+
323
+ (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] Code is attached in the supplemental materials, with the appendix.
324
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] Our method is training-free. But we also report the hyperparameters for evaluations used in our proposed solver.
325
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] We observe that the standard deviation of the FID evaluations of DPM-Solver are rather small (mainly less than 0.01) because the FID is already averaged over 50K samples, following existing work [18, 20, 21]. The small standard deviation does not change the conclusion.
326
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] The GPU type and amount is detailed in Appendix E.
327
+
328
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
329
+
330
+ (a) If your work uses existing assets, did you cite the creators? [Yes]
331
+ (b) Did you mention the license of the assets? [Yes] See Appendix E
332
+ (c) Did you include any new assets either in the supplemental material or as a URL? [Yes] We include our code in the supplemental materials.
333
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [No] All of the datasets used in the experiments are publicly available.
334
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] We mentioned the human privacy issues of the ImageNet dataset in Appendix E.
335
+
336
+ 5. If you used crowdsourcing or conducted research with human subjects...
337
+
338
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
339
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
340
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
parse/dev/2uAaGwlP_V/2uAaGwlP_V_content_list.json ADDED
@@ -0,0 +1,1443 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "DPM-Solver: A Fast ODE Solver for Diffusion Probabilistic Model Sampling in Around 10 Steps ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 199,
8
+ 122,
9
+ 799,
10
+ 172
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Cheng $\\mathbf { L } \\mathbf { u } ^ { \\dagger }$ , Yuhao Zhou†, Fan Bao†, Jianfei $\\mathbf { C h e n } ^ { \\dagger * }$ , Chongxuan $\\mathbf { L i } ^ { \\dagger }$ , Jun Zhu†∗ †Dept. of Comp. Sci. & Tech., Institute for AI, BNRist Center, THBI Lab †Tsinghua-Bosch Joint ML Center, Tsinghua University, Beijing, 100084 China ‡Gaoling School of Artificial Intelligence, Renmin University of China, ‡Beijing Key Laboratory of Big Data Management and Analysis Methods, Beijing, China {lucheng.lc15, yuhaoz.cs}@gmail.com; bf19@mails.tsinghua.edu.cn chongxuanli@ruc.edu.cn; {jianfeic, dcszj}@tsinghua.edu.cn ",
17
+ "bbox": [
18
+ 207,
19
+ 224,
20
+ 790,
21
+ 328
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Abstract ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 462,
31
+ 363,
32
+ 535,
33
+ 380
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "Diffusion probabilistic models (DPMs) are emerging powerful generative models. Despite their high-quality generation performance, DPMs still suffer from their slow sampling as they generally need hundreds or thousands of sequential function evaluations (steps) of large neural networks to draw a sample. Sampling from DPMs can be viewed alternatively as solving the corresponding diffusion ordinary differential equations (ODEs). In this work, we propose an exact formulation of the solution of diffusion ODEs. The formulation analytically computes the linear part of the solution, rather than leaving all terms to black-box ODE solvers as adopted in previous works. By applying change-of-variable, the solution can be equivalently simplified to an exponentially weighted integral of the neural network. Based on our formulation, we propose DPM-Solver, a fast dedicated high-order solver for diffusion ODEs with the convergence order guarantee. DPM-Solver is suitable for both discrete-time and continuous-time DPMs without any further training. Experimental results show that DPM-Solver can generate high-quality samples in only 10 to 20 function evaluations on various datasets. We achieve $4 . 7 0 \\ : \\mathrm { F I D }$ in 10 function evaluations and 2.87 FID in 20 function evaluations on the CIFAR10 dataset, and a $4 \\sim 1 6 \\times$ speedup compared with previous state-of-the-art training-free samplers on various datasets.2 ",
40
+ "bbox": [
41
+ 233,
42
+ 395,
43
+ 766,
44
+ 643
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "1 Introduction ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 174,
54
+ 672,
55
+ 310,
56
+ 690
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "Diffusion probabilistic models (DPMs) [1–3] are emerging powerful generative models with promising performance on many tasks, such as image generation [4, 5], video generation [6], text-to-image generation [7], speech synthesis [8, 9] and lossless compression [10]. DPMs are defined by discretetime random processes [1, 2] or continuous-time stochastic differential equations (SDEs) [3], which learn to gradually remove the noise added to the data points. Compared with the widely-used generative adversarial networks (GANs) [11] and variational auto-encoders (VAEs) [12], DPMs can not only compute exact likelihood [3], but also achieve even better sample quality for image generation [4]. However, to obtain high-quality samples, DPMs usually need hundreds or thousands of sequential steps of large neural network evaluations, thereby resulting in a much slower sampling speed than the single-step GANs or VAEs. Such inefficiency is becoming a critical bottleneck for the adoption of DPMs in downstream tasks, leading to an urgent request to design fast samplers for DPMs. ",
63
+ "bbox": [
64
+ 174,
65
+ 705,
66
+ 826,
67
+ 858
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "image",
73
+ "img_path": "images/4d6dd94407a2a26c38622fe661183fe6ba98b37b4ec1a90af34b958f1acc3ac9.jpg",
74
+ "image_caption": [
75
+ "Figure 1: Samples by DDIM [19] with 10, 15, 20, 100 number of function evaluations (NFE), and DPM-Solver (ours) with only 10 NFE, using the pre-trained DPMs on ImageNet $2 5 6 \\times 2 5 6$ with classifier guidance [4]. "
76
+ ],
77
+ "image_footnote": [],
78
+ "bbox": [
79
+ 174,
80
+ 88,
81
+ 802,
82
+ 306
83
+ ],
84
+ "page_idx": 1
85
+ },
86
+ {
87
+ "type": "text",
88
+ "text": "Existing fast samplers for DPMs can be divided into two categories. The first category includes knowledge distillation [13, 14] and noise level or sample trajectory learning [15–18]. Such methods require a possibly expensive training stage before they can be used for efficient sampling. Furthermore, their applicability and flexibility might be limited. It might require nontrivial effort to adapt the method to different models, datasets, and number of sampling steps. The second category consists of training-free [19–21] samplers, which are suitable for all pre-trained DPMs in a simple plug-andplay manner. Training-free samplers include adopting implicit [19] or analytical [21] generation process, advanced differential equation (DE) solvers [3, 20, 22–24] and dynamic programming [18]. However, these methods still require $\\sim 5 0$ function evaluations [21] to generate high-quality samples (comparable to those generated by plain samplers in about 1000 function evaluations), thereby are still time-consuming. ",
89
+ "bbox": [
90
+ 174,
91
+ 354,
92
+ 825,
93
+ 506
94
+ ],
95
+ "page_idx": 1
96
+ },
97
+ {
98
+ "type": "text",
99
+ "text": "In this work, we bring the efficiency of training-free samplers to a new level to produce high-quality samples in the “few-step sampling” regime, where the sampling can be done within around 10 steps of sequential function evaluations. We tackle the alternative problem of sampling from DPMs as solving the corresponding diffusion ordinary differential equations (ODEs) of DPMs, and carefully examine the structure of diffusion ODEs. Diffusion ODEs have a semi-linear structure — they consist of a linear function of the data variable and a nonlinear function parameterized by neural networks. Such structure is omitted in previous training-free samplers [3, 20], which directly use black-box DE solvers. To utilize the semi-linear structure, we derive an exact formulation of the solutions of diffusion ODEs by analytically computing the linear part of the solutions, avoiding the corresponding discretization error. Furthermore, by applying change-of-variable, the solutions can be equivalently simplified to an exponentially weighted integral of the neural network. Such integral is very special and can be efficiently approximated by the numerical methods for exponential integrators [25]. ",
100
+ "bbox": [
101
+ 174,
102
+ 512,
103
+ 825,
104
+ 678
105
+ ],
106
+ "page_idx": 1
107
+ },
108
+ {
109
+ "type": "text",
110
+ "text": "Based on our formulation of solutions, we propose DPM-Solver, a fast dedicated solver for diffusion ODEs by approximating the above integral. Specifically, we propose first-order, second-order and third-order versions of DPM-Solver with convergence order guarantees. We further propose an adaptive step size schedule for DPM-Solver. In general, DPM-Solver is applicable to both continuoustime and discrete-time DPMs, and also conditional sampling with classifier guidance [4]. Fig. 1 demonstrates the speedup performance of a Denoising Diffusion Implicit Models (DDIM) [19] baseline and DPM-Solver, which shows that DPM-Solver can generate high-quality samples with as few as 10 function evaluations and is much faster than DDIM on the ImageNet 256x256 dataset [26]. Our additional experimental results show that DPM-Solver can greatly improve the sampling speed of both discrete-time and continuous-time DPMs, and it can achieve excellent sample quality in around 10 function evaluations, which is much faster than all previous training-free samplers of DPMs. ",
111
+ "bbox": [
112
+ 174,
113
+ 684,
114
+ 825,
115
+ 837
116
+ ],
117
+ "page_idx": 1
118
+ },
119
+ {
120
+ "type": "text",
121
+ "text": "2 Diffusion Probabilistic Models ",
122
+ "text_level": 1,
123
+ "bbox": [
124
+ 176,
125
+ 861,
126
+ 459,
127
+ 878
128
+ ],
129
+ "page_idx": 1
130
+ },
131
+ {
132
+ "type": "text",
133
+ "text": "We review diffusion probabilistic models and their associated differential equations in this section. ",
134
+ "bbox": [
135
+ 171,
136
+ 897,
137
+ 816,
138
+ 911
139
+ ],
140
+ "page_idx": 1
141
+ },
142
+ {
143
+ "type": "text",
144
+ "text": "2.1 Forward Process and Diffusion SDEs ",
145
+ "text_level": 1,
146
+ "bbox": [
147
+ 174,
148
+ 90,
149
+ 472,
150
+ 106
151
+ ],
152
+ "page_idx": 2
153
+ },
154
+ {
155
+ "type": "text",
156
+ "text": "Assume that we have a $D$ -dimensional random variable $\\pmb { x } _ { 0 } \\in \\mathbb { R } ^ { D }$ with an unknown distribution $q _ { 0 } ( { \\pmb x } _ { 0 } )$ . Diffusion Probabilistic Models (DPMs) [1–3, 10] define a forward process $\\{ \\pmb { x } _ { t } \\} _ { t \\in [ 0 , T ] }$ with $T > 0$ starting with $\\scriptstyle { \\mathbf { { \\mathit { x } } } } _ { 0 }$ , such that for any $t \\in [ 0 , T ]$ , the distribution of $\\mathbf { \\Delta } _ { \\mathbf { \\mathcal { X } } _ { t } }$ conditioned on $\\scriptstyle { \\mathbf { { \\mathit { x } } } } _ { 0 }$ satisfies ",
157
+ "bbox": [
158
+ 174,
159
+ 116,
160
+ 825,
161
+ 161
162
+ ],
163
+ "page_idx": 2
164
+ },
165
+ {
166
+ "type": "equation",
167
+ "img_path": "images/b98f04c1bbffa9531e257210ae6112c502489822e557b5a3afdb274392b83d54.jpg",
168
+ "text": "$$\n\\begin{array} { r } { q _ { 0 t } ( \\pmb { x } _ { t } | \\pmb { x } _ { 0 } ) = \\mathcal { N } ( \\pmb { x } _ { t } | \\alpha ( t ) \\pmb { x } _ { 0 } , \\sigma ^ { 2 } ( t ) \\pmb { I } ) , } \\end{array}\n$$",
169
+ "text_format": "latex",
170
+ "bbox": [
171
+ 372,
172
+ 167,
173
+ 622,
174
+ 188
175
+ ],
176
+ "page_idx": 2
177
+ },
178
+ {
179
+ "type": "text",
180
+ "text": "where $\\alpha ( t ) , \\sigma ( t ) \\in \\mathbb { R } ^ { + }$ are differentiable functions of $t$ with bounded derivatives, and we denote them as $\\alpha _ { t } , \\sigma _ { t }$ for simplicity. The choice for $\\alpha _ { t }$ and $\\sigma _ { t }$ is referred to as the noise schedule of a DPM. Let $q _ { t } ( \\pmb { x } _ { t } )$ denote the marginal distribution of $\\mathbf { \\Delta } _ { \\mathbf { \\mathcal { X } } _ { t } }$ , DPMs choose noise schedules to ensure that $q _ { T } ( \\pmb { x } _ { T } ) \\overset { \\cdot } { \\approx } \\dot { \\mathcal { N } } ( \\pmb { x } _ { T } | \\mathbf { 0 } , \\tilde { \\sigma } ^ { 2 } \\pmb { I } )$ for some $\\tilde { \\sigma } > 0$ , and the signal-to-noise-ratio (SNR) $\\alpha _ { t } ^ { 2 } / \\sigma _ { t } ^ { 2 }$ is strictly decreasing w.r.t. $t$ [10]. Moreover, Kingma et al. [10] prove that the following stochastic differential equation (SDE) has the same transition distribution $q _ { 0 t } ( \\pmb { x } _ { t } | \\pmb { x } _ { 0 } )$ as in Eq. (2.1) for any $t \\in [ 0 , T ]$ : ",
181
+ "bbox": [
182
+ 173,
183
+ 193,
184
+ 825,
185
+ 279
186
+ ],
187
+ "page_idx": 2
188
+ },
189
+ {
190
+ "type": "equation",
191
+ "img_path": "images/8433318473b1628737ca5404d0a929d6a4570d9919cf8824f87c274bc4a0bbfd.jpg",
192
+ "text": "$$\n\\mathrm { d } \\pmb { x } _ { t } = f ( t ) \\pmb { x } _ { t } \\mathrm { d } t + g ( t ) \\mathrm { d } \\pmb { w } _ { t } , \\quad \\pmb { x } _ { 0 } \\sim q _ { 0 } ( \\pmb { x } _ { 0 } ) ,\n$$",
193
+ "text_format": "latex",
194
+ "bbox": [
195
+ 348,
196
+ 285,
197
+ 648,
198
+ 303
199
+ ],
200
+ "page_idx": 2
201
+ },
202
+ {
203
+ "type": "text",
204
+ "text": "where ${ \\pmb w } _ { t } \\in \\mathbb { R } ^ { D }$ is the standard Wiener process, and ",
205
+ "bbox": [
206
+ 173,
207
+ 309,
208
+ 517,
209
+ 324
210
+ ],
211
+ "page_idx": 2
212
+ },
213
+ {
214
+ "type": "equation",
215
+ "img_path": "images/e5d12cd513ddf8ae3fa219a1feddb4594e4cf22e33260b27389e15d81ab87dc7.jpg",
216
+ "text": "$$\nf ( t ) = \\frac { \\mathrm { d } \\log \\alpha _ { t } } { \\mathrm { d } t } , \\quad g ^ { 2 } ( t ) = \\frac { \\mathrm { d } \\sigma _ { t } ^ { 2 } } { \\mathrm { d } t } - 2 \\frac { \\mathrm { d } \\log \\alpha _ { t } } { \\mathrm { d } t } \\sigma _ { t } ^ { 2 } .\n$$",
217
+ "text_format": "latex",
218
+ "bbox": [
219
+ 336,
220
+ 332,
221
+ 661,
222
+ 364
223
+ ],
224
+ "page_idx": 2
225
+ },
226
+ {
227
+ "type": "text",
228
+ "text": "Under some regularity conditions, Song et al. [3] show that the forward process in Eq. (2.2) has an equivalent reverse process from time $T$ to $0$ , starting with the marginal distribution $q _ { T } ( { \\pmb x } _ { T } )$ : ",
229
+ "bbox": [
230
+ 174,
231
+ 371,
232
+ 826,
233
+ 400
234
+ ],
235
+ "page_idx": 2
236
+ },
237
+ {
238
+ "type": "equation",
239
+ "img_path": "images/098b1c09edd91e1e8b539459bb92a3c5f191abb42aa1157755522d3dce62bcae.jpg",
240
+ "text": "$$\n\\mathrm { d } \\pmb { x } _ { t } = [ f ( t ) \\pmb { x } _ { t } - g ^ { 2 } ( t ) \\nabla _ { \\pmb { x } } \\log q _ { t } ( \\pmb { x } _ { t } ) ] \\mathrm { d } t + g ( t ) \\mathrm { d } \\bar { \\pmb { w } } _ { t } , \\quad \\pmb { x } _ { T } \\sim q _ { T } ( \\pmb { x } _ { T } ) ,\n$$",
241
+ "text_format": "latex",
242
+ "bbox": [
243
+ 266,
244
+ 406,
245
+ 728,
246
+ 426
247
+ ],
248
+ "page_idx": 2
249
+ },
250
+ {
251
+ "type": "text",
252
+ "text": "where $\\bar { \\mathbf { \\nabla } } \\bar { \\mathbf { \\nabla } } \\bar { \\mathbf { \\nabla } } \\bar { \\mathbf { \\nabla } } \\bar { \\mathbf { \\nabla } } \\bar { \\mathbf { \\nabla } } \\bar { \\mathbf { w } } _ { t }$ is a standard Wiener process in the reverse time. The only unknown term in Eq. (2.4) is the score function $\\nabla _ { \\pmb { x } } \\log q _ { t } ( \\pmb { x } _ { t } )$ at each time $t$ . In practice, DPMs use a neural network $\\epsilon _ { \\theta } ( x _ { t } , t )$ parameterized by $\\theta$ to estimate the scaled score function: $- \\sigma _ { t } \\nabla _ { \\pmb { x } } \\log q _ { t } ( \\pmb { x } _ { t } )$ . The parameter $\\theta$ is optimized by minimizing the following objective [2, 3]: ",
253
+ "bbox": [
254
+ 176,
255
+ 433,
256
+ 825,
257
+ 489
258
+ ],
259
+ "page_idx": 2
260
+ },
261
+ {
262
+ "type": "equation",
263
+ "img_path": "images/18da74f3ada9dcef2cf0de53303bacedefeb327430ef720bfe85381fb0de2f45.jpg",
264
+ "text": "$$\n\\begin{array} { l } { \\displaystyle \\mathcal { L } ( \\theta ; \\omega ( t ) ) : = \\frac { 1 } { 2 } \\int _ { 0 } ^ { T } \\omega ( t ) \\mathbb { E } _ { q _ { t } ( \\mathbf { \\Delta x } _ { t } ) } \\Big [ \\| \\epsilon _ { \\theta } ( \\mathbf { x } _ { t } , t ) + \\sigma _ { t } \\nabla _ { \\mathbf { x } } \\log q _ { t } ( \\mathbf { \\Delta x } _ { t } ) \\| _ { 2 } ^ { 2 } \\Big ] \\mathrm { d } t } \\\\ { \\displaystyle \\qquad = \\frac { 1 } { 2 } \\int _ { 0 } ^ { T } \\omega ( t ) \\mathbb { E } _ { q _ { 0 } ( \\mathbf { x } _ { 0 } ) } \\mathbb { E } _ { q ( \\epsilon ) } \\Big [ \\| \\epsilon _ { \\theta } ( \\mathbf { x } _ { t } , t ) - \\epsilon \\| _ { 2 } ^ { 2 } \\Big ] \\mathrm { d } t + C , } \\end{array}\n$$",
265
+ "text_format": "latex",
266
+ "bbox": [
267
+ 269,
268
+ 496,
269
+ 727,
270
+ 571
271
+ ],
272
+ "page_idx": 2
273
+ },
274
+ {
275
+ "type": "text",
276
+ "text": "where $\\omega ( t )$ is a weighting function, $\\epsilon \\sim q ( \\epsilon ) = \\mathcal { N } ( \\epsilon | \\mathbf { 0 } , I )$ , ${ \\pmb x } _ { t } = \\alpha _ { t } { \\pmb x } _ { 0 } + \\sigma _ { t } { \\pmb \\epsilon }$ , and $C$ is a constant independent of $\\theta$ . As $\\epsilon _ { \\theta } ( x _ { t } , t )$ can also be regarded as predicting the Gaussian noise added to $\\mathbf { \\Delta } _ { \\mathbf { \\mathcal { X } } _ { t } }$ , it is usually called the noise prediction model. Since the ground truth of $\\epsilon _ { \\theta } ( x _ { t } , t )$ is $- \\sigma _ { t } \\nabla _ { \\pmb { x } } \\log q _ { t } ( \\pmb { x } _ { t } )$ , DPMs replace the score function in Eq. (2.4) by $- \\mathbf { \\epsilon } \\mathbf { \\epsilon } \\bar { \\mathbf { \\alpha } } ( \\mathbf { x } _ { t } , t ) / \\sigma _ { t }$ and define a parameterized reverse process (diffusion $S D E$ ) from time $T$ to $0$ , starting with $\\pmb { x } _ { T } \\overset { \\cdot } { \\sim } \\mathcal { N } ( \\mathbf { 0 } , \\tilde { \\sigma } ^ { 2 } \\pmb { I } )$ : ",
277
+ "bbox": [
278
+ 173,
279
+ 575,
280
+ 826,
281
+ 647
282
+ ],
283
+ "page_idx": 2
284
+ },
285
+ {
286
+ "type": "equation",
287
+ "img_path": "images/65fdde0d1d949853db59a598710255c20a35d6c68ca6401f8b46cd9f514525f2.jpg",
288
+ "text": "$$\n\\mathrm { d } x _ { t } = \\left[ f ( t ) x _ { t } + \\frac { g ^ { 2 } ( t ) } { \\sigma _ { t } } \\epsilon _ { \\theta } ( x _ { t } , t ) \\right] \\mathrm { d } t + g ( t ) \\mathrm { d } \\bar { w } _ { t } , \\quad x _ { T } \\sim \\mathcal { N } ( \\mathbf { 0 } , \\tilde { \\sigma } ^ { 2 } I ) .\n$$",
289
+ "text_format": "latex",
290
+ "bbox": [
291
+ 266,
292
+ 654,
293
+ 732,
294
+ 689
295
+ ],
296
+ "page_idx": 2
297
+ },
298
+ {
299
+ "type": "text",
300
+ "text": "Samples can be generated from DPMs by solving the diffusion SDE in Eq. (2.5) with numerical solvers, which discretize the SDE from $T$ to 0. Song et al. [3] proved that the traditional ancestral sampling method for DPMs [2] can be viewed as a first-order SDE solver for Eq. (2.5). However, these first-order methods usually need hundreds of or thousands of function evaluations to converge [3], leading to extremely slow sampling speed. ",
301
+ "bbox": [
302
+ 174,
303
+ 695,
304
+ 826,
305
+ 766
306
+ ],
307
+ "page_idx": 2
308
+ },
309
+ {
310
+ "type": "text",
311
+ "text": "2.2 Diffusion (Probability Flow) ODEs ",
312
+ "text_level": 1,
313
+ "bbox": [
314
+ 176,
315
+ 781,
316
+ 454,
317
+ 797
318
+ ],
319
+ "page_idx": 2
320
+ },
321
+ {
322
+ "type": "text",
323
+ "text": "When discretizing SDEs, the step size is limited by the randomness of the Wiener process [27, Chap. 11]. A large step size (small number of steps) often causes non-convergence, especially in high dimensional spaces. For faster sampling, one can consider the associated probability flow ODE [3], which has the same marginal distribution at each time $t$ as that of the SDE. Specifically, for DPMs, Song et al. [3] proved that the probability flow ODE of Eq. (2.4) is ",
324
+ "bbox": [
325
+ 173,
326
+ 808,
327
+ 826,
328
+ 878
329
+ ],
330
+ "page_idx": 2
331
+ },
332
+ {
333
+ "type": "equation",
334
+ "img_path": "images/db0329942038b0f1cd9de0b5b9716a202705a11feeab57d38ae6c43085d15745.jpg",
335
+ "text": "$$\n\\frac { \\mathrm { d } \\pmb { x } _ { t } } { \\mathrm { d } t } = f ( t ) \\pmb { x } _ { t } - \\frac { 1 } { 2 } g ^ { 2 } ( t ) \\nabla _ { \\pmb { x } } \\log q _ { t } ( \\pmb { x } _ { t } ) , \\quad \\pmb { x } _ { T } \\sim q _ { T } ( \\pmb { x } _ { T } ) ,\n$$",
336
+ "text_format": "latex",
337
+ "bbox": [
338
+ 308,
339
+ 886,
340
+ 687,
341
+ 916
342
+ ],
343
+ "page_idx": 2
344
+ },
345
+ {
346
+ "type": "text",
347
+ "text": "where the marginal distribution of $\\mathbf { \\Delta } _ { \\mathbf { \\mathcal { X } } _ { t } }$ is also $q _ { t } ( \\pmb { x } _ { t } )$ . By replacing the score function with the noise prediction model, Song et al. [3] defined the following parameterized ODE (diffusion $O D E$ ): ",
348
+ "bbox": [
349
+ 171,
350
+ 90,
351
+ 823,
352
+ 119
353
+ ],
354
+ "page_idx": 3
355
+ },
356
+ {
357
+ "type": "equation",
358
+ "img_path": "images/772c489895a83788baac27c0b2cc0da51d29a5ff2c72c378ea8301efa3cfe52d.jpg",
359
+ "text": "$$\n\\frac { \\mathrm { d } \\pmb { x } _ { t } } { \\mathrm { d } t } = \\pmb { h } _ { \\theta } ( \\pmb { x } _ { t } , t ) : = f ( t ) \\pmb { x } _ { t } + \\frac { g ^ { 2 } ( t ) } { 2 \\sigma _ { t } } \\epsilon _ { \\theta } ( \\pmb { x } _ { t } , t ) , \\quad \\pmb { x } _ { T } \\sim \\mathcal { N } ( \\mathbf { 0 } , \\tilde { \\sigma } ^ { 2 } \\mathbf { I } ) .\n$$",
360
+ "text_format": "latex",
361
+ "bbox": [
362
+ 277,
363
+ 121,
364
+ 720,
365
+ 155
366
+ ],
367
+ "page_idx": 3
368
+ },
369
+ {
370
+ "type": "text",
371
+ "text": "Samples can be drawn by solving the ODE from $T$ to 0. Comparing with SDEs, ODEs can be solved with larger step sizes as they have no randomness. Furthermore, we can take advantage of efficient numerical ODE solvers to accelerate the sampling. Song et al. [3] used the RK45 ODE solver [28] for the diffusion ODEs, which generates samples in $\\sim 6 0$ function evaluations to reach comparable quality with a 1000-step SDE solver for Eq. (2.5) on the CIFAR-10 dataset [29]. However, existing general-purpose ODE solvers still cannot generate satisfactory samples in the few-step $\\sim 1 0$ steps) sampling regime. To the best of our knowledge, there is still a lack of training-free samplers for DPMs in the few-step sampling regime, and the sampling speed of DPMs is still a critical issue. ",
372
+ "bbox": [
373
+ 173,
374
+ 155,
375
+ 826,
376
+ 267
377
+ ],
378
+ "page_idx": 3
379
+ },
380
+ {
381
+ "type": "text",
382
+ "text": "3 Customized Fast Solvers for Diffusion ODEs ",
383
+ "text_level": 1,
384
+ "bbox": [
385
+ 173,
386
+ 285,
387
+ 576,
388
+ 303
389
+ ],
390
+ "page_idx": 3
391
+ },
392
+ {
393
+ "type": "text",
394
+ "text": "As highlighted in Sec. 2.2, discretizing SDEs is generally difficult in high dimensions [27, Chap. 11] and it is hard to converge within few steps. In contrast, ODEs are easier to solve, yielding a potential for fast samplers. However, as mentioned in Sec. 2.2, the general black-box ODE solver used in previous work [3] empirically fails to converge in few steps. This motivates us to design a dedicated solver for diffusion ODEs to enable fast and high-quality few-step sampling. We start with a detailed investigation of the specific structure of diffusion ODEs. ",
395
+ "bbox": [
396
+ 173,
397
+ 314,
398
+ 825,
399
+ 398
400
+ ],
401
+ "page_idx": 3
402
+ },
403
+ {
404
+ "type": "text",
405
+ "text": "3.1 Simplified Formulation of Exact Solutions of Diffusion ODEs ",
406
+ "text_level": 1,
407
+ "bbox": [
408
+ 174,
409
+ 412,
410
+ 637,
411
+ 429
412
+ ],
413
+ "page_idx": 3
414
+ },
415
+ {
416
+ "type": "text",
417
+ "text": "The key insight of this work is that given an initial value $\\mathbf { \\delta } _ { \\mathbf { \\mathcal { X } } _ { s } }$ at time $s > 0$ , the solution $\\mathbf { \\Delta } _ { \\mathbf { \\mathcal { X } } _ { t } }$ at each time $t < s$ of diffusion ODEs in Eq. (2.7) can be simplified into a very special exact formulation which can be efficiently approximated. ",
418
+ "bbox": [
419
+ 176,
420
+ 439,
421
+ 823,
422
+ 482
423
+ ],
424
+ "page_idx": 3
425
+ },
426
+ {
427
+ "type": "text",
428
+ "text": "Our first key observation is that a part of the solution $\\mathbf { \\Delta } _ { \\mathbf { \\mathcal { X } } _ { t } }$ can be exactly computed by considering the particular structure of diffusion ODEs. The r.h.s. of diffusion ODEs in Eq. (2.7) consists of two parts: the part $f ( t ) x _ { t }$ is a linear function of $\\mathbf { \\Delta } _ { \\mathbf { \\mathcal { X } } _ { t } }$ , and the other part $\\frac { g ^ { 2 } ( t ) } { 2 \\sigma _ { t } } \\epsilon _ { \\theta } ( \\pmb { x } _ { t } , t )$ is generally a nonlinear function of $\\mathbf { \\Delta } _ { \\mathbf { \\mathcal { X } } _ { t } }$ because of the neural network $\\epsilon _ { \\theta } ( x _ { t } , t )$ . This type of ODE is referred to as semi-linear ODE. The black-box ODE solvers adopted by previous work [3] are ignorant of this semi-linear structure as they take the whole $h _ { \\theta } ( x _ { t } , \\bar t ) $ in Eq. (2.7) as the input, which causes discretization errors of both the linear and nonlinear term. We note that for semi-linear ODEs, the solution at time $t$ can be exactly formulated by the “variation of constants” formula [30]: ",
429
+ "bbox": [
430
+ 173,
431
+ 487,
432
+ 825,
433
+ 606
434
+ ],
435
+ "page_idx": 3
436
+ },
437
+ {
438
+ "type": "equation",
439
+ "img_path": "images/6f1153f8f759866e204632c40d87e1d736b7589259f6710fccd3282a51e399e5.jpg",
440
+ "text": "$$\n\\pmb { x } _ { t } = e ^ { \\int _ { s } ^ { t } f ( \\tau ) \\mathrm { d } \\tau } \\pmb { x } _ { s } + \\int _ { s } ^ { t } \\left( e ^ { \\int _ { \\tau } ^ { t } f ( r ) \\mathrm { d } r } \\frac { g ^ { 2 } \\big ( \\tau \\big ) } { 2 \\sigma _ { \\tau } } \\epsilon _ { \\theta } ( \\pmb { x } _ { \\tau } , \\tau ) \\right) \\mathrm { d } \\tau .\n$$",
441
+ "text_format": "latex",
442
+ "bbox": [
443
+ 307,
444
+ 607,
445
+ 691,
446
+ 643
447
+ ],
448
+ "page_idx": 3
449
+ },
450
+ {
451
+ "type": "text",
452
+ "text": "This formulation decouples the linear part and the nonlinear part. In contrast to black-box ODE solvers, the linear part is now exactly computed, which eliminates the approximation error of the linear term. However, the integral of the nonlinear part is still complicated because it couples the coefficients about the noise schedule (i.e., $f ( \\tau ) , g ( \\tau ) \\bar { , } \\sigma _ { \\tau } )$ and the complex neural network $\\epsilon _ { \\theta }$ , which is still hard to approximate. ",
453
+ "bbox": [
454
+ 173,
455
+ 643,
456
+ 825,
457
+ 713
458
+ ],
459
+ "page_idx": 3
460
+ },
461
+ {
462
+ "type": "text",
463
+ "text": "Our second key observation is that the integral of the nonlinear part can be greatly simplified by introducing a special variable. Let $\\lambda _ { t } : = \\log \\bar { ( \\alpha _ { t } / \\sigma _ { t } ) }$ (one half of the log-SNR), then $\\lambda _ { t }$ is a strictly decreasing function of $t$ (due to the definition of DPMs as discussed in Sec. 2.1). We can rewrite $g ( t )$ in Eq. (2.3) as ",
464
+ "bbox": [
465
+ 173,
466
+ 719,
467
+ 825,
468
+ 775
469
+ ],
470
+ "page_idx": 3
471
+ },
472
+ {
473
+ "type": "equation",
474
+ "img_path": "images/28428e28211e5384d76d1e8330c965590495d098f46b2f50a448a40982e1a8f0.jpg",
475
+ "text": "$$\ng ^ { 2 } ( t ) = \\frac { \\mathrm { d } \\sigma _ { t } ^ { 2 } } { \\mathrm { d } t } - 2 \\frac { \\mathrm { d } \\log { \\alpha _ { t } } } { \\mathrm { d } t } \\sigma _ { t } ^ { 2 } = 2 \\sigma _ { t } ^ { 2 } \\left( \\frac { \\mathrm { d } \\log { \\sigma _ { t } } } { \\mathrm { d } t } - \\frac { \\mathrm { d } \\log { \\alpha _ { t } } } { \\mathrm { d } t } \\right) = - 2 \\sigma _ { t } ^ { 2 } \\frac { \\mathrm { d } \\lambda _ { t } } { \\mathrm { d } t } .\n$$",
476
+ "text_format": "latex",
477
+ "bbox": [
478
+ 254,
479
+ 776,
480
+ 743,
481
+ 813
482
+ ],
483
+ "page_idx": 3
484
+ },
485
+ {
486
+ "type": "text",
487
+ "text": "Combining with $f ( t ) = \\mathrm { d } \\log \\alpha _ { t } / \\mathrm { d } t$ in Eq. (2.3), we can rewrite Eq. (3.1) as ",
488
+ "bbox": [
489
+ 171,
490
+ 813,
491
+ 676,
492
+ 829
493
+ ],
494
+ "page_idx": 3
495
+ },
496
+ {
497
+ "type": "equation",
498
+ "img_path": "images/d804fb43f91c9fdbe50275bbfdd61568c9d23d13e7c4cea3f8e0751dee5a2bb6.jpg",
499
+ "text": "$$\n\\pmb { x } _ { t } = \\frac { \\alpha _ { t } } { \\alpha _ { s } } \\pmb { x } _ { s } - \\alpha _ { t } \\int _ { s } ^ { t } \\left( \\frac { \\mathrm { d } \\lambda _ { \\tau } } { \\mathrm { d } \\tau } \\right) \\frac { \\sigma _ { \\tau } } { \\alpha _ { \\tau } } \\pmb { \\epsilon } _ { \\theta } ( \\pmb { x } _ { \\tau } , \\tau ) \\mathrm { d } \\tau .\n$$",
500
+ "text_format": "latex",
501
+ "bbox": [
502
+ 344,
503
+ 830,
504
+ 651,
505
+ 866
506
+ ],
507
+ "page_idx": 3
508
+ },
509
+ {
510
+ "type": "text",
511
+ "text": "As $\\lambda ( t ) = \\lambda _ { t }$ is a strictly decreasing function of $t$ , it has an inverse function $t _ { \\lambda } ( \\cdot )$ satisfying $t = t _ { \\lambda } ( \\lambda ( t ) )$ . We further change the subscripts of $_ { \\textbf { \\em x } }$ and $\\epsilon _ { \\theta }$ from $t$ to $\\lambda$ and denote $\\hat { \\pmb x } _ { \\lambda } : = \\pmb x _ { t _ { \\lambda } ( \\lambda ) }$ $\\hat { \\epsilon } _ { \\boldsymbol { \\theta } } ( \\hat { x } _ { \\lambda } , \\lambda ) : = \\epsilon _ { \\boldsymbol { \\theta } } ( x _ { t _ { \\lambda } ( \\lambda ) } , t _ { \\lambda } ( \\lambda ) )$ . Rewrite Eq. (3.3) by “change-of-variable” for $\\lambda$ , then we have: ",
512
+ "bbox": [
513
+ 173,
514
+ 867,
515
+ 825,
516
+ 912
517
+ ],
518
+ "page_idx": 3
519
+ },
520
+ {
521
+ "type": "text",
522
+ "text": "Proposition 3.1 (Exact solution of diffusion ODEs). Given an initial value $\\mathbf { \\delta } _ { \\mathbf { \\mathcal { X } } _ { s } }$ at time $s > 0$ , the solution $\\mathbf { \\Delta } _ { \\mathbf { \\mathcal { X } } _ { t } }$ at time $t \\in [ 0 , s ]$ of diffusion ODEs in Eq. (2.7) is: ",
523
+ "bbox": [
524
+ 171,
525
+ 90,
526
+ 823,
527
+ 121
528
+ ],
529
+ "page_idx": 4
530
+ },
531
+ {
532
+ "type": "equation",
533
+ "img_path": "images/9abcfd7effacf68fb53c21394f34e41f5f607171cf80a13282a4bf3971c34831.jpg",
534
+ "text": "$$\n\\pmb { x } _ { t } = \\frac { \\alpha _ { t } } { \\alpha _ { s } } \\pmb { x } _ { s } - \\alpha _ { t } \\int _ { \\lambda _ { s } } ^ { \\lambda _ { t } } e ^ { - \\lambda } \\hat { \\pmb { \\epsilon } } _ { \\theta } ( \\hat { \\pmb { x } } _ { \\lambda } , \\lambda ) \\mathrm { d } \\lambda .\n$$",
535
+ "text_format": "latex",
536
+ "bbox": [
537
+ 366,
538
+ 125,
539
+ 632,
540
+ 162
541
+ ],
542
+ "page_idx": 4
543
+ },
544
+ {
545
+ "type": "text",
546
+ "text": "We call the integral $\\begin{array} { r } { \\int e ^ { - \\lambda } \\hat { \\epsilon } _ { \\theta } ( \\hat { \\pmb x } _ { \\lambda } , \\lambda ) \\mathrm { d } \\lambda } \\end{array}$ the exponentially weighted integral of $\\scriptstyle { \\hat { \\epsilon } } _ { \\theta }$ , which is very special and highly related to the exponential integrators in the literature of ODE solvers [25]. To the best of our knowledge, such formulation has not been revealed in prior work of diffusion models. ",
547
+ "bbox": [
548
+ 173,
549
+ 174,
550
+ 825,
551
+ 217
552
+ ],
553
+ "page_idx": 4
554
+ },
555
+ {
556
+ "type": "text",
557
+ "text": "Eq. (3.4) provides a new perspective for approximating the solutions of diffusion ODEs. Specifically, given $\\mathbf { \\delta } _ { \\mathbf { \\mathcal { X } } _ { s } }$ at time $s$ , According to Eq. (3.4), approximating the solution at time $t$ is equivalent to directly approximating the exponentially weighted integral of $\\hat { \\epsilon } _ { \\theta }$ from $\\lambda _ { s }$ to $\\lambda _ { t }$ , which avoids the error of the linear terms and is well-studied in the literature of exponential integrators [25, 31]. Based on this insight, we propose fast solvers for diffusion ODEs, as detailed in the following sections. ",
558
+ "bbox": [
559
+ 173,
560
+ 223,
561
+ 825,
562
+ 292
563
+ ],
564
+ "page_idx": 4
565
+ },
566
+ {
567
+ "type": "text",
568
+ "text": "3.2 High-Order Solvers for Diffusion ODEs ",
569
+ "text_level": 1,
570
+ "bbox": [
571
+ 173,
572
+ 308,
573
+ 490,
574
+ 324
575
+ ],
576
+ "page_idx": 4
577
+ },
578
+ {
579
+ "type": "text",
580
+ "text": "In this section, we propose high-order solvers for diffusion ODEs with convergence order guarantee by leveraging our proposed solution formulation Eq. (3.4). The proposed solvers and analysis are highly motivated by the methods of exponential integrators [25, 31] in the ODE literature. ",
581
+ "bbox": [
582
+ 173,
583
+ 333,
584
+ 825,
585
+ 376
586
+ ],
587
+ "page_idx": 4
588
+ },
589
+ {
590
+ "type": "text",
591
+ "text": "Specifically, given an initial value $\\mathbf { \\nabla } _ { \\mathbf { x } _ { T } }$ at time $T$ and $M + 1$ time steps $\\{ t _ { i } \\} _ { i = 0 } ^ { M }$ decreasing from $t _ { 0 } = T$ to $t _ { M } = 0$ . Let $\\tilde { \\mathbf { x } } _ { t _ { 0 } } = \\mathbf { x } _ { T }$ be the initial value. The proposed solvers use $M$ steps to iteratively compute a sequence $\\{ \\tilde { { \\pmb { x } } } _ { t _ { i } } \\} _ { i = 0 } ^ { M }$ to approximate the true solutions at time steps $\\{ t _ { i } \\} _ { i = 0 } ^ { M }$ . In particular, the last iterate $\\tilde { \\boldsymbol { x } } _ { t _ { M } }$ approximates the true solution at time 0. ",
592
+ "bbox": [
593
+ 173,
594
+ 381,
595
+ 825,
596
+ 439
597
+ ],
598
+ "page_idx": 4
599
+ },
600
+ {
601
+ "type": "text",
602
+ "text": "In order to reduce the approximation error between $\\tilde { \\pmb { x } } _ { t _ { M } }$ and the true solution at time 0, we need to reduce the approximation error for each $\\tilde { \\mathbf { x } } _ { t _ { i } }$ at every step [30]. Starting with the previous value $\\tilde { \\pmb { x } } _ { t _ { i - 1 } }$ at time $t _ { i - 1 }$ , according to Eq. (3.4), the exact solution $\\pmb { x } _ { t _ { i - 1 } t _ { i } }$ at time $t _ { i }$ is given by ",
603
+ "bbox": [
604
+ 174,
605
+ 444,
606
+ 825,
607
+ 487
608
+ ],
609
+ "page_idx": 4
610
+ },
611
+ {
612
+ "type": "equation",
613
+ "img_path": "images/e941fd95cbf3e1c496583b82dd623ff65158438a8e8529e43b6a17ad2855df95.jpg",
614
+ "text": "$$\n\\pmb { x } _ { t _ { i - 1 } t _ { i } } = \\frac { \\alpha _ { t _ { i } } } { \\alpha _ { t _ { i - 1 } } } \\tilde { \\pmb { x } } _ { t _ { i - 1 } } - \\alpha _ { t _ { i } } \\int _ { \\lambda _ { t _ { i - 1 } } } ^ { \\lambda _ { t _ { i } } } e ^ { - \\lambda } \\hat { \\pmb { \\epsilon } } _ { \\theta } ( \\hat { \\pmb { x } } _ { \\lambda } , \\lambda ) \\mathrm { d } \\lambda .\n$$",
615
+ "text_format": "latex",
616
+ "bbox": [
617
+ 316,
618
+ 492,
619
+ 679,
620
+ 532
621
+ ],
622
+ "page_idx": 4
623
+ },
624
+ {
625
+ "type": "text",
626
+ "text": "Therefore, to compute the value $\\tilde { \\boldsymbol { x } } _ { t _ { i } }$ for approximating $\\pmb { x } _ { t _ { i - 1 } t _ { i } }$ , we need to approximate the exponentially weighted integral of $\\hat { \\epsilon } _ { \\theta }$ from $\\lambda _ { t _ { i - 1 } }$ to $\\lambda _ { t _ { i } }$ . Denote $h _ { i } : = \\lambda _ { t _ { i } } - \\lambda _ { t _ { i - 1 } }$ , and $\\hat { \\epsilon } _ { \\theta } ^ { ( n ) } ( \\hat { { \\mathbf x } } _ { \\lambda } , \\lambda ) \\mathrel { \\mathop : } =$ dnϵˆθ(xˆλ,λ)dλn as the n-th order total derivative of ϵˆθ(xˆλ, λ) w.r.t. λ. For k ≥ 1, the (k − 1)-th order Taylor expansion of $\\hat { \\epsilon } _ { \\theta } ( \\hat { \\pmb x } _ { \\lambda } , \\lambda )$ w.r.t. $\\lambda$ at $\\lambda _ { t _ { i - 1 } }$ is ",
627
+ "bbox": [
628
+ 173,
629
+ 536,
630
+ 825,
631
+ 603
632
+ ],
633
+ "page_idx": 4
634
+ },
635
+ {
636
+ "type": "equation",
637
+ "img_path": "images/976243e2861066edc99111ffc150a8141dda0494f026576eb3e22e90ae405d03.jpg",
638
+ "text": "$$\n\\hat { \\epsilon } _ { \\theta } ( \\hat { x } _ { \\lambda } , \\lambda ) = \\sum _ { n = 0 } ^ { k - 1 } \\frac { ( \\lambda - \\lambda _ { t _ { i - 1 } } ) ^ { n } } { n ! } \\hat { \\epsilon } _ { \\theta } ^ { ( n ) } ( \\hat { x } _ { \\lambda _ { t _ { i - 1 } } } , \\lambda _ { t _ { i - 1 } } ) + \\mathcal { O } ( ( \\lambda - \\lambda _ { t _ { i - 1 } } ) ^ { k } ) ,\n$$",
639
+ "text_format": "latex",
640
+ "bbox": [
641
+ 264,
642
+ 608,
643
+ 732,
644
+ 651
645
+ ],
646
+ "page_idx": 4
647
+ },
648
+ {
649
+ "type": "text",
650
+ "text": "Substituting the above Taylor expansion into Eq. (3.5) yields ",
651
+ "bbox": [
652
+ 173,
653
+ 655,
654
+ 573,
655
+ 670
656
+ ],
657
+ "page_idx": 4
658
+ },
659
+ {
660
+ "type": "equation",
661
+ "img_path": "images/aa02a3d9e9670da70428ff51d8dccbfd33121e4f699e839306505e69a37a124c.jpg",
662
+ "text": "$$\n\\pmb { x } _ { t _ { i - 1 } t _ { i } } = \\frac { \\alpha _ { t _ { i } } } { \\alpha _ { t _ { i - 1 } } } \\tilde { \\pmb { x } } _ { t _ { i - 1 } } - \\alpha _ { t _ { i } } \\sum _ { n = 0 } ^ { k - 1 } \\hat { \\pmb { \\epsilon } } _ { \\theta } ^ { ( n ) } ( \\hat { \\pmb { x } } _ { { \\pmb { \\lambda } } _ { t _ { i - 1 } } } , \\lambda _ { t _ { i - 1 } } ) \\int _ { \\lambda _ { t _ { i - 1 } } } ^ { \\lambda _ { t _ { i } } } e ^ { - \\lambda } \\frac { ( \\lambda - \\lambda _ { t _ { i - 1 } } ) ^ { n } } { n ! } \\mathrm { d } \\lambda + \\mathcal { O } ( h _ { i } ^ { k + 1 } ) ,\n$$",
663
+ "text_format": "latex",
664
+ "bbox": [
665
+ 181,
666
+ 674,
667
+ 787,
668
+ 718
669
+ ],
670
+ "page_idx": 4
671
+ },
672
+ {
673
+ "type": "text",
674
+ "text": "where the integral $\\begin{array} { r } { \\int e ^ { - \\lambda } \\frac { ( \\lambda - \\lambda _ { t _ { i - 1 } } ) ^ { n } } { n ! } \\mathrm { d } \\lambda } \\end{array}$ can be analytically computed by repeatedly applying $n$ times of integration-by-parts (see Appendix B.2). Therefore, to approximate $\\pmb { x } _ { t _ { i - 1 } t _ { i } }$ , we only need to approximate the $n$ -th order total derivatives $\\hat { \\epsilon } _ { \\theta } ^ { ( n ) } ( \\hat { \\pmb { x } } _ { \\lambda } , \\lambda )$ for $n \\leq k - 1$ , which is a well-studied problem in the ODE literature [31, 32]. By dropping the $\\mathcal { O } ( h _ { i } ^ { k + 1 } )$ error term and approximating the first $( k - 1 )$ -th total derivatives with the “stiff order conditions” [31, 32], we can derive $k$ -th-order ODE solvers for diffusion ODEs. We name such solvers as DPM-Solver overall, and DPM-Solver- $k$ for a specific order $k$ . Here we take $k = 1$ for demonstration. In this case, Eq. (3.6) becomes ",
675
+ "bbox": [
676
+ 173,
677
+ 722,
678
+ 826,
679
+ 833
680
+ ],
681
+ "page_idx": 4
682
+ },
683
+ {
684
+ "type": "equation",
685
+ "img_path": "images/e1a7a77f08fcf2344ebba70e31c391e6092d3781368a0af49fae27dbeb5b255e.jpg",
686
+ "text": "$$\n\\begin{array} { l } { \\displaystyle { \\boldsymbol { x } } _ { t _ { i - 1 } \\to t _ { i } } = \\frac { \\alpha _ { t _ { i } } } { \\alpha _ { t _ { i - 1 } } } \\tilde { \\boldsymbol { x } } _ { t _ { i - 1 } } - \\alpha _ { t _ { i } } \\epsilon _ { \\theta } ( \\tilde { \\boldsymbol { x } } _ { t _ { i - 1 } } , t _ { i - 1 } ) \\int _ { \\lambda _ { t _ { i - 1 } } } ^ { \\lambda _ { t _ { i } } } e ^ { - \\lambda } \\mathrm { d } \\lambda + \\mathcal { O } ( h _ { i } ^ { 2 } ) } \\\\ { \\displaystyle = \\frac { \\alpha _ { t _ { i } } } { \\alpha _ { t _ { i - 1 } } } \\tilde { \\boldsymbol { x } } _ { t _ { i - 1 } } - \\sigma _ { t _ { i } } ( e ^ { h _ { i } } - 1 ) \\epsilon _ { \\theta } ( \\tilde { \\boldsymbol { x } } _ { t _ { i - 1 } } , t _ { i - 1 } ) + \\mathcal { O } ( h _ { i } ^ { 2 } ) . } \\end{array}\n$$",
687
+ "text_format": "latex",
688
+ "bbox": [
689
+ 269,
690
+ 837,
691
+ 728,
692
+ 911
693
+ ],
694
+ "page_idx": 4
695
+ },
696
+ {
697
+ "type": "text",
698
+ "text": "By dropping the high-order error term $\\mathcal { O } ( h _ { i } ^ { 2 } )$ , we can obtain an approximation for $\\pmb { x } _ { t _ { i - 1 } t _ { i } }$ . As $k = 1$ here, we call this solver DPM-Solver- $^ { l }$ , and the detailed algorithm is as following. ",
699
+ "bbox": [
700
+ 171,
701
+ 90,
702
+ 823,
703
+ 119
704
+ ],
705
+ "page_idx": 5
706
+ },
707
+ {
708
+ "type": "text",
709
+ "text": "DPM-Solver-1. Given an initial value $\\mathbf { \\nabla } _ { \\mathbf { x } _ { T } }$ and $M + 1$ time steps $\\{ t _ { i } \\} _ { i = 0 } ^ { M }$ decreasing from $t _ { 0 } = T$ to $t _ { M } = 0$ . Starting with $\\tilde { \\mathbf { x } } _ { t _ { 0 } } = \\mathbf { x } _ { T }$ , the sequence $\\{ \\tilde { { x } } _ { t _ { i } } \\} _ { i = 1 } ^ { M }$ is computed iteratively as follows: ",
710
+ "bbox": [
711
+ 169,
712
+ 125,
713
+ 825,
714
+ 156
715
+ ],
716
+ "page_idx": 5
717
+ },
718
+ {
719
+ "type": "equation",
720
+ "img_path": "images/8deaa6e7603de31da2fd31418b2d224dd8ec375a261d169ca354b6f5b2802791.jpg",
721
+ "text": "$$\n\\tilde { \\boldsymbol { x } } _ { t _ { i } } = \\frac { \\alpha _ { t _ { i } } } { \\alpha _ { t _ { i - 1 } } } \\tilde { \\boldsymbol { x } } _ { t _ { i - 1 } } - \\sigma _ { t _ { i } } ( e ^ { h _ { i } } - 1 ) \\boldsymbol { \\epsilon } _ { \\boldsymbol { \\theta } } ( \\tilde { \\boldsymbol { x } } _ { t _ { i - 1 } } , t _ { i - 1 } ) , \\quad \\mathrm { w h e r e ~ } h _ { i } = \\lambda _ { t _ { i } } - \\lambda _ { t _ { i - 1 } } .\n$$",
722
+ "text_format": "latex",
723
+ "bbox": [
724
+ 243,
725
+ 162,
726
+ 753,
727
+ 194
728
+ ],
729
+ "page_idx": 5
730
+ },
731
+ {
732
+ "type": "text",
733
+ "text": "For $k \\geq 2$ , approximating the first $k$ terms of the Taylor expansion needs additional intermediate points between $t$ and $s$ [31]. The derivation is more technical so we defer it to Appendix B. Below we propose algorithms for $k = 2 , 3$ and name them as DPM-Solver-2 and DPM-Solver-3, respectively. ",
734
+ "bbox": [
735
+ 173,
736
+ 207,
737
+ 825,
738
+ 250
739
+ ],
740
+ "page_idx": 5
741
+ },
742
+ {
743
+ "type": "text",
744
+ "text": "Algorithm 1 DPM-Solver-2. ",
745
+ "text_level": 1,
746
+ "bbox": [
747
+ 174,
748
+ 267,
749
+ 362,
750
+ 281
751
+ ],
752
+ "page_idx": 5
753
+ },
754
+ {
755
+ "type": "text",
756
+ "text": "Require: initial value $\\mathbf { \\nabla } _ { \\mathbf { \\mathcal { X } } T }$ , time steps $\\{ t _ { i } \\} _ { i = 0 } ^ { M }$ , model $\\epsilon _ { \\theta }$ ",
757
+ "bbox": [
758
+ 174,
759
+ 286,
760
+ 544,
761
+ 303
762
+ ],
763
+ "page_idx": 5
764
+ },
765
+ {
766
+ "type": "text",
767
+ "text": "Algorithm 2 DPM-Solver-3. ",
768
+ "text_level": 1,
769
+ "bbox": [
770
+ 174,
771
+ 462,
772
+ 364,
773
+ 476
774
+ ],
775
+ "page_idx": 5
776
+ },
777
+ {
778
+ "type": "text",
779
+ "text": "Require: initial value $\\mathbf { \\nabla } _ { \\mathbf { \\mathcal { X } } T }$ , time steps $\\{ t _ { i } \\} _ { i = 0 } ^ { M }$ , model $\\epsilon _ { \\theta }$ ",
780
+ "bbox": [
781
+ 174,
782
+ 482,
783
+ 544,
784
+ 498
785
+ ],
786
+ "page_idx": 5
787
+ },
788
+ {
789
+ "type": "equation",
790
+ "img_path": "images/ad4609832a6419c85fb2132d9d91d2c95beec92e10bd4907c45b4ed7d6c517e6.jpg",
791
+ "text": "$$\n\\begin{array} { r l } & { \\quad _ { s 2 i - 1 } _ { t _ { \\lambda } } ( \\overline { { \\lambda } } _ { t _ { i - 1 } } + r _ { 1 } h _ { i } ) , \\quad s _ { 2 i } t _ { \\lambda } ( \\lambda _ { t _ { i - 1 } } + r _ { 2 } h _ { i } ) } \\\\ & { u _ { 2 i - 1 } \\frac { \\alpha _ { s _ { 2 i - 1 } } } { \\alpha _ { t _ { i - 1 } } } \\tilde { x } _ { t _ { i - 1 } } - \\sigma _ { s _ { 2 i - 1 } } ( e ^ { r _ { 1 } h _ { i } } - 1 ) \\epsilon _ { \\theta } ( \\tilde { x } _ { t _ { i - 1 } } , t _ { i - 1 } ) } \\\\ & { D _ { 2 i - 1 } \\epsilon _ { \\theta } ( u _ { 2 i - 1 } , s _ { 2 i - 1 } ) - \\epsilon _ { \\theta } ( \\tilde { x } _ { t _ { i - 1 } } , t _ { i - 1 } ) } \\\\ & { u _ { 2 i } \\frac { \\alpha _ { s _ { 2 i } } } { \\alpha _ { t _ { i - 1 } } } \\tilde { x } _ { t _ { i - 1 } } - \\sigma _ { s _ { 2 i } } ( e ^ { r _ { 2 } h _ { i } } - 1 ) \\epsilon _ { \\theta } ( \\tilde { x } _ { t _ { i - 1 } } , t _ { i - 1 } ) - \\frac { \\sigma _ { s _ { 2 i } } r _ { 2 } } { r _ { 1 } } ( \\frac { e ^ { r _ { 2 } h _ { i } } - 1 } { r _ { 2 } h _ { i } } - 1 ) D _ { 2 i - 1 } } \\\\ & { D _ { 2 i } \\epsilon _ { \\theta } ( u _ { 2 i } , s _ { 2 i } ) - \\epsilon _ { \\theta } ( \\tilde { x } _ { t _ { i - 1 } } , t _ { i - 1 } ) } \\\\ & { \\tilde { x } _ { t _ { i } } \\frac { \\alpha _ { t _ { i } } } { \\alpha _ { t _ { i - 1 } } } \\tilde { x } _ { t _ { i - 1 } } - \\sigma _ { t _ { i } } ( e ^ { h _ { i } } - 1 ) \\epsilon _ { \\theta } ( \\tilde { x } _ { t _ { i - 1 } } , t _ { i - 1 } ) - \\frac { \\sigma _ { t _ { i } } } { r _ { 2 } } ( \\frac { e ^ { h _ { i } } - 1 } { h } - 1 ) D _ { 2 i } } \\end{array}\n$$",
792
+ "text_format": "latex",
793
+ "bbox": [
794
+ 222,
795
+ 522,
796
+ 789,
797
+ 645
798
+ ],
799
+ "page_idx": 5
800
+ },
801
+ {
802
+ "type": "text",
803
+ "text": "10: return $\\tilde { \\pmb { x } } _ { t _ { M } }$ ",
804
+ "bbox": [
805
+ 176,
806
+ 655,
807
+ 279,
808
+ 670
809
+ ],
810
+ "page_idx": 5
811
+ },
812
+ {
813
+ "type": "text",
814
+ "text": "Here, $t _ { \\lambda } ( \\cdot )$ is the inverse function of $\\lambda ( t )$ , which has an analytical formulation for the practical noise schedule used in [2, 16], as shown in Appendix D. The chosen intermediate points are $( s _ { i } , \\pmb { u } _ { i } )$ for DPM-Solver-2 and $\\left( s _ { 2 i - 1 } , { \\pmb u } _ { 2 i - 1 } \\right)$ and $( s _ { 2 i } , { \\pmb u } _ { 2 i } )$ for DPM-Solver-3. As shown in the algorithm, DPM-Solver- $k$ requires $k$ function evaluations per step for $k = 1 , 2 , 3$ . Despite the more expensive steps, higher-order solvers $( k = 2 , 3$ ) are usually more efficient since they require much fewer steps to converge, due to their higher convergence order. We show that DPM-Solver- $k$ is $k$ -th-order solver, as stated in the following theorem. The proof is in Appendix B. ",
815
+ "bbox": [
816
+ 173,
817
+ 698,
818
+ 826,
819
+ 796
820
+ ],
821
+ "page_idx": 5
822
+ },
823
+ {
824
+ "type": "text",
825
+ "text": "Theorem 3.2 (DPM-Solver- $k$ as a $k$ -th-order solver). Assume $\\epsilon _ { \\theta } ( x _ { t } , t )$ follows the regularity conditions detailed in Appendix B.1, then for $k = 1 , 2 , 3$ , DPM-Solver- $k$ is a $k$ -th order solver for diffusion ODEs, i.e., for the sequence $\\{ \\tilde { \\pmb { x } } _ { t _ { i } } \\} _ { i = 1 } ^ { M }$ computed by DPM-Solver- $k$ , the approximation error at time 0 satisfies $\\tilde { \\pmb { x } } _ { t _ { M } } - \\pmb { x } _ { 0 } = \\mathcal { O } ( h _ { \\operatorname* { m a x } } ^ { k } )$ , where $h _ { m a x } = \\mathrm { m a x } _ { 1 \\leq i \\leq M } ( \\lambda _ { t _ { i } } - \\lambda _ { t _ { i - 1 } } )$ . ",
826
+ "bbox": [
827
+ 173,
828
+ 800,
829
+ 825,
830
+ 861
831
+ ],
832
+ "page_idx": 5
833
+ },
834
+ {
835
+ "type": "text",
836
+ "text": "Finally, solvers with $k \\geq 4$ need much more intermediate points as shown by previous work [31, 32] for exponential integrators. Therefore, we only consider $k$ from 1 to 3 in this work, while leaving the solvers with higher $k$ for future study. ",
837
+ "bbox": [
838
+ 174,
839
+ 868,
840
+ 825,
841
+ 911
842
+ ],
843
+ "page_idx": 5
844
+ },
845
+ {
846
+ "type": "text",
847
+ "text": "3.3 Step Size Schedule ",
848
+ "text_level": 1,
849
+ "bbox": [
850
+ 174,
851
+ 90,
852
+ 343,
853
+ 106
854
+ ],
855
+ "page_idx": 6
856
+ },
857
+ {
858
+ "type": "text",
859
+ "text": "The proposed solvers in Sec. 3.2 need to specify the time steps $\\{ t _ { i } \\} _ { i = 0 } ^ { M }$ in advance. We propose two choices of the time step schedule. One choice is handcrafted, which is to uniformly split the interval $[ \\lambda _ { T } , \\lambda _ { 0 } ]$ , i.e. $\\begin{array} { r } { \\lambda _ { t _ { i } } = \\dot { \\lambda _ { T } } + \\frac { i } { M } ( \\lambda _ { 0 } - \\lambda _ { T } ) } \\end{array}$ , $i = 0 , \\ldots , M$ . Note that this is different from previous work [2, 3] which chooses uniform steps for $t _ { i }$ . Empirically, DPM-Solver with uniform time steps $\\lambda _ { t _ { i } }$ can already generate quite good samples in few steps, where results are listed in Appendix E. As the other choice, we propose an adaptive step size algorithm, which dynamically adjusts the step size by combining different orders of DPM-Solver. The adaptive algorithm is inspired by [20] and we defer its implementation details to Appendix C. ",
860
+ "bbox": [
861
+ 173,
862
+ 116,
863
+ 825,
864
+ 228
865
+ ],
866
+ "page_idx": 6
867
+ },
868
+ {
869
+ "type": "text",
870
+ "text": "For few-step sampling, we need to use up all the number of function evaluations (NFE). When the NFE is not divisible by 3, we firstly apply DPM-Solver-3 as much as possible, and then add a single step of DPM-Solver-1 or DPM-Solver-2 (dependent on the reminder of $K$ divided by 3), as detailed in Appendix D. In the subsequent experiments, we use such combination of solvers with the uniform step size schedule for $\\mathrm { N F E } \\leq 2 0$ , and otherwise the adaptive step size schedule. ",
871
+ "bbox": [
872
+ 174,
873
+ 233,
874
+ 825,
875
+ 304
876
+ ],
877
+ "page_idx": 6
878
+ },
879
+ {
880
+ "type": "text",
881
+ "text": "3.4 Sampling from Discrete-Time DPMs ",
882
+ "text_level": 1,
883
+ "bbox": [
884
+ 176,
885
+ 320,
886
+ 467,
887
+ 335
888
+ ],
889
+ "page_idx": 6
890
+ },
891
+ {
892
+ "type": "text",
893
+ "text": "Discrete-time DPMs [2] train the noise prediction model at $N$ fixed time steps $\\{ t _ { n } \\} _ { n = 1 } ^ { N }$ , and the noise prediction model is parameterized by $\\tilde { \\epsilon } _ { \\theta } ( { \\boldsymbol x } _ { n } , n )$ for $n = 0 , \\ldots , N - 1$ , where each ${ \\pmb x } _ { n }$ is corresponding to the value at time $t _ { n + 1 }$ . We can transform the discrete-time noise prediction model to the continuous version by letting $\\begin{array} { r } { \\epsilon _ { \\theta } ( x , t ) : = \\tilde { \\epsilon } _ { \\theta } ( x , \\frac { ( N - 1 ) t } { T } ) } \\end{array}$ , for all $\\pmb { x } \\in \\mathbb { R } ^ { d } , t \\in [ 0 , T ]$ . Note that the input time of $\\tilde { \\epsilon } _ { \\theta }$ may not be integers, but we find that the noise prediction model can still work well, and we hypothesize that it is because of the smooth time embeddings (e.g., position embeddings [2]). By such reparameterization, the noise prediction model can adopt the continuous-time steps as input, and thus we can also use DPM-Solver for fast sampling. ",
894
+ "bbox": [
895
+ 173,
896
+ 344,
897
+ 826,
898
+ 460
899
+ ],
900
+ "page_idx": 6
901
+ },
902
+ {
903
+ "type": "text",
904
+ "text": "4 Comparison with Existing Fast Sampling Methods ",
905
+ "text_level": 1,
906
+ "bbox": [
907
+ 174,
908
+ 479,
909
+ 627,
910
+ 498
911
+ ],
912
+ "page_idx": 6
913
+ },
914
+ {
915
+ "type": "text",
916
+ "text": "Here, we discuss the relationship and highlight the difference between DPM-Solver and existing ODE-based fast sampling methods for DPMs. We further briefly discuss the advantage of training-free samplers over those training-based ones. ",
917
+ "bbox": [
918
+ 173,
919
+ 511,
920
+ 825,
921
+ 554
922
+ ],
923
+ "page_idx": 6
924
+ },
925
+ {
926
+ "type": "text",
927
+ "text": "4.1 DDIM as DPM-Solver-1 ",
928
+ "text_level": 1,
929
+ "bbox": [
930
+ 174,
931
+ 570,
932
+ 379,
933
+ 585
934
+ ],
935
+ "page_idx": 6
936
+ },
937
+ {
938
+ "type": "text",
939
+ "text": "Denoising Diffusion Implicit Models (DDIM) [19] design a deterministic method for fast sampling from DPMs. For two adjacent time steps $t _ { i - 1 }$ and $t _ { i }$ , assume that we have a solution $\\tilde { \\boldsymbol { x } } _ { t _ { i - 1 } }$ at time $t _ { i - 1 }$ , then a single step of DDIM from time $t _ { i - 1 }$ to time $t _ { i }$ is ",
940
+ "bbox": [
941
+ 174,
942
+ 595,
943
+ 825,
944
+ 638
945
+ ],
946
+ "page_idx": 6
947
+ },
948
+ {
949
+ "type": "equation",
950
+ "img_path": "images/3ad93903d54c31c8256e52d597943286bbf9fba385901a6d278538f4eb730eed.jpg",
951
+ "text": "$$\n\\tilde { \\pmb { x } } _ { t _ { i } } = \\frac { \\alpha _ { t _ { i } } } { \\alpha _ { t _ { i - 1 } } } \\tilde { \\pmb { x } } _ { t _ { i - 1 } } - \\alpha _ { t _ { i } } \\left( \\frac { \\sigma _ { t _ { i - 1 } } } { \\alpha _ { t _ { i - 1 } } } - \\frac { \\sigma _ { t _ { i } } } { \\alpha _ { t _ { i } } } \\right) \\epsilon _ { \\theta } ( \\tilde { \\pmb { x } } _ { t _ { i - 1 } } , t _ { i - 1 } ) .\n$$",
952
+ "text_format": "latex",
953
+ "bbox": [
954
+ 307,
955
+ 646,
956
+ 691,
957
+ 681
958
+ ],
959
+ "page_idx": 6
960
+ },
961
+ {
962
+ "type": "text",
963
+ "text": "Although motivated by entirely different perspectives, we show that the updates of DPM-Solver-1 and Denoising Diffusion Implicit Models (DDIM) [19] are identical. By the definition of $\\lambda$ , we have $\\frac { \\sigma _ { t _ { i - 1 } } } { \\alpha _ { t _ { i - 1 } } } = e ^ { - \\lambda _ { t _ { i - 1 } } ^ { - } }$ and $\\begin{array} { r } { \\frac { \\sigma _ { t _ { i } } } { \\alpha _ { t _ { i } } } = e ^ { - \\lambda _ { t _ { i } } } } \\end{array}$ . Plugging these and $h _ { i } = \\lambda _ { t _ { i } } - \\lambda _ { t _ { i - 1 } }$ to Eq. (4.1) results in exactly a step of DPM-Solver-1 in Eq. (3.7). However, the semi-linear ODE formulation of DPM-Solver allows for principled generalization to higher-order solvers and convergence order analysis. ",
964
+ "bbox": [
965
+ 174,
966
+ 688,
967
+ 825,
968
+ 765
969
+ ],
970
+ "page_idx": 6
971
+ },
972
+ {
973
+ "type": "text",
974
+ "text": "Recent work [13] also show that DDIM is a first-order discretization of diffusion ODEs by differentiating both sides of Eq. (4.1). However, they cannot explain the difference between DDIM and the first-order Euler discretization of diffusion ODEs. In contrast, by showing that DDIM is a special case of DPM-Solver, we reveal that DDIM makes full use of the semi-linearity of diffusion ODEs, which explains its superiority over traditional Euler methods. ",
975
+ "bbox": [
976
+ 174,
977
+ 770,
978
+ 826,
979
+ 840
980
+ ],
981
+ "page_idx": 6
982
+ },
983
+ {
984
+ "type": "text",
985
+ "text": "4.2 Comparison with Traditional Runge-Kutta Methods ",
986
+ "text_level": 1,
987
+ "bbox": [
988
+ 173,
989
+ 857,
990
+ 576,
991
+ 872
992
+ ],
993
+ "page_idx": 6
994
+ },
995
+ {
996
+ "type": "text",
997
+ "text": "One can obtain a high-order solver by directly applying traditional explicit Runge-Kutta (RK) methods to the diffusion ODE in Eq. (2.7). Specifically, RK methods write the solution of Eq. (2.7) in the ",
998
+ "bbox": [
999
+ 173,
1000
+ 882,
1001
+ 821,
1002
+ 911
1003
+ ],
1004
+ "page_idx": 6
1005
+ },
1006
+ {
1007
+ "type": "table",
1008
+ "img_path": "images/114b9edc4cc71bed7f9d053944dde80589018ddf790160907d7334f50b5c35fb.jpg",
1009
+ "table_caption": [
1010
+ "Table 1: FID ↓ on CIFAR-10 for different orders of Runge-Kutta (RK) methods and DPM-Solvers, varying the number of function evaluations (NFE). For RK methods, we evaluate diffusion ODEs w.r.t. both $t$ (Eq. (2.7)) and $\\lambda$ (Eq. (E.1)). We use uniform step size in $t$ for RK (t), and uniform step size in $\\lambda$ for RK $( \\lambda )$ and DPM-Solvers. "
1011
+ ],
1012
+ "table_footnote": [],
1013
+ "table_body": "<table><tr><td>Sampling method\\NFE</td><td>12</td><td>18</td><td>24</td><td>30</td><td>36</td><td>42</td><td>48</td></tr><tr><td>RK2 (t)</td><td>16.40</td><td>7.25</td><td>3.90</td><td>3.63</td><td>3.58</td><td>3.59</td><td>3.54</td></tr><tr><td>RK2(入)</td><td>107.81</td><td>42.04</td><td>17.71</td><td>7.65</td><td>4.62</td><td>3.58</td><td>3.17</td></tr><tr><td>DPM-Solver-2</td><td>5.28</td><td>3.43</td><td>3.02</td><td>2.85</td><td>2.78</td><td>2.72</td><td>2.69</td></tr><tr><td>RK3 (t)</td><td>48.75</td><td>21.86</td><td>10.90</td><td>6.96</td><td>5.22</td><td>4.56</td><td>4.12</td></tr><tr><td>RK3 (入)</td><td>34.29</td><td>4.90</td><td>3.50</td><td>3.03</td><td>2.85</td><td>2.74</td><td>2.69</td></tr><tr><td>DPM-Solver-3</td><td>6.03</td><td>2.90</td><td>2.75</td><td>2.70</td><td>2.67</td><td>2.65</td><td>2.65</td></tr></table>",
1014
+ "bbox": [
1015
+ 238,
1016
+ 137,
1017
+ 754,
1018
+ 247
1019
+ ],
1020
+ "page_idx": 7
1021
+ },
1022
+ {
1023
+ "type": "text",
1024
+ "text": "following integral form: ",
1025
+ "bbox": [
1026
+ 174,
1027
+ 275,
1028
+ 333,
1029
+ 290
1030
+ ],
1031
+ "page_idx": 7
1032
+ },
1033
+ {
1034
+ "type": "equation",
1035
+ "img_path": "images/dbc1e1d3bec4cc742d44654340bd9da788aefebc8fc4b4e2a9e38d739f018ceb.jpg",
1036
+ "text": "$$\n{ \\bf { x } } _ { t } = { \\bf { x } } _ { s } + \\int _ { s } ^ { t } h _ { \\theta } ( { \\bf { x } } _ { \\tau } , \\tau ) \\mathrm { { d } } \\tau = { \\bf { x } } _ { s } + \\int _ { s } ^ { t } \\left( f ( \\tau ) { \\bf { x } } _ { \\tau } + \\frac { g ^ { 2 } ( \\tau ) } { 2 \\sigma _ { \\tau } } \\epsilon _ { \\theta } ( { \\bf { x } } _ { \\tau } , \\tau ) \\right) \\mathrm { { d } } \\tau ,\n$$",
1037
+ "text_format": "latex",
1038
+ "bbox": [
1039
+ 251,
1040
+ 297,
1041
+ 745,
1042
+ 334
1043
+ ],
1044
+ "page_idx": 7
1045
+ },
1046
+ {
1047
+ "type": "text",
1048
+ "text": "and use some intermediate time steps between $[ t , s ]$ and combine the evaluations of $h _ { \\theta }$ at these time steps to approximate the whole integral. The approximation error of explicit RK methods depends on $h _ { \\theta }$ , which consists of the error corresponding to both the linear term $f ( \\tau ) x _ { \\tau }$ and the nonlinear noise prediction model $\\epsilon _ { \\theta }$ . However, the error of the linear term may increase exponentially because the exact solution of the linear term has an exponential coefficient (as shown in Eq. (3.1)). There are many empirical evidence [25, 31] showing that directly using explicit RK methods for semi-linear ODEs may suffer from unstable numerical issues for large step size. We also demonstrate the empirical difference of the proposed DPM-Solver and the traditional explicit RK methods in Sec. 5.1, which shows that DPM-Solver have smaller discretization errors than the RK methods with the same order. ",
1049
+ "bbox": [
1050
+ 173,
1051
+ 342,
1052
+ 825,
1053
+ 467
1054
+ ],
1055
+ "page_idx": 7
1056
+ },
1057
+ {
1058
+ "type": "text",
1059
+ "text": "4.3 Training-based Fast Sampling Methods for DPMs ",
1060
+ "text_level": 1,
1061
+ "bbox": [
1062
+ 173,
1063
+ 484,
1064
+ 560,
1065
+ 501
1066
+ ],
1067
+ "page_idx": 7
1068
+ },
1069
+ {
1070
+ "type": "text",
1071
+ "text": "Samplers that need extra training or optimization include knowledge distillation [13, 14], learning the noise level or variance [15, 16, 33], and learning the noise schedule or sample trajectory [17, 18]. Although the progressive distillation method [13] can obtain a fast sampler within 4 steps, it needs further training costs and loses part of the information in the original DPM (e.g., after distillation, the noise prediction model cannot predict the noise (score function) at every time step between $[ 0 , T ] )$ . In contrast, training-free samplers can keep all the information of the original model, and thereby can be directly extended to the conditional sampling by combining the original model and an external classifier [4] (e.g. see Appendix D for the conditional sampling with classifier guidance). ",
1072
+ "bbox": [
1073
+ 173,
1074
+ 511,
1075
+ 826,
1076
+ 622
1077
+ ],
1078
+ "page_idx": 7
1079
+ },
1080
+ {
1081
+ "type": "text",
1082
+ "text": "Beyond directly designing fast samplers for DPMs, several works also propose novel types of DPMs which supports faster sampling. For instance, defining a low-dimensional latent variable for DPMs [34]; designing special diffusion processes with bounded score functions [35]; combining GANs with the reverse process of DPMs [36]. The proposed DPM-Solver may also be suitable for accelerating the sampling of these DPMs, and we leave them for future work. ",
1083
+ "bbox": [
1084
+ 174,
1085
+ 628,
1086
+ 825,
1087
+ 698
1088
+ ],
1089
+ "page_idx": 7
1090
+ },
1091
+ {
1092
+ "type": "text",
1093
+ "text": "5 Experiments ",
1094
+ "text_level": 1,
1095
+ "bbox": [
1096
+ 174,
1097
+ 719,
1098
+ 312,
1099
+ 737
1100
+ ],
1101
+ "page_idx": 7
1102
+ },
1103
+ {
1104
+ "type": "text",
1105
+ "text": "In this section, we show that as a training-free sampler, DPM-Solver can greatly speedup the sampling of existing pre-trained DPMs, including both continuous-time and discrete-time ones, with both linear noise schedule [2, 19] and cosine noise schedule [16]. We vary different number of function evaluations (NFE) which is the number of calls to the noise prediction model $\\epsilon _ { \\theta } ( x _ { t } , t )$ , and compare the sample quality between DPM-Solver and other methods. For each experiment, We draw 50K samples and use the widely adopted FID score [37] to evaluate the sample quality, where lower FID usually implies better sample quality. ",
1106
+ "bbox": [
1107
+ 174,
1108
+ 752,
1109
+ 825,
1110
+ 849
1111
+ ],
1112
+ "page_idx": 7
1113
+ },
1114
+ {
1115
+ "type": "text",
1116
+ "text": "Unless explicitly mentioned, we always use the solver combination with the uniform step size schedule in Sec. 3.3 if the NFE budget is less than 20, and otherwise the DPM-Solver-3 with the adaptive step size schedule in Sec. 3.3. We refer to Appendix D for other implementation details of DPM-Solver and Appendix E for detailed settings. ",
1117
+ "bbox": [
1118
+ 176,
1119
+ 856,
1120
+ 825,
1121
+ 911
1122
+ ],
1123
+ "page_idx": 7
1124
+ },
1125
+ {
1126
+ "type": "image",
1127
+ "img_path": "images/4e1bcabdec913d95ec9ff692dca4450fca481c16e793a3c86ffe1cf469e22305.jpg",
1128
+ "image_caption": [
1129
+ "Figure 2: Sample quality measured by FID $\\downarrow$ of different sampling methods for DPMs on CIFAR-10 with both continuous-time and discrete-time models, CelebA 64x64, ImageNet 64x64, ImageNet $1 2 8 \\mathrm { x } 1 2 8$ and LSUN bedroom $2 5 6 \\times 2 5 6$ with discrete-time models, varying the number of function evaluations (NFE). The method $^ { \\dag } { \\bf G } { \\bf G } { \\bf D } { \\bf M }$ [18] needs extra training to optimize the sample trajectory, while other methods are training-free. To get the strongest baseline, we use the quadratic step size for DDIM on CelebA, which has a better FID than that of the uniform step size in the original paper [19]. "
1130
+ ],
1131
+ "image_footnote": [],
1132
+ "bbox": [
1133
+ 179,
1134
+ 87,
1135
+ 816,
1136
+ 364
1137
+ ],
1138
+ "page_idx": 8
1139
+ },
1140
+ {
1141
+ "type": "text",
1142
+ "text": "5.1 Comparison with Continuous-Time Sampling Methods ",
1143
+ "text_level": 1,
1144
+ "bbox": [
1145
+ 174,
1146
+ 462,
1147
+ 594,
1148
+ 477
1149
+ ],
1150
+ "page_idx": 8
1151
+ },
1152
+ {
1153
+ "type": "text",
1154
+ "text": "We firstly compare DPM-Solver with other continuous-time sampling methods for DPMs. The compared methods include the Euler-Maruyama discretization for diffusion SDEs [3], the adaptive step size solver for diffusion SDEs [20] and the RK methods for diffusion ODEs [3, 28] in Eq. (2.7). We compare these methods for sampling from a pre-trained continuous-time “VP deep” model [3] on the CIFAR-10 dataset [29] with the linear noise schedule. ",
1155
+ "bbox": [
1156
+ 174,
1157
+ 489,
1158
+ 825,
1159
+ 559
1160
+ ],
1161
+ "page_idx": 8
1162
+ },
1163
+ {
1164
+ "type": "text",
1165
+ "text": "Fig. 2a shows the efficiency of compared solvers. We use uniform time steps with 50, 200, 1000 NFE for the diffusion SDE with Euler discretization, and vary the tolerance hyperparameter [3, 20] for the adaptive step size SDE solver [20] and RK45 ODE solver [28] to control the NFE. DPM-Solver can generate good sample quality within around 10 NFE, while other solvers have large discretization error even in 50 NFE, which shows that DPM-Solver can achieve ${ \\sim } 5 $ speedup of the previous best solver. In particular, we achieve 4.70 FID with 10 NFE, 3.75 FID with 12 NFE, 3.24 FID with 15 NFE, and 2.87 FID with 20 NFE, which is the fastest sampler on CIFAR-10. ",
1166
+ "bbox": [
1167
+ 174,
1168
+ 565,
1169
+ 825,
1170
+ 662
1171
+ ],
1172
+ "page_idx": 8
1173
+ },
1174
+ {
1175
+ "type": "text",
1176
+ "text": "As an ablation study, we also compare the second-order and third-order DPM-Solver and RK methods, as shown in Table 1. We compare RK methods for diffusion ODEs w.r.t. both time $t$ in Eq. (2.7) and half-log-SNR $\\lambda$ by applying change-of-variable (see detailed formulations in Appendix E.1). The results show that given the same NFE, the sample quality of DPM-Solver is consistently better than RK methods with the same order. The superior efficiency of DPM-Solver is particularly evident in the few-step regime under 15 NFE, where RK methods have rather large discretization errors. This is mainly because DPM-Solver analytically computes the linear term, avoiding the corresponding discretization error. Besides, the higher order DPM-Solver-3 converges faster than DPM-Solver-2, which matches the order analysis in Theorem 3.2. ",
1177
+ "bbox": [
1178
+ 174,
1179
+ 669,
1180
+ 825,
1181
+ 792
1182
+ ],
1183
+ "page_idx": 8
1184
+ },
1185
+ {
1186
+ "type": "text",
1187
+ "text": "5.2 Comparison with Discrete-Time Sampling Methods ",
1188
+ "text_level": 1,
1189
+ "bbox": [
1190
+ 173,
1191
+ 814,
1192
+ 570,
1193
+ 829
1194
+ ],
1195
+ "page_idx": 8
1196
+ },
1197
+ {
1198
+ "type": "text",
1199
+ "text": "We use the method in Sec. 3.4 for using DPM-Solver in discrete-time DPMs, and then compare DPM-Solver with other discrete-time training-free samplers, including DDPM [2], DDIM [19], Analytic-DDPM [21], Analytic-DDIM [21], PNDM [22], FastDPM [38] and Itô-Taylor [24]. We also compare with GGDM [18], which uses the same pre-trained model but needs further training for the sampling trajectory. We compare the sample quality by varying NFE from 10 to 1000. ",
1200
+ "bbox": [
1201
+ 174,
1202
+ 842,
1203
+ 825,
1204
+ 911
1205
+ ],
1206
+ "page_idx": 8
1207
+ },
1208
+ {
1209
+ "type": "text",
1210
+ "text": "Specifically, we use the discrete-time model trained by $L _ { \\mathrm { s i m p l e } }$ in [2] on the CIFAR-10 dataset with linear noise schedule; the discrete-time model in [19] on CelebA 64x64 [39] with linear noise schedule; the discrete-time model trained by $L _ { \\mathrm { h y b r i d } }$ in [16] on ImageNet 64x64 [26] with cosine noise schedule; the discrete-time model with classifier guidance in [4] on ImageNet 128x128 [26] with linear noise schedule; the discrete-time model in [4] on LSUN bedroom $2 5 6 \\times 2 5 6$ [40] with linear noise schedule. For the models trained on ImageNet, we only use their “mean” model and omit the “variance” model. As shown in Fig. 2, on all datasets, DPM-Solver can obtain reasonable samples within 12 steps (FID 4.65 on CIFAR-10, FID 3.71 on CelebA 64x64 and FID 19.97 on ImageNet 64x64, FID 4.08 on ImageNet $1 2 8 \\mathbf { x } 1 2 8 _ { \\rho }$ ), which is $4 \\sim 1 6 \\times$ faster than the previous fastest training-free sampler. DPM-Solver even outperforms GGDM, which requires additional training. ",
1211
+ "bbox": [
1212
+ 173,
1213
+ 90,
1214
+ 825,
1215
+ 229
1216
+ ],
1217
+ "page_idx": 9
1218
+ },
1219
+ {
1220
+ "type": "text",
1221
+ "text": "6 Conclusions ",
1222
+ "text_level": 1,
1223
+ "bbox": [
1224
+ 174,
1225
+ 251,
1226
+ 305,
1227
+ 267
1228
+ ],
1229
+ "page_idx": 9
1230
+ },
1231
+ {
1232
+ "type": "text",
1233
+ "text": "We tackle the problem of fast and training-free sampling from DPMs. We propose DPM-Solver, a fast dedicated training-free solver of diffusion ODEs for fast sampling of DPMs in around 10 steps of function evaluations. DPM-Solver leverages the semi-linearity of diffusion ODEs and it directly approximates a simplified formulation of exact solutions of diffusion ODEs, which consists of an exponentially weighted integral of the noise prediction model. Inspired by numerical methods for exponential integrators, we propose first-order, second-order and third-order DPMSolver to approximate the exponentially weighted integral of noise prediction models with theoretical convergence guarantee. We propose both handcrafted and adaptive step size schedule, and apply DPM-Solver for both continuous-time and discrete-time DPMs. Our experimental results show that DPM-Solver can generate high-quality samples in around 10 function evaluations on various datasets, and it can achieve $4 \\sim 1 6 \\times$ speedup compared with previous state-of-the-art training-free samplers. ",
1234
+ "bbox": [
1235
+ 174,
1236
+ 282,
1237
+ 825,
1238
+ 435
1239
+ ],
1240
+ "page_idx": 9
1241
+ },
1242
+ {
1243
+ "type": "text",
1244
+ "text": "Limitations and broader impact Despite the promising speedup performance, DPM-Solver is designed for fast sampling, which may be not suitable for accelerating the likelihood evaluations of DPMs. Besides, compared to the commonly-used GANs, diffusion models with DPM-Solver are still not fast enough for real-time applications. In addition, like other deep generative models, DPMs may be used to generate adverse fake contents, and the proposed solver may further amplify the potential undesirable influence of deep generative models for malicious applications. ",
1245
+ "bbox": [
1246
+ 174,
1247
+ 440,
1248
+ 825,
1249
+ 525
1250
+ ],
1251
+ "page_idx": 9
1252
+ },
1253
+ {
1254
+ "type": "text",
1255
+ "text": "Acknowledgements ",
1256
+ "text_level": 1,
1257
+ "bbox": [
1258
+ 176,
1259
+ 545,
1260
+ 338,
1261
+ 561
1262
+ ],
1263
+ "page_idx": 9
1264
+ },
1265
+ {
1266
+ "type": "text",
1267
+ "text": "This work was supported by National Key Research and Development Project of China (No. 2021ZD0110502); NSF of China Projects (Nos. 62061136001, 61620106010, 62076145, U19B2034, U1811461, U19A2081, 6197222, 62106120); Beijing NSF Project (No. JQ19016); Beijing Outstanding Young Scientist Program NO. BJJWZYJH012019100020098; a grant from Tsinghua Institute for Guo Qiang; the NVIDIA NVAIL Program with GPU/DGX Acceleration; the High Performance Computing Center, Tsinghua University; the Fundamental Research Funds for the Central Universities, and the Research Funds of Renmin University of China (22XNKJ13). J.Z is also supported by the XPlorer Prize. ",
1268
+ "bbox": [
1269
+ 174,
1270
+ 577,
1271
+ 826,
1272
+ 688
1273
+ ],
1274
+ "page_idx": 9
1275
+ },
1276
+ {
1277
+ "type": "text",
1278
+ "text": "References ",
1279
+ "text_level": 1,
1280
+ "bbox": [
1281
+ 174,
1282
+ 710,
1283
+ 266,
1284
+ 726
1285
+ ],
1286
+ "page_idx": 9
1287
+ },
1288
+ {
1289
+ "type": "text",
1290
+ "text": "[1] J. Sohl-Dickstein, E. Weiss, N. Maheswaranathan, and S. Ganguli, “Deep unsupervised learning using nonequilibrium thermodynamics,” in International Conference on Machine Learning. PMLR, 2015, pp. 2256–2265. \n[2] J. Ho, A. Jain, and P. Abbeel, “Denoising diffusion probabilistic models,” in Advances in Neural Information Processing Systems, vol. 33, 2020, pp. 6840–6851. \n[3] Y. Song, J. Sohl-Dickstein, D. P. Kingma, A. Kumar, S. Ermon, and B. Poole, “Score-based generative modeling through stochastic differential equations,” in International Conference on Learning Representations, 2021. \n[4] P. Dhariwal and A. Q. Nichol, “Diffusion models beat GANs on image synthesis,” in Advances in Neural Information Processing Systems, vol. 34, 2021, pp. 8780–8794. \n[5] C. Meng, Y. Song, J. Song, J. Wu, J.-Y. Zhu, and S. Ermon, “SDEdit: Image synthesis and editing with stochastic differential equations,” in International Conference on Learning Representations, 2022. \n[6] J. Ho, T. Salimans, A. Gritsenko, W. Chan, M. Norouzi, and D. J. Fleet, “Video diffusion models,” arXiv preprint arXiv:2204.03458, 2022. \n[7] A. Ramesh, P. Dhariwal, A. Nichol, C. Chu, and M. Chen, “Hierarchical text-conditional image generation with CLIP latents,” arXiv preprint arXiv:2204.06125, 2022. \n[8] N. Chen, Y. Zhang, H. Zen, R. J. Weiss, M. Norouzi, and W. Chan, “Wavegrad: Estimating gradients for waveform generation,” in International Conference on Learning Representations, 2021. \n[9] N. Chen, Y. Zhang, H. Zen, R. J. Weiss, M. Norouzi, N. Dehak, and W. Chan, “Wavegrad 2: Iterative refinement for text-to-speech synthesis,” in International Speech Communication Association, 2021, pp. 3765–3769. \n[10] D. P. Kingma, T. Salimans, B. Poole, and J. Ho, “Variational diffusion models,” in Advances in Neural Information Processing Systems, 2021. \n[11] I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. C. Courville, and Y. Bengio, “Generative adversarial nets,” in Advances in Neural Information Processing Systems, vol. 27, 2014, pp. 2672–2680. \n[12] D. P. Kingma and M. Welling, “Auto-encoding variational bayes,” in International Conference on Learning Representations, 2014. \n[13] T. Salimans and J. Ho, “Progressive distillation for fast sampling of diffusion models,” in International Conference on Learning Representations, 2022. \n[14] E. Luhman and T. Luhman, “Knowledge distillation in iterative generative models for improved sampling speed,” arXiv preprint arXiv:2101.02388, 2021. \n[15] R. San-Roman, E. Nachmani, and L. Wolf, “Noise estimation for generative diffusion models,” arXiv preprint arXiv:2104.02600, 2021. \n[16] A. Q. Nichol and P. Dhariwal, “Improved denoising diffusion probabilistic models,” in International Conference on Machine Learning. PMLR, 2021, pp. 8162–8171. \n[17] M. W. Lam, J. Wang, R. Huang, D. Su, and D. Yu, “Bilateral denoising diffusion models,” arXiv preprint arXiv:2108.11514, 2021. \n[18] D. Watson, W. Chan, J. Ho, and M. Norouzi, “Learning fast samplers for diffusion models by differentiating through sample quality,” in International Conference on Learning Representations, 2022. \n[19] J. Song, C. Meng, and S. Ermon, “Denoising diffusion implicit models,” in International Conference on Learning Representations, 2021. \n[20] A. Jolicoeur-Martineau, K. Li, R. Piché-Taillefer, T. Kachman, and I. Mitliagkas, “Gotta go fast when generating data with score-based models,” arXiv preprint arXiv:2105.14080, 2021. \n[21] F. Bao, C. Li, J. Zhu, and B. Zhang, “Analytic-DPM: An analytic estimate of the optimal reverse variance in diffusion probabilistic models,” in International Conference on Learning Representations, 2022. \n[22] L. Liu, Y. Ren, Z. Lin, and Z. Zhao, “Pseudo numerical methods for diffusion models on manifolds,” in International Conference on Learning Representations, 2022. \n[23] V. Popov, I. Vovk, V. Gogoryan, T. Sadekova, M. Kudinov, and J. Wei, “Diffusion-based voice conversion with fast maximum likelihood sampling scheme,” in International Conference on Learning Representations, 2022. \n[24] H. Tachibana, M. Go, M. Inahara, Y. Katayama, and Y. Watanabe, “Itô-Taylor sampling scheme for denoising diffusion probabilistic models using ideal derivatives,” arXiv preprint arXiv:2112.13339, 2021. \n[25] M. Hochbruck and A. Ostermann, “Exponential integrators,” Acta Numerica, vol. 19, pp. 209–286, 2010. \n[26] J. Deng, W. Dong, R. Socher, L. Li, K. Li, and L. Fei-Fei, “ImageNet: A large-scale hierarchical image database,” in 2009 IEEE Conference on Computer Vision and Pattern Recognition. IEEE, 2009, pp. 248–255. \n[27] P. E. Kloeden and E. Platen, Numerical Solution of Stochastic Differential Equations. Springer, 1992. \n[28] J. R. Dormand and P. J. Prince, “A family of embedded Runge-Kutta formulae,” Journal of computational and applied mathematics, vol. 6, no. 1, pp. 19–26, 1980. \n[29] A. Krizhevsky, “Learning multiple layers of features from tiny images,” Tech. Rep., 2009. \n[30] K. Atkinson, W. Han, and D. E. Stewart, Numerical solution of ordinary differential equations. John Wiley & Sons, 2011, vol. 108. \n[31] M. Hochbruck and A. Ostermann, “Explicit exponential Runge-Kutta methods for semilinear parabolic problems,” SIAM Journal on Numerical Analysis, vol. 43, no. 3, pp. 1069–1090, 2005. \n[32] V. T. Luan, “Efficient exponential Runge-Kutta methods of high order: Construction and implementation,” BIT Numerical Mathematics, vol. 61, no. 2, pp. 535–560, 2021. \n[33] F. Bao, C. Li, J. Sun, J. Zhu, and B. Zhang, “Estimating the optimal covariance with imperfect mean in diffusion probabilistic models,” arXiv preprint arXiv:2206.07309, 2022. \n[34] A. Vahdat, K. Kreis, and J. Kautz, “Score-based generative modeling in latent space,” in Advances in Neural Information Processing Systems, vol. 34, 2021, pp. 11 287–11 302. \n[35] T. Dockhorn, A. Vahdat, and K. Kreis, “Score-based generative modeling with critically-damped Langevin diffusion,” in International Conference on Learning Representations, 2022. \n[36] Z. Xiao, K. Kreis, and A. Vahdat, “Tackling the generative learning trilemma with denoising diffusion GANs,” in International Conference on Learning Representations, 2022. \n[37] M. Heusel, H. Ramsauer, T. Unterthiner, B. Nessler, and S. Hochreiter, “GANs trained by a two time-scale update rule converge to a local Nash equilibrium,” in Advances in Neural Information Processing Systems, I. Guyon, U. von Luxburg, S. Bengio, H. M. Wallach, R. Fergus, S. V. N. Vishwanathan, and R. Garnett, Eds., vol. 30, 2017, pp. 6626–6637. \n[38] Z. Kong and W. Ping, “On fast sampling of diffusion probabilistic models,” arXiv preprint arXiv:2106.00132, 2021. \n[39] Z. Liu, P. Luo, X. Wang, and X. Tang, “Deep learning face attributes in the wild,” in Proceedings of the IEEE International Conference on Computer Vision, 2015, pp. 3730–3738. \n[40] F. Yu, A. Seff, Y. Zhang, S. Song, T. Funkhouser, and J. Xiao, “LSUN: Construction of a large-scale image dataset using deep learning with humans in the loop,” arXiv preprint arXiv:1506.03365, 2015. \n[41] Y. Song, C. Durkan, I. Murray, and S. Ermon, “Maximum likelihood training of score-based diffusion models,” in Advances in Neural Information Processing Systems, vol. 34, 2021, pp. 1415–1428. \n[42] K. Yang, J. Yau, L. Fei-Fei, J. Deng, and O. Russakovsky, “A study of face obfuscation in ImageNet,” arXiv preprint arXiv:2103.06191, 2021. ",
1291
+ "bbox": [
1292
+ 179,
1293
+ 734,
1294
+ 826,
1295
+ 911
1296
+ ],
1297
+ "page_idx": 9
1298
+ },
1299
+ {
1300
+ "type": "text",
1301
+ "text": "",
1302
+ "bbox": [
1303
+ 171,
1304
+ 65,
1305
+ 828,
1306
+ 916
1307
+ ],
1308
+ "page_idx": 10
1309
+ },
1310
+ {
1311
+ "type": "text",
1312
+ "text": "",
1313
+ "bbox": [
1314
+ 171,
1315
+ 64,
1316
+ 828,
1317
+ 907
1318
+ ],
1319
+ "page_idx": 11
1320
+ },
1321
+ {
1322
+ "type": "text",
1323
+ "text": "Checklist ",
1324
+ "text_level": 1,
1325
+ "bbox": [
1326
+ 174,
1327
+ 89,
1328
+ 254,
1329
+ 106
1330
+ ],
1331
+ "page_idx": 12
1332
+ },
1333
+ {
1334
+ "type": "text",
1335
+ "text": "1. For all authors... ",
1336
+ "bbox": [
1337
+ 214,
1338
+ 116,
1339
+ 339,
1340
+ 130
1341
+ ],
1342
+ "page_idx": 12
1343
+ },
1344
+ {
1345
+ "type": "text",
1346
+ "text": "(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] \n(b) Did you describe the limitations of your work? [Yes] See section 6. \n(c) Did you discuss any potential negative societal impacts of your work? [Yes] See section 6. \n(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] ",
1347
+ "bbox": [
1348
+ 238,
1349
+ 135,
1350
+ 825,
1351
+ 239
1352
+ ],
1353
+ "page_idx": 12
1354
+ },
1355
+ {
1356
+ "type": "text",
1357
+ "text": "2. If you are including theoretical results... ",
1358
+ "bbox": [
1359
+ 214,
1360
+ 243,
1361
+ 493,
1362
+ 258
1363
+ ],
1364
+ "page_idx": 12
1365
+ },
1366
+ {
1367
+ "type": "text",
1368
+ "text": "(a) Did you state the full set of assumptions of all theoretical results? [Yes] See Appendix B. (b) Did you include complete proofs of all theoretical results? [Yes] See Appendix B. ",
1369
+ "bbox": [
1370
+ 238,
1371
+ 262,
1372
+ 825,
1373
+ 308
1374
+ ],
1375
+ "page_idx": 12
1376
+ },
1377
+ {
1378
+ "type": "text",
1379
+ "text": "3. If you ran experiments... ",
1380
+ "bbox": [
1381
+ 214,
1382
+ 311,
1383
+ 393,
1384
+ 325
1385
+ ],
1386
+ "page_idx": 12
1387
+ },
1388
+ {
1389
+ "type": "text",
1390
+ "text": "(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] Code is attached in the supplemental materials, with the appendix. \n(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] Our method is training-free. But we also report the hyperparameters for evaluations used in our proposed solver. \n(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] We observe that the standard deviation of the FID evaluations of DPM-Solver are rather small (mainly less than 0.01) because the FID is already averaged over 50K samples, following existing work [18, 20, 21]. The small standard deviation does not change the conclusion. \n(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] The GPU type and amount is detailed in Appendix E. ",
1391
+ "bbox": [
1392
+ 238,
1393
+ 332,
1394
+ 825,
1395
+ 531
1396
+ ],
1397
+ "page_idx": 12
1398
+ },
1399
+ {
1400
+ "type": "text",
1401
+ "text": "4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... ",
1402
+ "bbox": [
1403
+ 207,
1404
+ 536,
1405
+ 823,
1406
+ 551
1407
+ ],
1408
+ "page_idx": 12
1409
+ },
1410
+ {
1411
+ "type": "text",
1412
+ "text": "(a) If your work uses existing assets, did you cite the creators? [Yes] \n(b) Did you mention the license of the assets? [Yes] See Appendix E \n(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] We include our code in the supplemental materials. \n(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [No] All of the datasets used in the experiments are publicly available. \n(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] We mentioned the human privacy issues of the ImageNet dataset in Appendix E. ",
1413
+ "bbox": [
1414
+ 238,
1415
+ 555,
1416
+ 825,
1417
+ 689
1418
+ ],
1419
+ "page_idx": 12
1420
+ },
1421
+ {
1422
+ "type": "text",
1423
+ "text": "5. If you used crowdsourcing or conducted research with human subjects... ",
1424
+ "bbox": [
1425
+ 214,
1426
+ 694,
1427
+ 705,
1428
+ 708
1429
+ ],
1430
+ "page_idx": 12
1431
+ },
1432
+ {
1433
+ "type": "text",
1434
+ "text": "(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] \n(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] \n(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] ",
1435
+ "bbox": [
1436
+ 238,
1437
+ 712,
1438
+ 825,
1439
+ 801
1440
+ ],
1441
+ "page_idx": 12
1442
+ }
1443
+ ]
parse/dev/2uAaGwlP_V/2uAaGwlP_V_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/2uAaGwlP_V/2uAaGwlP_V_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/401LFvBGIb/401LFvBGIb.md ADDED
@@ -0,0 +1,308 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Deep feedforward functionality by equilibrium-point control in a shallow recurrent network
2
+
3
+ Anonymous Author(s)
4
+ Affiliation
5
+ Address
6
+ email
7
+
8
+ # Abstract
9
+
10
+ Recurrent neural network based machine learning systems are typically employed for their sequential functionality in handling time-varying signals, such as for speech processing. However, neurobiologists find recurrent connections in the vision system and debate about equilibrium-point control in the motor system. Thus, we need a deeper understanding of how recurrent dynamics can be exploited to attain combinational stable-input stable-output functionality. Here, we study how a simplified Cohen-Grossberg neural network model can realize combinational multi-input Boolean functionality. We place our problem within the discipline of algebraic geometry, and solve a special case of it using piecewise-linear algebra. We demonstrate a connectance-efficient realization of the parity function as a proof-of-concept. Small-scale systems of this kind can be easily built, say for hobby robotics, as a network of two-terminal devices of resistors and tunnel diodes. Large-scale systems may be energy-efficiently built as an interconnected network of multi-electrode nanoclusters with non-monotonic transport mechanisms.
11
+
12
+ # 15 1 Introduction
13
+
14
+ 16 Shallow recurrent neural networks are being investigated for more context-aware object recognition
15
+ 17 [25] and brain-like behaviour [23]. They can be more compact (by trading space for time) and are a
16
+ 18 naturally robust alternative to deep neural networks (which are easily fooled by input perturbations
17
+ 19 or transformations [18, 29, 1]) when the role of recurrent dynamics is not to produce time-varying
18
+ 20 output but instead to produce transient (hidden) state-dynamics that facilitate deep, robust and
19
+ 21 transformation-invariant fixed-input fixed-output functionality. To better engineer such dynamics,
20
+ 22 we shall study equilibrium-point control, which can be defined as the process of steering to a target
21
+ 23 in state-space by fixing the input signal, instead of driving it by a continuously varying input signal.
22
+ 24 Historically, equilibrium-point control [14, 5] was first formulated to provide a plausible solution
23
+ 25 to the degrees of freedom problem in motor control [3], that is, we mentally represent intermediate
24
+ 26 destination points rather than a continuum of velocity information required to execute a movement.
25
+ 27 Here, we shall focus on using equilibrium-point control to realize multi-input Boolean functionality,
26
+ 28 in particular the parity function, which is a canonical proxy for nonlinear classification. Theoretical
27
+ 29 results in circuit complexity are known already for realizing Boolean functionality out of feedforward
28
+ 30 neural networks, with weighted-sum thresholded binary-output neurons [35]. It has been shown that
29
+ 31 arbitrary $N$ -input Boolean functions can be realized in depth-3 feedforward networks with fewer
30
+ 32 neurons $( m = \mathcal { O } ( 2 ^ { N / 2 } )$ instead of the $\mathcal { O } ( 2 ^ { N } )$ in total required for depth-2). However, with the
31
+ 33 advent of nanoelectronics, the size of an artificial neuron has been downscaled to such an extent
32
+ 34 that it is rather the interconnect wiring that now occupies a greater area in chip design. Thus for a
33
+ 35 fully-connected deep network, the area scales as the number of interconnects $\dot { m ^ { 2 } } = \mathcal { \bar { O } } ( 2 ^ { N } )$ . Such a
34
+ 36 $\mathcal { O } ( 2 ^ { N } )$ scaling law was earlier obtained by Shannon [34] for realizing arbitrary $N$ -input Boolean
35
+ 37 functions by an interconnection of input-controlled switches (or equivalently a feedforward network
36
+ 38 of 2-input Boolean gates). Thus, unless we employ higher-order neurons [16], we can say that
37
+ 39 a Shannon bottleneck limits the maximum $N$ -input Boolean logic realizable in a given area by
38
+ 40 (nanoscale) feedforward networks. We aim to circumvent this Shannon bottleneck by employing
39
+ 41 recurrent physical networks. It is known that certain combinational logic functions can be realized
40
+ 42 by fewer logic gates in a cyclic network than in an acyclic network [31], and with analog signal
41
+ 43 processing the improvement factor could be even higher.
42
+ 44 In the following section, we introduce a state-space model formalism to study equilibrium-point
43
+ 45 control, and commit to a physically realizable model, and discuss how a general solution for its
44
+ 46 equilibrium points is a difficult problem in algebraic geometry. Thus, we proceed to idealize the non
45
+ 47 monotonic output of the physical system as a piecewise-linear function and solve for the equilibrium
46
+ 48 points. Finally, a piecewise-quadratic Lyapunov function is obtained for stability analysis and
47
+ 49 conditions for a unique equilibrium-point are provided.
48
+ 50 After the theory, in the results section, we provide a connectance-efficient realization of the parity
49
+ 51 function. The discussion section puts our results into a broader context and offers avenues for further
50
+ 52 research. Our objective here is to work at the intersection of nonlinear dynamical systems, neural
51
+ 53 networks, unconventional neuromorphic hardware, cyclic Boolean circuits, piecewise-linear control
52
+ 54 systems, and algebraic geometry.
53
+
54
+ # 2 Theory
55
+
56
+ # 2.1 State-space model
57
+
58
+ For equilibrium-point control, in general we have an input vector $_ { \textbf { \em x } }$ , a state $s _ { i } ( t )$ for $i = 1 : N$ , and an output $y$ obtained from a system of equations
59
+
60
+ $$
61
+ \dot { s } _ { i } ( t ) = F _ { i } ( \pmb { s } ( t ) , \pmb { x } ) , y = \operatorname* { l i m } _ { t \to \infty } G ( \pmb { s } ( t ) ) .
62
+ $$
63
+
64
+ 59 In this paper, we commit to a physically realizable recurrent network with voltage nodes $s _ { i }$ from
65
+ 60 $i = 1 : N$ , with a capacitive time-constant $\tau _ { i }$ , using resistors (of a constant conductance $f _ { i j }$ ) and
66
+ 61 tunnel diodes (of a voltage-dependent conductance $\bar { G _ { i } } ( s _ { i } ) \rangle$ ) as shown in Fig. 1, yielding a state-space
67
+ 62 model of the form
68
+
69
+ $$
70
+ \tau _ { i } \dot { s } _ { i } = \boldsymbol { x } _ { i } - \sum _ { j \neq i } f _ { i j } ( s _ { i } - s _ { j } ) - G _ { i } ( s _ { i } ) , y = G _ { 1 } ( \boldsymbol { \hat { s } } _ { 1 } )
71
+ $$
72
+
73
+ 63 where $f _ { i j } \geq 0$ , $G _ { i }$ is a nonlinear passive function such that $G _ { i } ( s ) s \geq 0$ and $\begin{array} { r } { \hat { s } _ { 1 } \equiv \operatorname* { l i m } _ { t \infty } s _ { 1 } ( t ) } \end{array}$ is
74
+ 64 the stable equilibrium-point if one exists (note: $y ( x )$ can be multi-valued and depend on the basin of
75
+ 65 attraction that the initial state $s ( 0 )$ lies in). Brain-scale systems of this kind may be realized by an
76
+ 66 interconnected network of nanoclusters with non-monotonic transport mechanisms as proposed in
77
+ 67 [24, Chapter 5]. However, finding suitable network parameters that result in practical functionality
78
+ 68 remains a challenge. Note that, although not the focus of this work, Eq. (2) can also represent
79
+ 69 state-space models with noisy rectified-linear units, for which semi-analytical results are known from
80
+ 70 a computational neuroscience [12] and a machine learning [33] perspective.
81
+
82
+ # 71 2.2 Algebraic geometry of the equilibrium points
83
+
84
+ 72 A study of the set of equilibrium points of a state-space model, $S _ { 0 } ( { \pmb x } ) \equiv \{ { \pmb s } \ni F _ { 1 : N } ( { \pmb s } , { \pmb x } ) = { \bf 0 } \}$ ,
85
+ 73 can not only help in characterising the stable equilibrium-points $\hat { \pmb { s } } \in \mathcal { S } _ { * } \subseteq \mathcal { S } _ { 0 }$ , but also provide
86
+ 74 necessary (but not sufficient) conditions in the parameters defining the functions $F _ { 1 : N }$ and $G$ , to
87
+ 75 realize desired equilibrium-point functionality $y ( \pmb { x } )$ . For example, to realize a Boolean function
88
+ 76 $y : \{ 0 , 1 \} ^ { N } \to \{ \dot { 0 , } 1 \}$ , the following property has to be satisfied:
89
+
90
+ $$
91
+ \operatorname* { m i n } _ { \pmb { s } \in S _ { 0 } ( \pmb { x } ) } G ( \pmb { s } ) \le 1 \land \operatorname* { m a x } _ { \pmb { s } \in S _ { 0 } ( \pmb { x } ) } G ( \pmb { s } ) \ge 0 \forall \pmb { x } \in \{ 0 , 1 \} ^ { N } .
92
+ $$
93
+
94
+ ![](images/c50692ef8cdcad5502b6ebd9b21a34932a646b0ce26ad496ad3e16d2aa2c2d6d.jpg)
95
+ Figure 1: Recurrent physical network corresponding to the state-space model (2) where the inputs $x _ { 1 : N }$ are currents, the states $s _ { 1 : N }$ are voltages, the output $y$ is a measured current, the linear interactions are due to resistors with a conductance $f _ { i j }$ between node $i$ and $j$ , and nonlinear interactions are due to tunnel diodes from node $i$ to GND with conductance $G _ { i } ( s _ { i } )$ .
96
+
97
+ 77 The set of equilibrium points of our recurrent physical network model (2) are the roots of the system
98
+ 78 of nonlinear equations
99
+
100
+ $$
101
+ - f _ { i , 1 : N } \cdot s _ { 1 : N } + G _ { i } ( s _ { i } ) = x _ { i }
102
+ $$
103
+
104
+ where the linear-interaction matrix 79 $f _ { N \times N }$ has terms $\begin{array} { r } { f _ { i i } \equiv - \sum _ { j \neq i } f _ { i j } } \end{array}$
105
+
106
+ 80 Solving the multivariate nonlinear equation (4) is a difficult problem in algebraic geometry, a
107
+ 81 discipline of mathematics which classically grew around efforts to understand the roots of multivariate
108
+ 82 polynomials and later metamorphosed by the study of integer-coefficient piecewise-linear functions,
109
+ 83 with an abstract language that has even recently been applied to explain circuit complexity results of
110
+ 84 deep feedforward networks [35, 30] through the lens of rational piecewise-linear functions [40].
111
+ 85 Algebraic geometry originally dealt with a qualitative approach by geometrical arguments [15], in
112
+ 86 contrast to a quantitative approach by numerical methods. An example of that kind is Harnack’s
113
+ 87 curve theorem [19] which states that for a 2-D polynomial curve of degree $n$ , the maximum number
114
+ 88 of connected components is $( n ^ { 2 } - 3 n + 4 ) / 2$ . Now, with the advent of computer algebra, the roots
115
+ 89 of multivariate nonlinear equations are studied by the elimination of variables, using techniques
116
+ 90 such as resultants [13, 38] and Groebner bases [7, 8] for polynomial systems, and as an instance
117
+ 91 of the linear-complementarity problem [11] or equivalently as absolute-value equations [26] for
118
+ 92 piecewise-linear systems [37]. However, computer algebra is not scalable for higher dimensions.
119
+ 93 Thus there is a need to convey the richness in algebraic geometry using analytical expressions. While
120
+ 94 it is unlikely that analytical expressions may be obtained for any general form of nonlinearity, we
121
+ 95 may hope that the set of exactly solvable models can be extended well beyond linear equations, a
122
+ 96 hope banking on our successful experience from other areas of mathematics such as integral calculus
123
+ 97 [9, section IX] and iterated mappings [39, page 1098].
124
+
125
+ # 98 2.2.1 Piecewise-linear algebra
126
+
127
+ 99 In this paper, we commit to a piecewise-linear analysis by considering
128
+
129
+ $$
130
+ G _ { i } ( s ) = \left\{ \begin{array} { l l } { g _ { i 1 } s } & { 0 \leq s \leq g _ { i 2 } } \\ { ( g _ { i 1 } + g _ { i 3 } ) g _ { i 2 } - g _ { i 3 } s } & { g _ { i 2 } \leq s \leq g _ { i 2 } ( 1 + \frac { g _ { i 1 } } { g _ { i 3 } } ) } \end{array} \right.
131
+ $$
132
+
133
+ 100 where $g _ { i 1 , 2 , 3 } > 0$ so that $G _ { i }$ is a triangular peak function in a limited range of $s$ , thus defining
134
+ 101 an idealized negative-differential behaviour. Shifting the state-space about its inflection points as
135
+ 102 ${ \pmb z } \equiv { \pmb s } - { \pmb g } _ { 2 }$ and then combining (5) with (4) yields
136
+
137
+ $$
138
+ x _ { i } = \left\{ \begin{array} { l l } { - f _ { i , 1 : N } \cdot z + g _ { i 1 } z _ { i } - f _ { i , 1 : N } \cdot g _ { 2 } + g _ { i 1 } g _ { i 2 } } & { - g _ { i 2 } \leq z _ { i } \leq 0 } \\ { - f _ { i , 1 : N } \cdot z - g _ { i 3 } z _ { i } - f _ { i , 1 : N } \cdot g _ { 2 } + g _ { i 1 } g _ { i 2 } } & { 0 \leq z _ { i } \leq g _ { i 2 } ( \frac { g _ { i 1 } } { g _ { i 3 } } ) } \end{array} \right. ,
139
+ $$
140
+
141
+ 103 which can be simplified to
142
+
143
+ $$
144
+ x _ { i } = - f _ { i , 1 : N } \cdot z + g _ { i \ominus } z _ { i } - g _ { i \oplus } | z _ { i } | - f _ { i , 1 : N } \cdot g _ { 2 } + g _ { i 1 } g _ { i 2 }
145
+ $$
146
+
147
+ 105 The system in (7) can be expressed in the absolute-value equation normal form
148
+
149
+ $$
150
+ \pmb { \Delta z } - | \pmb { z } | = \pmb { b }
151
+ $$
152
+
153
+ $$
154
+ - g _ { 2 } \leq z \leq g _ { 2 } g _ { 1 } / g _ { 3 } ,
155
+ $$
156
+
157
+ 107 Similarly, (2) can be expressed as
158
+
159
+ $$
160
+ \tau \dot { z } = g _ { \oplus } ( b - { \bf A } z + | z | ) .
161
+ $$
162
+
163
+ Two sufficient conditions are known for the absolute value equation (8) to have a unique solution based on the largest singular value $\sigma _ { \mathrm { m i n } }$ [26] and the spectral radius $\rho$ [32]:
164
+
165
+ $$
166
+ \begin{array} { r } { \sigma _ { \operatorname* { m i n } } ( \mathsf { \pmb { A } } ) > 1 , } \\ { \rho ( | \mathsf { \pmb { A } } ^ { - 1 } | ) < 1 . } \end{array}
167
+ $$
168
+
169
+ 108 However, those are not yet sufficient conditions for a unique equilibrium-point solution for (2) and
170
+ 109 (10) because the bounds in (9) were not enforced. Thus, we shall proceed to obtain a Lyapunov
171
+ 110 function to guarantee that a stable equilibrium-point is reached.
172
+
173
+ # 111 2.3 Lyapunov stability analysis
174
+
175
+ 112 Equilibrium-point stability for large complex systems is not guaranteed in general [17, 27], and the
176
+ 113 effective dimensionality of stable-input stable-output responses is richly dependent on the parameter
177
+ 114 space [2]. However, the interaction matrix for our physical system (2) is symmetric, and hence the
178
+ 115 system is a special case of the Cohen-Grossberg model [10]
179
+
180
+ $$
181
+ \dot { s _ { i } } = a _ { i } ( s _ { i } ) [ b _ { i } ( s _ { i } ) - \sum _ { j = 1 } ^ { N } c _ { i j } d _ { j } ( s _ { j } ) ] ,
182
+ $$
183
+
184
+ with $a _ { i } ( s _ { i } ) = 1 / \tau _ { i }$ , $b _ { i } ( s _ { i } ) = x _ { i } - G _ { i } ( s _ { i } )$ , $c _ { i j } = - f _ { i j }$ and $d _ { j } ( s _ { j } ) = s _ { j }$ . Thus, it is known to be globally absolute stable, with a Lyapunov function
185
+
186
+ $$
187
+ \begin{array} { r l r } & { } & { V = - \displaystyle \sum _ { i } \int _ { 0 } ^ { s _ { i } } b _ { i } ( u ) d _ { i } ^ { \prime } ( u ) \mathrm { d } u + \displaystyle \sum _ { i , j } \frac { c _ { i j } } { 2 } d _ { i } ( s _ { i } ) d _ { j } ( s _ { j } ) } \\ & { } & { \quad = \displaystyle \sum _ { i } \Big ( P _ { i } ( s _ { i } ) - x _ { i } s _ { i } - \displaystyle \sum _ { j > i } f _ { i j } s _ { i } s _ { j } - \frac { f _ { i i } } { 2 } s _ { i } ^ { 2 } \Big ) , } \\ & { } & { \quad \mathrm { w h e r e ~ o u t p u t ~ p o w e r ~ } P _ { i } ( s _ { i } ) \equiv \displaystyle \int _ { 0 } ^ { s _ { i } } G _ { i } ( u ) \mathrm { d } u . } \end{array}
188
+ $$
189
+
190
+ 116 Alternatively, since our system (5) is piecewise-linear, a piecewise-quadratic Lyapunov function may
191
+ 117 be obtained by a piecewise-affine system [22] analysis. While this approach is more powerful and
192
+ 118 holds even for asymmetric interaction matrices, it also seems to be analytically complex. From another
193
+ 119 angle, global asymptotic stability [21, Theorem 3] is guaranteed if the Jacobian matrix $\mathbf { J }$ satisfies
194
+ 120 $J _ { i i } \dot { + } 1 \dot { / } 2 \sum _ { j \neq i } \dot { | } J _ { i j } + J _ { j i } | < 0 \Longleftrightarrow G _ { i } ^ { \prime } ( s _ { i } ) > 0$ because in our system $\begin{array} { r } { J _ { i i } = - \sum _ { j \neq i } f _ { i j } - G _ { i } ^ { \prime } ( s _ { i } ) } \end{array}$
195
+ 121 and $J _ { i j } = f _ { i j }$ . Since our network employs non-monotonic functionality, $G _ { i } ^ { \prime } ( s _ { i } ) > 0$ cannot be
196
+ 122 guaranteed for all reachable states $s _ { i }$ , and thus the above criteria is unfortunately inapplicable. Hence,
197
+ 123 we shall proceed with the Cohen-Grossberg approach.
198
+
199
+ 124 The power function (21) simplifies to
200
+
201
+ $$
202
+ P ( s ) = \left\{ \begin{array} { l l } { \int _ { 0 } ^ { s } g _ { 1 } u \mathrm { d } u = g _ { 1 } s ^ { 2 } / 2 } & { 0 \le s \le g _ { 2 } } \\ { g _ { 1 } g _ { 2 } ^ { 2 } / 2 + \int _ { g _ { 2 } } ^ { s } ( g _ { 1 } + g _ { 3 } ) g _ { 2 } - g _ { 3 } u \mathrm { d } u } & { g _ { 2 } \le s } \\ { = g _ { 1 } s ^ { 2 } / 2 - g _ { \oplus } ( s - g _ { 2 } ) ^ { 2 } , } \end{array} \right.
203
+ $$
204
+
205
+ 125 and using the rectifier function $[ x ) \equiv \operatorname* { m a x } ( x , 0 )$ may be expressed conveniently as
206
+
207
+ $$
208
+ P ( s ) = g _ { 1 } s ^ { 2 } / 2 - g _ { \oplus } [ s - g _ { 2 } ) ^ { 2 } ,
209
+ $$
210
+
211
+ 126 when the system is within its operational bounds.
212
+
213
+ 128 Given the Lyapunov stability result of our system, it is computationally efficient to simulate our
214
+ 129 state-space model and probe for combinational functionality. Here, we will simulate for the simplest
215
+ 130 proof-of-concept for deep functionality in a shallow recurrent - solving a parity problem.
216
+ 131 Using a cascade of 2-input XOR gates, the $N$ -bit parity function can be realized with $N / 2 + N / 4 +$
217
+ 132 $\dots + 1 = N - 1$ gates and $2 N - 1$ connections. Thus its total cost in area is at least $3 N - 2$ units.
218
+ 133 A minimally-connected network has $N$ input wires, 1 output wire, and $N - 1$ interconnect wires
219
+ 134 with a total area cost of $2 N$ units, assuming that the area occupied by the remaining components is
220
+ 135 negligible. Thus for $N = 3$ , while a conventional digital circuit costs 7 units, our recurrent physical
221
+ 136 network takes just 6 wiring units.
222
+ 137 Our simple model has $N = 3$ , $f _ { 1 2 } = f _ { 1 3 } = f$ , $f _ { 2 3 } = 0$ , $g _ { 1 1 } = g _ { 1 }$ , $g _ { 1 3 } = g _ { 3 }$ , $g _ { 2 1 } = g _ { 3 1 } = \gamma _ { 1 }$
223
+ 138 $g _ { 2 3 } = g _ { 3 3 } = \gamma _ { 3 }$ , $g _ { 1 2 } = g _ { 2 }$ and $\gamma _ { 2 2 } = \gamma _ { 3 2 } = \gamma _ { 2 }$ . We find from a symbolic evaluation that $\sigma _ { \mathrm { m i n } } ( \pmb { \mathsf { A } } ) \neq$
224
+ 139 $1 / \rho ( | \pmb { \mathsf { A } } ^ { - 1 } | )$ in general, and conditions for unique stability were not obtainable (which is not surprising
225
+ 140 due to the $s _ { 2 } \mathrm { ~ - ~ } s _ { 3 }$ symmetry). Thus, parity functionality was found by trial-and-error yielding the
226
+ 141 parameters $\{ f = 1 . 7 5 1 , g _ { 1 } = 1 . 8 7 6 , g _ { 2 } = g _ { 3 } = 0 . 1 2 6 , \gamma _ { 1 } = 0 . 8 7 6 , \gamma _ { 2 } = 1 . 6 , \gamma _ { 3 } = 0 . 7 5 1 \}$ and
227
+ 142 simulated using Wolfram Mathematica 13 (code in Appendix). When $x _ { 1 } = x _ { 2 } = x _ { 3 } = 1$ , the states
228
+ 143 were forced to transition beyond the bounds in (5), so its range was extended by taking an absolute
229
+ 144 value. The results are plotted in Fig. 2.
230
+
231
+ # 145 4 Discussion
232
+
233
+ 146 Our result should be seen as a theoretical proof-of-concept and as a motivation for continued
234
+ 147 research in this area. Future work must extend our simulations to much higher dimensions to serve
235
+ 148 as a practical demonstration of deep functionality by shallow recurrent networks. Moreover, the
236
+ 149 theoretical formalism introduced here is not yet fully exploited. We hope to find an analytical method
237
+ 150 to design functionality out of piecewise-linear Cohen-Grossberg networks.
238
+ 151 Our style of reasoning to circumvent the Shannon bottleneck may also be applied to other systems
239
+ 152 such as networks of coupled oscillators [28]. Our non-modular mode of signal processing, offers
240
+ 153 an alternative to not just circuit designers, but also to systems biologists who typically understand
241
+ 154 chemical reaction networks [6] as a composition of modules [20]. While, we have discussed
242
+ 155 equilibium-point functionality in a state-space model driven by an additive input, it is also worth
243
+ 156 investigating autonomous systems where the input is set as an initial state. An example is realizing
244
+ 157 unboundedly-finite parity functions using just a radius-4 cellular automaton [4]. Finally, we hope
245
+ 158 that this paper can serve as a call to action for neuromorphic engineers to look at physical reservoir
246
+ 159 computing [36] from another angle, besides temporal input-output functionality.
247
+
248
+ # 160 References
249
+
250
+ [1] M. A. Alcorn, Q. Li, Z. Gong, C. Wang, L. Mai, W.-S. Ku, and A. Nguyen. Strike (with) a pose: Neural networks are easily fooled by strange poses of familiar objects. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4845–4854, 2019.
251
+ [2] R. D. Beer. Parameter space structure of continuous-time recurrent neural networks. Neural computation, 18(12):3009–3051, 2006.
252
+ [3] N. Bernstein. The co-ordination and regulation of movements. The co-ordination and regulation of movements, 1966.
253
+ [4] H. Betel, P. P. de Oliveira, and P. Flocchini. Solving the parity problem in one-dimensional cellular automata. Natural Computing, 12(3):323–337, 2013.
254
+ [5] E. Bizzi, N. Hogan, F. A. Mussa-Ivaldi, and S. Giszter. Does the nervous system use equilibriumpoint control to guide single and multiple joint movements? Behavioral and brain sciences, 15(4):603–613, 1992.
255
+
256
+ ![](images/d9cf59a020f738ccb475e1ac9c101a757318b97c389dc2f1ff8fa83e38e5c4da.jpg)
257
+ Figure 2: Numerical simulation of our 3-state network over 200 timesteps.
258
+
259
+ [6] D. Bray. Protein molecules as computational elements in living cells. Nature, 376(6538):307– 312, 1995. 75 [7] B. Buchberger. Ein algorithmus zum auffinden der basiselemente des restklassenringes nach einem nulldimensionalen polynomideal. PhD thesis, Universitat Insbruck, 1965. [8] B. Buchberger. Bruno buchberger’s phd thesis 1965: An algorithm for finding the basis 78 elements of the residue class ring of a zero dimensional polynomial ideal. Journal of symbolic computation, 41(3-4):475–511, 2006. [9] G. S. Carr. Synopsis of elementary results in pure mathematics. 1886. [10] M. A. Cohen and S. Grossberg. Absolute stability of global pattern formation and parallel memory storage by competitive neural networks. IEEE transactions on systems, man, and cybernetics, (5):815–826, 1983. [11] R. W. Cottle. Linear complementarity problem, pages 1873–1878. Springer US, Boston, MA, 2009. [12] D. Durstewitz. A state space approach for piecewise-linear recurrent neural networks for identifying computational dynamics from neural measurements. PLoS computational biology, 13(6):e1005542, 2017. [13] I. Z. Emiris. On the complexity of sparse elimination. Journal of Complexity, 12(2):134–166, 1996. [14] A. G. Feldman. Functional tuning of the nervous system with control of movement or maintenance of a steady posture-ii. controllable parameters of the muscle. Biofizika, 11:565–578, 1966. [15] W. Fulton. Intersection theory, volume 2. Springer Science & Business Media, 2013. [16] S. Gao, M. Zhou, Y. Wang, J. Cheng, H. Yachi, and J. Wang. Dendritic neuron model with ef96 fective learning algorithms for classification, approximation, and prediction. IEEE transactions on neural networks and learning systems, 30(2):601–614, 2019. [17] M. R. Gardner and W. R. Ashby. Connectance of large dynamic (cybernetic) systems: critical values for stability. Nature, 228(5273):784–784, 1970. [18] I. J. Goodfellow, J. Shlens, and C. Szegedy. Explaining and harnessing adversarial examples, 2015. [19] A. Harnack. Ueber die vieltheiligkeit der ebenen algebraischen curven. Mathematische Annalen, 10(2):189–198, 1876. [20] L. H. Hartwell, J. J. Hopfield, S. Leibler, and A. W. Murray. From molecular to modular cell biology. Nature, 402(6761):C47–C52, 1999. [21] M. W. Hirsch. Convergent activation dynamics in continuous time networks. Neural networks, 2(5):331–349, 1989. [22] M. Johansson and A. Rantzer. Computation of piecewise quadratic lyapunov functions for hybrid systems. In 1997 European Control Conference (ECC), pages 2005–2010. IEEE, 1997. [23] J. Kubilius, M. Schrimpf, K. Kar, R. Rajalingham, H. Hong, N. Majaj, E. Issa, P. Bashivan, J. Prescott-Roy, K. Schmidt, et al. Brain-like object recognition with high-performing shallow recurrent anns. Advances in neural information processing systems, 32, 2019. [24] C. P. Lawrence. Evolving Networks To Have Intelligence Realized At Nanoscale. PhD thesis, University of Twente, 2018. [25] M. Liang and X. Hu. Recurrent convolutional neural network for object recognition. In 16 Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3367– 17 3375, 2015.
260
+
261
+ 18 [26] O. Mangasarian and R. Meyer. Absolute value equations. Linear Algebra and Its Applications, 419(2-3):359–367, 2006.
262
+ 20 [27] R. M. May. Will a large complex system be stable? Nature, 238(5364):413–414, 1972. [28] S. N. Menon and S. Sinha. “defective” logic: Using spatiotemporal patterns in coupled relaxation oscillator arrays for computation. In 2014 International Conference on Signal Processing and Communications (SPCOM), pages 1–6. IEEE, 2014. [29] S.-M. Moosavi-Dezfooli, A. Fawzi, O. Fawzi, and P. Frossard. Universal adversarial perturbations. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1765–1773, 2017. [30] M. Raghu, B. Poole, J. Kleinberg, S. Ganguli, and J. Sohl-Dickstein. On the expressive power of deep neural networks. In international conference on machine learning, pages 2847–2854. PMLR, 2017.
263
+ 30 [31] M. D. Riedel and J. Bruck. Cyclic boolean circuits. Discrete Applied Mathematics, 160(13- 14):1877–1900, 2012. [32] J. Rohn, V. Hooshyarbakhsh, and R. Farhadsefat. An iterative method for solving absolute value equations and sufficient conditions for unique solvability. Optimization Letters, 8(1):35–44, 2014.
264
+ 35 [33] D. Schmidt, G. Koppe, Z. Monfared, M. Beutelspacher, and D. Durstewitz. Identifying nonlinear dynamical systems with multiple time scales and long-range dependencies. In International Conference on Learning Representations, 2021.
265
+ 38 [34] C. E. Shannon. The synthesis of two-terminal switching circuits. The Bell System Technical Journal, 28(1):59–98, 1949. [35] K.-Y. Siu, V. P. Roychowdhury, and T. Kailath. Depth-size tradeoffs for neural computation. IEEE Transactions on Computers, 40(12):1402–1412, 1991. [36] G. Tanaka, T. Yamane, J. Héroux, R. Nakane, N. Kanazawa, S. Takeda, H. Numata, D. Nakano, and A. Hirose. Recent advances in physical reservoir computing: A review. Neural Networks, 115:100–123, 2019. [37] W. M. Van Bokhoven and D. M. Leenaerts. Explicit formulas for the solutions of piecewise linear networks. IEEE Transactions on Circuits and Systems I: Fundamental Theory and Applications, 46(9):1110–1117, 1999. [38] M. P. Williams. Solving polynomial equations using linear algebra. Johns Hopkins APL Technical Digest, 28(4):354–363, 2010.
266
+ 0 [39] S. Wolfram. A new kind of science, volume 5. Wolfram media Champaign, IL, 2002.
267
+ 51 [40] L. Zhang, G. Naitzat, and L.-H. Lim. Tropical geometry of deep neural networks. In International Conference on Machine Learning, pages 5824–5832. PMLR, 2018.
268
+
269
+ # Checklist
270
+
271
+ 1. For all authors...
272
+
273
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] The concrete result is the realization of a parity function by our recurrent physical network by using just 6 wiring units, while a conventional digital circuit costs 7 units. That being said, the paper is written to cover a much broader scope - this is a matter of taste (an earlier version of this manuscript recieved both positive and negative comments about the scope of this article).
274
+
275
+ (b) Did you describe the limitations of your work? [Yes] It is mentioned that future work must extend our simulations to much higher dimensions to serve as a practical demonstration of deep functionality by shallow recurrent networks. Also the simulation parameters were found by trial and error, instead of being derived analytically from the theoretical formalism - these limitations are mentioned in the discussion.
276
+ (c) Did you discuss any potential negative societal impacts of your work? [N/A]
277
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
278
+
279
+ 2. If you are including theoretical results...
280
+
281
+ (a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
282
+
283
+ 3. If you ran experiments...
284
+
285
+ (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] Check Appendix for the code to reproduce Figure 2.
286
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [N/A]
287
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A]
288
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [N/A] It is evident that Figure 2 is not a large-scale deep learning experiment but a small-scale conceptual simulation which takes less than 2 seconds on a modern desktop CPU.
289
+
290
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
291
+
292
+ (a) If your work uses existing assets, did you cite the creators? [N/A]
293
+ (b) Did you mention the license of the assets? [N/A]
294
+ (c) Did you include any new assets either in the supplemental material or as a URL? [No]
295
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
296
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
297
+
298
+ 5. If you used crowdsourcing or conducted research with human subjects...
299
+
300
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
301
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
302
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
303
+
304
+ # 299 A Appendix
305
+
306
+ 300 Wolfram Mathematica code to reproduce Figure 2.
307
+
308
+ $\quad I n f \circ J { : } =$ simulate $[ f _ { - }$ , $g _ { - }$ , $\gamma \_ 1 : =$ (sys $=$ NonlinearStateSpaceModel[{ {x1 - (2 f) ${ \pmb { s } } { \pmb { 1 } } + { \pmb { f } }$ ( $\mathsf { s } 2 + \mathsf { s } 3 \mathrm { \mathrm { ; } }$ ) - Abs[g〚1〛 \* s1 - (g〚1〛 $^ +$ g〚3〛) Ramp[s1 - g〚2〛]], x2 - (f) $\mathsf { s } \mathsf { 2 } + \mathsf { f }$ (s1) - Abs[ $\mathcal { Y }$ 〚1〛 s2 - ( $\mathbf { \mathcal { V } } [ [ \mathbf { 1 } ] ] + \mathbf { \mathcal { V } } [ [ \mathbf { 3 } ] ]$ ) Ramp[s2 - γ 〚2〛]], x3 - (f) $\mathsf { s } \mathsf { 3 } + \mathsf { f }$ (s1) - Abs[ $\mathcal { Y }$ 〚1〛 s3 - ( $\mathbf { \mathcal { V } } [ [ \mathbf { 1 } ] ] + \mathbf { \mathcal { V } } [ [ \mathbf { 3 } ] ]$ ) Ramp[s3 - $\mathcal { Y }$ 〚2〛]]}, {x1, $\times 2$ , $\times 3$ , Xor[x1, $\times 2$ , $\times 3 ]$ , s1, s2, s3, $\mathbf { y } =$ Abs[g〚1〛 s1 - (g〚1〛 ${ } + g$ 〚3〛) Ramp[s1 - g〚2〛]], HeavisideTheta[y - .15]} }, {s1, s2, s3}, $\{ \mathbf { x 1 } , \mathbf { x 2 } , \mathbf { x 3 } \} ]$ ; inputs $= \{ . 5 - . 5 \star$ SquareWave[ t / 50], .5 - . $^ { ; \star }$ SquareWave[ t / 100], .5 - .5 $^ { \star }$ SquareWave[ t / 200]}; out $\equiv$ OutputResponse[{sys, {0, 0}}, inputs, {t, 0, 200}]; GraphicsColumn@Table[Plot[out〚i〛, {t, 0, 200}, PlotRange All, Ticks {Automatic, {0, 1 / 5, 1, 2}}], {i, 9}])
parse/dev/401LFvBGIb/401LFvBGIb_content_list.json ADDED
@@ -0,0 +1,910 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Deep feedforward functionality by equilibrium-point control in a shallow recurrent network ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 179,
8
+ 122,
9
+ 818,
10
+ 172
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Anonymous Author(s) \nAffiliation \nAddress \nemail ",
17
+ "bbox": [
18
+ 423,
19
+ 222,
20
+ 578,
21
+ 276
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Abstract ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 462,
31
+ 313,
32
+ 535,
33
+ 329
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "Recurrent neural network based machine learning systems are typically employed for their sequential functionality in handling time-varying signals, such as for speech processing. However, neurobiologists find recurrent connections in the vision system and debate about equilibrium-point control in the motor system. Thus, we need a deeper understanding of how recurrent dynamics can be exploited to attain combinational stable-input stable-output functionality. Here, we study how a simplified Cohen-Grossberg neural network model can realize combinational multi-input Boolean functionality. We place our problem within the discipline of algebraic geometry, and solve a special case of it using piecewise-linear algebra. We demonstrate a connectance-efficient realization of the parity function as a proof-of-concept. Small-scale systems of this kind can be easily built, say for hobby robotics, as a network of two-terminal devices of resistors and tunnel diodes. Large-scale systems may be energy-efficiently built as an interconnected network of multi-electrode nanoclusters with non-monotonic transport mechanisms. ",
40
+ "bbox": [
41
+ 148,
42
+ 345,
43
+ 766,
44
+ 540
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "15 1 Introduction ",
51
+ "text_level": 1,
52
+ "bbox": [
53
+ 148,
54
+ 577,
55
+ 338,
56
+ 597
57
+ ],
58
+ "page_idx": 0
59
+ },
60
+ {
61
+ "type": "text",
62
+ "text": "16 Shallow recurrent neural networks are being investigated for more context-aware object recognition \n17 [25] and brain-like behaviour [23]. They can be more compact (by trading space for time) and are a \n18 naturally robust alternative to deep neural networks (which are easily fooled by input perturbations \n19 or transformations [18, 29, 1]) when the role of recurrent dynamics is not to produce time-varying \n20 output but instead to produce transient (hidden) state-dynamics that facilitate deep, robust and \n21 transformation-invariant fixed-input fixed-output functionality. To better engineer such dynamics, \n22 we shall study equilibrium-point control, which can be defined as the process of steering to a target \n23 in state-space by fixing the input signal, instead of driving it by a continuously varying input signal. \n24 Historically, equilibrium-point control [14, 5] was first formulated to provide a plausible solution \n25 to the degrees of freedom problem in motor control [3], that is, we mentally represent intermediate \n26 destination points rather than a continuum of velocity information required to execute a movement. \n27 Here, we shall focus on using equilibrium-point control to realize multi-input Boolean functionality, \n28 in particular the parity function, which is a canonical proxy for nonlinear classification. Theoretical \n29 results in circuit complexity are known already for realizing Boolean functionality out of feedforward \n30 neural networks, with weighted-sum thresholded binary-output neurons [35]. It has been shown that \n31 arbitrary $N$ -input Boolean functions can be realized in depth-3 feedforward networks with fewer \n32 neurons $( m = \\mathcal { O } ( 2 ^ { N / 2 } )$ instead of the $\\mathcal { O } ( 2 ^ { N } )$ in total required for depth-2). However, with the \n33 advent of nanoelectronics, the size of an artificial neuron has been downscaled to such an extent \n34 that it is rather the interconnect wiring that now occupies a greater area in chip design. Thus for a \n35 fully-connected deep network, the area scales as the number of interconnects $\\dot { m ^ { 2 } } = \\mathcal { \\bar { O } } ( 2 ^ { N } )$ . Such a \n36 $\\mathcal { O } ( 2 ^ { N } )$ scaling law was earlier obtained by Shannon [34] for realizing arbitrary $N$ -input Boolean \n37 functions by an interconnection of input-controlled switches (or equivalently a feedforward network \n38 of 2-input Boolean gates). Thus, unless we employ higher-order neurons [16], we can say that \n39 a Shannon bottleneck limits the maximum $N$ -input Boolean logic realizable in a given area by \n40 (nanoscale) feedforward networks. We aim to circumvent this Shannon bottleneck by employing \n41 recurrent physical networks. It is known that certain combinational logic functions can be realized \n42 by fewer logic gates in a cyclic network than in an acyclic network [31], and with analog signal \n43 processing the improvement factor could be even higher. \n44 In the following section, we introduce a state-space model formalism to study equilibrium-point \n45 control, and commit to a physically realizable model, and discuss how a general solution for its \n46 equilibrium points is a difficult problem in algebraic geometry. Thus, we proceed to idealize the non \n47 monotonic output of the physical system as a piecewise-linear function and solve for the equilibrium \n48 points. Finally, a piecewise-quadratic Lyapunov function is obtained for stability analysis and \n49 conditions for a unique equilibrium-point are provided. \n50 After the theory, in the results section, we provide a connectance-efficient realization of the parity \n51 function. The discussion section puts our results into a broader context and offers avenues for further \n52 research. Our objective here is to work at the intersection of nonlinear dynamical systems, neural \n53 networks, unconventional neuromorphic hardware, cyclic Boolean circuits, piecewise-linear control \n54 systems, and algebraic geometry. ",
63
+ "bbox": [
64
+ 147,
65
+ 614,
66
+ 825,
67
+ 767
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "",
74
+ "bbox": [
75
+ 147,
76
+ 772,
77
+ 825,
78
+ 898
79
+ ],
80
+ "page_idx": 0
81
+ },
82
+ {
83
+ "type": "text",
84
+ "text": "",
85
+ "bbox": [
86
+ 145,
87
+ 90,
88
+ 825,
89
+ 203
90
+ ],
91
+ "page_idx": 1
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "",
96
+ "bbox": [
97
+ 147,
98
+ 208,
99
+ 825,
100
+ 292
101
+ ],
102
+ "page_idx": 1
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "",
107
+ "bbox": [
108
+ 147,
109
+ 297,
110
+ 825,
111
+ 368
112
+ ],
113
+ "page_idx": 1
114
+ },
115
+ {
116
+ "type": "text",
117
+ "text": "2 Theory ",
118
+ "text_level": 1,
119
+ "bbox": [
120
+ 163,
121
+ 400,
122
+ 284,
123
+ 420
124
+ ],
125
+ "page_idx": 1
126
+ },
127
+ {
128
+ "type": "text",
129
+ "text": "2.1 State-space model ",
130
+ "text_level": 1,
131
+ "bbox": [
132
+ 173,
133
+ 440,
134
+ 370,
135
+ 458
136
+ ],
137
+ "page_idx": 1
138
+ },
139
+ {
140
+ "type": "text",
141
+ "text": "For equilibrium-point control, in general we have an input vector $_ { \\textbf { \\em x } }$ , a state $s _ { i } ( t )$ for $i = 1 : N$ , and an output $y$ obtained from a system of equations ",
142
+ "bbox": [
143
+ 160,
144
+ 472,
145
+ 825,
146
+ 502
147
+ ],
148
+ "page_idx": 1
149
+ },
150
+ {
151
+ "type": "equation",
152
+ "img_path": "images/8f4c0ae46dc1069e168bd3bf5d951dfbd121cf48c49ce2c0745df33bb79fa318.jpg",
153
+ "text": "$$\n\\dot { s } _ { i } ( t ) = F _ { i } ( \\pmb { s } ( t ) , \\pmb { x } ) , y = \\operatorname* { l i m } _ { t \\to \\infty } G ( \\pmb { s } ( t ) ) .\n$$",
154
+ "text_format": "latex",
155
+ "bbox": [
156
+ 367,
157
+ 510,
158
+ 632,
159
+ 532
160
+ ],
161
+ "page_idx": 1
162
+ },
163
+ {
164
+ "type": "text",
165
+ "text": "59 In this paper, we commit to a physically realizable recurrent network with voltage nodes $s _ { i }$ from \n60 $i = 1 : N$ , with a capacitive time-constant $\\tau _ { i }$ , using resistors (of a constant conductance $f _ { i j }$ ) and \n61 tunnel diodes (of a voltage-dependent conductance $\\bar { G _ { i } } ( s _ { i } ) \\rangle$ ) as shown in Fig. 1, yielding a state-space \n62 model of the form ",
166
+ "bbox": [
167
+ 147,
168
+ 540,
169
+ 825,
170
+ 594
171
+ ],
172
+ "page_idx": 1
173
+ },
174
+ {
175
+ "type": "equation",
176
+ "img_path": "images/0ac8e139ddc59c84f59cef65f620359128865b40c40219d107cd4743ad2ba4dd.jpg",
177
+ "text": "$$\n\\tau _ { i } \\dot { s } _ { i } = \\boldsymbol { x } _ { i } - \\sum _ { j \\neq i } f _ { i j } ( s _ { i } - s _ { j } ) - G _ { i } ( s _ { i } ) , y = G _ { 1 } ( \\boldsymbol { \\hat { s } } _ { 1 } )\n$$",
178
+ "text_format": "latex",
179
+ "bbox": [
180
+ 325,
181
+ 593,
182
+ 671,
183
+ 628
184
+ ],
185
+ "page_idx": 1
186
+ },
187
+ {
188
+ "type": "text",
189
+ "text": "63 where $f _ { i j } \\geq 0$ , $G _ { i }$ is a nonlinear passive function such that $G _ { i } ( s ) s \\geq 0$ and $\\begin{array} { r } { \\hat { s } _ { 1 } \\equiv \\operatorname* { l i m } _ { t \\infty } s _ { 1 } ( t ) } \\end{array}$ is \n64 the stable equilibrium-point if one exists (note: $y ( x )$ can be multi-valued and depend on the basin of \n65 attraction that the initial state $s ( 0 )$ lies in). Brain-scale systems of this kind may be realized by an \n66 interconnected network of nanoclusters with non-monotonic transport mechanisms as proposed in \n67 [24, Chapter 5]. However, finding suitable network parameters that result in practical functionality \n68 remains a challenge. Note that, although not the focus of this work, Eq. (2) can also represent \n69 state-space models with noisy rectified-linear units, for which semi-analytical results are known from \n70 a computational neuroscience [12] and a machine learning [33] perspective. ",
190
+ "bbox": [
191
+ 145,
192
+ 635,
193
+ 825,
194
+ 747
195
+ ],
196
+ "page_idx": 1
197
+ },
198
+ {
199
+ "type": "text",
200
+ "text": "71 2.2 Algebraic geometry of the equilibrium points ",
201
+ "text_level": 1,
202
+ "bbox": [
203
+ 147,
204
+ 776,
205
+ 598,
206
+ 795
207
+ ],
208
+ "page_idx": 1
209
+ },
210
+ {
211
+ "type": "text",
212
+ "text": "72 A study of the set of equilibrium points of a state-space model, $S _ { 0 } ( { \\pmb x } ) \\equiv \\{ { \\pmb s } \\ni F _ { 1 : N } ( { \\pmb s } , { \\pmb x } ) = { \\bf 0 } \\}$ , \n73 can not only help in characterising the stable equilibrium-points $\\hat { \\pmb { s } } \\in \\mathcal { S } _ { * } \\subseteq \\mathcal { S } _ { 0 }$ , but also provide \n74 necessary (but not sufficient) conditions in the parameters defining the functions $F _ { 1 : N }$ and $G$ , to \n75 realize desired equilibrium-point functionality $y ( \\pmb { x } )$ . For example, to realize a Boolean function \n76 $y : \\{ 0 , 1 \\} ^ { N } \\to \\{ \\dot { 0 , } 1 \\}$ , the following property has to be satisfied: ",
213
+ "bbox": [
214
+ 147,
215
+ 809,
216
+ 825,
217
+ 880
218
+ ],
219
+ "page_idx": 1
220
+ },
221
+ {
222
+ "type": "equation",
223
+ "img_path": "images/0cb4925d5d8ff6c36aa73756df81b07334610fd105cb9ec857a2f807f77d50a9.jpg",
224
+ "text": "$$\n\\operatorname* { m i n } _ { \\pmb { s } \\in S _ { 0 } ( \\pmb { x } ) } G ( \\pmb { s } ) \\le 1 \\land \\operatorname* { m a x } _ { \\pmb { s } \\in S _ { 0 } ( \\pmb { x } ) } G ( \\pmb { s } ) \\ge 0 \\forall \\pmb { x } \\in \\{ 0 , 1 \\} ^ { N } .\n$$",
225
+ "text_format": "latex",
226
+ "bbox": [
227
+ 321,
228
+ 888,
229
+ 676,
230
+ 915
231
+ ],
232
+ "page_idx": 1
233
+ },
234
+ {
235
+ "type": "image",
236
+ "img_path": "images/c50692ef8cdcad5502b6ebd9b21a34932a646b0ce26ad496ad3e16d2aa2c2d6d.jpg",
237
+ "image_caption": [
238
+ "Figure 1: Recurrent physical network corresponding to the state-space model (2) where the inputs $x _ { 1 : N }$ are currents, the states $s _ { 1 : N }$ are voltages, the output $y$ is a measured current, the linear interactions are due to resistors with a conductance $f _ { i j }$ between node $i$ and $j$ , and nonlinear interactions are due to tunnel diodes from node $i$ to GND with conductance $G _ { i } ( s _ { i } )$ . "
239
+ ],
240
+ "image_footnote": [],
241
+ "bbox": [
242
+ 372,
243
+ 90,
244
+ 622,
245
+ 215
246
+ ],
247
+ "page_idx": 2
248
+ },
249
+ {
250
+ "type": "text",
251
+ "text": "77 The set of equilibrium points of our recurrent physical network model (2) are the roots of the system \n78 of nonlinear equations ",
252
+ "bbox": [
253
+ 142,
254
+ 310,
255
+ 823,
256
+ 338
257
+ ],
258
+ "page_idx": 2
259
+ },
260
+ {
261
+ "type": "equation",
262
+ "img_path": "images/00ad708abfe047776620aae9152720aa40de90fcf9f9e5baa51f3feb70dc5e5c.jpg",
263
+ "text": "$$\n- f _ { i , 1 : N } \\cdot s _ { 1 : N } + G _ { i } ( s _ { i } ) = x _ { i }\n$$",
264
+ "text_format": "latex",
265
+ "bbox": [
266
+ 397,
267
+ 337,
268
+ 598,
269
+ 354
270
+ ],
271
+ "page_idx": 2
272
+ },
273
+ {
274
+ "type": "text",
275
+ "text": "where the linear-interaction matrix 79 $f _ { N \\times N }$ has terms $\\begin{array} { r } { f _ { i i } \\equiv - \\sum _ { j \\neq i } f _ { i j } } \\end{array}$ ",
276
+ "bbox": [
277
+ 147,
278
+ 357,
279
+ 637,
280
+ 375
281
+ ],
282
+ "page_idx": 2
283
+ },
284
+ {
285
+ "type": "text",
286
+ "text": "80 Solving the multivariate nonlinear equation (4) is a difficult problem in algebraic geometry, a \n81 discipline of mathematics which classically grew around efforts to understand the roots of multivariate \n82 polynomials and later metamorphosed by the study of integer-coefficient piecewise-linear functions, \n83 with an abstract language that has even recently been applied to explain circuit complexity results of \n84 deep feedforward networks [35, 30] through the lens of rational piecewise-linear functions [40]. \n85 Algebraic geometry originally dealt with a qualitative approach by geometrical arguments [15], in \n86 contrast to a quantitative approach by numerical methods. An example of that kind is Harnack’s \n87 curve theorem [19] which states that for a 2-D polynomial curve of degree $n$ , the maximum number \n88 of connected components is $( n ^ { 2 } - 3 n + 4 ) / 2$ . Now, with the advent of computer algebra, the roots \n89 of multivariate nonlinear equations are studied by the elimination of variables, using techniques \n90 such as resultants [13, 38] and Groebner bases [7, 8] for polynomial systems, and as an instance \n91 of the linear-complementarity problem [11] or equivalently as absolute-value equations [26] for \n92 piecewise-linear systems [37]. However, computer algebra is not scalable for higher dimensions. \n93 Thus there is a need to convey the richness in algebraic geometry using analytical expressions. While \n94 it is unlikely that analytical expressions may be obtained for any general form of nonlinearity, we \n95 may hope that the set of exactly solvable models can be extended well beyond linear equations, a \n96 hope banking on our successful experience from other areas of mathematics such as integral calculus \n97 [9, section IX] and iterated mappings [39, page 1098]. ",
287
+ "bbox": [
288
+ 145,
289
+ 378,
290
+ 825,
291
+ 449
292
+ ],
293
+ "page_idx": 2
294
+ },
295
+ {
296
+ "type": "text",
297
+ "text": "",
298
+ "bbox": [
299
+ 145,
300
+ 455,
301
+ 826,
302
+ 636
303
+ ],
304
+ "page_idx": 2
305
+ },
306
+ {
307
+ "type": "text",
308
+ "text": "98 2.2.1 Piecewise-linear algebra ",
309
+ "text_level": 1,
310
+ "bbox": [
311
+ 151,
312
+ 660,
313
+ 393,
314
+ 675
315
+ ],
316
+ "page_idx": 2
317
+ },
318
+ {
319
+ "type": "text",
320
+ "text": "99 In this paper, we commit to a piecewise-linear analysis by considering ",
321
+ "bbox": [
322
+ 145,
323
+ 689,
324
+ 635,
325
+ 704
326
+ ],
327
+ "page_idx": 2
328
+ },
329
+ {
330
+ "type": "equation",
331
+ "img_path": "images/f81693dde742af29e7815bc0bfe1aecc8ce28ad059d980c040ebbe4f6f90bb93.jpg",
332
+ "text": "$$\nG _ { i } ( s ) = \\left\\{ \\begin{array} { l l } { g _ { i 1 } s } & { 0 \\leq s \\leq g _ { i 2 } } \\\\ { ( g _ { i 1 } + g _ { i 3 } ) g _ { i 2 } - g _ { i 3 } s } & { g _ { i 2 } \\leq s \\leq g _ { i 2 } ( 1 + \\frac { g _ { i 1 } } { g _ { i 3 } } ) } \\end{array} \\right.\n$$",
333
+ "text_format": "latex",
334
+ "bbox": [
335
+ 302,
336
+ 709,
337
+ 694,
338
+ 752
339
+ ],
340
+ "page_idx": 2
341
+ },
342
+ {
343
+ "type": "text",
344
+ "text": "100 where $g _ { i 1 , 2 , 3 } > 0$ so that $G _ { i }$ is a triangular peak function in a limited range of $s$ , thus defining \n101 an idealized negative-differential behaviour. Shifting the state-space about its inflection points as \n102 ${ \\pmb z } \\equiv { \\pmb s } - { \\pmb g } _ { 2 }$ and then combining (5) with (4) yields ",
345
+ "bbox": [
346
+ 142,
347
+ 757,
348
+ 823,
349
+ 801
350
+ ],
351
+ "page_idx": 2
352
+ },
353
+ {
354
+ "type": "equation",
355
+ "img_path": "images/668e4cbfa3a636747c9151b6e27c846a0972245bdd7b8b62f22bc4f8ef694add.jpg",
356
+ "text": "$$\nx _ { i } = \\left\\{ \\begin{array} { l l } { - f _ { i , 1 : N } \\cdot z + g _ { i 1 } z _ { i } - f _ { i , 1 : N } \\cdot g _ { 2 } + g _ { i 1 } g _ { i 2 } } & { - g _ { i 2 } \\leq z _ { i } \\leq 0 } \\\\ { - f _ { i , 1 : N } \\cdot z - g _ { i 3 } z _ { i } - f _ { i , 1 : N } \\cdot g _ { 2 } + g _ { i 1 } g _ { i 2 } } & { 0 \\leq z _ { i } \\leq g _ { i 2 } ( \\frac { g _ { i 1 } } { g _ { i 3 } } ) } \\end{array} \\right. ,\n$$",
357
+ "text_format": "latex",
358
+ "bbox": [
359
+ 263,
360
+ 806,
361
+ 732,
362
+ 849
363
+ ],
364
+ "page_idx": 2
365
+ },
366
+ {
367
+ "type": "text",
368
+ "text": "103 which can be simplified to ",
369
+ "bbox": [
370
+ 142,
371
+ 862,
372
+ 349,
373
+ 877
374
+ ],
375
+ "page_idx": 2
376
+ },
377
+ {
378
+ "type": "equation",
379
+ "img_path": "images/08ccede6a614cc5b3e2bd67982252c2f669b82b2086351dadd3d5a26d29120b0.jpg",
380
+ "text": "$$\nx _ { i } = - f _ { i , 1 : N } \\cdot z + g _ { i \\ominus } z _ { i } - g _ { i \\oplus } | z _ { i } | - f _ { i , 1 : N } \\cdot g _ { 2 } + g _ { i 1 } g _ { i 2 }\n$$",
381
+ "text_format": "latex",
382
+ "bbox": [
383
+ 307,
384
+ 896,
385
+ 689,
386
+ 912
387
+ ],
388
+ "page_idx": 2
389
+ },
390
+ {
391
+ "type": "text",
392
+ "text": "105 The system in (7) can be expressed in the absolute-value equation normal form ",
393
+ "bbox": [
394
+ 145,
395
+ 113,
396
+ 687,
397
+ 128
398
+ ],
399
+ "page_idx": 3
400
+ },
401
+ {
402
+ "type": "equation",
403
+ "img_path": "images/8f4de9fdca88c39df77d035b060d1144a921eda196796180f0fafca4f5e74d9b.jpg",
404
+ "text": "$$\n\\pmb { \\Delta z } - | \\pmb { z } | = \\pmb { b }\n$$",
405
+ "text_format": "latex",
406
+ "bbox": [
407
+ 450,
408
+ 131,
409
+ 547,
410
+ 148
411
+ ],
412
+ "page_idx": 3
413
+ },
414
+ {
415
+ "type": "equation",
416
+ "img_path": "images/e19f9a3075e93e7f74935f07682d4d2b7a474b530b790b751a42958c8755cbc3.jpg",
417
+ "text": "$$\n- g _ { 2 } \\leq z \\leq g _ { 2 } g _ { 1 } / g _ { 3 } ,\n$$",
418
+ "text_format": "latex",
419
+ "bbox": [
420
+ 428,
421
+ 170,
422
+ 565,
423
+ 188
424
+ ],
425
+ "page_idx": 3
426
+ },
427
+ {
428
+ "type": "text",
429
+ "text": "107 Similarly, (2) can be expressed as ",
430
+ "bbox": [
431
+ 142,
432
+ 189,
433
+ 397,
434
+ 204
435
+ ],
436
+ "page_idx": 3
437
+ },
438
+ {
439
+ "type": "equation",
440
+ "img_path": "images/6a9b05b23f47ef7ed37713a379d095ea37147c111bfef0e7f5f1a4e531b04813.jpg",
441
+ "text": "$$\n\\tau \\dot { z } = g _ { \\oplus } ( b - { \\bf A } z + | z | ) .\n$$",
442
+ "text_format": "latex",
443
+ "bbox": [
444
+ 411,
445
+ 207,
446
+ 584,
447
+ 226
448
+ ],
449
+ "page_idx": 3
450
+ },
451
+ {
452
+ "type": "text",
453
+ "text": "Two sufficient conditions are known for the absolute value equation (8) to have a unique solution based on the largest singular value $\\sigma _ { \\mathrm { m i n } }$ [26] and the spectral radius $\\rho$ [32]: ",
454
+ "bbox": [
455
+ 173,
456
+ 234,
457
+ 823,
458
+ 263
459
+ ],
460
+ "page_idx": 3
461
+ },
462
+ {
463
+ "type": "equation",
464
+ "img_path": "images/1f69dfe9f62137a2d66b3beea9c0ce4b9a56a68bb4f99ecc3730d64c11d60159.jpg",
465
+ "text": "$$\n\\begin{array} { r } { \\sigma _ { \\operatorname* { m i n } } ( \\mathsf { \\pmb { A } } ) > 1 , } \\\\ { \\rho ( | \\mathsf { \\pmb { A } } ^ { - 1 } | ) < 1 . } \\end{array}\n$$",
466
+ "text_format": "latex",
467
+ "bbox": [
468
+ 450,
469
+ 265,
470
+ 549,
471
+ 304
472
+ ],
473
+ "page_idx": 3
474
+ },
475
+ {
476
+ "type": "text",
477
+ "text": "108 However, those are not yet sufficient conditions for a unique equilibrium-point solution for (2) and \n109 (10) because the bounds in (9) were not enforced. Thus, we shall proceed to obtain a Lyapunov \n110 function to guarantee that a stable equilibrium-point is reached. ",
478
+ "bbox": [
479
+ 142,
480
+ 304,
481
+ 825,
482
+ 347
483
+ ],
484
+ "page_idx": 3
485
+ },
486
+ {
487
+ "type": "text",
488
+ "text": "111 2.3 Lyapunov stability analysis ",
489
+ "text_level": 1,
490
+ "bbox": [
491
+ 147,
492
+ 371,
493
+ 449,
494
+ 390
495
+ ],
496
+ "page_idx": 3
497
+ },
498
+ {
499
+ "type": "text",
500
+ "text": "112 Equilibrium-point stability for large complex systems is not guaranteed in general [17, 27], and the \n113 effective dimensionality of stable-input stable-output responses is richly dependent on the parameter \n114 space [2]. However, the interaction matrix for our physical system (2) is symmetric, and hence the \n115 system is a special case of the Cohen-Grossberg model [10] ",
501
+ "bbox": [
502
+ 140,
503
+ 402,
504
+ 825,
505
+ 459
506
+ ],
507
+ "page_idx": 3
508
+ },
509
+ {
510
+ "type": "equation",
511
+ "img_path": "images/b775b702ac77876668eb6203cdfc27e50d96ab3a943d6abcb7a1d80873c466ec.jpg",
512
+ "text": "$$\n\\dot { s _ { i } } = a _ { i } ( s _ { i } ) [ b _ { i } ( s _ { i } ) - \\sum _ { j = 1 } ^ { N } c _ { i j } d _ { j } ( s _ { j } ) ] ,\n$$",
513
+ "text_format": "latex",
514
+ "bbox": [
515
+ 380,
516
+ 462,
517
+ 617,
518
+ 507
519
+ ],
520
+ "page_idx": 3
521
+ },
522
+ {
523
+ "type": "text",
524
+ "text": "with $a _ { i } ( s _ { i } ) = 1 / \\tau _ { i }$ , $b _ { i } ( s _ { i } ) = x _ { i } - G _ { i } ( s _ { i } )$ , $c _ { i j } = - f _ { i j }$ and $d _ { j } ( s _ { j } ) = s _ { j }$ . Thus, it is known to be globally absolute stable, with a Lyapunov function ",
525
+ "bbox": [
526
+ 173,
527
+ 508,
528
+ 823,
529
+ 537
530
+ ],
531
+ "page_idx": 3
532
+ },
533
+ {
534
+ "type": "equation",
535
+ "img_path": "images/617c1c10f7d08e612cb314f263d3e32087eea99241d887ae6e71dbbd2746283e.jpg",
536
+ "text": "$$\n\\begin{array} { r l r } & { } & { V = - \\displaystyle \\sum _ { i } \\int _ { 0 } ^ { s _ { i } } b _ { i } ( u ) d _ { i } ^ { \\prime } ( u ) \\mathrm { d } u + \\displaystyle \\sum _ { i , j } \\frac { c _ { i j } } { 2 } d _ { i } ( s _ { i } ) d _ { j } ( s _ { j } ) } \\\\ & { } & { \\quad = \\displaystyle \\sum _ { i } \\Big ( P _ { i } ( s _ { i } ) - x _ { i } s _ { i } - \\displaystyle \\sum _ { j > i } f _ { i j } s _ { i } s _ { j } - \\frac { f _ { i i } } { 2 } s _ { i } ^ { 2 } \\Big ) , } \\\\ & { } & { \\quad \\mathrm { w h e r e ~ o u t p u t ~ p o w e r ~ } P _ { i } ( s _ { i } ) \\equiv \\displaystyle \\int _ { 0 } ^ { s _ { i } } G _ { i } ( u ) \\mathrm { d } u . } \\end{array}\n$$",
537
+ "text_format": "latex",
538
+ "bbox": [
539
+ 321,
540
+ 540,
541
+ 678,
542
+ 652
543
+ ],
544
+ "page_idx": 3
545
+ },
546
+ {
547
+ "type": "text",
548
+ "text": "116 Alternatively, since our system (5) is piecewise-linear, a piecewise-quadratic Lyapunov function may \n117 be obtained by a piecewise-affine system [22] analysis. While this approach is more powerful and \n118 holds even for asymmetric interaction matrices, it also seems to be analytically complex. From another \n119 angle, global asymptotic stability [21, Theorem 3] is guaranteed if the Jacobian matrix $\\mathbf { J }$ satisfies \n120 $J _ { i i } \\dot { + } 1 \\dot { / } 2 \\sum _ { j \\neq i } \\dot { | } J _ { i j } + J _ { j i } | < 0 \\Longleftrightarrow G _ { i } ^ { \\prime } ( s _ { i } ) > 0$ because in our system $\\begin{array} { r } { J _ { i i } = - \\sum _ { j \\neq i } f _ { i j } - G _ { i } ^ { \\prime } ( s _ { i } ) } \\end{array}$ \n121 and $J _ { i j } = f _ { i j }$ . Since our network employs non-monotonic functionality, $G _ { i } ^ { \\prime } ( s _ { i } ) > 0$ cannot be \n122 guaranteed for all reachable states $s _ { i }$ , and thus the above criteria is unfortunately inapplicable. Hence, \n123 we shall proceed with the Cohen-Grossberg approach. ",
549
+ "bbox": [
550
+ 140,
551
+ 659,
552
+ 826,
553
+ 775
554
+ ],
555
+ "page_idx": 3
556
+ },
557
+ {
558
+ "type": "text",
559
+ "text": "124 The power function (21) simplifies to ",
560
+ "bbox": [
561
+ 145,
562
+ 779,
563
+ 419,
564
+ 795
565
+ ],
566
+ "page_idx": 3
567
+ },
568
+ {
569
+ "type": "equation",
570
+ "img_path": "images/800ffae7752736c21a4922a3289bf4e8558764f630301baeda6e026733c133e0.jpg",
571
+ "text": "$$\nP ( s ) = \\left\\{ \\begin{array} { l l } { \\int _ { 0 } ^ { s } g _ { 1 } u \\mathrm { d } u = g _ { 1 } s ^ { 2 } / 2 } & { 0 \\le s \\le g _ { 2 } } \\\\ { g _ { 1 } g _ { 2 } ^ { 2 } / 2 + \\int _ { g _ { 2 } } ^ { s } ( g _ { 1 } + g _ { 3 } ) g _ { 2 } - g _ { 3 } u \\mathrm { d } u } & { g _ { 2 } \\le s } \\\\ { = g _ { 1 } s ^ { 2 } / 2 - g _ { \\oplus } ( s - g _ { 2 } ) ^ { 2 } , } \\end{array} \\right.\n$$",
572
+ "text_format": "latex",
573
+ "bbox": [
574
+ 297,
575
+ 796,
576
+ 699,
577
+ 854
578
+ ],
579
+ "page_idx": 3
580
+ },
581
+ {
582
+ "type": "text",
583
+ "text": "125 and using the rectifier function $[ x ) \\equiv \\operatorname* { m a x } ( x , 0 )$ may be expressed conveniently as ",
584
+ "bbox": [
585
+ 142,
586
+ 857,
587
+ 715,
588
+ 872
589
+ ],
590
+ "page_idx": 3
591
+ },
592
+ {
593
+ "type": "equation",
594
+ "img_path": "images/2b9a2b8e0e8ce7e3a1917ab44ef8e3edf1e02c7ba6b658a55a75b75d1f60b808.jpg",
595
+ "text": "$$\nP ( s ) = g _ { 1 } s ^ { 2 } / 2 - g _ { \\oplus } [ s - g _ { 2 } ) ^ { 2 } ,\n$$",
596
+ "text_format": "latex",
597
+ "bbox": [
598
+ 393,
599
+ 876,
600
+ 602,
601
+ 893
602
+ ],
603
+ "page_idx": 3
604
+ },
605
+ {
606
+ "type": "text",
607
+ "text": "126 when the system is within its operational bounds. ",
608
+ "bbox": [
609
+ 142,
610
+ 897,
611
+ 496,
612
+ 912
613
+ ],
614
+ "page_idx": 3
615
+ },
616
+ {
617
+ "type": "text",
618
+ "text": "128 Given the Lyapunov stability result of our system, it is computationally efficient to simulate our \n129 state-space model and probe for combinational functionality. Here, we will simulate for the simplest \n130 proof-of-concept for deep functionality in a shallow recurrent - solving a parity problem. \n131 Using a cascade of 2-input XOR gates, the $N$ -bit parity function can be realized with $N / 2 + N / 4 +$ \n132 $\\dots + 1 = N - 1$ gates and $2 N - 1$ connections. Thus its total cost in area is at least $3 N - 2$ units. \n133 A minimally-connected network has $N$ input wires, 1 output wire, and $N - 1$ interconnect wires \n134 with a total area cost of $2 N$ units, assuming that the area occupied by the remaining components is \n135 negligible. Thus for $N = 3$ , while a conventional digital circuit costs 7 units, our recurrent physical \n136 network takes just 6 wiring units. \n137 Our simple model has $N = 3$ , $f _ { 1 2 } = f _ { 1 3 } = f$ , $f _ { 2 3 } = 0$ , $g _ { 1 1 } = g _ { 1 }$ , $g _ { 1 3 } = g _ { 3 }$ , $g _ { 2 1 } = g _ { 3 1 } = \\gamma _ { 1 }$ \n138 $g _ { 2 3 } = g _ { 3 3 } = \\gamma _ { 3 }$ , $g _ { 1 2 } = g _ { 2 }$ and $\\gamma _ { 2 2 } = \\gamma _ { 3 2 } = \\gamma _ { 2 }$ . We find from a symbolic evaluation that $\\sigma _ { \\mathrm { m i n } } ( \\pmb { \\mathsf { A } } ) \\neq$ \n139 $1 / \\rho ( | \\pmb { \\mathsf { A } } ^ { - 1 } | )$ in general, and conditions for unique stability were not obtainable (which is not surprising \n140 due to the $s _ { 2 } \\mathrm { ~ - ~ } s _ { 3 }$ symmetry). Thus, parity functionality was found by trial-and-error yielding the \n141 parameters $\\{ f = 1 . 7 5 1 , g _ { 1 } = 1 . 8 7 6 , g _ { 2 } = g _ { 3 } = 0 . 1 2 6 , \\gamma _ { 1 } = 0 . 8 7 6 , \\gamma _ { 2 } = 1 . 6 , \\gamma _ { 3 } = 0 . 7 5 1 \\}$ and \n142 simulated using Wolfram Mathematica 13 (code in Appendix). When $x _ { 1 } = x _ { 2 } = x _ { 3 } = 1$ , the states \n143 were forced to transition beyond the bounds in (5), so its range was extended by taking an absolute \n144 value. The results are plotted in Fig. 2. ",
619
+ "bbox": [
620
+ 142,
621
+ 125,
622
+ 826,
623
+ 167
624
+ ],
625
+ "page_idx": 4
626
+ },
627
+ {
628
+ "type": "text",
629
+ "text": "",
630
+ "bbox": [
631
+ 142,
632
+ 172,
633
+ 825,
634
+ 257
635
+ ],
636
+ "page_idx": 4
637
+ },
638
+ {
639
+ "type": "text",
640
+ "text": "",
641
+ "bbox": [
642
+ 140,
643
+ 262,
644
+ 825,
645
+ 376
646
+ ],
647
+ "page_idx": 4
648
+ },
649
+ {
650
+ "type": "text",
651
+ "text": "145 4 Discussion ",
652
+ "text_level": 1,
653
+ "bbox": [
654
+ 142,
655
+ 404,
656
+ 316,
657
+ 424
658
+ ],
659
+ "page_idx": 4
660
+ },
661
+ {
662
+ "type": "text",
663
+ "text": "146 Our result should be seen as a theoretical proof-of-concept and as a motivation for continued \n147 research in this area. Future work must extend our simulations to much higher dimensions to serve \n148 as a practical demonstration of deep functionality by shallow recurrent networks. Moreover, the \n149 theoretical formalism introduced here is not yet fully exploited. We hope to find an analytical method \n150 to design functionality out of piecewise-linear Cohen-Grossberg networks. \n151 Our style of reasoning to circumvent the Shannon bottleneck may also be applied to other systems \n152 such as networks of coupled oscillators [28]. Our non-modular mode of signal processing, offers \n153 an alternative to not just circuit designers, but also to systems biologists who typically understand \n154 chemical reaction networks [6] as a composition of modules [20]. While, we have discussed \n155 equilibium-point functionality in a state-space model driven by an additive input, it is also worth \n156 investigating autonomous systems where the input is set as an initial state. An example is realizing \n157 unboundedly-finite parity functions using just a radius-4 cellular automaton [4]. Finally, we hope \n158 that this paper can serve as a call to action for neuromorphic engineers to look at physical reservoir \n159 computing [36] from another angle, besides temporal input-output functionality. ",
664
+ "bbox": [
665
+ 142,
666
+ 443,
667
+ 825,
668
+ 512
669
+ ],
670
+ "page_idx": 4
671
+ },
672
+ {
673
+ "type": "text",
674
+ "text": "",
675
+ "bbox": [
676
+ 140,
677
+ 518,
678
+ 825,
679
+ 643
680
+ ],
681
+ "page_idx": 4
682
+ },
683
+ {
684
+ "type": "text",
685
+ "text": "160 References ",
686
+ "text_level": 1,
687
+ "bbox": [
688
+ 148,
689
+ 672,
690
+ 284,
691
+ 690
692
+ ],
693
+ "page_idx": 4
694
+ },
695
+ {
696
+ "type": "text",
697
+ "text": "[1] M. A. Alcorn, Q. Li, Z. Gong, C. Wang, L. Mai, W.-S. Ku, and A. Nguyen. Strike (with) a pose: Neural networks are easily fooled by strange poses of familiar objects. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4845–4854, 2019. \n[2] R. D. Beer. Parameter space structure of continuous-time recurrent neural networks. Neural computation, 18(12):3009–3051, 2006. \n[3] N. Bernstein. The co-ordination and regulation of movements. The co-ordination and regulation of movements, 1966. \n[4] H. Betel, P. P. de Oliveira, and P. Flocchini. Solving the parity problem in one-dimensional cellular automata. Natural Computing, 12(3):323–337, 2013. \n[5] E. Bizzi, N. Hogan, F. A. Mussa-Ivaldi, and S. Giszter. Does the nervous system use equilibriumpoint control to guide single and multiple joint movements? Behavioral and brain sciences, 15(4):603–613, 1992. ",
698
+ "bbox": [
699
+ 168,
700
+ 703,
701
+ 826,
702
+ 911
703
+ ],
704
+ "page_idx": 4
705
+ },
706
+ {
707
+ "type": "image",
708
+ "img_path": "images/d9cf59a020f738ccb475e1ac9c101a757318b97c389dc2f1ff8fa83e38e5c4da.jpg",
709
+ "image_caption": [
710
+ "Figure 2: Numerical simulation of our 3-state network over 200 timesteps. "
711
+ ],
712
+ "image_footnote": [],
713
+ "bbox": [
714
+ 313,
715
+ 140,
716
+ 689,
717
+ 833
718
+ ],
719
+ "page_idx": 5
720
+ },
721
+ {
722
+ "type": "text",
723
+ "text": "[6] D. Bray. Protein molecules as computational elements in living cells. Nature, 376(6538):307– 312, 1995. 75 [7] B. Buchberger. Ein algorithmus zum auffinden der basiselemente des restklassenringes nach einem nulldimensionalen polynomideal. PhD thesis, Universitat Insbruck, 1965. [8] B. Buchberger. Bruno buchberger’s phd thesis 1965: An algorithm for finding the basis 78 elements of the residue class ring of a zero dimensional polynomial ideal. Journal of symbolic computation, 41(3-4):475–511, 2006. [9] G. S. Carr. Synopsis of elementary results in pure mathematics. 1886. [10] M. A. Cohen and S. Grossberg. Absolute stability of global pattern formation and parallel memory storage by competitive neural networks. IEEE transactions on systems, man, and cybernetics, (5):815–826, 1983. [11] R. W. Cottle. Linear complementarity problem, pages 1873–1878. Springer US, Boston, MA, 2009. [12] D. Durstewitz. A state space approach for piecewise-linear recurrent neural networks for identifying computational dynamics from neural measurements. PLoS computational biology, 13(6):e1005542, 2017. [13] I. Z. Emiris. On the complexity of sparse elimination. Journal of Complexity, 12(2):134–166, 1996. [14] A. G. Feldman. Functional tuning of the nervous system with control of movement or maintenance of a steady posture-ii. controllable parameters of the muscle. Biofizika, 11:565–578, 1966. [15] W. Fulton. Intersection theory, volume 2. Springer Science & Business Media, 2013. [16] S. Gao, M. Zhou, Y. Wang, J. Cheng, H. Yachi, and J. Wang. Dendritic neuron model with ef96 fective learning algorithms for classification, approximation, and prediction. IEEE transactions on neural networks and learning systems, 30(2):601–614, 2019. [17] M. R. Gardner and W. R. Ashby. Connectance of large dynamic (cybernetic) systems: critical values for stability. Nature, 228(5273):784–784, 1970. [18] I. J. Goodfellow, J. Shlens, and C. Szegedy. Explaining and harnessing adversarial examples, 2015. [19] A. Harnack. Ueber die vieltheiligkeit der ebenen algebraischen curven. Mathematische Annalen, 10(2):189–198, 1876. [20] L. H. Hartwell, J. J. Hopfield, S. Leibler, and A. W. Murray. From molecular to modular cell biology. Nature, 402(6761):C47–C52, 1999. [21] M. W. Hirsch. Convergent activation dynamics in continuous time networks. Neural networks, 2(5):331–349, 1989. [22] M. Johansson and A. Rantzer. Computation of piecewise quadratic lyapunov functions for hybrid systems. In 1997 European Control Conference (ECC), pages 2005–2010. IEEE, 1997. [23] J. Kubilius, M. Schrimpf, K. Kar, R. Rajalingham, H. Hong, N. Majaj, E. Issa, P. Bashivan, J. Prescott-Roy, K. Schmidt, et al. Brain-like object recognition with high-performing shallow recurrent anns. Advances in neural information processing systems, 32, 2019. [24] C. P. Lawrence. Evolving Networks To Have Intelligence Realized At Nanoscale. PhD thesis, University of Twente, 2018. [25] M. Liang and X. Hu. Recurrent convolutional neural network for object recognition. In 16 Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3367– 17 3375, 2015. ",
724
+ "bbox": [
725
+ 155,
726
+ 69,
727
+ 831,
728
+ 915
729
+ ],
730
+ "page_idx": 6
731
+ },
732
+ {
733
+ "type": "text",
734
+ "text": "18 [26] O. Mangasarian and R. Meyer. Absolute value equations. Linear Algebra and Its Applications, 419(2-3):359–367, 2006. \n20 [27] R. M. May. Will a large complex system be stable? Nature, 238(5364):413–414, 1972. [28] S. N. Menon and S. Sinha. “defective” logic: Using spatiotemporal patterns in coupled relaxation oscillator arrays for computation. In 2014 International Conference on Signal Processing and Communications (SPCOM), pages 1–6. IEEE, 2014. [29] S.-M. Moosavi-Dezfooli, A. Fawzi, O. Fawzi, and P. Frossard. Universal adversarial perturbations. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1765–1773, 2017. [30] M. Raghu, B. Poole, J. Kleinberg, S. Ganguli, and J. Sohl-Dickstein. On the expressive power of deep neural networks. In international conference on machine learning, pages 2847–2854. PMLR, 2017. \n30 [31] M. D. Riedel and J. Bruck. Cyclic boolean circuits. Discrete Applied Mathematics, 160(13- 14):1877–1900, 2012. [32] J. Rohn, V. Hooshyarbakhsh, and R. Farhadsefat. An iterative method for solving absolute value equations and sufficient conditions for unique solvability. Optimization Letters, 8(1):35–44, 2014. \n35 [33] D. Schmidt, G. Koppe, Z. Monfared, M. Beutelspacher, and D. Durstewitz. Identifying nonlinear dynamical systems with multiple time scales and long-range dependencies. In International Conference on Learning Representations, 2021. \n38 [34] C. E. Shannon. The synthesis of two-terminal switching circuits. The Bell System Technical Journal, 28(1):59–98, 1949. [35] K.-Y. Siu, V. P. Roychowdhury, and T. Kailath. Depth-size tradeoffs for neural computation. IEEE Transactions on Computers, 40(12):1402–1412, 1991. [36] G. Tanaka, T. Yamane, J. Héroux, R. Nakane, N. Kanazawa, S. Takeda, H. Numata, D. Nakano, and A. Hirose. Recent advances in physical reservoir computing: A review. Neural Networks, 115:100–123, 2019. [37] W. M. Van Bokhoven and D. M. Leenaerts. Explicit formulas for the solutions of piecewise linear networks. IEEE Transactions on Circuits and Systems I: Fundamental Theory and Applications, 46(9):1110–1117, 1999. [38] M. P. Williams. Solving polynomial equations using linear algebra. Johns Hopkins APL Technical Digest, 28(4):354–363, 2010. \n0 [39] S. Wolfram. A new kind of science, volume 5. Wolfram media Champaign, IL, 2002. \n51 [40] L. Zhang, G. Naitzat, and L.-H. Lim. Tropical geometry of deep neural networks. In International Conference on Machine Learning, pages 5824–5832. PMLR, 2018. ",
735
+ "bbox": [
736
+ 153,
737
+ 83,
738
+ 828,
739
+ 746
740
+ ],
741
+ "page_idx": 7
742
+ },
743
+ {
744
+ "type": "text",
745
+ "text": "Checklist ",
746
+ "text_level": 1,
747
+ "bbox": [
748
+ 163,
749
+ 773,
750
+ 269,
751
+ 792
752
+ ],
753
+ "page_idx": 7
754
+ },
755
+ {
756
+ "type": "text",
757
+ "text": "1. For all authors... ",
758
+ "bbox": [
759
+ 214,
760
+ 809,
761
+ 339,
762
+ 821
763
+ ],
764
+ "page_idx": 7
765
+ },
766
+ {
767
+ "type": "text",
768
+ "text": "(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] The concrete result is the realization of a parity function by our recurrent physical network by using just 6 wiring units, while a conventional digital circuit costs 7 units. That being said, the paper is written to cover a much broader scope - this is a matter of taste (an earlier version of this manuscript recieved both positive and negative comments about the scope of this article). ",
769
+ "bbox": [
770
+ 240,
771
+ 828,
772
+ 823,
773
+ 911
774
+ ],
775
+ "page_idx": 7
776
+ },
777
+ {
778
+ "type": "text",
779
+ "text": "(b) Did you describe the limitations of your work? [Yes] It is mentioned that future work must extend our simulations to much higher dimensions to serve as a practical demonstration of deep functionality by shallow recurrent networks. Also the simulation parameters were found by trial and error, instead of being derived analytically from the theoretical formalism - these limitations are mentioned in the discussion. \n(c) Did you discuss any potential negative societal impacts of your work? [N/A] \n(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] ",
780
+ "bbox": [
781
+ 236,
782
+ 92,
783
+ 826,
784
+ 208
785
+ ],
786
+ "page_idx": 8
787
+ },
788
+ {
789
+ "type": "text",
790
+ "text": "2. If you are including theoretical results... ",
791
+ "bbox": [
792
+ 215,
793
+ 212,
794
+ 493,
795
+ 227
796
+ ],
797
+ "page_idx": 8
798
+ },
799
+ {
800
+ "type": "text",
801
+ "text": "(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A] ",
802
+ "bbox": [
803
+ 236,
804
+ 231,
805
+ 738,
806
+ 262
807
+ ],
808
+ "page_idx": 8
809
+ },
810
+ {
811
+ "type": "text",
812
+ "text": "3. If you ran experiments... ",
813
+ "bbox": [
814
+ 214,
815
+ 266,
816
+ 393,
817
+ 280
818
+ ],
819
+ "page_idx": 8
820
+ },
821
+ {
822
+ "type": "text",
823
+ "text": "(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] Check Appendix for the code to reproduce Figure 2. \n(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [N/A] \n(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A] \n(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [N/A] It is evident that Figure 2 is not a large-scale deep learning experiment but a small-scale conceptual simulation which takes less than 2 seconds on a modern desktop CPU. ",
824
+ "bbox": [
825
+ 238,
826
+ 285,
827
+ 825,
828
+ 444
829
+ ],
830
+ "page_idx": 8
831
+ },
832
+ {
833
+ "type": "text",
834
+ "text": "4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... ",
835
+ "bbox": [
836
+ 209,
837
+ 449,
838
+ 823,
839
+ 463
840
+ ],
841
+ "page_idx": 8
842
+ },
843
+ {
844
+ "type": "text",
845
+ "text": "(a) If your work uses existing assets, did you cite the creators? [N/A] \n(b) Did you mention the license of the assets? [N/A] \n(c) Did you include any new assets either in the supplemental material or as a URL? [No] \n(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] \n(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] ",
846
+ "bbox": [
847
+ 238,
848
+ 468,
849
+ 823,
850
+ 575
851
+ ],
852
+ "page_idx": 8
853
+ },
854
+ {
855
+ "type": "text",
856
+ "text": "5. If you used crowdsourcing or conducted research with human subjects... ",
857
+ "bbox": [
858
+ 215,
859
+ 579,
860
+ 707,
861
+ 593
862
+ ],
863
+ "page_idx": 8
864
+ },
865
+ {
866
+ "type": "text",
867
+ "text": "(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] \n(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] \n(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] ",
868
+ "bbox": [
869
+ 238,
870
+ 597,
871
+ 825,
872
+ 688
873
+ ],
874
+ "page_idx": 8
875
+ },
876
+ {
877
+ "type": "text",
878
+ "text": "299 A Appendix ",
879
+ "text_level": 1,
880
+ "bbox": [
881
+ 143,
882
+ 714,
883
+ 313,
884
+ 734
885
+ ],
886
+ "page_idx": 8
887
+ },
888
+ {
889
+ "type": "text",
890
+ "text": "300 Wolfram Mathematica code to reproduce Figure 2. ",
891
+ "bbox": [
892
+ 140,
893
+ 752,
894
+ 504,
895
+ 766
896
+ ],
897
+ "page_idx": 8
898
+ },
899
+ {
900
+ "type": "text",
901
+ "text": "$\\quad I n f \\circ J { : } =$ simulate $[ f _ { - }$ , $g _ { - }$ , $\\gamma \\_ 1 : =$ (sys $=$ NonlinearStateSpaceModel[{ {x1 - (2 f) ${ \\pmb { s } } { \\pmb { 1 } } + { \\pmb { f } }$ ( $\\mathsf { s } 2 + \\mathsf { s } 3 \\mathrm { \\mathrm { ; } }$ ) - Abs[g〚1〛 \\* s1 - (g〚1〛 $^ +$ g〚3〛) Ramp[s1 - g〚2〛]], x2 - (f) $\\mathsf { s } \\mathsf { 2 } + \\mathsf { f }$ (s1) - Abs[ $\\mathcal { Y }$ 〚1〛 s2 - ( $\\mathbf { \\mathcal { V } } [ [ \\mathbf { 1 } ] ] + \\mathbf { \\mathcal { V } } [ [ \\mathbf { 3 } ] ]$ ) Ramp[s2 - γ 〚2〛]], x3 - (f) $\\mathsf { s } \\mathsf { 3 } + \\mathsf { f }$ (s1) - Abs[ $\\mathcal { Y }$ 〚1〛 s3 - ( $\\mathbf { \\mathcal { V } } [ [ \\mathbf { 1 } ] ] + \\mathbf { \\mathcal { V } } [ [ \\mathbf { 3 } ] ]$ ) Ramp[s3 - $\\mathcal { Y }$ 〚2〛]]}, {x1, $\\times 2$ , $\\times 3$ , Xor[x1, $\\times 2$ , $\\times 3 ]$ , s1, s2, s3, $\\mathbf { y } =$ Abs[g〚1〛 s1 - (g〚1〛 ${ } + g$ 〚3〛) Ramp[s1 - g〚2〛]], HeavisideTheta[y - .15]} }, {s1, s2, s3}, $\\{ \\mathbf { x 1 } , \\mathbf { x 2 } , \\mathbf { x 3 } \\} ]$ ; inputs $= \\{ . 5 - . 5 \\star$ SquareWave[ t / 50], .5 - . $^ { ; \\star }$ SquareWave[ t / 100], .5 - .5 $^ { \\star }$ SquareWave[ t / 200]}; out $\\equiv$ OutputResponse[{sys, {0, 0}}, inputs, {t, 0, 200}]; GraphicsColumn@Table[Plot[out〚i〛, {t, 0, 200}, PlotRange All, Ticks {Automatic, {0, 1 / 5, 1, 2}}], {i, 9}]) ",
902
+ "bbox": [
903
+ 174,
904
+ 773,
905
+ 862,
906
+ 881
907
+ ],
908
+ "page_idx": 8
909
+ }
910
+ ]
parse/dev/401LFvBGIb/401LFvBGIb_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/401LFvBGIb/401LFvBGIb_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/E01k9048soZ/E01k9048soZ.md ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/E01k9048soZ/E01k9048soZ_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/E01k9048soZ/E01k9048soZ_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/E01k9048soZ/E01k9048soZ_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/ECvgmYVyeUz/ECvgmYVyeUz.md ADDED
@@ -0,0 +1,559 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # CHAOS IS A LADDER: A NEW THEORETICAL UNDERSTANDING OF CONTRASTIVE LEARNING VIA AUGMENTATION OVERLAP
2
+
3
+ Yifei Wang1∗ Qi Zhang2∗ Yisen Wang3,4† Jiansheng Yang1 Zhouchen Lin3,4,5
4
+
5
+ 1 School of Mathematical Sciences, Peking University
6
+ 2 School of Computer Science and Engineering, Sun Yat-sen University
7
+ 3 Key Lab. of Machine Perception (MoE), School of Artificial Intelligence, Peking University
8
+ 4 Institute for Artificial Intelligence, Peking University
9
+ 5 Pazhou Lab, Guangzhou, 510330, China
10
+
11
+ # ABSTRACT
12
+
13
+ Recently, contrastive learning has risen to be a promising approach for large-scale self-supervised learning. However, theoretical understanding of how it works is still unclear. In this paper, we propose a new guarantee on the downstream performance without resorting to the conditional independence assumption that is widely adopted in previous work but hardly holds in practice. Our new theory hinges on the insight that the support of different intra-class samples will become more overlapped under aggressive data augmentations, thus simply aligning the positive samples (augmented views of the same sample) could make contrastive learning cluster intra-class samples together. Based on this augmentation overlap perspective, theoretically, we obtain asymptotically closed bounds for downstream performance under weaker assumptions, and empirically, we propose an unsupervised model selection metric ARC that aligns well with downstream accuracy. Our theory suggests an alternative understanding of contrastive learning: the role of aligning positive samples is more like a surrogate task than an ultimate goal, and the overlapped augmented views (i.e., the chaos) create a ladder for contrastive learning to gradually learn class-separated representations. The code for computing ARC is available at https://github.com/zhangq327/ARC.
14
+
15
+ # 1 INTRODUCTION
16
+
17
+ Contrastive Learning (CL) emerges to be a promising paradigm for learning data representations without labeled data (Oord et al., 2018; Hjelm et al., 2019). Recently, it has achieved impressive results and gradually closed the gap between supervised and unsupervised learning, hopefully leading to a new era that resolves the hunger for labeled data in the deep learning field (He et al., 2020; Chen et al., 2020b; Wang et al., 2021). However, despite its intriguing empirical success, a theoretical understanding of how contrastive learning actually works in practice is still under-explored.
18
+
19
+ The general methodology of contrastive learning is quite simple, that is to maximize the similarity between augmented views of the same image (a.k.a. positive samples), and minimize the similarity between that of two random images (a.k.a. negative samples). Intuitively, it is an instance discrimination task (differing each image from others) instead of a classification task (clustering images from the same class together and differing with other classes). Nevertheless, as shown in Figure 1(a), CL representations are also class-separated. Therefore, understanding how the pretraining task (CL) and the downstream task (classification) interact plays a central role in both theoretical understandings and practical designings of contrastive methods.
20
+
21
+ Previously, Saunshi et al. (2019) and Lee et al. (2020) have tried to establish guarantees on the classification performance for self-supervised representations. However, their analysis relies heavily on the assumption that the two positive samples, as augmented views of the same image, are (nearly) conditionally independent on the class $y$ . However, this is hardly practical as the augmented views are still strongly input-dependent (see Figure 1(b)). In fact, if the conditional independence is satisfied, the unsupervised task will become as informative as the supervised task, making this discussion
22
+
23
+ (a) Contrastive learning learns clustered features.
24
+
25
+ ![](images/f0e71e9dc98bcc446485082ba4b2db17785b417586b2c89a2666d120819ca82f.jpg)
26
+ Figure 1: (a) t-SNE visualization of representations before and after contrastive learning. Each point denotes a sample and its color denotes its class. (b) Applying aggressive data augmentations (Chen et al., 2020a) to four images from ImageNet (two are cars and two are pens). The 1st column shows the raw (center-cropped) images and the 2-5th colums show the augmented ones.
27
+
28
+ ![](images/e053ee5cdb9fa66ce0d4be00f7f1d8fb74319bb5fa31517772994b0e79f855a3.jpg)
29
+ (b) Intra-class samples are more alike via augmented views.
30
+
31
+ almost unnecessary. This motivates us to find more practical and weaker assumptions to understand how contrastive learning actually works (even without conditional independence). To achieve this, we need to re-examine the contrastive learning process. Previously, Wang & Isola (2020) show that CL objective involves two goals: alignment (for positive samples) and uniformity (for negative samples). Nevertheless, we show that there exist bad cases where the features could still have poor performance even with perfect alignment and uniformity. Thus, contradictory to the common belief of contrastive learning as learning invariance, we note that invariance alone is inadequate to learning useful representations for downstream tasks.
32
+
33
+ In this paper, we provide a novel understanding of contrastive learning that requires only practical and minimal assumptions, while also guarantee class-separated representations. Our core insight hinges on the observation that contrastive learning usually adopts much more aggressive data augmentations than that in supervised learning (He et al., 2020; Chen et al., 2020a). As shown in Figure 1(b), we notice that aggressive random cropping of two images can generate views that are very much alike that we could even hardly tell them apart, e.g., the wheels of two different cars. In other words, there will be support overlap between different intra-class images through aggressively augmented views of them, a phenomenon we call augmentation overlap. Thus, the alignment of positive samples will also cluster all the intra-class samples together, and lead to class-separated representations. From our perspective, the role of data augmentation is to create a certain degree of “chaos” between intra-class samples, and the role of contrastive loss is to “climb the ladder of chaos”, i.e., the process that we gradually cluster intra-class samples by aligning positive samples.
34
+
35
+ Following this intuition, we develop a new theory for understanding the effectiveness of contrastive learning from the perspective of augmentation overlap. Specifically, we derive the upper and lower bounds for its downstream performance and show how the two bounds will asymptotically converge with our assumptions on augmentation overlap. Driven by this analysis, we further discuss how varying augmentation will affect the performance of contrastive learning from both synthetic and real-world datasets, and show that the results align well with our theory. In summary,
36
+
37
+ • We characterize the failure of the previous analysis of contrastive learning, and develop a new understanding through the augmentation overlap effect. Compared to existing theories on contrastive learning, ours can provide guidance to the practical designing of contrastive methods and evaluation metrics. • We establish general guarantees (both upper and lower bounds) for the downstream performance without assumptions on conditional independence. And we further show how the two bounds could asymptotically converge under our less restrictive assumptions. • We provide a quantitative discussion on the effect of augmentation strength, which verifies our theory from both theoretical and empirical aspects. Motivated by our theory, we further propose a new unsupervised evaluation metric for contrastive learning named ARC and show that it aligns well with downstream performance on real-world datasets.
38
+
39
+ # 2 RELATED WORK
40
+
41
+ Contrastive Learning in Practice. Contrastive self-supervised learning originates from a mutual information perspective of representation learning (Oord et al., 2018; Hjelm et al., 2019), and soon becomes a general learning paradigm that contrasts between positive and negative pairs (He et al., 2020; Chen et al., 2020a). It is rapidly closing the performance gap between unsupervised and supervised learning on large-scale dataset like ImageNet (Chen et al., 2021), and outperforms supervised learning when combined with a few (e.g., $10 \%$ ) labels (Chen et al., 2020b). Several recent works show that similar performance could be achieved without negative samples by adopting certain training techniques (Grill et al., 2020; Chen & He, 2020).
42
+
43
+ Understanding Contrastive Learning Objectives. Both the original InfoNCE loss (Oord et al., 2018) and its InfoMax variants (Hjelm et al., 2019; Poole et al., 2019) are designed as variational estimates of the mutual information between inputs and representations, but these estimators are shown to have poor bias-variance trade-offs (Song & Ermon, 2020). Instead, Wang & Isola (2020) simply understand contrastive learning through the two terms in the InfoNCE loss: alignment of positive samples and uniformity of negative samples. However, as we show later, this perspective is also insufficient to explain the effectiveness of contrastive learning, and we should take the interplay between augmentation and alignment into consideration.
44
+
45
+ Understanding Downstream Generalization. Saunshi et al. (2019) propose the first theoretical guarantees by bridging the contrastive and classification objectives. Lee et al. (2020) further link the reconstruction-based objective to the downstream objective. However, both Saunshi et al. (2019) and Lee et al. (2020) rely on the unrealistic assumption that the positive samples are (nearly) conditionally independent. Huang et al. (2021) establish bounds by assuming a very small intra-class support diameter, which is also not practical. Besides, some also explore the information-theoretical perspectives for analyzing contrastive learning (Tian et al., 2020; Tsai et al., 2021; Tosh et al., 2020; 2021), though their mutual information assumptions are hard to verify. Recently, similar to our analysis, HaoChen et al. (2021) also study the augmentation graph and establish guarantees in terms of graph connectivity. Our work differs to theirs mainly in three aspects: 1) our analysis is applicable for the widely adopted InfoNCE and CE losses, while theirs is developed for their own spectral loss; 2) ours starts from the alignment and uniformity perspective while theirs starts from the matrix decomposition perspective; 3) our theory is empirically verified and inspires a useful evaluation metric for data augmentation, while their analysis focusing on minimizing the decomposition error is farther from the practical designing of positive and negative samples. In a nutshell, compared to previous discussions, our theory has a closer connection to the actual contrastive learning process, and we verify the feasibility of each assumption with empirical evidence.
46
+
47
+ # 3 LIMITATIONS OF PREVIOUS UNDERSTANDINGS
48
+
49
+ We begin by introducing the basic notations and common practice of contrastive learning in the image classification task. In general, it has two stages, unsupervised pretraining, and supervised finetuning. In the first stage, with $N$ unlabeled samples $\mathcal { D } _ { u } \dot { = } \{ x _ { i } \} _ { i = 1 } ^ { \hat { N } }$ , we pretrain an encoder mapping from the $d$ -dimensonal input space to a unit hypersphere $f \in \bar { \mathcal { F } } : \mathbb { R } ^ { d } \to \mathbb { S } ^ { m - 1 }$ in the $m$ - dimensional space. In the second stage, we evaluate the learned representations $z$ with the labeled data $\mathcal { D } _ { l } = \{ ( \dot { x } _ { i } , y _ { i } ) \}$ where labels $\check { y _ { i } } \in \{ 1 , \ldots , K \}$ . Specifically, we fix the encoder and learn a linear classification head $g : \mathcal { R } ^ { m } \to \mathcal { R } ^ { K }$ on top from $\tilde { \mathcal { D } } _ { l } = \{ ( z , y ) | z = f ( x ) \in \mathcal { R } ^ { m } \}$ .
50
+
51
+ Contrastive Pretraining. Taking a training example $x \in \mathcal { D } _ { u }$ , we draw its positive sample $x ^ { + } =$ $t ( x )$ by applying a random data augmentation $t \sim \tau$ , and draw $M$ randomly augmented samples $\{ x _ { i } ^ { - } \} _ { i = 1 } ^ { M }$ from $\mathcal { D } _ { u }$ as its negative samples. Then, we can learn the encoder $f$ with the widely used InfoNCE loss (Oord et al., 2018)
52
+
53
+ $$
54
+ { \mathcal { L } } _ { \mathrm { N C E } } ( f ) = \mathbb { E } _ { p ( x , x ^ { + } ) } \mathbb { E } _ { \{ p ( x _ { i } ^ { - } ) \} } \left[ - \log \frac { \exp ( f ( x ) ^ { \top } f ( x ^ { + } ) ) } { \sum _ { i = 1 } ^ { M } \exp ( f ( x ) ^ { \top } f ( x _ { i } ^ { - } ) ) } \right] .
55
+ $$
56
+
57
+ Let $p ( x )$ be the data distribution, $p ( x , x ^ { + } )$ be the joint distribution of positive pairs, and we simply assume $p ( x , x ^ { + } ) = p ( x ^ { + } , x )$ and $\begin{array} { r } { p ( x ) = \int p ( x , x ^ { + } ) d x ^ { + } , \forall x \in \mathbb { R } ^ { d } } \end{array}$ following Wang $\&$ Isola (2020).
58
+
59
+ Linear Evaluation. To evaluate the learned representations by contrastive learning, we usually adopt the Cross Entropy (CE) loss (Chen et al., 2020a) for a labeled pair $( x , y ) \in \mathcal { D } _ { l }$
60
+
61
+ $$
62
+ \mathcal { L } _ { \mathrm { C E } } ( \boldsymbol { f } , \boldsymbol { g } ) = \mathbb { E } _ { p ( \boldsymbol { x } , \boldsymbol { y } ) } \left[ - \log \frac { \exp \left( \boldsymbol { f } ( \boldsymbol { x } ) ^ { \top } \boldsymbol { w } _ { \boldsymbol { y } } \right) } { \sum _ { i = 1 } ^ { K } \exp \left( \boldsymbol { f } ( \boldsymbol { x } ) ^ { \top } \boldsymbol { w } _ { i } \right) } \right] ,
63
+ $$
64
+
65
+ with a linear classifier $\begin{array} { r } { g ( z ) = W z } \end{array}$ where $W = [ w _ { 1 } , w _ { 2 } , \dots , w _ { K } ]$
66
+
67
+ As discussed above, there are some previous understandings on how contrastive learning yields good performance, and they mainly differ by their theoretical assumptions.
68
+
69
+ First, Wang & Isola (2020) interpret the first and second terms of the InfoNCE loss (Eq. 1) as they are aiming at the following two properties: 1) alignment (the nominator): positive samples $x , x ^ { \mp }$ has similar features, i.e., $f ( x ) \approx f ( x ^ { + } ) ; 2 )$ uniformity (the denominator): features are roughly uniformly distributed in the unit hypersphere $\mathbb { S } ^ { m - 1 }$ . In particular, they show that InfoNCE can be minimized with 1) perfect alignment and 2) perfect uniformity. However, as we illustrate in Figure 2, the features could still have very poor downstream performance in the finite sample scenario. This issue can be described rigorously by the following proposition.
70
+
71
+ Proposition 3.1 (Class-uniform Features Also Minimize the InfoNCE Loss). For $N$ training examples of $K$ classes, consider the case when features $\{ f ( x _ { i } ) \} _ { i = 1 } ^ { N }$ are randomly distributed in $\mathbb { S } ^ { m - 1 }$ with maximal uniformity (i.e., , minimizing the 2nd term of Eq. 1) while also satisfying $\forall x _ { i } , x _ { i } ^ { + } \sim$ $p ( x , x ^ { + } ) , f ( x _ { i } ) = f ( x _ { i } ^ { + } )$ . Because we have these two properties, the InfoNCE loss achieves its minimum. However, the downstream classification accuracy is at most $1 / K + \varepsilon$ and $\varepsilon$ is nearly zero when $N$ is large enough.
72
+
73
+ ![](images/0772bd27b1244f8c1ea80ee3e34c28cf085d993dbf1f7e1d39e45dfb80d9eaed.jpg)
74
+ Figure 2: Contrastive learning may learn class inseparable features even with perfect aligned postive samples and uniform negative samples. Colors denote classes.
75
+
76
+ Proofs can be found in Appendix A. This proposition indicates that the instance discrimination task (alignment $^ +$ uniformity) alone cannot guarantee the learning of class-discriminative features as desired in the downsteam classification. Instead, Saunshi et al. (2019) and Lee et al. (2020) both establish the relationship between pretraining and classification objectives and provide guarantees for the downstream performance. In fact, the two works both assume the conditional independence of the two positive samples, i.e., $p ( x , x ^ { + } | y ) \stackrel { } { = } p ( x | y ) p ( x ^ { + } | y )$ . However, this assumption is too strong as it is hardly practical. As shown in Figure 1(b), augmented views from the same class are not actually independent as views from the same sample are more alike than that from other samples.
77
+
78
+ # 4 NEW AUGMENTATION OVERLAP THEORY FOR CONTRASTIVE LEARNING
79
+
80
+ The analysis above motivates us to find a minimal and practical assumption: 1) it is enough to guarantee good performance on downstream tasks; 2) it is less restrictive than the i.i.d. assumptions as in Saunshi et al. (2019) and Lee et al. (2020).
81
+
82
+ # 4.1 GAP BETWEEN CONTRASTIVE LEARNING AND DOWNSTREAM CLASSIFICATION
83
+
84
+ We start with an assumption on the label consistency between positive samples, that is, any pair of positive samples $( x , x ^ { + } )$ should belong to the same class.
85
+
86
+ Assumption 4.1 (Label Consistency). $\forall x , x ^ { + } \sim p ( x , x ^ { + } )$ , we assume the labels are deterministic (one-hot) and consistent: $p ( y | x ) = p ( y | x ^ { + } )$ .
87
+
88
+ This is a natural and minimal assumption that is likely to hold in practice. As shown in Figure 1(b), the widely adopted augmentations in contrastive learning (Chen et al., 2020a) like images cropping, color distortion, and horizontal flipping will hardly alter the belonging image classes.
89
+
90
+ With this minimal assumption, we can characterize the generalization gap between unsupervised and supervised learning risks. We first introduce the mean CE loss, $L _ { \mathrm { C E } } ^ { \mu } ( f ) \ ^ { \bullet } =$ $\begin{array} { r } { \mathbb { E } _ { p ( x , y ) } \left[ - \log \frac { \exp \bigl ( f ( x ) ^ { \top } \mu _ { y } \bigr ) } { \sum _ { i = 1 } ^ { K } \exp ( f ( x ) ^ { \top } \mu _ { i } ) } \right] } \end{array}$ where we use the classwise mean representation $\mu _ { k } \quad = $ $\mathbb { E } _ { p ( x | y = k ) } [ f ( x ) ]$ as the weight $w _ { k }$ of the classifier $g$ . It is easy to see that the mean CE loss upper bounds the CE loss, i.e., $L _ { \mathrm { C E } } ^ { \mu } ( f ) \ge \operatorname* { m i n } _ { g } \mathcal { L } _ { \mathrm { C E } } ( f , g )$ and Saunshi et al. (2019) showed that the mean classifier could achieve comparable performance to learned weights. Then, we have the following upper and lower bounds on the downstream risk (measured by mean CE loss).
91
+
92
+ ![](images/febec30b3917f142e2a926dec2b0e53957afadbe351fce38cb345c0b6e6d8cb8.jpg)
93
+ (b) Augmentation graph under increasing augmentation strengthes (left to right).
94
+
95
+ (a) Contrastive learning with an augmentation graph satisfying intra-class connectivity.
96
+
97
+ Figure 3: Illustrative examples of augmentation graphs, where each dot denotes a sample $x \in \mathcal { D } _ { u }$ and its color denotes its class. The lighter disks denote the support of the positive samples $p ( x ^ { + } | x )$ . We draw a solid edge for each $\tau$ -connected pair.
98
+
99
+ Theorem 4.2 (Guarantees for General Encoders). If Assumption 4.1 holds, then, for any $f \in { \mathcal { F } }$ , its downstream classification risk $\mathcal { L } _ { \mathrm { C E } } ^ { \mu } ( f )$ can be bounded by the contrastive learning risk $\mathcal { L } _ { \mathrm { N C E } } ( f )$
100
+
101
+ $$
102
+ \begin{array} { r l } & { \quad \mathcal { L } _ { \mathrm { N C E } } ( f ) - \sqrt { \mathrm { V a r } ( f ( x ) \mid y ) } - \frac { 1 } { 2 } \mathrm { V a r } ( f ( x ) \mid y ) - \mathcal { O } \left( M ^ { - 1 / 2 } \right) } \\ & { \leq \mathcal { L } _ { \mathrm { C E } } ^ { \mu } ( f ) + \log ( M / K ) \leq \mathcal { L } _ { \mathrm { N C E } } ( f ) + \sqrt { \mathrm { V a r } ( f ( x ) \mid y ) } + \mathcal { O } \left( M ^ { - 1 / 2 } \right) , } \end{array}
103
+ $$
104
+
105
+ where $\log ( M / K )$ is a constant\*, $\operatorname { V a r } ( f ( x ) | y ) = \mathbb { E } _ { p ( y ) } \left[ \mathbb { E } _ { p ( x | y ) } | | f ( x ) - \mathbb { E } _ { p ( x | y ) } f ( x ) | | ^ { 2 } \right]$ denotes the conditional (intra-class) feature variance, and $\mathcal { O } \left( M ^ { - 1 / 2 } \right)$ denotes the order of the approximation error by using $M$ negative samples.
106
+
107
+ Notably, our generalization bounds above improve over previous ones in the following aspects:
108
+
109
+ 1) we do not require the conditional independence assumption as in Saunshi et al. (2019); 2) we directly analyze the widely adopted InfoNCE loss (for contrastive learning) and CE loss (for supervised finetuning), while Saunshi et al. (2019) are restricted to hinge and logistic objectives that have worse performance in practice (Chen et al., 2020a); 3) the class collision error terms introduced in Saunshi et al. (2019) (due to the existence of same-class samples in the negative samples) now disappear in our bounds by adopting the InfoNCE loss, which also helps understand why InfoNCE performs better in practice; and 4) the bounds in Saunshi et al. (2019) will become looser with more negative samples, which is contradictory to the common practice (Chen et al., 2020a). While in our bounds, a larger $M$ indeed has a lower approximation error and helps close the generalization gap.
110
+
111
+ In fact, several recent works have also been devoted to resolve the last “large- $M ^ { \prime }$ ” problem (Ash et al., 2021; Merad et al., 2020). Nevertheless, their analysis also requires the conditional independence assumption as in Saunshi et al. (2019), while we show this problem can be resolved even without conditional independence. Nozawa & Sato (2021) also establish bounds for the InfoNCE loss, but their bounds have incompressible class collision terms while ours do not.
112
+
113
+ Nevertheless, an important message of the theorem above is that Assumption 4.1 alone is still insufficient to guarantee good downstream performance. As there are intra-class variance terms in the upper and lower bounds, when they are large enough, contrastive learning might still have inferior performance as shown in Proposition 3.1. Although the variance terms can be easily eliminated with the canonical conditional independence assumption, discussions in Section 1 have already demonstrated its impracticality. In the next part, we will present a new understanding of how contrastive learning could control this variance term in practice.
114
+
115
+ # 4.2 CLOSING THE GAP WITH INTRA-CLASS CONNECTIVITY
116
+
117
+ The theorem above motivates us to study how contrastive learning could effectively control its intraclass variance and learn class-separated features. Here, we propose a new understanding of this clustering ability through a dissection of the augmented views. In particular, we notice that although samples are different from each other, applying aggressive augmentations like that in SimCLR (Chen et al., 2020a) can largely make them more alike. For example, in Figure 1(b), two different cars become very similar when they are both cropped to the wheels. Then, with contrastive learning, the two cars will have closer representations as they share a common view of the wheels. In other words, two different intra-class samples could be aligned together if they have overlapped augmented views. If all intra-class samples could be bridged by data augmentations, we can successfully cluster the whole class together. Below, we formalize the intuition above with the language of graphs.
118
+
119
+ Notations. A graph $\mathcal { G }$ is represented by a tuple $\mathcal { G } = ( \nu , \mathcal { E } )$ where $\mathcal { V } = ( v _ { 1 } , v _ { 2 } , \ldots , v _ { N } )$ is a set of vertices and $\mathcal { E } \subseteq \mathcal { V } \times \mathcal { V }$ is a set of edges. A path is a sequence of edges that joins a sequence of vertices, e.g., $v _ { i _ { 1 } } - v _ { i _ { 2 } } - \cdot \cdot \cdot - v _ { i _ { k } }$ . We say that two vertices $v$ and $u$ are connected if $\mathcal { G }$ contains a path from $v$ to $u$ . A graph is said to be connected if every pair of vertices in the graph is connected. Two graphs are said to be disjoint if any pair of inter-graph vertices are not connected.
120
+
121
+ To begin with, we define the concept of $\tau$ -connectivity of sample pairs, which describes whether two samples could be connected via the augmentation overlap of their augmented views.
122
+
123
+ Definition 4.3 ( $\tau$ -connectivity). Given a collection of augmentations $\mathcal { T } = \{ t \ | \ t : \mathbb { R } ^ { d } \to \mathbb { R } ^ { d } \}$ , we say that two different images $x _ { i } , x _ { j } \ \in \ \mathbb { R } ^ { d }$ are $\tau$ -connected if they have overlapped views: $\mathrm { s u p p } ( p ( x _ { i } ^ { + } | x _ { i } ) ) \bigcap \mathrm { s u p p } ( p ( x _ { j } ^ { + } | x _ { j } ) ) \neq \partial$ , or equivalently, $\exists t _ { i } , t _ { j } \in \mathcal { T }$ such that $t _ { i } ( x _ { i } ) = t _ { j } ( x _ { j } )$ .
124
+
125
+ Then, we can define an augmentation graph of all training samples in terms of their $\tau$ -connectivity. Definition 4.4 (Augmentation Graph). Given a set of $N$ samples $\mathcal { D } = \{ x _ { i } \} _ { i = 1 } ^ { N }$ and an augmentation set $\mathcal { T } = \{ t \mid t : \mathbb { R } ^ { d } \mathbb { R } ^ { d } \}$ , we can define an augmentation graph $\mathcal { G } ( \mathcal { D } , \mathcal { T } ) = ( \nu , \mathcal { E } )$ as
126
+
127
+ • we take the $N$ natural samples as the vertices of the graph, i.e., $ { \gamma } = \{ x _ { i } \} _ { i = 1 } ^ { N }$ ;
128
+ • there exists an edge $e _ { i j }$ between two vertices $x _ { i }$ and $x _ { j }$ if they are $\tau$ -connected.
129
+
130
+ Based on these concepts, we introduce the following assumption that with a proper choice of data augmentations, all intra-class samples could form a connected graph, as depicted in Figure 3(a).
131
+
132
+ Assumption 4.5 (Intra-class Connectivity). Given a training set $\mathcal { D } _ { u }$ , there exists an appropriate augmentation set $\tau$ such that the augmentation graph $\mathcal { G } ( \mathcal { D } _ { u } , \bar { \mathcal { T } } )$ is class-wise connected, i.e., $\forall k \in$ $\{ 1 , \ldots , K \}$ , the subgraph $\mathcal { G } _ { k }$ (graph $\mathcal { G }$ restricted to vertices in class $k$ ) is connected.
133
+
134
+ Comparing to Saunshi et al. (2019) and Lee et al. (2020) that require (nearly) conditional independence $p ( \tilde { x , x ^ { + } } | y ) = p ( x | y ) p ( x ^ { + } | y )$ , ours only requires the connectivity of intra-class samples as in Figure 1(b), and does not need them to be conditionally independent.
135
+
136
+ To make this analysis technically simpler, we make another assumption that we can align positive samples perfectly by minimizing the InfoNCE loss. In practice, the alignment loss can typically be minimized up to a small error $\varepsilon$ , and we have appended a more involved discussion of this weak alignment scenario in Appendix B. For now, we focus on the simplified perfect alignment scenario.
137
+
138
+ Assumption 4.6 (Perfect Alignment). At the minimizer $f ^ { \star }$ of the InfoNCE loss, we can achieve perfect alignment, i.e., $\forall x , x ^ { \bar { + } } \sim p ( x , x ^ { + } ) , f ^ { \star } ( x ) = f ^ { \star } ( x ^ { + } )$ .
139
+
140
+ Proposition 4.7. Under Assumptions 4.5 & 4.6, by minimizing the InfoNCE loss we can conclude that the conditional variance terms vanish at the minimizer $f ^ { \star }$ , i.e.,
141
+
142
+ $$
143
+ \operatorname { V a r } ( f ^ { \star } ( x ) \mid y ) = 0 .
144
+ $$
145
+
146
+ Intuitively, for samples in each class $k$ , if the corresponding subgraph $\mathcal { G } _ { k }$ is connected, there exists a path connecting every intra-class pairs $( x _ { i } , x _ { j } )$ , as shown in Figure 3(a). Consequently, aligning the positive pairs will also align all samples on the path, and eventually align $x _ { i }$ and $x _ { j }$ . In this way, all intra-class samples can be clustered together and the intra-class variance shrinks to zero (under Assumption 4.6). Besides, because proper data augmentation will not cause inter-class augmentation overlap (Assumption 4.1), inter-class samples can be well separated with the uniformity term. As a result, we can attain alignment of intra-class samples while maximizing the uniformity of inter-class samples. According to Theorem 4.2, we will have an asymptotically closed generalization gap (with more negative samples $M \to \infty$ ) for the encoder that minimizes the contrastive loss.
147
+
148
+ Theorem 4.8 (Guarantees for the Optimal Encoder). If Assumption 4.1, 4.5 & 4.6 hold and $f$ is $L$ -smooth, then, for the minimizer $f ^ { \star } = \arg \operatorname* { m i n } \mathcal { L } _ { \mathrm { N C E } } ( f )$ , its classification risk can be upper and lower bounded by its contrastive risk as
149
+
150
+ $$
151
+ \begin{array} { r l } { { \mathcal { L } } _ { \mathrm { N C E } } ( f ^ { \star } ) - { \mathcal { O } } \left( M ^ { - 1 / 2 } \right) \leq } & { { \mathcal { L } } _ { \mathrm { C E } } ^ { \mu } ( f ^ { \star } ) + \log ( M / K ) \leq { \mathcal { L } } _ { \mathrm { N C E } } ( f ^ { \star } ) + { \mathcal { O } } \left( M ^ { - 1 / 2 } \right) . } \end{array}
152
+ $$
153
+
154
+ ![](images/24a19db4f1a9aef405603b46b46fa2a291887541f8c31bdd7d3dc1847dba9017.jpg)
155
+ Figure 4: t-SNE visualization of features learned with different augmentation strength $r$ on the random augmentation graph experiment. Each dot denotes a sample and its color denotes its class.
156
+
157
+ We note that different to previous bounds that hold for any $f \in { \mathcal { F } }$ as in Theorem 4.2, our results here only stand for the minimizer of the contrastive loss $\bar { f } ^ { \star }$ . This indicates that the InfoNCE loss alone cannot simply guarantee good downstream performance, and the learning dynamics matters for the contrastive learning to learn useful features.
158
+
159
+ # 4.3 RETHINKING THE ROLE OF DATA AUGMENTATIONS
160
+
161
+ Our analysis above suggests a new understanding of the role of data augmentations in contrastive learning. Conventionally, the success of contrastive learning is usually attributed to learning invariance w.r.t. various data augmentations by matching positive examples. However, as shown in Proposition 3.1, matching positive pairs alone is theoretically inadequate to learn useful features. Indeed, assuming that an ideal encoder that possesses invariance a priori does exist, like invariance to translation (CNNs), rotation (Cheng et al., 2016), and scaling (Xu et al., 2014), do we obtain class-discriminative features simply by random initialization? Still NO, since these low-level properties are independent of high-level class information that we want to learn. Thus, the reason why contrastive learning works cannot simply be attributed to the invariance learning principle.
162
+
163
+ We instead believe that the role of data augmentation is to create a certain degree of “chaos” between different intra-class samples (Figure 1(b)) such that they become more alike (or formally, $\tau$ -connected). In this way, the chaos serves as a “ladder” for bridging intra-class samples together when labels are absent, and the mission of the contrastive loss is to “climb this ladder”, that is, aligning intra-class samples by aligning the overlapped positive samples, as shown in Figure 3(a). Therefore, from our perspective, instance discrimination by contrastive learning is actually a surrogate for the classification task, and the surrogate can complete its misson when the ladder of chaos is complete (or formally, when intra-class connectivity holds).
164
+
165
+ # 5 QUANTIFYING THE INFLUENCE OF AUGMENTATION STRENGTH
166
+
167
+ We have shown that with appropriate augmentations, we can derive guarantees on downstream performance. However, in practice, as illustrated in Figure 3(b), there could be cases where augmentations are either too weak (intra-class features cannot be clustered together as in Figure 2) or too strong (inter-class features will also collapse to the same point) and lead to sub-optimal results. In this section, we further provide a quantitative analysis of how different strength of data augmentation will affect the final performance, both theoretically and empirically.
168
+
169
+ # 5.1 CHARACTERIZATION ON RANDOM AUGMENTATION GRAPH
170
+
171
+ In practice, there are various data augmentation types that are hard to be described precisely. For the ease of analysis, we consider a simple case where for each class $k$ , there are $N$ samples uniformly distributed around the cluster center $c _ { k }$ on a hypersphere $\mathbb { S } ^ { d }$ . We then augment each sample $x _ { i }$ with random samples in a hyper-disk of radius $r$ on the hypersphere.
172
+
173
+ In Appendix D, we provide theoretical analysis on how different augmentation strength (measured by $r$ ) will affect the connectivity of the augmentation as a function of the number of samples $N$ , the position of the cluster centers $c _ { k }$ and input dimensions $d$ . In particular, the minimal $r$ for the graph to be connected decreases as $N$ increases, so large-scale datasets can bring better connectivity. Meanwhile, the required $r$ also increases as $d$ increases, so we need more samples or stronger augmentations for large-size inputs. Here, we show our simulation results by applying contrastive learning to the problem above. From Figure 4, we can see that when $r = 0$ (no augmentation), the features are mixed together and hardly (linearly) separable, which corresponds to the under-overlap case in Figure 3(b). As we increase $r$ from 0 to 0.1, the features become more and more discriminative. And when $r$ is too large $( r = 1 . 5 )$ ), the inter-class features become mixed and inseparable again (over-overlap). In Appendix C.2, we provide visualization results of the augmentation graphs, which also align well with our analysis. Overall, our theoretical and empirical discussions verify our theory that intra-class augmentation overlap with a proper amount of data augmentation is crucial for contrastive learning to work well.
174
+
175
+ ![](images/702502628437d6d05c945a7599939c27d0c301e4e48b931f7021c95938385391.jpg)
176
+ Figure 5: (a) Average Confusion Rate (ACR) and downstream accuracy v.s. different augmentation strength (before training). (b,c): ACR and downstream accuracy while training.
177
+
178
+ # 5.2 NEW SURROGATE METRICS FOR AUGMENTATION OVERLAP
179
+
180
+ From our theory and analysis above, we see that the augmentation overlap between intra-class samples indeed matters from contrastive learning to generalize better. Inspired by this, we propose the Confusion Ratio metric as a measure of the degree of augmentation overlap. Specifically, for an unlabeled dataset $\mathcal { D } _ { u }$ with $N$ samples, we randomly augment each raw sample $x _ { i } \ \in \ \bar { D _ { u } }$ for $C$ times, and get an augmented set $\tilde { \mathcal { D } _ { u } } = \{ x _ { i j } , i \in [ \dot { N } ] , j \in [ C ] \}$ . Then, for each $x _ { i p } \in \widetilde { D } _ { u }$ that is an augmented view of $x _ { i } \in \mathcal { D } _ { u }$ , denoting its $k$ -nearest neighbors in $ { \widetilde { \mathcal { D } } } _ { u }$ in the feature space of $f$ as $\mathcal { N } _ { k } \overline { { ( x _ { i p } , f ) } }$ and other augmented views from the same image as $\mathcal { C } ( x _ { i p } ) = \{ x _ { i j } , j \neq p \}$ , we can define its Confusion Ratio (CR) as the ratio of augmented views from different raw samples in its $k$ -nearest neighbors,
181
+
182
+ $$
183
+ \mathrm { C R } ( x _ { i j } , f ) = \frac { \# [ \mathcal { N } _ { k } ( x _ { i p } , f ) \setminus \mathcal { C } ( x _ { i p } ) ] } { \# \mathcal { N } _ { k } ( x _ { i p } , f ) } \in [ 0 , 1 ] .
184
+ $$
185
+
186
+ We also define its average as Average Confusion Ratio (ACR):
187
+
188
+ $$
189
+ \begin{array} { r } { \mathrm { A C R } ( f ) = \mathbb { E } _ { x _ { i j } \sim \widetilde { \mathcal { D } } _ { u } } \mathrm { C R } ( x _ { i j , f } ) . } \end{array}
190
+ $$
191
+
192
+ When augmentation overlap happens, the nearest neighbors could be augmented views from a different sample, leading to a higher ACR. Thus, ACR measures the degree of augmentation overlap, and a higher ACR indicates a higher degree of augmentation overlap. Here we take $k = 1$ by default.
193
+
194
+ Here, to measure the augmentation strength in real-world datasets, following the common practice (Chen et al., 2020a), we adopt the RandomResizedCrop operator with scale range $[ a , b ]$ for data augmentation, and we define its strength of augmentation as $r = ( 1 - b ) + ( 1 - \bar { a } )$ (a comparison with other kinds of augmentations, e.g., color jittering, can be found in Appendix C.1). As shown in Figure 5(a), ACR (augmentation overlap) indeed increases with the strength of data augmentations, and only a moderate ACR achieves the best accuracy, which is consistent with our theory discussed above. Besides, we also plot the change of ACR along the training process in Figure 5(b) & 5(c). We can notice that for weak augmentations, the initial ACR is low, and it rapidly decreases to zero and seldom changes while training, which leads to poor test accuracy. Instead, with proper augmentations, the initial ACR is higher, and it gradually decreases to zero and obtains good accuracy. This is also consistent with our theory that we need a certain amount of augmentation overlap for contrastive learning to work well. At the beginning, this will lead to a higher ACR, but as training continues, better alignment (lower ACR) will help bring up the test accuracy.
195
+
196
+ Average Relative Confusion (ARC). In the discussion above, we notice that ACR itself does not indicate the test accuracy, but the relative change of ACR before and after training can be used as such an indicator. A large change of ACR means a large change of augmentation overlap, which indicates that the contrastive loss can actually cluster intra-class samples together through overlapped views. Based on this observation, we propose Average Relative Confusion (ARC) as
197
+
198
+ ![](images/1d33ee993f98cb0936802256d3cee05f058800b83e78a579b4cdb3fe243a5a5d.jpg)
199
+ Figure 6: Average Relative Confusion (ARC) and downstream accuracy v.s. different augmentation strength on different datasets (CIFAR-10, CIFAR-100, and STL-10) with different contrastive learning methods: SimCLR (Chen et al., 2020a) and BYOL (Grill et al., 2020).
200
+
201
+ ![](images/7ab1d1dd893b44d4d9e60edca8702cf935c1df9ea6a4bfee3475a0054030dd30.jpg)
202
+ Figure 7: Average Relative Confusion (ARC) and downstream accuracy v.s. different augmentation strength on CIFAR-10 (SimCLR) with different number of nearest neighbors $k$ .
203
+
204
+ $$
205
+ \mathrm { A R C } = \frac { 1 - \mathrm { A C R } ( f _ { \mathrm { f i n a l } } ) } { 1 - \mathrm { A C R } ( f _ { \mathrm { i n i t } } ) } ,
206
+ $$
207
+
208
+ a ratio calculated with the initial ACR of the initialized model $f _ { \mathrm { i n i t } }$ and the final ACR of the pretrained model $f _ { \mathrm { f i n a l } }$ . A higher ARC indicates that the contrastive learning process faces a hard task (augmentation overlap) at the beginning (high initial ACR), while successfully clustering intra-class samples with good alignment of positive samples at the end (lo final ACR). Therefore, a higher ARC score should correspond to higher downstream accuracy.
209
+
210
+ As shown in Figure 6 & 7, as augmentations become stronger, ARC scores indeed align well with the change of downstream accuracy across 1) different datasets, 2) different contrastive methods, and 3) different choices of $k$ . This justifies our understanding of contrastive learning through augmentation overlap. Meanwhile, as the calculation of ARC only involves unsupervised data, it could serve as a good surrogate metric for evaluating contrastive learning without using labeled data. Compared to previous evaluation methods like linear classification (Eq. 2), our ARC metric is more preferable as 1) it is theoretically motivated; 2) it does not need labeled data; 3) it does not need to learn additional modules like linear classifiers or rotation tasks (Reed et al., 2021). More experimental details can be found in Appendix E.
211
+
212
+ # 6 CONCLUSION
213
+
214
+ In this paper, we have proposed a new understanding of contrastive learning through a revisiting of the role of data augmentations. In particular, we notice the aggressive data augmentation applied in contrastive learning can significantly increase the augmentation overlap between intra-class samples, and as a result, by aligning positive samples, we can also cluster inter-class samples together. Based on this insight, we develop a new augmentation overlap theory that could guarantee good downstream performance without relying on conditional independence and obtain asymptotically closed gaps. With this perspective, we also characterize how different augmentation strength affects downstream performance with both random graphs and real-world datasets. Last but not least, we also develop a new surrogate metric for evaluating contrastive learning without labels and show that it aligns well with downstream performance. Overall, we believe that we pave a new way for understanding contrastive learning with insights on the designing of contrastive methods and evaluation metrics.
215
+
216
+ # ACKNOWLEDGEMENT
217
+
218
+ Yisen Wang is partially supported by the National Natural Science Foundation of China under Grant 62006153, Project 2020BD006 supported by PKU-Baidu Fund, and Huawei Technologies Inc. Jiansheng Yang is supported by the National Science Foundation of China under Grant No. 11961141007. Zhouchen Lin is supported by the NSF China (No. 61731018), NSFC Tianyuan Fund for Mathematics (No. 12026606), Project 2020BD006 supported by PKU-Baidu Fund, and Qualcomm.
219
+
220
+ # REFERENCES
221
+
222
+ Jordan T Ash, Surbhi Goel, Akshay Krishnamurthy, and Dipendra Misra. Investigating the role of negatives in contrastive representation learning. arXiv preprint arXiv:2106.09943, 2021.
223
+
224
+ Ivan Budimir, Sever S Dragomir, and Josep Pecaric. Further reverse results for jensen’s discrete inequality and applications in information theory. RGMIA research report collection, 3(1), 2000.
225
+
226
+ Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. ICML, 2020a.
227
+
228
+ Ting Chen, Simon Kornblith, Kevin Swersky, Mohammad Norouzi, and Geoffrey Hinton. Big selfsupervised models are strong semi-supervised learners. arXiv preprint arXiv:2006.10029, 2020b.
229
+
230
+ Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. arXiv preprint arXiv:2011.10566, 2020.
231
+
232
+ Xinlei Chen, Saining Xie, and Kaiming He. An empirical study of training self-supervised vision transformers. arXiv preprint arXiv:2104.02057, 2021.
233
+
234
+ Gong Cheng, Peicheng Zhou, and Junwei Han. RIFD-CNN: Rotation-invariant and fisher discriminative convolutional neural networks for object detection. In CVPR, 2016.
235
+
236
+ Jean-Bastien Grill, Florian Strub, Florent Altche, C. Tallec, Pierre H. Richemond, Elena ´ Buchatskaya, C. Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, B. Piot, K. Kavukcuoglu, Remi Munos, and Michal Valko. Bootstrap your own latent: A´ new approach to self-supervised learning. NeurIPS, 2020.
237
+
238
+ Jeff Z HaoChen, Colin Wei, Adrien Gaidon, and Tengyu Ma. Provable guarantees for self-supervised deep learning with spectral contrastive loss. NeurIPS, 2021.
239
+
240
+ Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. CVPR, 2020.
241
+
242
+ Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. NeurIPS, 2017.
243
+
244
+ R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Phil Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. ICLR, 2019.
245
+
246
+ Weiran Huang, Mingyang Yi, and Xuyang Zhao. Towards the generalization of contrastive selfsupervised learning. arXiv preprint arXiv:2111.00743, 2021.
247
+
248
+ Jason D Lee, Qi Lei, Nikunj Saunshi, and Jiacheng Zhuo. Predicting what you already know helps: Provable self-supervised learning. arXiv preprint arXiv:2008.01064, 2020.
249
+
250
+ Ibrahim Merad, Yiyang Yu, Emmanuel Bacry, and Stephane Ga ´ ¨ıffas. About contrastive unsupervised representation learning for classification and its convergence. arXiv preprint arXiv:2012.01064, 2020.
251
+
252
+ Kento Nozawa and Issei Sato. Understanding negative samples in instance discriminative selfsupervised representation learning. NeurIPS, 2021.
253
+
254
+ Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
255
+
256
+ Mathew D. Penrose. A Strong Law for the Longest Edge of the Minimal Spanning Tree. The Annals of Probability, 27(1):246 – 260, 1999.
257
+ Allon G Percus and Olivier C Martin. Scaling universalities of kth-nearest neighbor distances on closed manifolds. Advances in Applied Mathematics, 21(3):424–436, 1998. ISSN 0196-8858.
258
+ Ben Poole, Sherjil Ozair, Aaron Van Den Oord, Alex Alemi, and George Tucker. On variational bounds of mutual information. In ICML, 2019.
259
+ Colorado J Reed, Sean Metzger, Aravind Srinivas, Trevor Darrell, and Kurt Keutzer. Selfaugment: Automatic augmentation policies for self-supervised learning. In CVPR, 2021.
260
+ Nikunj Saunshi, Orestis Plevrakis, Sanjeev Arora, Mikhail Khodak, and Hrishikesh Khandeparkar. A theoretical analysis of contrastive unsupervised representation learning. In ICML, 2019.
261
+ Jiaming Song and Stefano Ermon. Understanding the limitations of variational mutual information estimators. In ICLR, 2020.
262
+ Yonglong Tian, Chen Sun, Ben Poole, Dilip Krishnan, Cordelia Schmid, and Phillip Isola. What makes for good views for contrastive learning. NeurIPS, 2020.
263
+ Christopher Tosh, Akshay Krishnamurthy, and Daniel Hsu. Contrastive estimation reveals topic posterior information to linear models. arXiv preprint arXiv:2003.02234, 2020.
264
+ Christopher Tosh, Akshay Krishnamurthy, and Daniel Hsu. Contrastive learning, multi-view redundancy, and linear models. In ALT, 2021.
265
+ Yao-Hung Hubert Tsai, Yue Wu, Ruslan Salakhutdinov, and Louis-Philippe Morency. Selfsupervised learning from a multi-view perspective. In ICLR, 2021.
266
+ Tongzhou Wang and Phillip Isola. Understanding contrastive representation learning through alignment and uniformity on the hypersphere, 2020.
267
+ Yifei Wang, Zhengyang Geng, Feng Jiang, Chuming Li, Yisen Wang, Jiansheng Yang, and Zhouchen Lin. Residual relaxation for multi-view representation learning. In NeurIPS, 2021.
268
+ Yichong Xu, Tianjun Xiao, Jiaxing Zhang, Kuiyuan Yang, and Zheng Zhang. Scale-invariant convolutional neural networks. arXiv preprint arXiv:1411.6369, 2014.
269
+
270
+ # A OMITTED PROOFS
271
+
272
+ # A.1 PROOF OF PROPOSITION 3.1
273
+
274
+ Proposition A.1 (Class-uniform features also minimize the InfoNCE loss). For $N$ training examples of $K$ classes, consider the case when features $\{ f ( x _ { i } ) \} _ { i = 1 } ^ { N }$ are randomly distributed in $\mathbb { S } ^ { m - 1 }$ with maximal uniformity while also satisfying $\forall x _ { i } , x _ { i } ^ { + } \sim p ( x , x ^ { + } ) , f ( x _ { i } ) = f ( x _ { i } ^ { + } )$ . Because we have perfect alignment and perfect uniformity, the InfoNCE loss achieves its minimum. However, the downstream classification accuracy is at most $1 / \check { K } + \varepsilon$ and $\varepsilon$ is nearly zero when $N$ is large enough.
275
+
276
+ Proof. We only need to give a counterexample that satisfy the desired classification accuracy. We consider the case when there is no $\tau$ -connectivity between any pair of samples from $\{ x _ { i } \} _ { i = 1 } ^ { N }$ , which is easily achieved if we adopt a small enough data augmentation. In this scenario, the perfect alignment of positive samples $( x _ { i } , x _ { i } ^ { + } )$ could have no effect on the other samples. Therefore, when the features $\{ f ( x _ { i } ) \} _ { i = 1 } ^ { N }$ are uniformly distributed in $\mathbb { S } ^ { m - 1 }$ , according to the law of large number, for any measurable set $\bar { \boldsymbol { u } } \in \mathbb { S } ^ { m - 1 }$ , when $N$ is large enough, there will be almost equal size of features from each class in $\mathcal { U }$ . Consequently, any classifier $g$ that classifies $\mathcal { U }$ to class $k$ will only have $1 / K$ accuracy asymptotically. □
277
+
278
+ # A.2 PROOF OF THEOREM 4.2
279
+
280
+ We will prove the upper and lower bounds separately as follows.
281
+
282
+ # A.2.1 THE UPPER BOUND
283
+
284
+ We first provide the upper bound of the approximation error of the following Monte Carlo estimate.
285
+
286
+ Lemma A.2. For $\mathrm { L S E } : = \log \mathbb { E } _ { p ( z ) } \exp ( f ( x ) ^ { \top } g ( z ) )$ , we denote its (biased) Monte Carlo estimate with $M$ random samples $z _ { i } \sim p ( z ) , i = 1 , . . . , M$ as $\begin{array} { r } { \widehat { \mathrm { L S E } } _ { M } = \log \frac { 1 } { M } \sum _ { i = 1 } ^ { M } \exp ( f ( x ) ^ { \top } g ( z _ { i } ) ) } \end{array}$ . Then the approximation error $A ( M )$ can be upper bounded in expectation as
287
+
288
+ $$
289
+ A ( M ) : = \mathbb { E } _ { p ( x , z _ { i } ) } | \widehat { \mathrm { L S E } } ( M ) - \mathrm { L S E } | \leq \mathcal { O } ( M ^ { - 1 / 2 } ) .
290
+ $$
291
+
292
+ We can see that the approximation error converges to zero in the order of $1 / M ^ { - 1 / 2 }$ .
293
+
294
+ Proof. First, we have
295
+
296
+ $$
297
+ \begin{array} { r l } & { \mathbb { E } _ { p ( x , z _ { i } ) } \left[ \log \displaystyle \frac { 1 } { M } \sum _ { i = 1 } ^ { M } \exp ( f ( x ) ^ { \top } g ( z _ { i } ) ) - \log \mathbb { E } _ { p ( z _ { i } ) } \exp ( f ( x ) ^ { \top } g ( z _ { i } ) ) \right] } \\ & { { \le } e \mathbb { E } _ { p ( x , z _ { i } ) } \left[ \displaystyle \frac { 1 } { M } \sum _ { i = 1 } ^ { M } \exp ( f ( x ) ^ { \top } g ( z _ { i } ) ) - \mathbb { E } _ { p ( z _ { i } ) } \exp ( f ( x ) ^ { \top } g ( z _ { i } ) ) \right] = \mathcal { O } ( M ^ { - 1 / 2 } ) , } \end{array}
298
+ $$
299
+
300
+ where the first inequality follows the Intermediate Value Theorem and $e$ (the natural number) is the upper bound of the absolute derivative of log between two points when $| f ( x ) ^ { \top } g ( z _ { i } ) | \leq 1$ . And the second inequality follows the Berry-Esseen Theorem given the bounded support of $\exp ( { f ( x ) } ^ { \top } g ( z _ { i } ) )$ as following: for i.i.d random variables $Y _ { i }$ with bounded support $\operatorname { s u p p } ( Y ) ~ \subset$ $[ - \alpha , \alpha ]$ , zero mean and bounded variance $\sigma _ { Y } ^ { 2 } < \alpha ^ { 2 }$ , we have:
301
+
302
+ $$
303
+ \begin{array} { r l } & { \mathbb { E } \left[ \left| \displaystyle \frac { 1 } { M } \displaystyle \sum _ { i = 1 } ^ { M ^ { d } } Y _ { i } \right| \right] = \frac { \sigma _ { y } } { \sqrt { M } } \mathbb { E } \left[ \left| \displaystyle \frac { 1 } { \sqrt { M } \sigma _ { y } } \displaystyle \sum _ { i = 1 } ^ { M } Y _ { i } \right| \right] } \\ & { = \frac { \sigma _ { Y } } { \sqrt { M } } \int _ { 0 } ^ { \infty \infty \pi } \mathbb { P } \left[ \left| \displaystyle \frac { 1 } { \sqrt { M } \sigma _ { Y } } \displaystyle \sum _ { i = 1 } ^ { M } Y _ { i } \right| > x \right] \mathrm { d } x } \\ & { \le \frac { \sigma _ { Y } } { \sqrt { M } } \int _ { 0 } ^ { \infty \pi } \mathbb { P } [ | N ( 0 , 1 ) | > x ] + \frac { C _ { \alpha } } { \sqrt { M } } \mathrm { d } x } \\ & { \le \frac { \sigma _ { Y } } { \sqrt { M } } \left( \frac { \alpha C _ { \alpha } } { \sigma _ { Y } } + \displaystyle \int _ { 0 } ^ { \infty } \mathbb { P } [ | N ( 0 , 1 ) | > x ] \mathrm { d } x \right) } \\ & { \le \frac { C _ { \alpha } } { \sqrt { M } } + \frac { \alpha } { \sqrt { M } } \mathbb { E } [ | N ( 0 , 1 ) | ] = \mathcal { O } ( M ^ { - 1 / 2 } ) } \end{array}
304
+ $$
305
+
306
+ where the constant $C _ { \alpha }$ only depends on $\alpha$ . Here, we set $\begin{array} { r l r } { Y _ { i } } & { { } = } & { \exp ( f ( x ) ^ { \top } g ( z _ { i } ) ) ~ - } \end{array}$ $\mathbb { E } _ { p ( z _ { i } ) } \exp ( f ( x ) ^ { \top } g ( z _ { i } ) )$ . As $| \mathbf { \bar { \Psi } } f ( x ) ^ { \dagger } g ( z _ { i } ) | \leq 1$ , $| Y _ { i } | \le 2 e$ . $Y _ { i }$ has zero mean and bounded variance $( 2 e ) ^ { 2 }$ . □
307
+
308
+ Theorem A.3. For each $f \in { \mathcal { F } }$ , the mean $C E$ loss can be upper bounded by the InfoNCE loss:
309
+
310
+ $$
311
+ \begin{array} { r } { \mathcal { L } _ { \mathrm { C E } } ^ { \mu } ( x , y ; f ) \leq \mathcal { L } _ { \mathrm { N C E } } ( x ; f ) - \log ( M / K ) + \sqrt { \mathrm { V a r } ( f ( x ) \mid y ) } + A ( M ) , } \end{array}
312
+ $$
313
+
314
+ where $\operatorname { V a r } ( f ( x ) | y ) = \mathbb { E } _ { p ( y ) } \left[ \mathbb { E } _ { p ( x | y ) } | | f ( x ) - \mathbb { E } _ { p ( x | y ) } f ( x ) | | ^ { 2 } \right]$ denotes the conditional variance.
315
+
316
+ Proof. Denote $p ( x , x ^ { + } , y )$ as the joint distribution of the positive pairs $x , x ^ { + }$ and the label $y$ . Denote the $M$ independently negative smaples as $\{ x _ { i } ^ { - } \} _ { i = 1 } ^ { M }$ . According to Assumption 4.1, $x ^ { + }$ and $x$ here has the same label $y$ . Denote $\mu _ { y }$ as the center of features of class y, $y = \mathsf { \bar { 1 } } , \ldots , K$ . Then we have the following lower bounds of the InfoNCE loss,
317
+
318
+ $$
319
+ \begin{array} { r l } & { \quad - \nu _ { 6 , 0 , e } / \nu _ { 1 , 0 } ^ { 2 } \nu _ { 2 , 0 } ^ { 3 } \nu _ { 1 , 0 } ^ { 4 } + 6 \nu _ { 1 , 1 } \nu _ { 2 , 0 } ^ { 4 } \nu _ { 1 , 0 } ^ { 4 } \nu _ { 1 , 0 } ^ { 4 } } \\ & { \stackrel { ( a , b ) } { \geq } \nu _ { 6 , 0 , e } / \nu _ { 2 , 0 } ^ { 4 } \nu _ { 1 , 0 } ^ { 4 } + 6 \nu _ { 1 , 1 } \nu _ { 2 , 0 } ^ { 4 } \nu _ { 1 , 0 } ^ { 4 } \nu _ { 1 , 0 } ^ { 4 } \nu _ { 2 , 0 } ^ { 4 } \nu _ { 2 , 0 } ^ { 4 } \nu _ { 1 , 0 } ^ { 4 } + 6 \nu _ { 1 , 1 } \nu _ { 1 , 0 } ^ { 4 } } \\ & { \stackrel { ( b , c ) } { \geq } \nu _ { 6 , 0 , e } / \nu _ { 1 , 0 } ^ { 2 } \nu _ { 2 , 1 } ^ { 4 } + 6 \nu _ { 1 , 1 } ^ { 2 } \nu _ { 1 , 0 } ^ { 4 } \nu _ { 1 , 0 } ^ { 4 } \nu _ { 1 , 0 } ^ { 4 } \nu _ { 1 , 0 } ^ { 4 } \nu _ { 1 , 0 } ^ { 4 } \nu _ { 1 , 0 } ^ { 4 } \nu _ { 1 , 0 } ^ { 4 } + 6 \nu _ { 1 , 1 } ^ { 4 } \nu _ { 1 , 0 } ^ { 4 } } \\ & { \quad - \nu _ { 6 , 0 , e } / \nu _ { 1 , 0 } ^ { 4 } \nu _ { 2 , 1 } ^ { 4 } \nu _ { 1 , 0 } ^ { 4 } \nu _ { 1 , 0 } ^ { 4 } \nu _ { 1 , 0 } ^ { 4 } \nu _ { 1 , 0 } ^ { 4 } \nu _ { 1 , 0 } ^ { 4 } \nu _ { 1 , 0 } ^ { 4 } \nu _ { 1 , 0 } ^ { 4 } } \\ & \stackrel { ( c , d ) } { = } - \nu _ { 6 , e } - \nu _ { 9 , e } / \nu _ { 2 , e } ^ { 2 } \nu _ { 1 , e } ^ { 2 } \nu _ { 2 , e } ^ { 3 } \nu _ { 1 , e } ^ { 4 } \nu _ { 1 , e } ^ { 4 } \nu _ { 1 , e } ^ { 4 } \nu _ { 1 , e } ^ { 4 } \nu _ { 1 , e } ^ { 4 } \nu _ { 1 , e } ^ { 4 } \nu _ { 1 , e } ^ \end{array}
320
+ $$
321
+
322
+ which is equivalent to our desired results. In the proof above, (1) follows Lemma A.2; (2) follows the Jensen’s inequality for the convex function $\exp ( \cdot )$ ; (3) follows from the fact that because $f ( x ) \in$ $\mathbb { S } ^ { m - 1 }$ , we have
323
+
324
+ $$
325
+ f ( x ) ^ { \top } ( f ( x ^ { + } ) - \mu _ { y } ) \leq \left( { \frac { f ( x ^ { + } ) - \mu _ { y } } { \| f ( x ^ { + } ) - \mu _ { y } \| } } \right) ^ { \top } ( f ( x ^ { + } ) - \mu _ { y } ) = \| f ( x ^ { + } ) - \mu _ { y } \| ;
326
+ $$
327
+
328
+ and (4) follows the Cauchy–Schwarz inequality and the fact that because $p ( x , x ^ { + } ) \ : = \ : p ( x ^ { + } , x )$ holds, $x , x ^ { + }$ have the same marginal distribution. □
329
+
330
+ # A.2.2 THE LOWER BOUND
331
+
332
+ In this part, we further show a lower bound on the downstream performance.
333
+
334
+ Lemma A.4 (Budimir et al. (2000) Corollary 3.5 (restated)). Let $g : \mathbb { R } ^ { m } \mathbb { R }$ be a differentiable convex mapping and $z \in \mathbb { R } ^ { n }$ . Suppose that $g$ is $L$ - smooth with the constant $L > 0$ , i.e., $\forall x , y \in$ $\mathbb { R } ^ { m } , \| \nabla g ( \dot { x } ) - \nabla g ( y ) \| \le L \| x - \dot { y } \|$ . Then we have
335
+
336
+ $$
337
+ 0 \leq \mathbb { E } _ { p ( z ) } g ( z ) - g \left( \mathbb { E } _ { p ( z ) } z \right) \leq L \left[ \mathbb { E } _ { p ( z ) } \| z \| ^ { 2 } - \| \mathbb { E } _ { p ( z ) } z \| ^ { 2 } \right] = L \sum _ { j = 1 } ^ { n } \mathrm { V a r } ( z ^ { ( j ) } ) ,
338
+ $$
339
+
340
+ where $x ^ { ( j ) }$ denotes the $j$ -th dimension of $x$
341
+
342
+ With the lemma above, we can derive the lower bound of the downstream performance.
343
+
344
+ Theorem A.5. For any $f \in { \mathcal { F } }$ , we have
345
+
346
+ $$
347
+ L _ { \mathrm { C E } } ^ { \mu } ( f ) \geq \mathcal { L } _ { \mathrm { N C E } } ( x ; f ) - \sqrt { \mathrm { V a r } ( f ( x ) \mid y ) } - \frac { 1 } { 2 } \mathrm { V a r } ( f ( x ) \mid y ) - A ( M ) - \log \frac { M } { K } ,
348
+ $$
349
+
350
+ where $\mathrm { V a r } ( u ( x ) | y ) = \mathbb { E } _ { p ( y ) } \left[ \mathbb { E } _ { p ( x | y ) } | | u ( x ) - \mathbb { E } _ { p ( x | y ) } u ( x ) | | ^ { 2 } \right]$ denotes the conditional variance.
351
+
352
+ Proof. Similar to the proof of Theorem A.3, we have
353
+
354
+ $$
355
+ \begin{array} { r l } & { \begin{array} { r l } & { \quad \lambda ^ { 2 } \lambda ^ { 3 } \mu _ { 3 } - \lambda ^ { 3 } \mu _ { 5 } ( \dot { \mathcal { R } } ^ { 2 } ) ^ { 2 } \nu _ { 5 } + \lambda ^ { 3 } \mu _ { 5 } ( \dot { \mathcal { R } } ^ { 2 } ) ^ { 2 } \nu _ { 5 } ( \dot { \mathcal { R } } ^ { 2 } ) } \\ & { = \quad \mathrm { E } _ { \mu \nu \mu \nu \lambda } ( \dot { \mathcal { R } } ^ { 2 } ) \ \dot { \mathcal { R } } \ \mu \mu \dot { \mathcal { R } } \mu \dot { \mathcal { R } } \mu \dot { \mathcal { R } } \mu \dot { \mathcal { R } } \dot { \mathcal { R } } \dot { \mathcal { R } } } \\ & { \quad - \mathrm { E } _ { \mu \nu \nu \lambda } ( \dot { \mathcal { R } } ^ { 2 } ) \nu _ { 5 } ( \dot { \mathcal { R } } ^ { 2 } ) \dot { \mathcal { R } } \mu \mu \dot { \mathcal { R } } \mu \dot { \mathcal { R } } \dot { \mathcal { R } } ) \dot { \mathcal { R } } \mu \dot { \mathcal { R } } \dot { \mathcal { R } } } \end{ 1 } } \\ & \begin{array} { r l } & \quad - \mu _ { 5 } - \lambda ^ { 2 } \mu _ { 5 } ( \dot { \mathcal { R } } ^ { 2 } ) ^ { 2 } \nu _ { 5 } ( \dot { \mathcal { R } } ^ { 2 } ) ^ { 2 } \nu _ { 5 } + \lambda ^ { 2 } \mu _ { 5 } ( \dot { \mathcal { R } } ^ { 2 } ) ^ { 2 } \nu _ { 5 } ( \dot { \mathcal { R } } ^ { 2 } ) ^ { 2 } \nu _ { 5 } ( \dot { \mathcal { R } } ^ { 2 } ) ^ { 2 } \nu _ { 5 } ( \dot { \mathcal { R } } ^ { 2 } ) ^ { 2 } \nu _ { 5 } ( \dot { \mathcal { R } } ^ { 2 } ) ^ { 2 } \nu _ { 5 } ( \dot { \mathcal { R } } ^ { 2 } ) ^ { 2 } \nu _ { 5 } ( \dot { \mathcal { R } } ^ { 2 } ) ^ { 2 } \nu _ { 5 } ( \dot { \mathcal { R } } ^ { 2 } ) ^ { 2 } \nu _ { 5 } ( \dot { \mathcal { R } } ^ { 2 } ) ^ { 2 } \nu _ { 5 } ( \dot \mathcal R \end{array} \end{array} \end{array}
356
+ $$
357
+
358
+ which is our desired result. In the proof, (1) we adopt a Monte Carlo estimate with $M$ samples from $p ( y )$ and bound the approximation error with Lemma A.2; (2) follows the same deduction in Theorem A.3; (3) the first term is derived following the Cauchy–Schwarz inequality for the alignment term. As for the second term, we first show that the convex function logsumexp is $L$ -smooth as a function of $f ( x _ { j } ^ { - } )$ in our scenario. Because $\| f ( X ) \| \leq 1$ , we have $\forall f ( x _ { j _ { 1 } } ) , f ( x _ { j _ { 2 } } ) \in \mathbb { R } ^ { m }$ , the following bound on the difference of their gradients holds
359
+
360
+ $$
361
+ \begin{array} { r l } & { \Big \| \frac { \partial \log \left[ \exp ( f ( x ) ^ { \top } f ( x _ { j _ { 1 } } ^ { - } ) + \sum _ { i \neq j } \exp ( f ( x ) ^ { \top } f ( x _ { i } ^ { - } ) ) ) \right] } { \partial f ( x _ { j _ { 1 } } ^ { - } ) } - \frac { \partial \log \left[ \exp ( f ( x ) ^ { \top } f ( x _ { j _ { 2 } } ^ { - } ) + \sum _ { i \neq j } \exp ( f ( x ) ^ { \top } f ( x _ { i } ^ { - } ) ) ) \right] } { \partial f ( x _ { j _ { 2 } } ^ { - } ) } } \\ & { = \Big \| \left( \frac { \exp ( f ( x ) ^ { \top } f ( x _ { j _ { 1 } } ^ { - } ) ) } { \exp ( f ( x ) ^ { \top } f ( x _ { j _ { 1 } } ^ { - } ) + \sum _ { i \neq j } \exp ( f ( x _ { i } ^ { - } ) ) ) } - \frac { \exp ( f ( x ) ^ { \top } f ( x _ { j _ { 2 } } ^ { - } ) ) } { \exp ( f ( x ) ^ { \top } f ( x _ { j _ { 2 } } ^ { - } ) + \sum _ { i \neq j } \exp ( f ( x ) ^ { \top } f ( x _ { i } ^ { - } ) ) ) } \right) f \ } \\ & \leq \Big | \frac { ( \sum _ { i \neq j } \exp ( f ( x ) ^ { \top } f ( x _ { j _ { 1 } } ^ { - } ) ) \exp ( f ( x _ { j _ { 1 } } ^ { - } ) ) - \sum _ { i \neq j } \exp ( f ( x ) ^ { \top } f ( x _ { i } ^ { - } ) ) \exp ( f ( x ) ^ { \top } f ( x _ { j _ { 2 } } ^ { - } ) ) } { \big \{ \exp ( f ( x ) ^ { \top } f ( x _ { j _ { 1 } } ^ { - } ) ) + \sum _ { i \neq j } \exp ( f ( x ) ^ { \top } f ( x _ { i } ^ { - } ) ) \big \} ( \exp ( f ( x ) ^ { \top } f ( x _ { i } ^ { - } ) ) } \\ & { \leq \big \| f ( x ) \big \| \leq \frac { 1 } { 2 } \big \| f ( x _ { j _ { 1 } } ^ { - } ) - f ( x _ { j } ^ { - } ) \big \| } \end{array}
362
+ $$
363
+
364
+ So here the logsumexp is $L$ -smooth for $\begin{array} { r } { L = \frac { 1 } { 2 } } \end{array}$ . Then, we can apply the reversed Jensen’s inequality in Lemma A.4; (4) holds because
365
+
366
+ $$
367
+ \begin{array} { l } { { \displaystyle \sum _ { j = 1 } ^ { m } \mathrm { V a r } ( f _ { j } ( x ) | y ) } \ ~ } \\ { { \displaystyle = \sum _ { j = 1 } ^ { m } \mathbb { E } _ { p ( y ) } \mathbb { E } _ { p ( x | y ) } ( f _ { j } ( x ) - \mathbb { E } _ { p ( x ^ { \prime } | y ) } f _ { j } ( x ^ { \prime } ) ) ^ { 2 } } } \\ { { \displaystyle = \mathbb { E } _ { p ( y ) } \mathbb { E } _ { p ( x | y ) } \sum _ { j = 1 } ^ { m } ( f _ { j } ( x ) - \mathbb { E } _ { x ^ { \prime } } f _ { j } ( x ^ { \prime } ) ) ^ { 2 } } } \\ { { \displaystyle = \mathbb { E } _ { p ( y ) } \mathbb { E } _ { p ( x | y ) } \| f ( x ) - \mathbb { E } _ { x ^ { \prime } } f ( x ^ { \prime } ) \| ^ { 2 } } } \\ { { \displaystyle = \mathrm { V a r } ( f ( x ) | y ) . } } \end{array}
368
+ $$
369
+
370
+ # A.3 PROOF OF PROPOSITION 4.7
371
+
372
+ Proposition A.6. Under Assumptions 4.5, & 4.6, by minimizing the InfoNCE loss, we can conclude that the conditional variance term vanishes, i.e.,
373
+
374
+ $$
375
+ \operatorname { V a r } ( f ( x ) \mid y ) = 0 .
376
+ $$
377
+
378
+ Proof. Consider any $\tau$ -connected sample $x _ { i } , x _ { j }$ . Accoding to the definition of $\tau$ -connectivity, there exist $t _ { i } , t _ { j } \in \mathcal { T }$ such that $t _ { i } ( x ) = t _ { j } ( x )$ . When perfect alignment holds as in Assumption 4.6, we will have $f ( x _ { i } ) = f ( t _ { i } ( x _ { i } ) )$ and ${ \bf { \bar { f } } } ( x _ { j } ) = f ( t _ { j } ( x _ { j } ) )$ . Combining with $t _ { i } ( x _ { i } ) = t _ { j } ( x _ { j } )$ , we have $f ( x _ { i } ) = f ( x _ { j } )$ . That is, any $\tau$ -connected pair has the same representation. Then, in the augmentation subgraph $\mathcal { G } _ { k }$ that is connected according to Assumption 4.5, there exists a path for any pair of samples $\bar { \hat { x } } _ { i } , \hat { x } _ { j } \in \mathcal G _ { k }$ where any two adjacent samples are $\tau$ -connected. As a result, ${ \hat { x } } _ { i }$ and $\bar { \hat { x } } _ { j }$ will also have the same representation by applying $\bar { \tau }$ -connectivity recursively. At last, all samples in $\mathcal { G } _ { k }$ will have the same representation and the intra-class variance vanishes. □
379
+
380
+ # A.4 PROOF OF THEOREM 4.8
381
+
382
+ Theorem A.7 (Guarantees for the optimal encoder). If Assumption 4.1, 4.5 & 4.6 hold and $f$ is $L$ -smooth, then, for the minimizer $f ^ { \star } = \arg \operatorname* { m i n } \mathcal { L } _ { \mathrm { N C E } } ( f )$ , its classification risk can be upper and lower bounded by its contrastive risk as
383
+
384
+ $$
385
+ \begin{array} { r l } { { \mathcal { L } } _ { \mathrm { N C E } } ( f ^ { \star } ) - { \mathcal { O } } \left( M ^ { - 1 / 2 } \right) \leq } & { { \mathcal { L } } _ { \mathrm { C E } } ^ { \mu } ( f ^ { \star } ) + \log ( M / K ) \leq { \mathcal { L } } _ { \mathrm { N C E } } ( f ^ { \star } ) + { \mathcal { O } } \left( M ^ { - 1 / 2 } \right) . } \end{array}
386
+ $$
387
+
388
+ Proof. A direct combination of Theorem 4.2 and 4.7 will give us the above two-sided bounds.
389
+
390
+ # B GENERALIZED GUARANTEES UNDER WEAK ALIGNMENT
391
+
392
+ In Section 4.2, we have shown that with perfect alignment (Assumption 4.6), the variance terms in the bounds of Theorem 4.2 can be minimized to zero, and consequently, the upper and lower bounds can be asymptotically closed. Nevertheless, in practice, due to the constraint of hypothesis class $\mathcal { F }$ and optimization algorithms, we typically cannot achieve the exact minimizer, i.e., a perfect degree of alignment. This motivates us to consider a less restrictive setting, namely the $\varepsilon$ -weak alignment assumption, where the alignment error could be as large as $\varepsilon$ .
393
+
394
+ Definition B.1 (Weak Alignment). $A$ mapping $f$ satisfies $\varepsilon$ -weak alignment $i f \ \forall \ x , x ^ { + } \sim$ $p ( x , x ^ { + } ) , \| f ( x ) - f ( x ^ { + } ) \| \bar { \leq } \varepsilon$ .
395
+
396
+ For any $\varepsilon$ -weak alignment $f \in { \mathcal { F } }$ , we have the following bounds on its downstream risk.
397
+
398
+ Theorem B.2 (Guarantees under weak alignment). If Assumption 4.1, 4.5 hold, then $\forall f \in { \mathcal { F } }$ satisfying $\varepsilon$ -weak alignment, its classification risk can be upper and lower bounded by its contrastive risk as
399
+
400
+ $$
401
+ \begin{array} { r l } & { \quad \mathcal { L } _ { \mathrm { N C E } } ( f ) - D \varepsilon - \cfrac { 1 } { 2 } D ^ { 2 } \varepsilon ^ { 2 } - \mathcal { O } \left( M ^ { - 1 / 2 } \right) } \\ & { \leq \mathcal { L } _ { \mathrm { C E } } ^ { \mu } ( f ) + \log ( M / K ) \leq \mathcal { L } _ { \mathrm { N C E } } ( f ) + D \varepsilon + \mathcal { O } \left( M ^ { - 1 / 2 } \right) , } \end{array}
402
+ $$
403
+
404
+ where $D$ denotes the maximal diameter of the intra-class augmentation graphs $\{ \mathcal { G } _ { k } , k = 1 , \ldots , K \}$ and m denotes the output dimension of the encoder $f$ .
405
+
406
+ In this way, we extend the guarantees developed for optimal encoders (Theorem 4.8) to even nonminimizers $f \in { \mathcal { F } }$ as long as it could align the positive samples within error $\varepsilon$ .
407
+
408
+ ![](images/3a918122170e85bd8d2a85d43d1db87215adfd67e52bbd38bb53eeb31afe87bd.jpg)
409
+ Figure 8: Evaluation of the maximal diameter $D$ as a function of different augmentation strength (a) and different number of samples (b) on the synthetic data in Section 5.1.
410
+
411
+ Empirical Verification. Besides the alignment error, we could notice this relaxation also introduces the dependence on an additional parameter $D$ , the maximal diameter of the intra-class augmentation graphs. As shown in Figure 8, when the augmentation is very weak, the intra-class graph is not connected and the diameter is $\infty$ . Then, by applying stronger augmentations, $D$ will become smaller and smaller, and finally converge to 1 (fully connected). Besides, increasing the number of samples, ranging from 50 to $1 \dot { 0 } , 0 0 0$ , does not have a large impact on $D$ in practice. Given these facts, we could reasonably assume that $D$ is bounded and has a relatively small value with properly chosen augmentations. As a result, with a bounded diameter $D$ , a small alignment error $\varepsilon$ will guarantee a small generalization gap between the upstream and downstream tasks. This generalizes Theorem 4.8 by quantifying the generalization gap under weak alignment.
412
+
413
+ Proof. Consider any pair of samples $( x , x ^ { \prime } )$ from the same class $y$ , and the positive sample of $x$ as $x ^ { + }$ . As intra-class connectivity holds, $x$ and $x ^ { \prime }$ are connected, and the maximal length of the path from $x$ to $x ^ { \prime }$ is $D$ . Therefore, under the $\varepsilon$ -weak alignment that
414
+
415
+ $$
416
+ \forall x , x ^ { + } \sim p ( x , x ^ { + } ) , \| f ( x ) - f ( x ^ { + } ) \| \leq \varepsilon ,
417
+ $$
418
+
419
+ we can bound the representation distance between $x$ and $x ^ { \prime }$ by the triangular inequality
420
+
421
+ $$
422
+ \| f ( x ) - f ( x ^ { \prime } ) \| { \leq } D \operatorname* { s u p } _ { p ( x , x ^ { + } | y \sim p ( x , x ^ { + } ) } \| f ( x ) - f ( x _ { + } ) \| { \leq } D \varepsilon .
423
+ $$
424
+
425
+ With the inequality above, we can bound the variance terms in Theorem 4.2. In particular, the conditional variance can be bounded as
426
+
427
+ $$
428
+ \begin{array} { r l } & { \quad \mathrm { V a r } ( f ( x ) \ | \ y ) } \\ & { = \mathbb { E } _ { p ( y ) } \mathbb { E } _ { p ( x \mid y ) } \| f ( x ) - \mathbb { E } _ { x ^ { \prime } } f ( x ^ { \prime } ) \| ^ { 2 } } \\ & { = \mathbb { E } _ { p ( y ) } \mathbb { E } _ { p ( x \mid y ) } \| \mathbb { E } _ { x ^ { \prime } } f ( x ) - f ( x ^ { \prime } ) \| ^ { 2 } } \\ & { \le \mathbb { E } _ { p ( y ) } \mathbb { E } _ { p ( x \mid y ) } \mathbb { E } _ { p ( x ^ { \prime } \mid y ) } \| f ( x ) - f ( x ^ { \prime } ) \| ^ { 2 } } \\ & { \le \mathbb { E } _ { p ( y ) } \underset { x , x ^ { \prime } \sim p ( x \mid y ) } { \mathrm { m a x } } \ \| f ( x ) - f ( x ^ { \prime } ) \| ^ { 2 } } \\ & { \overset { ( 1 ) } { \le } \mathbb { E } _ { p ( y ) } D ^ { 2 } \varepsilon ^ { 2 } = D ^ { 2 } \varepsilon ^ { 2 } } \end{array}
429
+ $$
430
+
431
+ where (1) follows Eq. 19. At last, we can bound the variance items in Theorem 4.2 with Eq. 20, arrive at the desired bounds
432
+
433
+ $$
434
+ \begin{array} { r l } & { \quad \mathcal { L } _ { \mathrm { N C E } } ( f ) - D \varepsilon - \cfrac { 1 } { 2 } D ^ { 2 } \varepsilon ^ { 2 } - \mathcal { O } \left( M ^ { - 1 / 2 } \right) } \\ & { \leq \mathcal { L } _ { \mathrm { C E } } ^ { \mu } ( f ) + \log ( M / K ) \leq \mathcal { L } _ { \mathrm { N C E } } ( f ) + D \varepsilon + \mathcal { O } \left( M ^ { - 1 / 2 } \right) , } \end{array}
435
+ $$
436
+
437
+ which conclude our proof.
438
+
439
+ # C ADDITIONAL EMPIRICAL EVIDENCE
440
+
441
+ # C.1 FURTHER EVALUATION OF ARC METRIC
442
+
443
+ In the main text, we study the effect of different strength of RandomResizedCrop on the downstream accuracy as our proposed metrics (ACR and ARC), which help verify our theory. Nevertheless, in practice, the augmentations adopted in contrastive learning is composed of a list of different kinds of augmentations. Therefore, in this part, we further study the effect of other types of data augmentations, and we show that our ARC metric is also effective for evaluating not only other kinds of data augmentations, but also their composed ones.
444
+
445
+ ![](images/86cb8540be85837254cf0ba04fb684b977466b62af2c3e3a0a61684c46683cd7.jpg)
446
+ Figure 9: Downstream accuracy (ACC) v.s. Average Relative Confusion (ARC) for different types of augmentations in SimCLR on CIFAR-10.
447
+
448
+ Comparing different kinds of augmentations. We begin by comparing the four kinds of data augmentations adopted in SimCLR (Chen et al., 2020a): RandomResizedCrop, ColorJitter, Grayscale, etc. For a fair comparison, we apply each one alone for contrastive learning, and evaluate both the downstream accuracy and ARC. From Figure 11, we can conclude that among the six kinds of augmentations, RandomResizedCrop is the most important augmentation, and ColorJitter is the second. The rest of them are less powerful, as they cannot even learn useful features by themselves. We can also see that our ARC metric aligns well with the downstream accuracy for different kinds of augmentations.
449
+
450
+ Comparing ColorJitter with different strength. Based on the observation above, as we have discussed RandomResizedCrop in Section 5.2, we now choose ColorJitter, the second important augmentation, as another kind of augmentation for the study of different augmentation strength. Specifically, we study the four parameters of brightness, contrast, saturation, and hue, where a large value corresponds a large degree of augmentation. Note that we also adopt the default augmentations in SimCLR while only changing the parameters of ColorJitter (different to the setup in Figure 9). As shown in Figure 10, there is also a reverse-U curve like that in RandomResizedCrop, and the sweet spot is usually achieved with 0.8, which corresponds to the default of choice in SimCLR (which is selected with exhausted hyperparameter search). Meanwhile, our ARC metric still aligns well with the downstream accuracy for different strength of different kinds of color jittering, which demonstrates its wide applicability.
451
+
452
+ ![](images/d435cec459db0e2d05358c6d5270247b499b458af7224bcff113e05ba4f6d4e7.jpg)
453
+ Figure 10: Average Relative Confusion (ARC) v.s. downstream accuracy with different augmentation strength on four different kinds of color jittering operations.
454
+
455
+ ![](images/6fc1a89402ac4d9f5c3086d94f1321d1ba1f7ec927440c1fe5b8eda2f83eafd9.jpg)
456
+ Figure 11: Downstream accuracy (ACC) v.s. the logarithm of Average Relative Confusion (ARC) on a composition of RandomResizedCrop and ColorJitter with different strength. Experiments are conducted on CIFAR-10 with SimCLR.
457
+
458
+ Comparing composed augmentations. In the above discussion, we focus on the effect of a single kind of augmentations. Here, we show that our ARC metric is still effective for evaluating the composition of different augmentations. Notably, it is hard to define a metric of augmentation strength in this case, as the effect of different augmentations could be nested. Nevertheless, we can still draw a “ACC - log(ARC)” plot to show the correlation between the downstream accuracy (ACC) and our ARC metric, where each point denotes a model trained with randomly selected parameters of RandomResizedCrop and ColorJitter. As shown in Figure 11, we can see there is indeed a strong correlation between the two metrics, with a Pearson correlation coefficient $\rho = 0 . 8 0$ . Therefore, our metric can be used for selecting different kinds of augmentations as well as their compositions in an unsupervised fashion.
459
+
460
+ For a more intuitive and practical understanding of our augmentation overlap theory developed in Section 4, we visualize of the augmentation graphs on both synthetic data (Section 5.1) and realworld data (Section 5.2).
461
+
462
+ ![](images/2a9edad3cd30a09c387ced697eb3908aa9bb7427239da5541442c477baee8b75.jpg)
463
+ Figure 12: Visualization of the augmentation graph with different augmentation strength $r$ on the synthetic data described in Section 5.1. Each color denotes a connected component. The corresponding t-SNE visualization and test accuracy (of contrastive learning) can be found in Figure 4.
464
+
465
+ Synthetic data. Following the setting of experiments in Section 5.1, we construct the adjacent matrix of different samples, calculate its connected components, and visualize it in Figure 12 with different colors. It shows that when there is no augmentation, i.e., $r = 0$ , each sample is a connected component alone, and the number of connected components is the same as the number of samples $N$ . As we increase the augmentation strength, samples will be connected together through the augmented views. In particular, when $r = 0 . { \overset { } { 1 } }$ , the whole intra-class samples are connected while inter-class samples are separated, which exactly satisfy our assumptions on intra-class connectivity and label consistency, respectively. Therefore, this is the perfect overlap as desired, and indeed, as shown in Figure 5.1, contrastive learning on it obtains $\hat { 1 } 0 0 \%$ test accuracy. When we keep increasing the augmentation strength to be as large as 1.5, inter-class samples also become connected and inseparable, leading to a random guess in test accuracy $( 5 0 \% )$ . This shows that the relationship between the augmentation graph and the downstream performance aligns well with our augmentation overlap theory.
466
+
467
+ ![](images/d052ae1bf288850db8bed8bf8c868fb6fb7e95b54c17542b281ffeddacabf25d.jpg)
468
+ (a) Under-overlap augmentation (b) Proper overlap augmentation (c) Over-overlap augmentation graph $( \mathrm { r } { = } 0 . 0 \dot { 1 }$ , $\operatorname { a c c } { = } 0 . { \overset { - } { 2 } } 5 )$ ). graph $_ { ( \mathrm { r = } 0 . 9 2 }$ , ac ${ : = } 0 . 7 5$ ). graph $( \mathrm { r } { = } 1 . \hat { 9 } 6 $ , ac ${ \tt : = } 0 . \bar { 2 } 9 $ ).
469
+ Figure 13: The augmentation graph of CIFAR-10 with different strength $r$ of RandomResizedCrop as in Section 5.2. We choose a random subset of test images, randomly augment each one for 20 times. Then, we calculate the sample distance in the representation space as in prior work like FID (Heusel et al., 2017), and draw edges for image pairs whose smallest view distance is below a small threshold. Afterwards, we visualize the samples with t-SNE and color intra-class edges in black and inter-class edges in red and report their frequencies.
470
+
471
+ Real-world data. For the ease of analysis, our augmentation overlap theory adopts a simplified scenario by assuming label consistency (Assumption 4.1) and intra-class connectivity (Assumption 4.5), and we have verified their feasibility on the synthetic data. In comparison, these assumptions cannot hold exactly on real-world data as the chosen augmentations could be sub-optimal. Nevertheless, as shown in the augmentation graphs of CIFAR-10 (Figure 13), our assumptions could still approximately hold: with a properly chosen augmentation strength, the inter-class connections will be much less frequent than intra-class connections: $9 6 . 4 \%$ edges are intra-class edges. Further considering the continuity property and extrapolation ability of deep neural networks, these approximate conditions could still achieve close performance to the optimal performance guaranteed under the exact conditions. Besides, we also have similar conclusions for the under-overlap and over-overlap scenarios: 1) the lack of enough augmentations produces only a few edges in the augmentation graph, as a result, even though all edges are intra-class edges, the downstream performance is still poor ( $25 \%$ test accuracy); 2) too strong augmentations instead produce too many inter-class edges $\bar { ( } 8 7 . 6 \% )$ , which laso leads to poor downstream accuracy $( 2 9 \% )$ . This highlights that our assumptions on label consistency and intra-class connectivity are indeed effective guidelines for the designing of contrastive methods.
472
+
473
+ # D THEORETICAL CHARACTERIZATION OF AUGMENTATION STRENGTH
474
+
475
+ Following the setting in Section 5.1, we can take the radius $r$ as a notation of augmentation strength, and analyze its effect on the connectivity of the corresponding augmentation graph.
476
+
477
+ Theorem D.1. For $N$ random samples taken from a class, while gradually increasing the augmentation strength $r$ , we have the following results.
478
+
479
+ (a) Under-overlap. When $\begin{array} { r } { 0 \leq r \leq r _ { 1 } = \frac { [ ( d / 2 ) ! ] ^ { \frac { 1 } { d } } } { \sqrt { \pi } } \big ( \frac { 1 } { d } \big ) ! \big ( \frac { S } { N - 1 } \big ) ^ { \frac { 1 } { d } } \big [ 1 - \frac { 1 / d + 1 / d ^ { 2 } } { 2 ( N - 1 ) } + O \big ( \frac { 1 } { ( N - 1 ) ^ { 2 } } \big ) \big ] , } \end{array}$ where $r _ { 1 }$ is the minimal distance between $N$ samples, all samples (vertices) in the augmentation graph will be isolated. As a result, the learned features could be totally random as in Proposition 3.1. Instead, if $r \geq r _ { 1 }$ , there are at least two intra-class samples are $\tau$ -connected and enjoy the same representation.
480
+
481
+ (b) Perfect overlap. When r ≥ r2 = [(d/2)!] 1d √ (N−2+1/d)! ( $\begin{array} { r } { r \ge r _ { 2 } = \frac { [ ( d / 2 ) ! ] ^ { \frac { 1 } { d } } } { \sqrt { \pi } } \frac { ( N - 2 + 1 / d ) ! } { ( N - 2 ) ! } ( \frac { S } { N - 1 } ) ^ { \frac { 1 } { d } } [ 1 - \frac { 1 / d + 1 / d ^ { 2 } } { 2 ( N - 1 ) } + O ( \frac { 1 } { ( N - 1 ) ^ { 2 } } ) ] , } \end{array}$ where $r _ { 2 }$ is the maximal distance between $N$ samples, all samples in the augmentation graph will be $\tau$ -connected. As a result, the classwise connectivity in Assumption $4 . 5 ~ w i l l$ be guaranteed.
482
+
483
+ (c) Over-overlap. When $\begin{array} { r } { 0 \leq r < r _ { 3 } = \frac { 1 } { 2 } \operatorname* { m i n } _ { i , j } { \| c _ { i } - c _ { j } \| - 1 } } \end{array}$ , where $r _ { 3 }$ is the (asymptotic) minimal distance between samples from different classes, the label consistency is guaranteed. Otherwise, when the augmentation is too large, e.g., $r > r _ { 3 }$ , there will be inter-class augmentation overlap and Assumption 4.1 not longer holds.
484
+
485
+ In the theorem above, we show that the proper augmentation strength is a function of the number of samples $N$ and the input dimensions $d$ . In particular, for each $x$ , as $N$ increases, there will be more natural examples and we only need a smaller $r$ to obtain an overlap sample. Instead, as $d$ increases, due to the curse of dimensionality, there will be less samples within the same distance, thus it requires a larger $r$ .
486
+
487
+ Nevertheless, we actually only need the augmentation sub-graph $G _ { k }$ to be connected, instead of being fully connected as in Theorem D.1 (b). While the connectivity is hard to analyze in the finite sample scenario $N < \infty$ ), we have the following asymptotic property as $N \to \infty$ .
488
+
489
+ Theorem D.2. For $N$ uniformly distributed samples defined in $\mathbb { R } ^ { d }$ as above, we denote the min$G _ { k } ^ { ( r ) }$ augmentation strength needed for connectivity as a function of is connected}, and the minimal augmentation strength needed for $N$ : oi $c _ { N } ~ = ~ \operatorname* { i n f } \{ r ~ > ~ 0 ~ :$ $a$ function of $N$ : $d _ { N } = \operatorname* { i n f } \{ r > 0$ : every vertex at least has a neighbour}. $V _ { u }$ is the volume of unit hyperball. Then we have the following asymptotic result:
490
+
491
+ $$
492
+ \forall d \geq 2 , \operatorname* { l i m } _ { N \infty } ( c _ { N } ^ { d } \frac { N ^ { 2 } } { \log N } ) = \operatorname* { l i m } _ { N \infty } ( d _ { N } ^ { d } \frac { N ^ { 2 } } { \log N } ) = 2 \frac { ( 1 - 1 / d ) S } { V _ { u } } .
493
+ $$
494
+
495
+ From the theorem we can see that $c _ { N } ^ { d }$ decreases in the order of $\Theta \left( \sqrt [ d ] { \frac { \log N } { N ^ { 2 } } } \right)$ as $N \infty$ . First, this result is aligned with the empirical finding that self-supervised learning can benefit more from large scale dataset (Chen et al., 2020b). Second, it also indicate a curse of dimensionality that the required augmentation strength is exponentially large.
496
+
497
+ # D.1 PROOF OF THEOREM D.1
498
+
499
+ Proof. From definition and notation in section 4. We can construct an augmentation Graph $\mathcal { G } ( \mathcal { D } , \tau )$ given N random samples. We define $D _ { k }$ as the distance from a random point to its $\mathbf { k }$ -th nearest
500
+
501
+ neighbour. Percus & Martin (1998) discuss $D _ { k }$ in random grpah and give the estimation of that:
502
+
503
+ $$
504
+ D _ { k } \approx { \frac { [ ( d / 2 ) ! ] ^ { \frac { 1 } { d } } } { \sqrt { \pi } } } { \frac { ( k - 1 + 1 / d ) ! } { ( k - 1 ) ! } } ( { \frac { S } { N - 1 } } ) ^ { \frac { 1 } { d } } [ 1 - { \frac { 1 / d + 1 / d ^ { 2 } } { 2 ( N - 1 ) } } + O ( { \frac { 1 } { ( N - 1 ) ^ { 2 } } } ) ]
505
+ $$
506
+
507
+ where d is the dimension of hypersphere and $\mathbf { N }$ is the number of random points. When $r < D _ { 1 }$ there is no edge in the graph. So the class is separated. When $r > D _ { N - 1 }$ , any pair of vertexes have an edge between them,so the graph is full connected. □
508
+
509
+ # D.2 PROOF OF THEOREM D.2
510
+
511
+ Proof. Denote
512
+
513
+ $$
514
+ c _ { N } = \operatorname* { i n f } \{ r _ { i } > 0 : G _ { N } ( V , E , r _ { i } ) { \mathrm { i s ~ c o n n e c t e d } } \} .
515
+ $$
516
+
517
+ With Theorem 1.1 from Penrose (1999) and features are uniformly distributed in the surface of unit hypersphere, $V _ { u }$ denotes to the volume of unit hypershpere
518
+
519
+ $$
520
+ \operatorname* { l i m } _ { N \to \infty } ( c _ { N } ^ { d } \frac { N ^ { 2 } } { \log N } ) = 2 \frac { ( 1 - \frac { 1 } { d } ) S } { V _ { u } } , d \geq 2
521
+ $$
522
+
523
+ $\exists N _ { 0 }$ when $N > N _ { 0 }$ , and augmentation strength is larger than ( 2(d−1)S log N2 ) 1d + 1, the graph is connected,i.e the class is overlapped.
524
+
525
+ Then we want specify the case the class will be depart begin with some concepts in graph theory. The largest nearest-neighbor link: For a give edge distance $\mathbf { X }$ and for each $\mathrm { i } = 1$ ,...,n,let
526
+
527
+ $$
528
+ \deg { U _ { N , j } } = \sum _ { 1 \leq j \neq k \leq N } 1 _ { \{ \| U _ { j } - U _ { k } \| \leq r _ { i } \} }
529
+ $$
530
+
531
+ to be the degree of the vertex $U _ { j }$ in the random graph $G _ { N } ( V , E , r _ { i } )$ , and let
532
+
533
+ $$
534
+ \delta _ { N } ( r _ { i } ) = \operatorname* { m i n } \{ \deg \ U _ { m , 1 } ( x ) , . . . , \deg \ U _ { N , N } ( x ) \}
535
+ $$
536
+
537
+ be the minimum vertex degree.Define the largest nearest-neighbor link, the smallest edge distance for which each vertex has at least one neighbor
538
+
539
+ $$
540
+ d _ { N } = \operatorname* { i n f } \{ r _ { i } : \delta _ { N } ( r _ { i } ) \geq 1 \}
541
+ $$
542
+
543
+ With Theorem 1.2 from Penrose (1999),
544
+
545
+ $$
546
+ \operatorname* { l i m } _ { N \to \infty } ( d _ { N } ^ { d } \frac { N ^ { 2 } } { \log N } ) = 2 \frac { ( 1 - \frac { 1 } { d } ) S } { V _ { u } } , d \geq 2
547
+ $$
548
+
549
+ $\exists N _ { 0 } ^ { \prime }$ when $N > N _ { 0 } ^ { \prime }$ , and augmentation strength is less than $\big ( { \frac { 2 ( d - 1 ) S \log N } { 2 N ^ { 2 } V _ { u } d } } \big ) ^ { \frac { 1 } { d } } - \epsilon _ { 2 }$ , there will be at least 1 isolated point which is not connected to any other point,i.e the class is departed. Thus $\begin{array} { r l r } { \exists N _ { 1 } } & { { } = } & { \operatorname* { m a x } ( N _ { 0 } , N _ { 0 } ^ { \prime } ) } \end{array}$ ,when $\begin{array} { r l r } { N } & { { } > } & { \mathsf { \bar { N } } _ { 1 } } \end{array}$ , if augmentation strength is larger than $\Bigl ( { \frac { 2 ( d - 1 ) S \log N } { 2 N ^ { 2 } V _ { u } d } } \Bigr ) ^ { \frac { 1 } { d } } \ + \ \epsilon _ { 1 }$ , the graph is connected, if augmentation strength is less than $\big ( { \frac { 2 ( d - 1 ) S \log N } { 2 N ^ { 2 } V _ { u } d } } \big ) ^ { \frac { 1 } { d } } - \epsilon _ { 2 }$ , there will be at least 1 isolated point.
550
+
551
+ # E ADDITIONAL EXPERIMENTAL DETAILS
552
+
553
+ # E.1 SIMULATION ON RANDOM AUGMENTATION GRAPH
554
+
555
+ Following our setting in Section 5.1, we consider a binary classification task with InfoNCE loss. We generate data from two uniform distribution on a unit ball $\mathbb { S } ^ { 2 }$ in the 3-dimensional space. One center is $( 0 , 0 , 1 )$ and another is $( 0 , 0 , - 1 )$ . The area of both parts are 1. We take 5000 samples as train set and 1000 samples as test set. For the encoder class $\mathcal { F }$ , we use a single-hidden-layer neural network with softmax activation, and we use InfoNCE loss to optimize it.
556
+
557
+ # E.2 EXPERIMENTS ON REAL-WORLD DATASETS
558
+
559
+ To better understand and verify our theorem, we conduct experiments on real-world datasets, including CIFAR-10, CIFAR-100 and STL-10. We use SimCLR (Chen et al., 2020a) and BYOL Grill et al. (2020) as our training framework and use ResNet18 as our network. For CIFAR-10 and CIFAR-100, we adopt $C = 1 0$ augmentations for each image, and search neural neighbors in the entire augmented dataset. For STL-10, we adopt $C = 6$ due to its relatively large size.
parse/dev/ECvgmYVyeUz/ECvgmYVyeUz_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/ECvgmYVyeUz/ECvgmYVyeUz_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/ECvgmYVyeUz/ECvgmYVyeUz_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/LPB2BFZvncQ/LPB2BFZvncQ.md ADDED
@@ -0,0 +1,827 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # An Information-theoretic Perspective of Hierarchical Clustering
2
+
3
+ Anonymous Author(s)
4
+ Affiliation
5
+ Address
6
+ email
7
+
8
+ # Abstract
9
+
10
+ 1 A combinatorial cost function for hierarchical clustering was introduced by Das
11
+ 2 gupta [10]. It has received great attention and several new cost functions from sim
12
+ 3 ilar combinatorial perspective have been proposed. In this paper, we investigate
13
+ 4 hierarchical clustering from the information-theoretic perspective and formulate
14
+ 5 a new objective function. We also establish the relationship between these two
15
+ 6 perspectives. In algorithmic aspect, we present two algorithms for expander-like
16
+ 7 and well-clustered cardinality weighted graphs, respectively, and show that both
17
+ 8 of them achieve $O ( 1 )$ -approximation for our new objective function. For practi
18
+ 9 cal use, we consider non-binary hierarchical clustering problem. We get rid of
19
+ 10 the traditional top-down and bottom-up frameworks, and present a new one. Our
20
+ 11 new framework stratifies the sparsest level of a cluster tree recursively in guide
21
+ 12 with our objective function. Our algorithm called HCSE outputs a $k$ -level cluster
22
+ 13 tree by an interpretable mechanism to choose $k$ automatically without any hyper
23
+ 14 parameter. Our experimental results on synthetic datasets show that HCSE has
24
+ 15 its own superiority in finding the intrinsic number of hierarchies, and the results
25
+ 16 on real datasets show that HCSE also achieves competitive costs over the popular
26
+ 17 non-binary hierarchical clustering algorithms LOUVAIN and HLP.
27
+
28
+ # 18 1 Introduction
29
+
30
+ 19 Hierarchical clustering for graphs plays an important role in the structural analysis of a given data
31
+ 20 set. Understanding hierarchical structures on the levels of multiple granularities is fundamental in
32
+ 21 various disciplines including artificial intelligence, physics, biology, sociology, etc [4, 11, 13, 9].
33
+ 22 Hierarchical clustering requires a cluster tree that represents a recursive partitioning of a graph into
34
+ 23 smaller clusters as the tree nodes get deeper. A leaf represents a graph node while a non-leaf node
35
+ 24 represents a cluster containing its descendant leaves. The root is the largest one containing all leaves.
36
+ 25 Clustering is usually formulated as an optimization problem with some objective function. For hier
37
+ 26 archical clustering, no cost function with a clear and reasonable combinatorial explanation was de
38
+ 27 veloped until Dasgupta [10] introduced a cost function for cluster trees. In this definition, similarity
39
+ 28 or dissimilarity between data points is represented by weighted edges. Taking the similarity-based
40
+ 29 metrics as an example, a cluster is a set of nodes with relatively denser intra-links compared with its
41
+ 30 inter-links, and in a good cluster tree, heavier edges tend to connect leaves whose lowest common
42
+ 31 ancestor (LCA) is as deep as possible. This intuition leads to Dasgupta’s cost function that is a
43
+ 32 bilinear combination of edge weights and the sizes of corresponding LCAs.
44
+ 33 Motivated by Dasgupta’s cost function, Cohen-Addad et al. [8] proposed admissible cost functions.
45
+ 34 In their definition, the size of each LCA in Dasgupta’s objective is generalized to be a function of
46
+ 35 the sizes of its left and right children. For all similarity-based graphs generated from a minimal
47
+ 36 ultrametric, a cluster tree achieves the minimum cost if and only if it is a generating tree that is a
48
+ 37 “natural” ground truth tree in an axiomatic sense therein. A necessary condition of admissibility of
49
+ 38 an objective function is that it achieves the same value for every cluster tree for a uniformly weighted
50
+ 39 clique that has no structure in common sense. However, any slight deviation of edge weights would
51
+ 40 generally separate the two end-points of a light edge on a high level of its optimal (similarity-based)
52
+ 41 cluster tree. Thus, it seems that admissible objective functions, which take Dasgupta’s cost function
53
+ 42 as a specific form, ought to be an unchallenged criterion in evaluating cluster trees since they are
54
+ 43 formulated by an axiomatic approach.
55
+ 44 However, an admissible cost function seems imperfect in practice. The arbitrariness of optima of
56
+ 45 cluster trees for cliques indicates that the division of each internal node on an optimal cluster tree
57
+ 46 totally neglects the balance of its two children. Edge weight is the unique factor that decides the
58
+ 47 structure of optimal trees. But a balanced tree is commonly considered as an ideal candidate in
59
+ 48 hierarchical clustering compared to an unbalanced one. Even clustering for cliques, a balanced
60
+ 49 partition should be preferable for each internal node. At least, an optimal cluster tree whose height
61
+ 50 is logarithm of graph size $n$ is intuitively more reasonable than a caterpillar shaped cluster tree
62
+ 51 whose height is $n - 1$ . Moreover, a simple proof would imply that the optimal cluster tree for any
63
+ 52 connected graphs is binary. This property is not always useful in practice since a real system usually
64
+ 53 has its inherent number of hierarchies and a natural partition for each internal cluster. For instance,
65
+ 54 the natural levels of administrative division in a country is usually intrinsic, and it is not suitable to
66
+ 55 differentiate hierarchies for parallel cities in the same state. This structure cannot be obtained by
67
+ 56 simply minimizing admissible cost functions.
68
+ 57 In this paper, we investigate the hierarchical clustering from the perspective of information theory.
69
+ 58 Our study is based on Li and Pan’s structural information theory [14] whose core concept named
70
+ 59 structural entropy measures the complexity of hierarchical networks. We summarize our contribu
71
+ 60 tions as follows.
72
+ 61 (1) We formulate a new objective function from the information-theoretic perspective, which
73
+ 62 builds the bridge for combinatorial and information-theoretic perspectives for hierarchical cluster
74
+ 63 ing. For this cost function, the balance of cluster trees will be involved naturally as a factor just
75
+ 64 like we design optimal codes, for which the balance of probability over objects is fundamental in
76
+ 65 constructing an efficient coding tree. We also define cluster trees with a specific height, which is
77
+ 66 coincident with our cognition of natural clustering.
78
+ 67 (2) For our new objective function, we present two polynomial-time approximation algorithms
79
+ 68 respectively for two cases of the conductance $\Phi ( G )$ of a cardinality weighted graph $G$ . Our first
80
+ 69 result shows that any cluster tree of $G$ has a approximation factor $\bar { O } ( \Phi ( \bar { G } ) ^ { - 1 } )$ (Theorem 3.1). So
81
+ 70 a "Huffman-merge" heuristic that solely depends on the degrees of vertices achieves this guaran
82
+ 71 tee, and it achieves $O ( 1 )$ -approximation when $\Phi ( G )$ is a constant. The second result is a $O ( 1 )$ -
83
+ 72 approximation algorithm for $G$ that can be well clustered into a constant number of expanders (The
84
+ 73 orem 3.2). The main idea of this algorithm is inspired by very recent Manghiuc and Sun’s work [15],
85
+ 74 and our approximation factors for our new objective also match their results in these two cases.
86
+ 75 (3) For practical use, we develop a new interpretable framework for natural hierarchical clus
87
+ 76 tering that outputs a non-binary cluster tree. The idea of our framework is essentially different from
88
+ 77 the traditional recursive division or agglomeration ones. In our framework, the sparsest level of the
89
+ 78 cluster tree is stratified recursively. This coincide with the intuition that when we differentiate the
90
+ 79 hierarchies of a complex system, the clearest level should be stratified first, rather than in a rigid
91
+ 80 divisive or agglomerative fashion. Therefore, this framework has much better interpretability than
92
+ 81 the traditional ones.
93
+ 82 (4) We develop a new non-binary clustering algorithm (HCSE) under the new clustering frame
94
+ 83 work. To find the sparsest level in each iteration, we formulate two basic operations called stretch
95
+ 84 and compress, respectively. HCSE terminates when a specific criterion that intuitively coincides
96
+ 85 with the natural hierarchies is met, and no hyperparameter is needed. Our extensive experiments on
97
+ 86 both synthetic and real datasets demonstrate that HCSE outperforms the present popular heuristic
98
+ 87 algorithms LOUVAIN [3] and HLP [19]. These two algorithms proceed simply by recursively in
99
+ 88 voking flat clustering algorithms based on modularity and label propagation, respectively, and the
100
+ 89 hierarchy number is solely determined by the number of rounds when the algorithm terminates. So
101
+ 90 their interpretability is quite poor. Our experimental results on synthetic datasets show that HCSE
102
+ 91 has a great advantage in finding the intrinsic number of hierarchies, and the results on real datasets
103
+ 92 show that HCSE achieves much better costs than HLP and competitive costs to LOUVAIN.
104
+ 93 Related work. The first combinatorial objective function was proposed by Dasgupta [10]. Along
105
+ 94 with this line of study, several alternative objectives have been presented. All of them are bilinear
106
+ 95 functions of edge weights and some function of the corresponding LCAs. For Dasgupta’s cost func
107
+ 96 tion and for the worst case study, Dasgupta showed that a recursively bipartition applying Arora’s
108
+ 97 seminal algorithm for sparsest cut problem [2] yields √ $O ( \log ^ { 1 . 5 } n )$ -approximation, and it was im
109
+ 98 proved by [20] and [5, 8] to $O ( \log n )$ and $\sqrt { \log n }$ , respectively. It is NP-hard to optimize the cluster
110
+ 99 tree [10] and even a $O ( 1 )$ -approximation is impossible under the Small Set Expansion hypothesis
111
+ 100 [20, 5]. Beyond the worst case, Cohen-Addad et al. [8] showed that a SVD-based algorithm achieves
112
+ 101 a $O ( 1 + o ( 1 ) )$ -approximation for the stochastic block model with high probability. Manghiuc and
113
+ 102 Sun [15] presented a $O ( 1 )$ -appromation algorithm for more generalized well-clustered graphs. The
114
+ 103 outline of their method is to utilize a flat clustering algorithm [12] to obtain the underlying clusters
115
+ 104 first, and then some relatively easy heuristics for clustering in and out of these clusters are enough
116
+ 105 for the guarantee. Our proof follows this route also.
117
+ 106 For other lines of this study, Moseley and Wang [16] studied the dual of Dasgupta’s cost function
118
+ 107 and showed that the average-linkage algorithm achieves a $( 1 / 3 )$ -approximation. This factor has
119
+ 108 been improved by a series of works to 0.336 [6], 0.4246 [7] and 0.585 [1], respectively. Cohen
120
+ 109 Addad et al. [8] considered maximization of Dasgupta’s cost function for the dissimilarity-based
121
+ 110 metrics. They proved that the average-link and random partitioning algorithms achieve a $( 2 / 3 )$ -
122
+ 111 approximation, which has been improved to 0.667 [6], 0.716 [18] and 0.74 [17], respectively.
123
+ 112 For non-binary cluster tree construction, the most popular algorithm for practical use is LOUVAIN
124
+ 113 [3]. More recently, a hierarchical label propagation based algorithm HLP has been presented [19].
125
+ 114 Both of these two algorithms construct a non-binary cluster tree with the same framework, that is,
126
+ 115 the hierarchies are formed from bottom to top one by one. In each round, they invoke different flat
127
+ 116 clustering algorithms, Modularity and Label Propagation, respectively.
128
+
129
+ # 117 2 A cost function from information-theoretic perspective
130
+
131
+ 118 In this section, we introduce Li and Pan’s structural information theory [14] and the combinatorial
132
+ 119 cost functions of Dasgupta [10] and Cohen-Addad et al. [8]. Then we propose a new cost func
133
+ 120 tion that is developed from structural information theory and establish the relationship between the
134
+ 121 information-theoretic and combinatorial perspectives.
135
+ 122 Notations. Let $G = ( V , E , w )$ be an undirected weighted graph with a set of vertices $V$ , a set of
136
+ 123 edges $E$ and a weight function $w : E \to \mathbb { R } ^ { + }$ , where $\bar { \mathbb { R } ^ { + } }$ denotes the set of all positive real numbers.
137
+ 124 An unweighted multigraph can be viewed as a cardinality weighted one whose edge weight is the
138
+ 125 number of parallel edges. For each vertex $u \in V$ , denote by $\begin{array} { r } { \bar { d _ { u } } = \sum _ { ( u , v ) \in E } w ( u , \bar { v } ) } \end{array}$ the weighted
139
+ 126 degree of $u$ . For a subset of vertices $S \subseteq V$ , define the volume of $S$ to be the sum of degrees of
140
+ 127 vertices. We denote it by $\begin{array} { r } { \mathrm { v o l } ( S ) = \sum _ { u \in S } d _ { u } } \end{array}$ . We denote by $G [ S ]$ the subgraph induced by $S$ . A
141
+ 128 cluster tree $T$ for graph $G$ is a rooted tree with $| V |$ leaves, each of which is labeled by a distinct
142
+ 129 vertex $v \in V$ . Each non-leaf node on $T$ is labeled by a subset $S$ of $V$ that consists of all the leaves
143
+ 130 treating $S$ as an ancestor. For each node $\alpha$ on $T$ , denote by $\alpha ^ { - }$ the parent of $\alpha$ , and by $| \alpha |$ its size.
144
+ 131 For each pair of leaves $u$ and $v$ , denote by $u \vee v$ the LCA of them on $T$ .
145
+
146
+ Structural entropy of graphs. Because of the tense space limit, we just give the definition of the core concept structural entropy in structural information theory. The idea of this definition is briefly introduced in Appendix A. Readers could also refer to [14] for more information on this theory.
147
+
148
+ 35 Given a weighted graph $G = ( V , E , w )$ and a cluster tree $T$ for $G$ , the structural entropy of $G$ on $T$
149
+ 36 is defined as
150
+
151
+ $$
152
+ { \mathcal { H } } ^ { T } ( G ) = - \sum _ { \alpha \in T } { \frac { g _ { \alpha } } { \operatorname { v o l } ( V ) } } \log { \frac { \operatorname { v o l } ( \alpha ) } { \operatorname { v o l } ( \alpha ^ { - } ) } } , ^ { 1 }
153
+ $$
154
+
155
+ 137 where $\alpha ^ { - }$ denotes the parent of tree node $\alpha$ , and $g _ { \alpha }$ denotes the sum of weights of edges in $G$
156
+ 138 with exactly one end-point in the set of vertices corresponding to $\alpha$ . The structural entropy of $G$ is
157
+ 139 defined as the minimum one among all cluster trees, denoted by $\begin{array} { r } { \mathcal { H } ( G ) = \operatorname* { m i n } _ { T } \big \{ \mathcal { H } ^ { T } ( G ) \big \} } \end{array}$ .
158
+ 140 Combinatorial explanation of structural entropy. The cost function of a cluster tree $T$ for graph
159
+ 141 $G = ( V , E )$ introduced by Dasgupta [10] is defined to be $\begin{array} { r } { c ^ { T } ( G ) = \sum _ { ( u , v ) \in E } w ( u , v ) | u \vee v | } \end{array}$ . The
160
+ 142 admissible cost function introduced by Cohen-Addad et al. [8] generalizes the term $\vert u \vee v \vert$ in the
161
+ 143 definition of $c ^ { T } ( G )$ to be a general function $g ( | L | , | R | )$ , where $L$ and $R$ are the two children of
162
+ 144 $u \vee v$ , respectively. Dasgupta defined $g ( x , y ) = x + y$ . For both definitions, the optimal hierarchical
163
+ 145 clustering of $G$ is in correspondence with a cluster tree of minimum cost in the combinatorial sense
164
+ 146 that heavy edges are cut as far down the tree as possible. The following proposition establishes the
165
+ 147 relationship between structural entropy and this kind of combinatorial form of cost functions.
166
+ 148 Proposition 2.1. For a weighted graph $G = ( V , E , w )$ , minimizing ${ \mathcal { H } } ^ { T } ( G )$ (over $T$ ) is equivalent
167
+ 149 to minimizing the cost function
168
+
169
+ $$
170
+ c o s t ^ { T } ( G ) = \sum _ { ( u , v ) \in E } w ( u , v ) \log { \nu o l ( u \vee v ) } .
171
+ $$
172
+
173
+ 150 We defer the proof of Proposition 2.1 to Appendix B. We call cost(SE) the cost function in Propo
174
+ 151 sition 2.1 from now on. Proposition 2.1 indicates that when we view $g$ as a function of the LCA
175
+ 152 rather than that of its size and define $g ( u , v ) = \log { \mathrm { v o l } } ( u \vee v )$ , the “admissible” function becomes
176
+ 153 equivalent to structural entropy in evaluating cluster trees, although it is not admissible any more.
177
+ 154 So what is the difference between these two cost functions? As stated by Cohen-Addad et al. [8],
178
+ 155 an important axiomatic hypothesis for admissible function, thus also for Dasgupta’s cost function,
179
+ 156 is that the cost for every binary cluster tree of an unweighted clique is identical. So any binary tree
180
+ 157 for clustering on cliques is reasonable, which coincides with the common sense that structureless
181
+ 158 datasets can be organized hierarchically free. However, for structural entropy, the following theorem
182
+ 159 indicates that balanced organization is of importance even though for structureless dataset.
183
+ 160 Proposition 2.2. For any positive integer $n$ , let $K _ { n }$ be the clique of n vertices with identical weight
184
+ 161 on every edge. Then a cluster tree $T$ of $K _ { n }$ achieves minimum structural entropy if and only if $T$ is
185
+ 162 a balanced binary tree, that is, the two children clusters of each sub-tree of T have difference in size
186
+ 163 at most 1.
187
+ 164 The proof of Proposition 2.2 is a bit technical, and we defer it to Appendix C. The intuition behind
188
+ 165 Proposition 2.2 is that balanced codes are the most efficient encoding scheme for unrelated data. So
189
+ 166 the codewords of the random walk that jumps freely among clusters on each level of a cluster tree
190
+ 167 have the minimum average length if all the clusters on this level are in balance.
191
+ 168 It is worth noting that the admissible function introduced by Cohen-Addad et al. [8] is defined
192
+ 169 from the viewpoint that a generating tree $T$ of a similarity-based graph $G$ that is generated from a
193
+ 170 minimal ultrametric achieves the minimum cost. In this definition, the monotonicity of edge weights
194
+ 171 between clusters on each level from bottom to top on $T$ , which is given by Cohen-Addad et al. [8] as
195
+ 172 a property of a “natural” ground-truth hierarchical clustering, is the unique factor when evaluating $T$
196
+ 173 However, Proposition 2.2 implies that for cost(SE), besides cluster weights, the balance of cluster
197
+ 174 trees is implicitly involved as another factor. Moreover, for cliques, the minimum cost should be
198
+ 175 achieved on every subtree, which makes an optimal cluster tree balanced everywhere. This optimal
199
+ 176 clustering for cliques is also robust in the sense that a slight perturbation to the minimal ultrametric,
200
+ 177 which can be considered as slight variations to the weights of a batch of edges, will not change the
201
+ 178 optimal cluster tree structure wildly due to the holdback force of balance.
202
+
203
+ # 179 3 Approximation algorithms for SE-based cost function
204
+
205
+ In this section, we present approximation algorithms for expander-like and well-clustered graphs, respectively. These algorithms work for cardinality edge weights (e.g. the multiplicity of edges).
206
+
207
+ Why cardinality weights? In general, the term $\log { \mathrm { v o l } } ( u \vee v )$ in Eq. 1 and thus cost(SE) may be negative when the volume of $u \vee v$ varies, which may lead to pathosis in approximation analysis. The cardinality weight function $w$ is at least one, which makes cost(SE) non-negative. The dependence of cost(SE) on the scale of edge weights violates the scale-invariance principle. However, we emphasize that ${ \dot { \mathcal { H } } } ^ { T } ( G )$ is scale-invariant and Proposition 2.1 holds for any scale variation. In this paper, we present approximation algorithms for cost(SE) in well-defined settings.
208
+
209
+ 188 Theorem 3.1. For any cardinality weighted graph $G = ( V , E , w )$ with conductance $\Phi ( G )$ , it holds that any cluster tree has a cost 189 $O ( \Phi ( G ) ^ { - 1 } ) \cdot O P T$ , where $O P T$ is the minimum cost $S E )$ of $G$ .
210
+
211
+ 190 We defer the proof of Theorem 3.1 to Appendix D. When $\Phi ( G )$ is a constant, Theorem 3.1 implies
212
+ 191 that any cluster tree achieves $O ( 1 )$ -approximation for expanders. Thus, the balance of a cluster
213
+ 192 tree has a significant impact on its cost. Considering balance as an important factor, we present a
214
+ 193 Huffman-merging heuristic (Algorithm 1). It will serve as a subroutine for the algorithm for well
215
+ 194 clustered graphs.
216
+
217
+ # Algorithm 1: HuffmanMerge
218
+
219
+ Input: a graph $G = ( V , E , w )$
220
+
221
+ Output: A cluster tree $T$ of $G$
222
+
223
+ 1 Create $n$ singleton trees;
224
+
225
+ 2 while there are at least two trees do
226
+
227
+ 3 Select the two trees $T _ { 1 }$ and $T _ { 2 }$ with the least volumes;
228
+ 4 Construct a new tree $T _ { 0 }$ with $T _ { 1 }$ and $T _ { 2 }$ as two subtrees of the root;
229
+
230
+ 5 Return the resulting binary tree $T _ { 0 }$
231
+
232
+ 195 Next, we consider well-clustered graphs that are composed by a collection of densely-connected
233
+ 196 components with high inner conductance and weakly interconnections. Our settings for well
234
+ 197 clustered graphs is the same as those in [15]. We start from the following $( \Phi _ { i n } , \Phi _ { o u t } )$ -decomposition
235
+ 198 presented by Gharan and Trevisan [12]. Let $\lambda _ { k }$ be the $k$ -th smallest eigenvalue of the normalized
236
+ 199 Laplacian matrix of $G$ and $\Phi _ { G } ( S )$ be the conductance of a vertex set $S$ in $G$ .
237
+
238
+ 200 Lemma 3.1. ([12], Theorem 1.5) Let $G = ( V , E , w )$ be a graph such that $\lambda _ { k } > 0$ , for some $k \geq 1$ . 201 Then, there is a local search algorithm that finds a $l$ -partition $\{ P _ { i } \} _ { i = 1 } ^ { l }$ of $V ,$ for some $l < k$ , such that for every 202 $1 \leq i \leq l$ , $\Phi _ { G } ( P _ { i } ) = \mathcal { O } ( k ^ { 6 } \sqrt { \lambda _ { k - 1 } } )$ and $\Phi ( G [ P _ { i } ] ) = \Omega ( \lambda _ { k } ^ { 2 } / k ^ { 4 } )$ .
239
+
240
+ Lemma 3.1 implies that, when graph $G$ exhibits a clear clustering structure, there is a partition $\{ P _ { i } \} _ { i = 1 } ^ { l }$ of $\mathrm { v }$ such that for each $P _ { i }$ both the outer and inner conductance can be bounded. This is one of the most crucial insights that we can use $\{ P _ { i } \} _ { i = 1 } ^ { l }$ directly to construct a cluster tree.
241
+
242
+ 206 For a high-level description, our algorithm consists of two phases: Partition and Merge. In the
243
+ 207 Partition phase, it invokes the algorithm in Lemma 3.1 to partion $V$ into sets $\{ P _ { i } \} _ { i = 1 } ^ { l }$ . In the Merge
244
+ 208 phase it combines the trees in a "caterpillar style" according to an increasing order of their volumes.
245
+ 209 This algorithm is described as Algorithm 2.
246
+
247
+ # Algorithm 2: CaterpillarMerge
248
+
249
+ Input: A graph $G = ( V , E , w )$ , an integer $k \geq 2$ such that $\lambda _ { k } > 0$ Output: A cluster tree $T$ of $G$
250
+
251
+ 1 Apply the partitioning algorithm in Lemma 3.1 on input $( G , k )$ to obtain $\{ P _ { i } \} _ { i = 1 } ^ { l }$ for some $l < k$ ;
252
+
253
+ 2 Sort $P _ { 1 } , . . . , P _ { l }$ be such that ${ \mathrm { v o l } } _ { G } ( P _ { i } ) \leq { \mathrm { v o l } } _ { G } ( P _ { i + 1 } )$ , for all $1 \leq i < l$ ;
254
+
255
+ 3 Let $T _ { i } =$ HuffmanMerge $( G [ P _ { i } ] )$ ;
256
+ 4 Initialize $T = T _ { 1 }$ ;
257
+ 5 for $i = 2 , . . . , l$ do
258
+ 6 Let $T$ be the tree with $T$ and $T _ { i }$ as its two children;
259
+
260
+ 7 Return $T$
261
+
262
+ 210 Note that Algorithm 2 degenerates to Algorithm 1 when $k = 2$ . For the approximation guarantee,
263
+ 211 we have the following theorem.
264
+ 212 Theorem 3.2. Let $G = ( V , E , w )$ be a cardinality weighted graph such that $\lambda _ { k } \ > \ 0$ for some
265
+ 213 $k \geq 1$ . Then Algorithm 2 constructs in polynomial time a cluster tree $T$ of $G$ that achieves
266
+ 214 $\begin{array} { r } { O \left( \frac { 1 } { ( 1 - \alpha ) \beta } \log \frac { k } { 1 - \alpha } \right) } \end{array}$ -approximation for $c o s t ^ { T } ( G )$ , where $\alpha = O ( k ^ { 6 } \sqrt { \lambda _ { k - 1 } } )$ , $\beta = \Omega ( \lambda _ { k } ^ { 2 } / k ^ { 4 } )$ . Con
267
+ 215 sequently, when $\lambda _ { k } = \Omega ( 1 / p o l y ( k ) )$ and $\lambda _ { k - 1 } = { \cal O } ( 1 / k ^ { 1 2 } )$ such that $\alpha < 1 - \rho$ for some constant
268
+ 216 $\rho \in \mathsf { \Gamma } ( 0 , 1 )$ , Algorithm 2 achieves $O ( p o l y ( k ) )$ -approximation. In addition, when $k$ is a constant,
269
+ 217 Algorithm 2 achieves $O ( 1 )$ -approximation.
270
+
271
+ 218 The proof of Theorem 3.2 is given in Appendix E.
272
+
273
+ In this section, we develop a non-binary hierarchical clustering algorithm based on cost(SE) optimization. At present, all existing algorithms for hierarchical clustering can be categorized into two frameworks: top-down division and bottom-up agglomeration [8]. The top-down division approach usually yields a binary tree by recursively dividing a cluster into two parts with a cut-related criterion. But a binary clustering tree is far from a practical one as we introduced in Section 1. For practical use, bottom-up agglomeration that is also known as hierarchical agglomerative clustering (HAC) is commonly preferable. It constructs a cluster tree from leaves to the root recursively, during each round of which the newly generated clusters shrink into single vertices.
274
+
275
+ Our algorithm jumps out of these two frameworks. We establish a new one that stratifies the sparsest level of a cluster tree recursively rather than in a sequential order. In general, in guide with cost(SE), we construct a $k + 1$ -level cluster tree from the previous $k$ -level one, during which we find the level whose stratification makes the average cost in a local reduced subgraph decrease most, and then differentiate it into two levels. The process of stratification consists of two basic operations: stretch and compression. Generally speaking, in stretch steps, given an internal node of a cluster tree, a local binary subtree is constructed, while in compression steps, the paths that are overlength from the root to leaves on the binary tree is compressed by shrinking tree edges that make the cost reduce most. The intuition behind the “stretch-and-compress” scheme is as follows. First, we run a fast and simple, but probably rough clustering algorithm to obtain a binary cluster subtree. So intuitively, after stretch, we unfold all the potential hierarchies such that the sparsest level is possibly to be seen. Second, we compress every overlength path that is supposed to get through each level of this subtree, during which, the edge on the sparsest level whose compression makes too many graph edges amplify the sizes of their LCAs to a large extent will be retained.
276
+
277
+ We remark that this framework can be collocated with any cost function and any binary cluster tree algorithm. For computational efficiency, especially for real networks of large scale more than $1 0 ^ { 4 }$ we will adopt in our experiments an HAC construction of binary cluster trees in stretch steps.
278
+
279
+ Stretch and compress. Given a cluster tree $T$ for graph $G = ( V , E )$ , let $u$ be an internal node on $T$ and $v _ { 1 } , v _ { 2 } , \ldots , v _ { \ell }$ be its children. We call this local parent-children structure rooted at $u$ to be a $u$ -triangle of $T$ , denoted by $T _ { u }$ . These two operations are defined on $u$ -triangles. Note that each child $v _ { i }$ of $u$ is a cluster in $G$ . We reduce $G$ by shrinking each $v _ { i }$ to be a single vertex $\boldsymbol { v } _ { i } ^ { \prime }$ while maintaining each inter-link and ignoring each internal edge of $v _ { i }$ . This reduction captures the connections of clusters at this level in the parent cluster $u$ . The stretch operation constructs a binary tree for $u$ -triangle. We adopt a common HAC construction in this $u$ -triangle. That is, initially, view each $\boldsymbol { v } _ { i } ^ { \prime }$ as a cluster and recursively combine two clusters into a new one for which cost(SE) drops most. The sequence of combinations yields a binary subtree $T _ { u } ^ { \prime }$ rooted at $u$ which has $v _ { 1 } , v _ { 2 } , \ldots , v _ { \ell }$ as leaves. Then the compression operation is proposed to reduce the height of $T _ { u } ^ { \prime }$ to be 2. Let $\hat { E } ( T ^ { \prime } )$ be the set of edges on $T ^ { \prime }$ , each of which appears on a path of length more than 2 from the root of $T ^ { \prime }$ to some leaf. Denote by $\Delta ( e )$ for edge $e$ be the amount of structural entropy enhanced by the shrink of $e$ . We pick from $\hat { E } ( T _ { u } ^ { \prime } )$ the edge $e$ with least $\Delta ( e )$ . Note that the compression of a tree edge makes the grandchildren of some internal node to be children, which must amplify the cost. The compression operation picks the least amplification. The processes of stretch and compress are illustrated in Figure 3 and stated in Algorithms 5 and 6, respectively (see Appendix G).
280
+
281
+ Sparsest level. Let $U _ { j }$ be the set of $j$ -level nodes on cluster tree $T$ , that is, $U _ { j }$ is the set of nodes each of which has distance $j$ from $T$ ’s root. Suppose that the height of $T$ is $k$ , then $U _ { 0 } , U _ { 1 } , \dots , U _ { k - 1 }$ is a partition for all internal nodes of $T$ . For each internal node $u$ , define $\begin{array} { r } { \mathcal { H } ( u ) = - \sum _ { v : v ^ { - } = u } \frac { g _ { u } } { \mathrm { v o l } ( V ) } \log \frac { \mathrm { v o l } ( v ) } { \mathrm { v o l } ( u ) } } \end{array}$ . Note that $\mathcal { H } ( u )$ is the partial sum contributed by $u$ in ${ \mathcal { H } } ^ { T } ( G )$ . After a “stretch-and-compress” round on $u$ -triangle, denote by $\Delta \mathcal { H } ( u )$ the structural entropy by which the new cluster tree reduces. Since the reconstruction of $u$ -triangle stratifies cluster $u$ , $\Delta \mathcal { H } ( u )$ is always non-negative. Define the sparsity of $u$ to be $\begin{array} { r } { \mathrm { S p a r } ( u ) = \frac { \Delta \mathcal { H } ( u ) } { \mathcal { H } ( u ) } } \end{array}$ , which is the relative variation of structural entropy in cluster $u$ . From the information-theoretic perspective, this means that the uncertainty of random walk can be measured locally in any internal cluster, which reflects the quality of clustering in this local area. At last, we define the sparsest level of $T$ to be the $j$ -th level such that the average sparsity of triangles rooted at nodes in $U _ { j }$ is maximum, that is arg $\operatorname* { m a x } _ { j } \{ { \overline { { \operatorname { S p a r } } } } _ { j } ( T ) \}$ where 272 $\begin{array} { r } { \overline { { \mathrm { S p a r } } } _ { j } ( T ) = \sum _ { u \in U _ { j } } { \mathrm { S p a r } } ( \mathbf { u } ) / | U _ { j } | } \end{array}$ . Then stratification works for the sparsest level of $T$ . This 73 process is illustrated in Figure 4 (see Appendix G).
282
+
283
+ 274 For a given positive integer $k$ , to construct a cluster tree of height $k$ , we start from the trivial 1-level
284
+ 275 cluster tree that involves all vertices of $G$ as leaves. Then we do not stop stratifying at the sparsest
285
+ 276 level recursively until a $k$ -level cluster tree is obtained. This process is described in Algorithm 3.
286
+
287
+ # Algorithm 3: $k$ -Hierarchical clustering based on structural entropy ( $k$ -HCSE)
288
+
289
+ Input: a graph $G = ( V , E )$ , $k \in \mathbb { Z } ^ { + }$
290
+ Output: a $k$ -level cluster tree $T$
291
+ 1 Initialize $T$ to be the 1-level cluster tree;
292
+ 2 $h = \mathrm { h e i g h t ( T ) }$ ;
293
+ 3 while $h < k$ do
294
+ 4 $j ^ { \prime } \gets \arg \operatorname* { m a x } _ { j } \{ \overline { { \mathrm { S p a r } } } _ { j } ( T ) \}$ ; // Find the sparsest level of $T$ (breaking ties arbitraily);
295
+ 5 if $\overline { { S p a r } } _ { j ^ { \prime } } ( T ) = 0$ then
296
+ 6 break; // No cost will be saved by any further clustering;
297
+ 7 for $u \in U _ { j ^ { \prime } }$ do
298
+ 8 $T _ { u } \gets \mathrm { S t r e t c h } ( u \mathrm { - t r i a n g l e } T _ { u } )$ ;
299
+ 9 Compress $( T _ { u } )$ ;
300
+ 10 $h \gets h + 1$ ;
301
+ 11 for $j \in [ j ^ { \prime } + 1 , h ]$ do
302
+ 12 Update $U _ { j }$ ;
303
+ 13 return T
304
+ 277 To determine the height of the cluster tree automatically, we derive the natural clustering from the
305
+ 278 variation of sparsity on each level. Intuitively, a natural hierarchical cluster tree $T$ should have
306
+ 279 not only sparse boundary on clusters, but also low sparsity for triangles of $T$ , which means that
307
+ 280 stratification within the reduced subgraphs corresponding to the triangles on the sparsest level makes
308
+ 281 little sense. For this reason, we consider the inflection points of the sequence $\{ \delta _ { t } ( \mathcal { H } ) \} _ { t = 1 , 2 , . . . }$ ,
309
+ 282 where $\delta _ { t } ( \mathcal { H } )$ is the structural entropy by which the $t$ -th round of stratification reduces. Formally,
310
+ 283 denote $\Delta _ { t } \mathcal { H } = \delta _ { t - 1 } ( \mathcal { H } ) - \delta _ { t } ( \mathcal { H } )$ for each $t \geq 2$ . We say that $\Delta _ { t } \mathcal { H }$ is an inflection point if both
311
+ 284 $\Delta _ { t } \mathcal { H } \ \geq \ \Delta _ { t - 1 } \mathcal { H }$ and $\Delta _ { t } \mathcal { H } \ \geq \ \Delta _ { t + 1 } \mathcal { H }$ hold. Our algorithm finds the least $t$ such that $\Delta _ { t } \mathcal { H }$ is
312
+ 285 an inflection point and fix the height of the cluster tree to be $t$ (Note that after $t - 1$ rounds of
313
+ 286 stratification, the number of levels is $t$ ). This process is described as Algorithm 4.
314
+
315
+ # Algorithm 4: Hierarchical clustering based on structural entropy (HCSE)
316
+
317
+ Input: a graph $G = ( V , E )$ Output: a cluster tree $T$ 1 $t \gets 2$ ; 2 while $\Delta _ { t } \mathcal { H } < \Delta _ { t - 1 } \mathcal { H }$ or $\Delta _ { t } \mathcal { H } < \Delta _ { t + 1 } \mathcal { H }$ do 3 $\scriptstyle \mathbf { f } \operatorname* { m a x } _ { j } \{ { \overline { { S p a r } } } _ { j } ( T ) \} = O$ then 4 break; 5 $t \gets t + 1$ ; 6 return $\scriptstyle t - \mathrm { H C S E } ( T )$
318
+
319
+ 287 Time complexity. The running time of HCSE on graph $G = ( V , E )$ for which $| V | = n$ and $| E | = m$
320
+ 288 depends mainly on the iterations of stratification for the sparsest level. For each round of $t$ -HCSE in
321
+ 289 Algorithm 4, since the change of structure entropy can be calculated incrementally and locally when
322
+ 290 merge siblings, the time complexity for the Stretch process is $O ( m h \log n )$ , where $h$ is the height
323
+ 291 of the binary tree that Stretch yields. Since at most $n$ times of shrinking operations on tree edges
324
+ 292 will happen, the time complexity for the Compress process is $O ( h n )$ . Let $h _ { \mathrm { m a x } }$ be the maximum
325
+ 293 height among the binary trees that appear during all iterations. The time complexity of HCSE (and
326
+ 294 also $k$ -HCSE) is $O ( k m h _ { \operatorname* { m a x } } \log n + k h _ { \operatorname* { m a x } } n )$ . In practice, $k$ is usually very small (we can even
327
+ 295 set $k = O ( 1 )$ in $k$ -HCSE). Moreover, the balance property of structural entropy tends to produce a
328
+
329
+ <table><tr><td></td><td>p</td><td>HCSE</td><td>HLP</td><td>LOU</td></tr><tr><td>P2 P1 P0</td><td>4.5E(-2) 1.5E(-3) 6E(-6)</td><td>0.89 0.93 0.62</td><td>0.79 0.75 0.58</td><td>0.92 0.92 11</td></tr><tr><td>P2 P1 P0</td><td>5.5E(-2) 1.5E(-3) 4E(-6)</td><td>0.87 0.95 0.72</td><td>0.89 0.87 11</td><td>0.89 0.87 11</td></tr><tr><td>P2 P1 P0</td><td>6.5E(-2) 4.5E(-3) 2.5E(-6)</td><td>0.96 0.94 0.80</td><td>0.95 0.81 11</td><td>0.99 0.99</td></tr></table>
330
+
331
+ Table 1: NMI for three algorithms. Each dataset has 2, 500 vertices, and the cluster numbers at three levels are 5, 25 and 250, respectively, for which the size of each cluster is accordingly generated at random. $p _ { 3 } = 0 . 9$ for each graph. “ ” means the algorithm does not find this level.
332
+
333
+ ![](images/5eca06fdf88a06b1f8ab5f2739117f4d355cdceba0a808f187be2fcc4130005b.jpg)
334
+ Figure 1: $\delta _ { t } ( \mathcal { H } )$ variations for HCSE. It can be observed easily that the inflection points for all the three datasets appear on $t = 4$ , which is also the ground-truth number of hierarchies.
335
+
336
+ 296 balanced binary tree after stretch, which makes $h _ { \mathrm { m a x } } = { \cal { O } } ( \log n )$ . Therefore, in this case, the time complexity is merely 297 $O ( m \log ^ { 2 } n )$ .
337
+
338
+ # 298 5 Experiments
339
+
340
+ We evaluate experimentally our practically used non-binary clustering algorithm both on synthetic networks generated from the Hierarchical Stochastic Block Model (HSBM) and on real datasets, respectively. We compare HCSE with the popular practical algorithms LOUVAIN [3] and HLP [19]. To avoid over-fitting to higher levels, which possibly results in under-fitting to lower levels, LOUVAIN admits a sequential input of vertices. Usually, to avert the worst-case trap, the vertices come randomly, and the resulting cluster tree depends on their order. HLP invokes the common LP algorithm recursively, and so it cannot be guaranteed to avoid under-fitting in each round. This can be seen in our experiments on synthetic datasets, for which these two algorithms usually miss ground-truth levels. For real datasets, as far as we know, no public real datasets have clear ground truth for hierarchical clustering. We do the comparative experiments on real networks. Some of them have (overlapping, possibly hierarchical) ground truth, e.g., Amazon, while others do not have. We evaluate the resulting cluster trees for the Amazon network by Jaccard index, and show the results in Appendix F, For other networks without ground truth, we evaluate results by both cost(SE) and Dasgupta’s cost function cost(Das). All the source code can be downloaded from https://github.com/samwu-learn/HCSE.
341
+
342
+ 314 Synthetic datasets generated from HSBM. Our experiments on synthetic datasets utilize 4-level
343
+ 315 HSBM. For simplicity, let $\vec { p } = \left( p _ { 0 } , p _ { 1 } , p _ { 2 } , p _ { 3 } \right)$ be the probability vector for which $p _ { i }$ is the proba
344
+ 316 bility of generating edges for vertex pairs whose LCA on the ground-truth cluster tree has depth $i$
345
+ 317 Note that the 0-depth node is the root. We compare the Normalized Mutual Information (NMI) at
346
+ 318 each level of the ground-truth cluster tree to those of three algorithms. Note that the randomness in
347
+ 319 LOUVAIN, and breaking-ties rule as well as convergence of HLP make different results, we choose
348
+ 320 the most effective strategy and pick the best results in five runs for both of them. Compared to their
349
+ 321 uncertainty, our algorithm HCSE yields stable results.
350
+
351
+ Table 1 demonstrates the results in three groups of probabilities, for which the hierarchical structures get clearer one by one. Each dataset has 2, 500 vertices, and the cluster numbers at three levels are 5, 25 and 250, respectively, for which the size of each cluster is accordingly generated at random. $p _ { 3 } = 0 . 9$ for each graph. Our algorithm HCSE is always able to find the right number of levels, while LOUVAIN always misses the top level, and HLP misses the top level in two groups. The inflection points for choosing the intrinsic hierarchy number $t = 4$ of hierarchies are demonstrated in Figure 1.
352
+
353
+ <table><tr><td>Networks</td><td>HCSE</td><td>HLP</td><td>LOUVAIN</td></tr><tr><td>CSphd</td><td>1.30E4 / 5.19E4 / 5</td><td>1.54E4 / 5.58E4 /4</td><td>1.28E4 / 7.61E4 / 5</td></tr><tr><td>fb-pages-government</td><td>2.48E6 /1.18E8 / 4</td><td>2.53E6 / 1.76E8 / 3</td><td>2.43E6 / 1.33E8 / 4</td></tr><tr><td>email-univ</td><td>1.16E5 /2.20E6 / 3</td><td>1.46E5 / 6.14E6 / 3</td><td>1.14E5 / 2.20E6 /4</td></tr><tr><td>fb-messages</td><td>1.58E5 / 4.50E6 / 4</td><td>1.76E5 /8.12E6 / 3</td><td>1.52E5 / 4.96E6 / 4</td></tr><tr><td>G22</td><td>5.56E5 / 2.68E7 /4</td><td>6.11E5 /4.00E7 /3</td><td>5.63E5 /2.80E7 /5</td></tr><tr><td>As20000102</td><td>2.64E5 / 2.36E7 /4</td><td>3.62E5 / 7.63E7 /3</td><td>2.42E5 /2.42E7 / 5</td></tr><tr><td>bibd-13-6</td><td>7.41E5 / 2.56E7 / 3</td><td>8.05E5 /4.41E7 /2</td><td>7.50E5 / 2.75E7 /4</td></tr><tr><td>delaunay-n10</td><td>4.65E4 / 3.39E5 / 4</td><td>4.87E4 / 3.55E5 /4</td><td>4.24E4 / 4.25E5 / 5</td></tr><tr><td>p2p-Gnutella05</td><td>9.00E5 /1.48E8 / 3</td><td>1.01E6 / 2.78E8 / 3</td><td>8.05E5 / 1.49E8 / 5</td></tr><tr><td>p2p-Gnutella08</td><td>5.59E5 / 5.51E7 / 4</td><td>6.36E5 / 1.28E8 /4</td><td>4.88E5 / 6.03E7 / 5</td></tr></table>
354
+
355
+ Table 2: “cost(SE) / cost(Das) / k” for three algorithms, where $k$ is the hierarchy number that the algorithm finds.
356
+
357
+ Real datasets. We do our experiments on a series of real networks 2 without ground truth. We compare cost(SE) and cost(Das), respectively. Since the different level numbers given by the three algorithms influence the costs seriously, that is, lower costs are obtained just due to greater heights, we only list in Table 2 the networks for which the three algorithms yield similar level numbers that differ by at most 1 or 2. It can be observed that HLP does not achieve optima for any network, while HCSE performs best w.r.t. cost(Das) for all networks, but does not outperform LOUVAIN for most networks. This is mainly due to the fact that LOUVAIN always finds no less number of hierarchies than HCSE, and the better cost benefits from its depth. Moreover, we emphasize that there is no evidence to indicate that the lower cost(SE) or cost(Das) is, the better a non-binary cluster tree is. Our experiments on these real datasets are just demonstrations of the effectiveness for our interpretable mechanism in hierarchical clustering.
358
+
359
+ # 340 6 Conclusions and future discussions
360
+
361
+ In this paper, we investigate the hierarchical clustering problem from an information-theoretic perspective and propose a new objective function that relates to the combinatorial cost functions raised by Dasgupta [10]. For optimization of this function, we present two $O ( 1 )$ -approximation algorithms for expander-like and well-clustered cardinality weighted graphs, respectively. For practical use, we propose a new interpretable non-binary hierarchical clustering framework that stratifies the sparsest level of the cluster tree recursively, which can be collocated with any cost function. We also present an interpretable strategy to find the intrinsic number of levels without any hyper-parameter. The experimental results on $k$ -level HSBM demonstrate that our algorithm HCSE has a great advantage in finding $k$ compared to the popular but strongly heuristic algorithms LOUVAIN and HLP. Our results on real datasets show that HCSE also achieves competitive costs compared to these two algorithms.
362
+
363
+ There are several directions that are worth further study. The first problem is about the relationship between the concavity of $g$ of the cost function and the balance of the optimal cluster tree. It can be checked that for cliques, being concave is not a sufficient condition for total balance. Whether is it a necessary condition? Moreover, is there any explicit necessary and sufficient condition for total balance of the optimal cluster tree for cliques? The second problem is about approximation algorithms for both structural entropy and cost(SE) in the worst case. Due to the non-linear and volume-related function $g$ , many previous proof techniques for approximation algorithms seems unavailable. The third one is about more precise characterizations for “natural” hierarchical clustering whose depth is limited. Since any reasonable choice of $g$ makes the cost function achieve optimum on some binary tree, a blind pursuit of minimization of cost functions seems not to be a rational approach. More criteria in this scenario need to be studied.
364
+
365
+ # References
366
+
367
+ [1] Noga Alon, Yossi Azar, and Danny Vainstein. Hierarchical clustering: A 0.585 revenue approximation. In Jacob D. Abernethy and Shivani Agarwal, editors, Conference on Learning Theory, COLT 2020, 9-12 July 2020, Virtual Event [Graz, Austria], volume 125 of Proceedings of Machine Learning Research, pages 153–162. PMLR, 2020. [2] Sanjeev Arora, Satish Rao, and Umesh V. Vazirani. Expander flows, geometric embeddings and graph partitioning. J. ACM, 56(2):5:1–5:37, 2009. [3] Vincent D. Blondel, Jean-Loup Guillaume, Renaud Lambiotte, and Etienne Lefebvre. Fast unfolding of communities in large networks. Journal of statistical mechanics: theory and experiment, 2008(10):P10008, 2008. [4] Peter F Brown, Vincent J Della Pietra, Peter V Desouza, Jennifer C Lai, and Robert L Mercer. Class-based n-gram models of natural language. Computational linguistics, 18(4):467–480, 1992. [5] Moses Charikar and Vaggos Chatziafratis. Approximate hierarchical clustering via sparsest cut and spreading metrics. In Philip N. Klein, editor, Proceedings of the Twenty-Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2017, Barcelona, Spain, Hotel Porta Fira, January 16-19, pages 841–854. SIAM, 2017. [6] Moses Charikar, Vaggos Chatziafratis, and Rad Niazadeh. Hierarchical clustering better than average-linkage. In Timothy M. Chan, editor, Proceedings of the Thirtieth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2019, San Diego, California, USA, January 6-9, 2019, pages 2291–2304. SIAM, 2019. [7] Vaggos Chatziafratis, Grigory Yaroslavtsev, Euiwoong Lee, Konstantin Makarychev, Sara Ahmadian, Alessandro Epasto, and Mohammad Mahdian. Bisect and conquer: Hierarchical clustering via max-uncut bisection. In Silvia Chiappa and Roberto Calandra, editors, The $2 3 r d$ International Conference on Artificial Intelligence and Statistics, AISTATS 2020, 26-28 August 2020, Online [Palermo, Sicily, Italy], volume 108 of Proceedings of Machine Learning Research, pages 3121–3132. PMLR, 2020. [8] Vincent Cohen-Addad, Varun Kanade, Frederik Mallmann-Trenn, and Claire Mathieu. Hierarchical clustering: Objective functions and algorithms. Journal of the ACM (JACM), 66(4):1–42, 2019. [9] Aron Culotta, Pallika Kanani, Robert Hall, Michael Wick, and Andrew McCallum. Author disambiguation using error-driven machine learning with a ranking loss function. In Sixth International Workshop on Information Integration on the Web (IIWeb-07), Vancouver, Canada, 2007. [10] Sanjoy Dasgupta. A cost function for similarity-based hierarchical clustering. In Daniel Wichs and Yishay Mansour, editors, Proceedings of the 48th Annual ACM SIGACT Symposium on Theory of Computing, STOC 2016, Cambridge, MA, USA, June 18-21, 2016, pages 118–127. ACM, 2016. [11] Michael B Eisen, Paul T Spellman, Patrick O Brown, and David Botstein. Cluster analysis and display of genome-wide expression patterns. Proceedings of the National Academy of Sciences, 95(25):14863–14868, 1998. [12] Shayan Oveis Gharan and Luca Trevisan. Partitioning into expanders. In Chandra Chekuri, editor, Proceedings of the Twenty-Fifth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA 2014, Portland, Oregon, USA, January 5-7, 2014, pages 1256–1266. SIAM, 2014. 06 [13] Alexander N Gorban, Balázs Kégl, Donald C Wunsch, Andrei Y Zinovyev, et al. Principal manifolds for data visualization and dimension reduction, volume 58. Springer, 2008. [14] Angsheng Li and Yicheng Pan. Structural information and dynamical complexity of networks. IEEE Trans. Inf. Theory, 62(6):3290–3339, 2016.
368
+
369
+ [15] Bogdan-Adrian Manghiuc and He Sun. Hierarchical clustering: O(1)-approximation for wellclustered graphs. In Marc’Aurelio Ranzato, Alina Beygelzimer, Yann N. Dauphin, Percy Liang, and Jennifer Wortman Vaughan, editors, Advances in Neural Information Processing Systems 34: Annual Conference on Neural Information Processing Systems 2021, NeurIPS 2021, December 6-14, 2021, virtual, pages 9278–9289, 2021.
370
+ [16] Benjamin Moseley and Joshua R. Wang. Approximation bounds for hierarchical clustering: Average linkage, bisecting $\mathbf { k }$ -means, and local search. In Isabelle Guyon, Ulrike von Luxburg, Samy Bengio, Hanna M. Wallach, Rob Fergus, S. V. N. Vishwanathan, and Roman Garnett, editors, Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA, pages 3094–3103, 2017.
371
+ [17] Stanislav Naumov, Grigory Yaroslavtsev, and Dmitrii Avdiukhin. Objective-based hierarchical clustering of deep embedding vectors. In Thirty-Fifth AAAI Conference on Artificial Intelligence, AAAI 2021, Thirty-Third Conference on Innovative Applications of Artificial Intelligence, IAAI 2021, The Eleventh Symposium on Educational Advances in Artificial Intelligence, EAAI 2021, Virtual Event, February 2-9, 2021, pages 9055–9063. AAAI Press, 2021.
372
+ [18] Mirmahdi Rahgoshay and Mohammad R. Salavatipour. Hierarchical clustering: New bounds and objective. CoRR, abs/2111.06863, 2021.
373
+ [19] Ryan A Rossi, Nesreen K Ahmed, Eunyee Koh, and Sungchul Kim. Fast hierarchical graph clustering in linear-time. In Companion Proceedings of the Web Conference 2020, pages 10– 12, 2020.
374
+ [20] Aurko Roy and Sebastian Pokutta. Hierarchical clustering via spreading metrics. J. Mach. Learn. Res., 18:88:1–88:35, 2017.
375
+
376
+ # Checklist
377
+
378
+ 1. For all authors...
379
+
380
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] See Abstract and Section 1
381
+ (b) Did you describe the limitations of your work? [Yes] See Section 3 and 6
382
+ (c) Did you discuss any potential negative societal impacts of your work? [N/A]
383
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
384
+
385
+ 2. If you are including theoretical results...
386
+
387
+ (a) Did you state the full set of assumptions of all theoretical results? [Yes] See Section 3 (b) Did you include complete proofs of all theoretical results? [Yes] See Appendices
388
+
389
+ 3. If you ran experiments...
390
+
391
+ (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See Section 5
392
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [N/A]
393
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A]
394
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [No] We do not compare the speed of computing, and so due to the space limit we have omitted resource introduction.
395
+
396
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
397
+
398
+ (a) If your work uses existing assets, did you cite the creators? [N/A] All codes are written by the authors, and all datasets we use is public. We have provided the URLs that link to the datasets we use.
399
+
400
+ (b) Did you mention the license of the assets? [N/A]
401
+ (c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
402
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [No] All datasets we used are public.
403
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [No] No such content is included.
404
+
405
+ 5. If you used crowdsourcing or conducted research with human subjects...
406
+
407
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
408
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
409
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
410
+
411
+ # 473 A A brief introduction to structural information
412
+
413
+ The idea of structural information is to encode a random walk with a certain rule by using a highdimensional encoding system for a graph $G$ . It is well known that a random walk, for which a neighbor is randomly chosen with probability proportional to edge weights, has a stationary distribution on vertices that is proportional to vertex degree.3 So to position a random walk under its stationary distribution, the amount of information needed is typically the Shannon’s entropy, denoted by
414
+
415
+ $$
416
+ { \mathcal { H } } ^ { ( 1 ) } ( G ) = - \sum _ { v \in V } { \frac { d _ { v } } { { \mathrm { v o l } } ( V ) } } \log { \frac { d _ { v } } { { \mathrm { v o l } } ( V ) } } .
417
+ $$
418
+
419
+ 474 By Shannon’s noiseless coding theorem, $\mathcal { H } ^ { ( 1 ) } ( G )$ is the limit of average code length generated from
420
+ 475 the memoryless source for one step of the random walk. However, dependence of locations may
421
+ 476 shorten the code length. For each level on cluster trees, the uncertainty of locations is measured by
422
+ 477 the entropy of the stationary distribution on the clusters of this level. Consider an encoding for every
423
+ 478 cluster, including the leaves. Each non-root node $\alpha$ is labeled by its order among the children of
424
+ 479 its parent $\alpha ^ { - }$ . So the amount of self-information of $\alpha$ within this local parent-children substructure
425
+ 480 is $\bar { - } \log ( \mathrm { v o l } ( \alpha ) / \mathrm { v o l } ( \alpha ^ { - } ) )$ , which is also roughly the length of Shannon code for $\alpha$ and its siblings.
426
+ 481 The codeword of $\alpha$ consists of the sequential labels of nodes along the unique path from the root
427
+ 482 (excluded) to itself (included). The key idea is as follows. For one step of the random walk from $u$ to
428
+ 483 $v$ in $G$ , to indicate $v$ , we omit from $v$ ’s codeword the longest common prefix of $u$ and $v$ that is exactly
429
+ 484 the codeword of $u \vee v$ . This means that the random walk takes this step in the cluster $u \vee v$ (and
430
+ 485 also in $u \vee v$ ’s ancestors) and the uncertainty at this level may not be involved. Therefore, intuitively,
431
+ 486 a quality similarity-based cluster tree would trap the random walk with high frequency in the deep
432
+ 487 clusters that are far from the root, and long codeword of $u \vee v$ would be omitted. This shortens the
433
+ 488 average code length of the random walk. Note that we ignore the uniqueness of decoding since a
434
+ 489 practical design of codewords is not our purpose. We utilize this scheme to evaluate and differentiate
435
+ 490 hierarchical structures.
436
+ 491 Then we formulate the above scheme and measure the average code length as follows. Given a
437
+ 492 weighted graph $G = ( V , E , w )$ and a cluster tree $T$ for $G$ , note that under the stationary distribution,
438
+ 493 the random walk takes one step out of a cluster $\alpha$ on $T$ with probability $g _ { \alpha } / { \mathrm { v o l } } ( V )$ . Therefore, the
439
+ 494 aforementioned uncertainty measured by the average code length is
440
+
441
+ $$
442
+ \mathcal { H } ^ { T } ( G ) = - \sum _ { \alpha \in T } \frac { g _ { \alpha } } { \mathrm { v o l } ( V ) } \log \frac { \mathrm { v o l } ( \alpha ) } { \mathrm { v o l } ( \alpha ^ { - } ) } ,
443
+ $$
444
+
445
+ 495 which is defined as the structural entropy of $G$ on $T$ . To minimize this uncertainty, the structural
446
+ 496 entropy $\mathcal { H } ( G )$ of $G$ is defined as the minimum one among all cluster trees. Note that the structural
447
+ 497 entropy of $G$ on the trivial 1-level cluster tree is consistent with the previously defined $\mathcal { H } ^ { ( 1 ) } ( G )$ . It
448
+ 498 doesn’t have any non-trivial cluster.
449
+
450
+ # 499 B Proof of Proposition 2.1
451
+
452
+ 500 Proof. For each internal node $\alpha$ on $T$ , denote by $\partial ( \alpha )$ the sets of edges in $G$ with exactly one
453
+ 501 end-point in the set of vertices corresponding to $\alpha$ $\begin{array} { r } { \chi _ { * } \operatorname { S o } g _ { \alpha } = \sum _ { e \in \partial ( \alpha ) } w \bar { ( } e ) } \end{array}$ . Note that
454
+
455
+ $$
456
+ \begin{array} { r c l } { \mathcal { H } ^ { T } ( G ) } & { = } & { \displaystyle - \sum _ { \alpha \in T } \frac { g _ { \alpha } } { \mathrm { v o l } ( V ) } \log \frac { \mathrm { v o l } ( \alpha ) } { \mathrm { v o l } ( \alpha ^ { - } ) } } \\ & { = } & { \displaystyle - \sum _ { \alpha \in T } \displaystyle \sum _ { ( u , v ) \in \partial ( \alpha ) } \frac { w ( u , v ) } { \mathrm { v o l } ( V ) } \log \frac { \mathrm { v o l } ( \alpha ) } { \mathrm { v o l } ( \alpha ^ { - } ) } } \\ & { = } & { \displaystyle - \sum _ { ( u , v ) \in E } \left( \frac { w ( u , v ) } { \mathrm { v o l } ( V ) } \sum _ { \alpha : ( u , v ) \in g _ { \alpha } } \log \frac { \mathrm { v o l } ( \alpha ) } { \mathrm { v o l } ( \alpha ^ { - } ) } \right) . } \end{array}
457
+ $$
458
+
459
+ 502 For a single edge $( u , v ) \in E$ , all the terms $\log ( \mathrm { v o l } ( \alpha ) / \mathrm { v o l } ( \alpha ^ { - } ) )$ for leaf $u$ satisfying $( u , v ) \in g _ { \alpha }$
460
+ 503 sum (over $\alpha$ ) up to $\log ( d _ { u } / \mathrm { v o l } ( u \vee v ) )$ along the unique path from $u$ to $u \vee v$ . It is symmetric for $v$
461
+ 504 Therefore, considering ordered pair $( u , v ) \in E$ ,
462
+
463
+ $$
464
+ \begin{array} { r c l } { \mathcal { H } ^ { T } ( G ) } & { = } & { - \displaystyle \sum _ { \mathrm { \tiny ~ o r d e r e d ~ } ( u , v ) \in E } \frac { w ( u , v ) } { \mathrm { v o l } ( V ) } \log \frac { d _ { u } } { \mathrm { v o l } ( u \vee v ) } } \\ & { = } & { \displaystyle \frac { 1 } { \mathrm { v o l } ( V ) } \left( - \sum _ { u \in V } d _ { u } \log d _ { u } + \sum _ { \mathrm { \tiny ~ o r d e r d ~ } ( u , v ) \in E } w ( u , v ) \log \mathrm { v o l } ( u \vee v ) \right) } \\ & { = } & { \displaystyle \frac { 1 } { \mathrm { v o l } ( V ) } \left( - \sum _ { u \in V } d _ { u } \log d _ { u } + 2 \cdot \sum _ { ( u , v ) \in E } w ( u , v ) \log \mathrm { v o l } ( u \vee v ) \right) . } \end{array}
465
+ $$
466
+
467
+ 505 The second equality follows from the fact $\begin{array} { r } { \sum _ { u \in V } d _ { u } = \sum _ { \mathrm { o r d e r e d } ( u , v ) \in E } w ( u , v ) = \mathrm { v o l } ( V ) } \end{array}$ and the
468
+ 506 last equality from the symmetry of $( u , v )$ . Since the first summation is independent of $T$ , Proposition
469
+ 507 2.1 follows. □
470
+
471
+ # C Proof of Proposition 2.2
472
+
473
+ We restate Proposition 2.2 as follows.
474
+
475
+ Theorem 2.2. For any positive integer n, let $K _ { n }$ be the clique of n vertices with identical weight on every edge. Then a cluster tree $T$ of $K _ { n }$ achieves minimum structural entropy if and only if $T$ is $a$ balanced binary tree, that is, the two children clusters of each sub-tree of $T$ have difference in size at most 1.
476
+
477
+ Note that a balanced binary tree (BBT for abbreviation) means the tree is balanced on every internal node. Formally, for an internal node of cluster size $k$ , its two sub-trees are of cluster sizes $\lfloor \dot { k } / 2 \rfloor$ and $\lceil k / 2 \rceil$ , respectively.
478
+
479
+ 517 For cliques, since the weights of each edge are identical, we assume it safely to be 1. By Theorem
480
+ 518 2.1, minimizing the structural entropy is equivalent to minimizing the cost function (over $T$ )
481
+
482
+ $$
483
+ \begin{array} { l c l } { \displaystyle \cos t ^ { T } ( G ) } & { = } & { \displaystyle \sum _ { ( u , v ) \in E } \log \mathrm { v o l } ( u \vee v ) } \\ { \displaystyle } & { = } & { \displaystyle \sum _ { ( u , v ) \in E } \log \left( ( n - 1 ) | u \vee v | \right) } \\ { \displaystyle } & { = } & { \displaystyle \sum _ { ( u , v ) \in E } \log ( n - 1 ) + \sum _ { ( u , v ) \in E } \log | u \vee v | } \end{array}
484
+ $$
485
+
486
+ 519 Since the first term in the last equation is independent of $T$ , the optimization turns to minimizing
487
+ 520 the last term, which we denote by $\Gamma ( T )$ . Grouping all edges in $E$ by LCA of two end-points, the
488
+ 521 cost $\Gamma ( T )$ can be written as the sum of the cost $\gamma$ at every internal node $N$ of $T$ . Formally, for every
489
+ 522 internal node $N$ , let $A , B \subseteq V$ be the leaves of the sub-trees rooted at the left and right child of $N$ ,
490
+ 523 respectively. We have
491
+
492
+ $$
493
+ \begin{array} { r c l } { { \Gamma ( T ) } } & { { = } } & { { \displaystyle \sum _ { N } \gamma ( N ) } } \\ { { } } & { { } } & { { } } \\ { { \gamma ( N ) } } & { { = } } & { { \displaystyle \left( \sum _ { x \in A , y \in B } 1 \right) \cdot \log \left( | A | + | B | \right) } } \\ { { } } & { { } } & { { } } \\ { { } } & { { = } } & { { | A | \cdot | B | \cdot \log ( | A | + | B | ) } } \end{array}
494
+ $$
495
+
496
+ 524 Now we only have to show the following lemma.
497
+
498
+ 25 Lemma C.1. For any positive integer $n$ , a cluster tree $T$ of $K _ { n }$ achieves minimum cost $\Gamma ( T )$ if and
499
+ 26 only if T is a BBT.
500
+ 527 Proof. Lemma C.1 is proved by induction on $| V |$ . The key technique of tree swapping we use here
501
+ 28 is inspired by Cohen-Addad et al [4]. The basis step holds since for $| V | = 2$ or 3, the cluster tree is
502
+ 29 balanced and unique. It certainly achieves the minimum cost exclusively.
503
+
504
+ Now, consider a clique $G = ( V , E )$ with $n = | V | \geq 4$ . Let $T _ { 1 }$ be an arbitrary unbalanced cluster tree and $\lambda$ be its root. We need to prove that the cost $\Gamma ( T _ { 1 } )$ does not achieve the minimum. Without loss of generality, we can safely assume the root node is unbalanced, since otherwise, we set $T _ { 1 }$ to be the sub-tree that is rooted at an unbalanced node. Let $T _ { 2 }$ be a tree with root $\lambda$ whose left and right sub-trees are BBTs such that they have the same sizes with the left and right sub-trees of $T _ { 1 }$ , respectively. Let $V _ { l l }$ , $V _ { l r }$ , $V _ { r l }$ and $V _ { r r }$ be the sets of nodes on the four sub-trees at the second level of $T _ { 2 }$ and $n _ { l l }$ , $n _ { l r }$ , $n _ { r l }$ and $n _ { r r }$ denote their sizes, respectively. Our proof is also available when some of them are empty. We always assume $n _ { l l } \le n _ { l r }$ and $n _ { r l } \geq n _ { r r }$ . Next, we construct $T _ { 3 }$ by swapping (transplanting) $V _ { l r }$ and $V _ { r l }$ with each other. Finally, let $T _ { 4 }$ be a tree with root $\lambda$ whose left and right sub-trees are BBTs after balancing the left and right sub-trees of $T _ { 3 }$ . So $T _ { 4 }$ is a BBT. Then we only have to prove that $\Gamma ( T _ { 1 } ) > \Gamma ( T _ { 4 } ) \quad$ . Note that the strict $\mathit { \Theta } ^ { \bullet } > \mathit { \Theta } ^ { \bullet }$ is necessary since we need to negate all unbalanced cluster trees.
505
+
506
+ Then we show that the transformation process that consists of the above three steps makes the cost decrease step by step. Formally,
507
+
508
+ (a) $T _ { 1 }$ to $T _ { 2 }$ . The sub-trees of $T _ { 1 }$ become BBTs in $T _ { 2 }$ . Since the number of edges whose end-points treat the root as LCA is the same, by induction we have $\Gamma ( T _ { 1 } ) \geq \Gamma ( \bar { T } _ { 2 } )$ .
509
+ (b) $T _ { 2 }$ to $T _ { 3 }$ . We will show that $\Gamma ( T _ { 2 } ) > \Gamma ( T _ { 3 } )$ in Lemma C.2.
510
+ (c) $T _ { 3 }$ to $T _ { 4 }$ . The sub-trees of $T _ { 3 }$ become BBTs in $T _ { 4 }$ . For the same reason as (a), we have $\Gamma ( T _ { 3 } ) \geq \Gamma ( T _ { 4 } )$ .
511
+
512
+ Putting them together, we get $\Gamma ( T _ { 1 } ) > \Gamma ( T _ { 4 } )$ and Lemma C.1 follows.
513
+
514
+ Lemma C.2. After swapping $V _ { l r }$ and $V _ { r l }$ , we obtain $T _ { 3 }$ from $T _ { 2 }$ , for which $\Gamma ( T _ { 2 } ) > \Gamma ( T _ { 3 } )$ .
515
+
516
+ 552 Proof. We only need to consider the changes in cost of three nodes: root and its left and right
517
+ 553 children, since the cost contributed by each of the remaining nodes does not change after swapping.
518
+ 554 Ignoring the unchanged costs, define
519
+
520
+ $$
521
+ \begin{array} { l l l } { { \displaystyle \mathrm { c o s t } ( T _ { 2 } ) } } & { { = } } & { { { n _ { l } } { n _ { r } } \log { n } + { n _ { l l } } { n _ { l r } } \log { n _ { l } } + { n _ { r l } } { n _ { r r } } \log { n _ { r } } } } \\ { { \displaystyle } } & { { = } } & { { { n _ { l } } { n _ { r } } \log { n } + \left\lfloor \displaystyle \frac { { n _ { l } } } { 2 } \right\rfloor \left\lceil \displaystyle \frac { { n _ { l } } } { 2 } \right\rceil \log { n _ { l } } + \left\lceil \displaystyle \frac { { n _ { r } } } { 2 } \right\rceil \left\lfloor \displaystyle \frac { { n _ { r } } } { 2 } \right\rfloor \log { n _ { r } } , } } \end{array}
522
+ $$
523
+
524
+ 555 where $n _ { l } = n _ { l l } + n _ { l r }$ , $n _ { r } = n _ { r l } + n _ { r r }$ . Both of them are at least 1. Similarly, define
525
+
526
+ $$
527
+ { \begin{array} { r c l } { \operatorname { o s t } ( T _ { 3 } ) } & { = } & { ( n _ { l l } + n _ { r l } ) ( n _ { l r } + n _ { r r } ) \log n + n _ { l l } n _ { r l } \log \left( n _ { l l } + n _ { r l } \right) + n _ { l r } n _ { r r } \log \left( n _ { l r } + n _ { r r } \right) } \\ & { = } & { \left\lfloor { \frac { n } { 2 } } \right\rfloor \left\lceil { \frac { n } { 2 } } \right\rceil \log n + \left\lfloor { \frac { n _ { l } } { 2 } } \right\rfloor \left\lceil { \frac { n _ { r } } { 2 } } \right\rceil \log \left( \left\lfloor { \frac { n _ { l } } { 2 } } \right\rfloor + \left\lceil { \frac { n _ { r } } { 2 } } \right\rceil \right) + \left\lceil { \frac { n _ { l } } { 2 } } \right\rceil \left\lfloor { \frac { n _ { r } } { 2 } } \right\rfloor \log \left( \left\lceil { \frac { n _ { l } } { 2 } } \right\rceil + \left\lfloor { \frac { n _ { r } } { 2 } } \right\rfloor \right) } \end{array} }
528
+ $$
529
+
530
+ 556 Denote
531
+
532
+ $$
533
+ \begin{array} { r c l } { { \Delta } } & { { = } } & { { \Gamma ( T _ { 2 } ) - \Gamma ( T _ { 3 } ) } } \\ { { } } & { { = } } & { { \displaystyle \mathrm { c o s t } ( T _ { 2 } ) - \mathrm { c o s t } ( T _ { 3 } ) } } \\ { { } } & { { = } } & { { \displaystyle \left\lfloor \frac { n _ { l } } { 2 } \right\rfloor \left\lceil \frac { n _ { l } } { 2 } \right\rceil \log \left( \frac { n _ { l } } { n } \right) + \left\lceil \frac { n _ { r } } { 2 } \right\rceil \left\lfloor \frac { n _ { r } } { 2 } \right\rfloor \log \left( \frac { n _ { r } } { n } \right) } } \\ { { } } & { { } } & { { - \left\lfloor \frac { n _ { l } } { 2 } \right\rfloor \left\lceil \frac { n _ { r } } { 2 } \right\rceil \log \left( \frac { \left\lfloor \frac { n _ { l } } { 2 } \right\rfloor + \left\lceil \frac { n _ { r } } { 2 } \right\rceil } { n } \right) - \left\lceil \frac { n _ { l } } { 2 } \right\rceil \left\lfloor \frac { n _ { r } } { 2 } \right\rfloor \log \left( \frac { \left\lceil \frac { n _ { l } } { 2 } \right\rceil + \left\lfloor \frac { n _ { r } } { 2 } \right\rfloor } { n } \right) } } \end{array}
534
+ $$
535
+
536
+ 557 So we only have to show that $\Delta > 0$ . We consider the following three cases according to the odevity
537
+ 558 of $n _ { l }$ and $n _ { r }$ .
538
+
539
+ Case 1: $n _ { l }$ and $n _ { r }$ are even.
540
+
541
+ Case 2: $n _ { l }$ and $n _ { r }$ are odd.
542
+
543
+ Case 3: $n _ { l }$ is odd while $n _ { r }$ is even.
544
+
545
+ The case that $n _ { l }$ is even while $n _ { r }$ is odd is symmetric to Case 3.
546
+
547
+ 63 For Case 1, if both $n _ { l }$ and $n _ { r }$ are even, then notations of rounding in Eq. (2) can be removed and $\Delta$
548
+ 64 can be simplified as
549
+
550
+ $$
551
+ \Delta = \frac { n _ { l } ^ { 2 } } { 4 } \log \left( \frac { n _ { l } } { n } \right) + \frac { n _ { r } ^ { 2 } } { 4 } \log \left( \frac { n _ { r } } { n } \right) + \frac { n _ { l } n _ { r } } { 2 } .
552
+ $$
553
+
554
+ 565 Let $p = n _ { l } / n , q = n _ { r } / n$ , and so $p + q = 1$ . Recall that $T _ { 1 }$ is unbalanced on the root $\lambda$ , so is $T _ { 2 }$ Thus 566 $p \neq q$ . Multiplying by $\textstyle { \frac { 4 } { n ^ { 2 } } }$ on both sides, we only have to prove that
555
+
556
+ $$
557
+ p ^ { 2 } \log p + q ^ { 2 } \log q + 2 p q > 0 .
558
+ $$
559
+
560
+ That is,
561
+
562
+ $$
563
+ \frac { p } { q } \log p + \frac { q } { p } \log q + 2 > 0 .
564
+ $$
565
+
566
+ Let 567 $\begin{array} { r } { g ( x ) = \frac { x } { 1 - x } \log x } \end{array}$ . Then we only need to show that $g ( p ) + g ( q ) + 2 > 0$ when $p \neq q$ . Since
567
+
568
+ $$
569
+ \begin{array} { r c l } { { g ^ { \prime } ( x ) } } & { { = } } & { { \displaystyle \frac { ( 1 - x ) + \ln x } { \ln 2 \cdot ( 1 - x ) ^ { 2 } } , } } \\ { { } } & { { } } & { { } } \\ { { g ^ { \prime \prime } ( x ) } } & { { = } } & { { \displaystyle - \frac { x ^ { 2 } - 2 x \ln x - 1 } { \ln 2 \cdot x ( 1 - x ) ^ { 3 } } . } } \end{array}
570
+ $$
571
+
572
+ It is easy to check that $g ^ { \prime \prime } ( x ) > 0$ when $0 < x < 1$ . So $g ( x )$ is strictly convex in the interval $( 0 , 1 )$ . Since $p \neq q$ ,
573
+
574
+ $$
575
+ g ( p ) + g ( q ) > 2 g \left( \frac { p + q } { 2 } \right) = - 2 .
576
+ $$
577
+
578
+ 568 Thus $\Delta > 0$ holds.
579
+
580
+ 569 For Case 2, if both $n _ { l }$ and $n _ { r }$ are odd, then $\Delta$ can be split into two parts $\Delta = \Delta _ { 1 } + \Delta _ { 2 }$ , in which
581
+
582
+ $$
583
+ \begin{array} { l c l } { \Delta _ { 1 } } & { = } & { \displaystyle \frac { n _ { l } ^ { 2 } } { 4 } \log \left( \frac { n _ { l } } { n } \right) + \frac { n _ { r } ^ { 2 } } { 4 } \log \left( \frac { n _ { r } } { n } \right) + \frac { n _ { l } n _ { r } } { 2 } } \\ { \Delta _ { 2 } } & { = } & { \displaystyle - \frac { 1 } { 4 } \log \left( \frac { n _ { l } } { n } \right) - \frac { 1 } { 4 } \log \left( \frac { n _ { r } } { n } \right) - \frac { 1 } { 2 } } \end{array}
584
+ $$
585
+
586
+ 570 Since we have shown that $\Delta _ { 1 } > 0$ , if we can prove $\Delta _ { 2 } \geq 0$ , then the lemma will hold for Case 2.
587
+ 571 Due to the convexity of logarithmic function, this holds clearly since
588
+
589
+ $$
590
+ 2 \log \left( \frac { n } { 2 } \right) \geq \log n _ { l } + \log n _ { r } .
591
+ $$
592
+
593
+ For Case 3, if 572 $n _ { l }$ is odd while $n _ { r }$ is even,
594
+
595
+ $$
596
+ \Delta = \frac { n _ { l } ^ { 2 } - 1 } { 4 } \log { \left( \frac { n _ { l } } { n } \right) } + \frac { n _ { r } ^ { 2 } } { 4 } \log { \left( \frac { n _ { r } } { n } \right) } - \left[ \frac { ( n _ { l } - 1 ) n _ { r } } { 4 } \log { \left( \frac { n - 1 } { 2 n } \right) } + \frac { ( n _ { l } + 1 ) n _ { r } } { 4 } \log { \left( \frac { n + 1 } { 2 n } \right) } \right] .
597
+ $$
598
+
599
+ $$
600
+ 4 \ln 2 ) \Delta = ( n _ { l } ^ { 2 } - 1 ) \ln \left( \frac { n _ { l } } { n } \right) + n _ { r } ^ { 2 } \ln \left( \frac { n _ { r } } { n } \right) - \left[ ( n _ { l } - 1 ) n _ { r } \ln \left( \frac { n - 1 } { 2 n } \right) + ( n _ { l } + 1 ) n _ { r } \ln \left( \frac { n + 1 } { 2 n } \right) \right] .
601
+ $$
602
+
603
+ 574 Splitting the right hand side into two parts,
604
+
605
+ $$
606
+ \begin{array} { l c l } { { A } } & { { = } } & { { \displaystyle n _ { l } ^ { 2 } \ln \left( \frac { n _ { l } } { n } \right) + n _ { r } ^ { 2 } \ln \left( \frac { n _ { r } } { n } \right) + 2 n _ { l } n _ { r } \ln 2 } } \\ { { } } & { { } } & { { } } \\ { { B } } & { { = } } & { { \displaystyle - \ln \left( \frac { n _ { l } } { n } \right) - ( n _ { l } + 1 ) n _ { r } \ln \left( 1 + \frac { 1 } { n } \right) - ( n _ { l } - 1 ) n _ { r } \ln \left( 1 - \frac { 1 } { n } \right) } } \end{array}
607
+ $$
608
+
609
+ 575 Since $n$ is odd and the root $\lambda$ of $T _ { 2 }$ is unbalanced, we only need to consider the case that $n _ { l } =$
610
+ 576 $( n - i ) / 2$ , $n _ { r } = ( n + i ) / 2$ (Note that $n _ { l }$ and $n _ { r }$ are symmetric. So if $( n - i ) / 2$ is even, exchange
611
+ 577 $n _ { l }$ and $n _ { r }$ ), where both $n$ and $i$ are odd satisfying $n > i \geq 3$ . Next we show that in this case,
612
+ 578 $A \geq \ln ( 1 / 5 ) + 4 ^ { 2 } \ln ( 4 / 5 ) + 2 \cdot 4 \ln 2$ and $\dot { B } > \ln 2 - 3 / 4 - ( 2 / 3 ) \cdot ( 1 / 5 ^ { 2 } )$ . By calculation,
613
+ 579 $\Delta = A + B > 0$ for Case 3.
614
+
615
+ Claim C.1. 580 $A \geq \ln ( 1 / 5 ) + 4 ^ { 2 } \ln ( 4 / 5 ) + 2 \cdot 4 \ln 2$ for odd integers $n > i \geq 3$ .
616
+
617
+ 581 Proof. Substituting $n _ { l } = ( n - i ) / 2$ , $n _ { r } = ( n + i ) / 2$ into the $A$ yields
618
+
619
+ $$
620
+ A = C ( n , i ) \triangleq \left( { \frac { n - i } { 2 } } \right) ^ { 2 } \ln \left( { \frac { n - i } { 2 n } } \right) + \left( { \frac { n + i } { 2 } } \right) ^ { 2 } \ln \left( { \frac { n + i } { 2 n } } \right) + 2 \cdot { \frac { n - i } { 2 } } \cdot { \frac { n + i } { 2 } } \ln 2 .
621
+ $$
622
+
623
+ 582 Treat $n$ as a continuous variable, we have
624
+
625
+ $$
626
+ \frac { \partial C ( n , i ) } { \partial n } = \frac { 1 } { 2 } \left[ ( n + i ) \ln \left( 1 + \frac { i } { n } \right) + ( n - i ) \ln \left( 1 - \frac { i } { n } \right) - \frac { i ^ { 2 } } { n } \right]
627
+ $$
628
+
629
+ 583 Multiplying the above equation by $2 / n$ and setting $x = i / n$ yields
630
+
631
+ $$
632
+ \begin{array} { r c l } { { f ( x ) } } & { { \triangleq } } & { { \displaystyle \left( 1 + x \right) \ln ( 1 + x ) + ( 1 - x ) \ln ( 1 - x ) - x ^ { 2 } , } } \\ { { f ^ { \prime } ( x ) } } & { { = } } & { { \ln ( 1 + x ) - \ln ( 1 - x ) - 2 x , } } \\ { { f ^ { \prime \prime } ( x ) } } & { { = } } & { { \displaystyle \frac { 2 x ^ { 2 } } { 1 - x ^ { 2 } } . } } \end{array}
633
+ $$
634
+
635
+ 584 It is easy to check that $f ( 0 ) = 0$ and $f ^ { \prime } ( 0 ) = 0$ . When $0 < x < 1$ , $f ^ { \prime \prime } ( x ) > 0$ . Thus $f ^ { \prime } ( x ) > 0$ and
636
+ 585 $f ( x ) > 0$ . This means that $\partial C ( n , i ) / \partial n > 0$ for all $n > 0$ . So $C ( n , i ) \geq C ( i + 2 , i )$ for $n \geq i + 2$
637
+ 586 (When $i$ is fixed, the minimum value of $n$ can be taken to $i + 2$ , which makes $n _ { l } = ( n - i ) / 2$ and
638
+ 587 $n _ { r } = ( n + i ) / 2$ integral). The curves of $C ( n , i )$ for varying $i$ are plotted in Figure 2.
639
+ 588 When $n = i + 2$ , we get $n _ { l } = ( n - i ) / 2 = 1$ and $n _ { r } = ( n + i ) / 2 = n - 1$ . Substituting them into
640
+ 589 $A$ yields
641
+
642
+ ![](images/35c968cedb2e5b0bbf4e6fc1d5f1c6b3578c977d5675066a6c385e317abb54d9.jpg)
643
+ Figure 2: Functions $C ( n , i )$
644
+
645
+ $$
646
+ \begin{array} { r c l } { { { \cal D } ( n ) } } & { { \triangleq } } & { { \displaystyle \ln \left( \frac { 1 } { n } \right) + ( n - 1 ) ^ { 2 } \ln \left( 1 - \frac { 1 } { n } \right) + 2 ( n - 1 ) \ln 2 , } } \\ { { \displaystyle \frac { d { \cal D } } { d n } } } & { { = } } & { { \displaystyle 1 - \frac { 2 } { n } + 2 \ln 2 + 2 ( n - 1 ) \ln \left( 1 - \frac { 1 } { n } \right) . } } \end{array}
647
+ $$
648
+
649
+ 590 When $n > 2$ , it is easy to check that $d D / d n > 0$ . So the minimum value of $d ( n )$ , which is also the
650
+ 591 minimum value of $\dot { C ( i + 2 , i ) }$ , is achieved at $n = i + 2 = 5$ . So $A = C ( n , i ) \geq C ( i + 2 , i ) \geq$
651
+ 592 $C ( 5 , 3 ) = \ln ( 1 / 5 ) + 4 ^ { 2 } \ln ( 4 / 5 ) + 2 \cdot 4 \ln 2$ . □
652
+
653
+ Claim C.2. 593 $B > \ln 2 - 3 / 4 - ( 2 / 3 ) \cdot ( 1 / 5 ^ { 2 } ) .$ .
654
+
655
+ 594 Proof. Due to the facts that
656
+
657
+ $$
658
+ { \begin{array} { r c c c } { \ln \left( 1 + { \cfrac { 1 } { n } } \right) } & { < } & { { \cfrac { 1 } { n } } - { \cfrac { 1 } { 2 n ^ { 2 } } } + { \cfrac { 1 } { 3 n ^ { 3 } } } , } \\ { \ln \left( 1 - { \cfrac { 1 } { n } } \right) } & { < } & { - { \cfrac { 1 } { n } } - { \cfrac { 1 } { 2 n ^ { 2 } } } - { \cfrac { 1 } { 3 n ^ { 3 } } } , } \end{array} }
659
+ $$
660
+
661
+ 595 we have
662
+
663
+ $$
664
+ \begin{array} { r c l } { B } & { = } & { \displaystyle - \ln \left( \frac { n _ { l } } { n } \right) - ( n _ { l } + 1 ) n _ { r } \ln \left( 1 + \frac { 1 } { n } \right) - ( n _ { l } - 1 ) n _ { r } \ln \left( 1 - \frac { 1 } { n } \right) } \\ & { > } & { \displaystyle - \ln \left( \frac { n _ { l } } { n } \right) + \frac { n _ { l } n _ { r } } { n ^ { 2 } } - \frac { 2 n _ { r } } { n } - \frac { 2 n _ { r } } { 3 n ^ { 3 } } } \\ & { > } & { \displaystyle - \ln \left( \frac { n _ { l } } { n } \right) + \frac { n _ { l } n _ { r } } { n ^ { 2 } } - \frac { 2 n _ { r } } { n } - \frac { 2 } { 3 n ^ { 2 } } . } \end{array}
665
+ $$
666
+
667
+ 596 Let $\alpha = n _ { l } / n$ , then
668
+
669
+ $$
670
+ \begin{array} { l l l } { { B } } & { { > } } & { { \displaystyle - \ln \alpha + \alpha ( 1 - \alpha ) - 2 ( 1 - \alpha ) - \frac { 2 } { 3 n ^ { 2 } } } } \\ { { } } & { { \geq } } & { { \ln 2 - \displaystyle \frac { 3 } { 4 } - \frac { 2 } { 3 n ^ { 2 } } . } } \end{array}
671
+ $$
672
+
673
+ When 597 $n \geq 5$ $5 , B > \ln 2 - 3 / 4 - ( 2 / 3 ) \cdot ( 1 / 5 ^ { 2 } )$ .
674
+
675
+ 8 Combining Claims C.1 and C.2, Lemma C.2 follows.
676
+
677
+ 99 This completes the proof of Proposition 2.2.
678
+
679
+ # 600 D Proof of Theorem 3.1
680
+
681
+ Proof. Note that $\operatorname { c o s t } ^ { T } ( G )$ for any cluster tree $T$ has a trivial upper bound. That is,
682
+
683
+ $$
684
+ \cos \mathsf { t } ^ { T } ( G ) = \sum _ { e \in E } \mathsf { c o s t } ^ { T } ( e ) \leq \sum _ { e \in E } w _ { e } \cdot \log ( \mathsf { v o l } ( G ) ) \leq \frac { \mathsf { v o l } ( G ) \cdot \log ( \mathsf { v o l } ( G ) ) } { 2 } ,
685
+ $$
686
+
687
+ 601 where $\mathrm { c o s t } ^ { T } ( e ) = w _ { e } \log \mathrm { v o l } ( \mathrm { L C A } _ { T } ( e ) )$ . Let $T ^ { * }$ be the optimal cluster tree that achieves the mini
688
+ 602 mum cost, we present here a lower bound for $\mathrm { c o s t } ^ { T ^ { * } } ( G )$ . Referring to the dense branch technique
689
+ 603 [10, 15], we start with the root node $A _ { 0 }$ and walk along $T ^ { * }$ recursively as follows: at every internal
690
+ 604 node $A _ { i }$ , walk down to the node $A _ { i + 1 }$ of higher volume between its two children. This process stops
691
+ 605 when we reach node $A _ { k }$ such that $\begin{array} { r } { \mathrm { v o l } _ { G } ( A _ { k } ) \le \frac { 2 \mathrm { v o l } ( G ) } { 3 } } \end{array}$ 2vol(G)3 . Denote A ≜ Ak as well as B ≜ V \Ak. By
692
+ 606 construction, it holds that $\begin{array} { r } { \mathrm { v o l } _ { G } ( A ) > \frac { \mathrm { v o l } ( G ) } { 3 } } \end{array}$ and $\begin{array} { r } { \mathrm { v o l } _ { G } ( B ) \geq \frac { \mathrm { v o l } ( G ) } { 3 } } \end{array}$ . Moreover, $\begin{array} { r } { \mathrm { v o l } _ { G } ( A _ { i } ) > \frac { 2 \mathrm { v o l } ( G ) } { 3 } } \end{array}$
693
+
694
+ 607 for every $0 \leq i < k$ . The basic idea behind the dense branch is that the $c u t ( A , B )$ has a significant contribution to 608 $c o s t ^ { T ^ { * } } ( G )$ .
695
+
696
+ $$
697
+ \begin{array} { r l } { c o s t ^ { T ^ { * } } ( G ) = \displaystyle \sum _ { e = \{ u , v \} } w _ { e } \cdot \log ( \mathsf { v o l } _ { G } ( u \vee v ) ) } & { } \\ { \ge \displaystyle \sum _ { e = \{ u , v \} } w _ { e } \cdot \log ( \mathsf { v o l } _ { G } ( u \vee v ) ) } & { } \\ { ~ } & { \displaystyle \sum _ { e \in E \{ A , B \} } \log \left( \frac { 2 \mathsf { v o l } ( G ) } { 3 } \right) . } \\ { ~ } & { \ge w ( A , B ) \cdot \log \left( \frac { 2 \mathsf { v o l } ( G ) } { 3 } \right) . } \\ { ~ } & { \ge \Phi ( G ) \cdot \displaystyle \frac { \mathsf { v o l } ( G ) } { 3 } \cdot \log \left( \frac { 2 \mathsf { v o l } ( G ) } { 3 } \right) . } \end{array}
698
+ $$
699
+
700
+ Let $T$ be an arbitrary cluster tree, and $T ^ { * }$ be an optimal tree. We have
701
+
702
+ $$
703
+ \frac { c o s t ^ { T } ( G ) } { c o s t ^ { T * } ( G ) } \leq \frac { 3 } { 2 \Phi ( G ) } \cdot \frac { \log ( \mathrm { v o l } ( G ) ) } { \log \left( \frac { 2 \mathrm { v o l } ( G ) } { 3 } \right) } = O ( \Phi ( G ) ^ { - 1 } ) .
704
+ $$
705
+
706
+ 609
707
+
708
+ # 610 E Proof of Theorem 3.2
709
+
710
+ Proof. To prove Theorem 3.2, we only have to prove the following lemma. Then the theorem follows from a simplification of the approximation factor.
711
+
712
+ Lemma E.1. Let $\alpha ~ = ~ \operatorname* { m a x } _ { i } \{ \Phi _ { G } ( P _ { i } ) \}$ and $\beta ~ = ~ \mathrm { \ m i n } _ { i } \{ \Phi ( G [ P _ { i } ] ) \}$ . Algorithm 2 achieves $\begin{array} { r } { \bigg ( \Big ( \Big ( \log \Big ( \frac { 1 } { 1 - \alpha } \Big ) + 1 \Big ) + \frac { 2 \alpha } { 1 - \alpha } \left( 1 + \log \frac { k } { 1 - \alpha } \right) \Big ) \cdot \frac { 3 } { 2 \beta \log \left( \frac { 4 } { 3 } \right) } \bigg ) } \end{array}$ -approximation.
713
+
714
+ Proof. We group the edges of $\mathbf { G }$ into two categories: let $E _ { 1 }$ be the set of edges in the induced subgraphs $G [ P _ { i } ]$ for all $1 \leq i \leq l$ , i.e.,
715
+
716
+ $$
717
+ E _ { 1 } \triangleq \cup _ { i = 1 } ^ { l } E [ G [ P _ { i } ] ] ,
718
+ $$
719
+
720
+ and $E _ { 2 }$ be the remaining crossing edges. Then we have
721
+
722
+ $$
723
+ \mathrm { c o s t } ^ { T } ( G ) = \sum _ { e \in E _ { 1 } } \mathrm { c o s t } ^ { T } ( e ) + \sum _ { e \in E _ { 2 } } \mathrm { c o s t } ^ { T } ( e ) .
724
+ $$
725
+
726
+ We denote by ${ \mathrm { v o l } } ( G [ P _ { i } ] )$ the volume of the induced graph $G [ P _ { i } ]$ , by ${ \mathrm { v o l } } _ { G } ( P _ { i } )$ the volume of $P _ { i }$ in $G$ , and by parent $^ T ( \dot { P _ { i } } )$ the parent of $P _ { i }$ on $T$ . Then it holds for every $P _ { i }$ that
727
+
728
+ $$
729
+ \operatorname { v o l } _ { G } ( { \mathrm { p a r e n t } } ^ { T } ( P _ { i } ) ) \leq k \cdot \operatorname { v o l } _ { G } ( P _ { i } ) .
730
+ $$
731
+
732
+ By the construction of $T$ we have that
733
+
734
+ $$
735
+ \operatorname { v o l } _ { G } ( { \mathrm { p a r e n t } } ^ { T } ( P _ { i } ) ) = \sum _ { j = 1 } ^ { i } \operatorname { v o l } _ { G } ( P _ { j } ) \leq i \cdot \operatorname { v o l } _ { G } ( P _ { i } ) \leq k \cdot \operatorname { v o l } _ { G } ( P _ { i } ) .
736
+ $$
737
+
738
+ Note that
739
+
740
+ $$
741
+ \begin{array} { r l } & { w ( P _ { i } , V \backslash P _ { i } ) = \mathsf { v o l } _ { G } ( P _ { i } ) - \mathsf { v o l } ( G [ P _ { i } ] ) \leq \alpha \cdot \mathsf { v o l } _ { G } ( P _ { i } ) , } \\ & { \qquad ( 1 - \alpha ) \cdot \mathsf { v o l } _ { G } ( P _ { i } ) \leq \mathsf { v o l } ( G [ P _ { i } ] ) , } \end{array}
742
+ $$
743
+
744
+ and thus
745
+
746
+ $$
747
+ \operatorname { v o l } _ { G } ( { \mathrm { p a r e n t } } ^ { T } ( P _ { i } ) ) \leq k \cdot \operatorname { v o l } _ { G } ( P _ { i } ) \leq { \frac { k } { 1 - \alpha } } { \mathrm { v o l } } ( G [ P _ { i } ] ) .
748
+ $$
749
+
750
+ 615 Combining the above, we have that
751
+
752
+ $$
753
+ \begin{array} { r c l } { \displaystyle \sum _ { \boldsymbol { \alpha } \in E _ { 1 } } \cos ^ { T } ( \boldsymbol { \epsilon } ) } & { \le } & { \displaystyle \sum _ { \boldsymbol { \epsilon } \in E _ { 1 } } w _ { \boldsymbol { \epsilon } } \cdot \log ( \mathsf { v o l } _ { G } ( P _ { i } ) ) } \\ & { \le } & { \displaystyle \sum _ { \boldsymbol { \epsilon } \in E _ { 1 } } w _ { \boldsymbol { \epsilon } } \cdot \log \left( \frac { 1 } { 1 - \boldsymbol { \alpha } } \operatorname { v o l } ( G [ P _ { i } ] ) \right) } \\ & { = } & { \displaystyle \sum _ { \boldsymbol { \epsilon } \in E _ { 1 } } \left( w _ { \boldsymbol { \epsilon } } \cdot \log \frac { 1 } { 1 - \boldsymbol { \alpha } } + w _ { \boldsymbol { \epsilon } } \cdot \log ( \operatorname { v o l } ( G [ P _ { i } ] ) ) \right) } \\ & { \le } & { \displaystyle \left( \log \frac { 1 } { 1 - \boldsymbol { \alpha } } + 1 \right) \cdot \sum _ { j = 1 } ^ { k } \frac { \operatorname { v o l } ( G [ P _ { i } ] ) \cdot \log ( \operatorname { v o l } ( G [ P _ { i } ] ) ) } { 2 } , } \end{array}
754
+ $$
755
+
756
+ 616 and
757
+
758
+ $$
759
+ \begin{array} { r c l } { \displaystyle \sum _ { e \in E _ { 2 } } \cos \mathrm { t r } ^ { T } ( e ) } & { \le } & { \displaystyle \sum _ { j = 1 } ^ { k } w ( P _ { 1 } , V \backslash P _ { k } ) \cdot \log ( \mathsf { w d } _ { G } ( \mathsf { p a r e n t } ^ { T } ( P _ { i } ) ) ) } \\ & { \le } & { \displaystyle \sum _ { j = 1 } ^ { k } \frac { \alpha } { 1 - \alpha } \mathrm { v o l } ( G [ P _ { i } ] ) \log \left( \frac { k } { 1 - \alpha } \mathrm { v o l } ( G [ P _ { i } ] ) \right) } \\ & { \le } & { \displaystyle \sum _ { j = 1 } ^ { k } \frac { \alpha } { 1 - \alpha } \left( 1 + \log \frac { k } { 1 - \alpha } \right) \mathrm { v o l } ( G [ P _ { i } ] ) \log ( \mathsf { w l } ( G [ P _ { i } ] ) ) } \\ & { = } & { \displaystyle \frac { 2 \alpha } { 1 - \alpha } \left( 1 + \log \frac { k } { 1 - \alpha } \right) \cdot \displaystyle \sum _ { j = 1 } ^ { k } \frac { \mathrm { v o l } ( G [ P _ { i } ] ) \cdot \log ( \mathrm { w d } ( G [ P _ { i } ] ) ) } { 2 } . } \end{array}
760
+ $$
761
+
762
+ Let $T ^ { * }$ be the optimal cluster tree of $G$ , and $O P T _ { G }$ be the optimal value. We have
763
+
764
+ $$
765
+ O P T _ { G } = \mathsf { c o s t } _ { G } ( T ^ { * } ) \geq \sum _ { i = 1 } ^ { l } \sum _ { e \in E ( G [ P _ { i } ] ) } \mathsf { c o s t } _ { T ^ { * } } ( e ) \geq \sum _ { i = 1 } ^ { l } O P T _ { G [ P _ { i } ] } .
766
+ $$
767
+
768
+ Denote by
769
+
770
+ $$
771
+ h ( \alpha , k ) = \left( \left( \log \left( \frac { 1 } { 1 - \alpha } \right) + 1 \right) + \frac { 2 \alpha } { 1 - \alpha } \left( 1 + \log \frac { k } { 1 - \alpha } \right) \right) .
772
+ $$
773
+
774
+ 617 We have
775
+
776
+ $$
777
+ \begin{array} { l l l } { \displaystyle \mathrm { c o s s } ^ { T } ( G ) } & { = } & { \displaystyle \sum _ { s \in { \bar { \mathbb { E } } } _ { k } } \mathrm { c o s s } ^ { T } ( e ) + \sum _ { s \in { \bar { \mathbb { E } } } _ { k } } \mathrm { c o s s } ^ { T } ( e ) } \\ { \ } & { \le } & { \displaystyle \hbar ( \alpha , k ) \cdot \sum _ { j = 1 } ^ { k } \frac { \sum _ { w \in [ 0 , 1 ] } \cdot 1 - \log ( \mathrm { c } ( P _ { k } | ) ) } { 2 } } \\ { \ } & { \le } & { \displaystyle \hbar ( \alpha , k ) \cdot \sum _ { j = 1 } ^ { k } \frac { \log ( | G | P _ { k , j } | ) \cdot 1 - \log ( \mathrm { c } ( P _ { k } | ) | ) } { 2 } } \\ { \ } & { \displaystyle \le } & { \displaystyle \hbar ( \alpha , k ) \cdot \sum _ { j = 1 } ^ { k } \frac { \log ( | G | P _ { k , j } | ) \cdot 1 - \log ( \mathrm { c } ( P _ { k } | ) | ) } { 2 \sqrt { 6 } ( P _ { k } | ) \cdot 1 - | G | ( G | P _ { k , j } | ) \cdot 1 - \log ( \mathrm { c } ( P _ { k } | ) | ) } { 2 \sqrt { 6 } ( P _ { k } | ) \cdot 1 - | G | ( P _ { k , j } | ) } { 2 \sqrt { 6 } ( P _ { k } | ) \cdot 1 - | G | ( P _ { k , j } | ) } { 2 \sqrt { 6 } ( P _ { k } | ) \cdot 1 - | G | ( P _ { k , j } | ) } } \\ { \ } & { \displaystyle \le } & { \displaystyle \hbar ( \alpha , k ) \cdot \operatorname* { m a x } _ { i } \frac { \log ( | G | P _ { k , j } | ) ) } { 2 \sqrt { 6 } ( P _ { k } | ) \cdot 1 - | G | ( P _ { k , j } | ) \cdot 1 - | G | ( P _ { k , j } | ) } \sum _ { j = 1 } ^ { k } { \cal P } { \cal T } _ { [ 0 , k ] } } \\ { \ } & { \displaystyle \le } & \displaystyle \hbar ( \alpha , k ) \cdot \operatorname* { m a x } _ { i } \frac { \sum _ { w \in [ 0 , 1 ] } \cdot | \log ( \mathrm { c } ( P _ { k } | ) | ) } { 2 \sqrt { 6 } ( P _ { k , j } | ) \cdot 1 - | G | ( P _ { k , j } | ) \cdot 1 - | G | ( P _ { k , j } | ) } \\ { \ } & { \displaystyle \le } & \end{array}
778
+ $$
779
+
780
+ 618 Lemma E.1 follows.
781
+
782
+ Note that 619 $\begin{array} { r } { h ( \alpha , k ) = O \left( \frac { 1 } { ( 1 - \alpha ) } \log \frac { k } { 1 - \alpha } \right) } \end{array}$ , Theorem 3.2 follows.
783
+
784
+ 621 We do our experiments on Amazon network 4 for which the set of ground-truth clusters has been
785
+ 622 given. For two sets $A , B$ , the Jaccard Index of them is defined as $J ( \bar { A } , B ) = | A \cap B | / | A \cup B |$ . We
786
+ 623 pick the largest cluster which is a subgraph with 58283 vertices and 133178 edges. We run HCSE
787
+ 624 algorithm on it. For each ground-truth cluster $c$ that appears in this subgraph, we find from the
788
+ 625 resulting cluster tree an internal node that has maximum Jaccard index with $c$ . Then we calculate
789
+ 626 the average Jaccard index $\overline { J }$ over all such $c$ . We also calculate cost(SE) and cost(Das). The results
790
+ 627 are demonstrated in Table 3. HCSE performs better for $\overline { J }$ and cost(SE), while LOUVAIN performs
791
+ 628 better for cost(Das). Because of unbalance in over-fitting and under-fitting traps, HLP outperforms
792
+ 629 none of the other two algorithms for all criteria.
793
+
794
+ <table><tr><td>index</td><td>HCSE</td><td>HLP</td><td>LOUVAIN</td></tr><tr><td>J</td><td>0.20</td><td>0.16</td><td>0.17</td></tr><tr><td>cost(SE)</td><td>1.85E6</td><td>2.05E6</td><td>1.89E6</td></tr><tr><td>cost(Das)</td><td>5.57E8</td><td>3.99E8</td><td>3.08E8</td></tr></table>
795
+
796
+ # 630 G Some figures and pseudocodes
797
+
798
+ ![](images/48b8fb0ce160fc82aa361cca703ec122c79d748d8c6d9903ebdebc73363a9987.jpg)
799
+ Table 3: Comparisons of the average Jaccard index $( { \overline { { J } } } )$ , cost function based on structural entropy (cost(SE)) and Dasgupta’s cost function (cost(Das)).
800
+ Figure 3: Illustrations of stretch and compress for a $u$ -triangle. A binary cluster tree is constructed first by stretch, and then edge $e$ is compressed, which yields a non-binary tree.
801
+
802
+ ![](images/4e3ed913335175c591c8c0b34ac958d9be0ae4ee0ef95ae2cc3543a1345868cf.jpg)
803
+ Figure 4: Illustration of stratification for a 2-level cluster tree. The preference of (a) and (b) depends on the average sparsity of triangles at each level.
804
+
805
+ # Algorithm 5: Stretch
806
+
807
+ Input: a $u$ -triangle $T _ { u }$
808
+ Output: a binary tree rooted at $u$
809
+ 1 Let $\{ v _ { 1 } , v _ { 2 } , \ldots , v _ { \ell } \}$ be the set of leaves of $T _ { u }$ ;
810
+ 2 Compute $\eta ( a , b )$ which is the cost reduced by merging siblings $a , b$ into a single cluster;
811
+ 3 for $t \in [ \ell - 1 ]$ do
812
+ 4 $( \alpha , \beta ) \gets \mathrm { a r g m a x } _ { ( a , b ) }$ are siblings $\{ \eta ( a , b ) \}$ ;
813
+ 5 Add a new node $\gamma$ ;
814
+ 6 $\gamma . p a r e n t \alpha$ .parent;
815
+ 7 $\alpha . p a r e n t = \gamma$ ;
816
+ 8 $\beta . p a r e n t = \gamma$ ;
817
+ 9 return $T _ { u }$
818
+
819
+ # Algorithm 6: Compress
820
+
821
+ Input: a binary tree $T$
822
+ 1 while $T$ ’s height is more than 2 do
823
+ 2 $e \gets \arg \operatorname* { m i n } _ { e ^ { \prime } \in \hat { E } ( T ) } \{ \Delta ( e ^ { \prime } ) \}$ ;
824
+ 3 Denote $\boldsymbol { e } = ( u , v )$ where $u$ is the parent of $v$ ;
825
+ 4 for $w \in v$ .children do
826
+ 5 ${ \_ } \psi . p a r e n t u .$ ;
827
+ 6 Delete $v$ from $T$ ;
parse/dev/LPB2BFZvncQ/LPB2BFZvncQ_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/LPB2BFZvncQ/LPB2BFZvncQ_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/LPB2BFZvncQ/LPB2BFZvncQ_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/NudBMY-tzDr/NudBMY-tzDr.md ADDED
@@ -0,0 +1,536 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # NATURAL LANGUAGE DESCRIPTIONS OF DEEP VISUAL FEATURES
2
+
3
+ Evan Hernandez1 Sarah Schwettmann1 David $\mathbf { B a u } ^ { 1 , 2 }$ Teona Bagashvili3 Antonio Torralba1 Jacob Andreas1 1MIT CSAIL 2Northeastern University 3Allegheny College {dez,schwett,teona,torralba,jda}@mit.edu d.bau@northeastern.edu
4
+
5
+ # ABSTRACT
6
+
7
+ Some neurons in deep networks specialize in recognizing highly specific perceptual, structural, or semantic features of inputs. In computer vision, techniques exist for identifying neurons that respond to individual concept categories like colors, textures, and object classes. But these techniques are limited in scope, labeling only a small subset of neurons and behaviors in any network. Is a richer characterization of neuron-level computation possible? We introduce a procedure (called MILAN, for mutual-information-guided linguistic annotation of neurons) that automatically labels neurons with open-ended, compositional, natural language descriptions. Given a neuron, MILAN generates a description by searching for a natural language string that maximizes pointwise mutual information with the image regions in which the neuron is active. MILAN produces fine-grained descriptions that capture categorical, relational, and logical structure in learned features. These descriptions obtain high agreement with human-generated feature descriptions across a diverse set of model architectures and tasks, and can aid in understanding and controlling learned models. We highlight three applications of natural language neuron descriptions. First, we use MILAN for analysis, characterizing the distribution and importance of neurons selective for attribute, category, and relational information in vision models. Second, we use MILAN for auditing, surfacing neurons sensitive to human faces in datasets designed to obscure them. Finally, we use MILAN for editing, improving robustness in an image classifier by deleting neurons sensitive to text features spuriously correlated with class labels.1
8
+
9
+ # 1 INTRODUCTION
10
+
11
+ A surprising amount can be learned about the behavior of a deep network by understanding the individual neurons that make it up. Previous studies aimed at visualizing or automatically categorizing neurons have identified a range of interpretable functions across models and application domains: low-level convolutional units in image classifiers implement color detectors and Gabor filters (Erhan et al., 2009), while some later units activate for specific parts and object categories (Zeiler & Fergus, 2014; Bau et al., 2017). Single neurons have also been found to encode sentiment in language data (Radford et al., 2017) and biological function in computational chemistry (Preuer et al., 2019). Given a new model trained to perform a new task, can we automatically catalog these behaviors?
12
+
13
+ Techniques for characterizing the behavior of individual neurons are still quite limited. Approaches based on visualization (Zeiler & Fergus, 2014; Girshick et al., 2014; Karpathy et al., 2015; Mahendran & Vedaldi, 2015; Olah et al., 2017) leave much of the work of interpretation up to human users, and cannot be used for large-scale analysis. Existing automated labeling techniques (Bau et al., 2017; 2019; Mu & Andreas, 2020) require researchers to pre-define a fixed space of candidate neuron labels; they label only a subset of neurons in a given network and cannot be used to surface novel or unexpected behaviors.
14
+
15
+ This paper develops an alternative paradigm for labeling neurons with expressive, compositional, and open-ended annotations in the form of natural language descriptions. We focus on the visual domain: building on past work on information-theoretic approaches to model interpretability, we formulate neuron labeling as a problem of finding informative descriptions of a neuron’s pattern of activation on input images. We describe a procedure (called MILAN, for mutual-informationguided linguistic annotation of neurons) that labels individual neurons with fine-grained natural language descriptions by searching for descriptions that maximize pointwise mutual information with the image regions in which neurons are active. To do so, we first collect a new dataset of fine-grained image annotations (MILANNOTATIONS, Figure 1c), then use these to construct learned approximations to the distributions over image regions (Figure 1b) and descriptions. In some cases, MILAN surfaces neuron descriptions that more specific than the underlying training data (Figure 1d).
16
+
17
+ ![](images/a1a1d916cc11e144455da0e309b43d4befdf6a3a9f3744d900ec0bc1fcec6ed0.jpg)
18
+ Figure 1: (a) We aim to generate natural language descriptions of individual neurons in deep networks. (b) We first represent each neuron via an exemplar set of input regions that activate it. (c) In parallel, we collect a dataset of fine-grained human descriptions of image regions, and use these to train a model of $p$ (description | exemplars) and $p$ (description). (d) Using these models, we search for a description that has high pointwise mutual information with the exemplars, ultimately generating highly specific neuron annotations.
19
+
20
+ MILAN is largely model-agnostic and can surface descriptions for different classes of neurons, ranging from convolutional units in CNNs to fully connected units in vision transformers, even when the target network is trained on data that differs systematically from MILANNOTATIONS’ images. These descriptions can in turn serve a diverse set of practical goals in model interpretability and dataset design. Our experiments highlight three: using MILAN-generated descriptions to (1) analyze the role and importance of different neuron classes in convolutional image classifiers, (2) audit models for demographically sensitive feature by comparing their features when trained on anonymized (blurred) and non-anonymized datasets, and (3) identify and mitigate the effects of spurious correlations with text features, improving classifier performance on adversarially distributed test sets. Taken together, these results show that fine-grained, automatic annotation of deep network models is both possible and practical: rich descriptions produced by automated annotation procedures can surface meaningful and actionable information about model behavior.
21
+
22
+ # 2 RELATED WORK
23
+
24
+ Interpreting deep networks MILAN builds on a long line of recent approaches aimed at explaining the behavior of deep networks by characterizing the function of individual neurons, either by visualizing the inputs they select for (Zeiler & Fergus, 2014; Girshick et al., 2014; Karpathy et al., 2015; Mahendran & Vedaldi, 2015; Olah et al., 2017) or by automatically categorizing them according to the concepts they recognize (Bau et al., 2017; 2018; Mu & Andreas, 2020; Morcos et al., 2018; Dalvi et al., 2019). Past approaches to automatic neuron labeling require fixed, pre-defined label sets; in computer vision, this has limited exploration to pre-selected object classes, parts, materials, and simple logical combinations of these concepts. While manual inspection of neurons has revealed that a wider range of features play an important role in visual recognition (e.g. orientation, illumination, and spatial relations; Cammarata et al. 2021) MILAN is the first automated approach that can identify such features at scale. Discrete categorization is also possible for directions in representation space (Kim et al., 2018; Andreas et al., 2017; Schwettmann et al., 2021) and for clusters of images induced by visual representations (Laina et al., 2020); in the latter, an off-the-shelf image captioning model is used to obtain language descriptions of the unifying visual concept for the cluster, although the descriptions miss low-level visual commonalities. As MILAN requires only a primitive procedure for generating model inputs maximally associated with the feature or direction of interest, future work might extend it to these settings as well.
25
+
26
+ Natural language explanations of decisions Previous work aimed at explaining computer vision classifiers using natural language has focused on generating explanations for individual classification decisions (e.g., Hendricks et al., 2016; Park et al., 2018; Hendricks et al., 2018; Zellers et al., 2019). Outside of computer vision, several recent papers have proposed procedures for generating natural language explanations of decisions in text classification models (Zaidan & Eisner, 2008; Camburu et al., 2018; Rajani et al., 2019; Narang et al., 2020) and of representations in more general sequence modeling problems (Andreas & Klein, 2017). These approaches require task-specific datasets and often specialized training procedures, and do not assist with interpretability at the model level. To the best of our knowledge, MILAN is the first approach for generating compositional natural language descriptions for interpretability at the level of individual features rather than input-conditional decisions or representations. More fundamentally, MILAN can do so independently of the model being described, making it (as shown in Section 4) modular, portable, and to a limited extent task-agnostic.
27
+
28
+ # 3 APPROACH
29
+
30
+ Neurons and exemplars Consider the neuron depicted in Figure 1b, located in a convlutional network trained to classify scenes (Zhou et al., 2017). When the images in Figure 1 are provided as input to the network, the neuron activates in patches of grass near animals, but not in grass without animals nearby. How might we automate the process of automatically generating such a description?
31
+
32
+ While the image regions depicted in Fig. 1b do not completely characterize the neuron’s function in the broader network, past work has found that actionable information can be gleaned from such regions alone. Bau et al. (2020; 2019) use them to identify neurons that can trigger class predictions or generative synthesis of specific objects; Andreas & Klein (2017) use them to predict sequence outputs on novel inputs; Olah et al. (2018) and Mu & Andreas (2020) use them to identify adversarial vulnerabilities. Thus, building on this past work, our approach to neuron labeling also begins by representing each neuron via the set of input regions on which its activity exceeds a fixed threshold.
33
+
34
+ Definition 1. Let $f : X \to Y$ be a neural network, and let $f _ { i } ( x )$ denote the activation value of the ith neuron in $f$ given an input $x$ .2 Then, an exemplar representation of the neuron $f _ { i }$ is given by:
35
+
36
+ $$
37
+ E _ { i } = \{ x \in X : f _ { i } ( x ) > \eta _ { i } \} .
38
+ $$
39
+
40
+ for some threshold parameter $\eta _ { i }$ (discussed in more detail below).
41
+
42
+ Exemplars and descriptions Given this explicit representation of $f _ { i }$ ’s behavior, it remains to construct a description $d _ { i }$ of the neuron. Past work (Bau et al., 2017; Andreas et al., 2017) begins with a fixed inventory of candidate descriptions (e.g. object categories), defines an exemplar set $E _ { d } ^ { \prime }$ for each such category (e.g. via the output of a semantic segmentation procedure) then labels neurons by optimizing $d _ { i } : = \arg \operatorname* { m i n } _ { d } \ \delta ( E _ { i } , E _ { d } ^ { \prime } )$ for some measure of set distance (e.g. Jaccard, 1912).
43
+
44
+ In this work, we instead adopt a probabilistic approach to neuron labeling. In computer vision applications, each $E _ { i }$ is a set of image patches. Humans are adept at describing such patches (Rashtchian et al., 2010) and one straightforward possibility might be to directly optimize $d _ { i } : = \arg \operatorname* { m a x } _ { d } p ( d \mid$ $E _ { i }$ ). In practice, however, the distribution of human descriptions given images may not be wellaligned with the needs of model users. Fig. 2 includes examples of human-generated descriptions for exemplar sets. Many of them (e.g. text for AlexNet conv3-252) are accurate, but generic; in reality, the neuron responds specifically to text on screens. The generated description of a neuron should capture the specificity of its function—especially relative to other neurons in the same model.
45
+
46
+ We thus adopt an information-theoretic criterion for selecting descriptions: our final neuron description procedure optimizes pointwise mutual information between descriptions and exemplar sets:
47
+
48
+ # Definition 2. The max-mutual-information description of the neuron $f _ { i }$ is given by:
49
+
50
+ $$
51
+ \operatorname { M I L A N } ( f _ { i } ) : = \arg \operatorname* { m a x } _ { d } \ \operatorname { p m i } ( d ; E _ { i } ) = \arg \operatorname* { m a x } _ { d } \ \log p ( d \mid E _ { i } ) - \log p ( d ) ~ .
52
+ $$
53
+
54
+ To turn Eq. (2) into a practical procedure for annotating neurons, three additional steps are required: constructing a tractable approximation to the exemplar set $E _ { i }$ (Section 3.1), using human-generated image descriptions to model $p ( d \mid E )$ and $p ( d )$ (Section 3.2 and Section 3.3), and finding a highquality description $d$ in the infinite space of natural language strings (Section 3.4).
55
+
56
+ ![](images/11271cee22a0fc906e77474b813fcf4d907a114efa7288893ec13f3437c8b454.jpg)
57
+ Figure 2: Examples of MILAN descriptions on the generalization tasks described in Section 4. Even highly specific labels (like the top boundaries of horizontal objects) can be predicted for neurons in new networks. Failure modes include semantic errors, e.g. MILAN misses the cupcakes in the dog faces and cupcakes neuron.
58
+
59
+ # 3.1 APPROXIMATING THE EXEMPLAR SET
60
+
61
+ As written, the exemplar set in Equation (1) captures a neuron’s behavior on all image patches. This set is large (limited only by the precision used to represent individual pixel values), so we follow past work (Bau et al., 2017) by restricting each $E _ { i }$ to the set of images that cause the greatest activation in the neuron $f _ { i }$ . For convolutional neurons in image processing tasks, sets $E _ { i }$ ultimately comprise $k$ images with activation masks indicating the regions of those images in which $f _ { i }$ fired (Fig. 1a; see Bau et al. 2017 for details). Throughout this paper, we use exemplar sets with $k = 1 5$ images and choose $\eta _ { i }$ equal to the 0.99 percentile of activations for the neuron $f _ { i }$ .
62
+
63
+ # 3.2 MODELING $p ( d \mid E )$ AND $p ( d )$
64
+
65
+ The term $\mathrm { p m i } ( d ; E _ { i } )$ in Equation (2) can be expressed in terms of two distributions: the probability $p ( d \mid E _ { i } )$ that a human would describe an image region with $d$ , and the probability $p ( d )$ that a human would use the description $d$ for any neuron. $\bar { p ( d \mid E _ { i } ) }$ is, roughly speaking, a distribution over image captions (Donahue et al., 2015). Here, however, the input to the model is not a single image but a set of image regions (the masks in Fig. 1a); we seek natural language descriptions of the common features of those regions. We approximate $p ( d \mid E _ { i } )$ with learned model—specifically the Show-Attend-Tell image description model of $\mathrm { X u }$ et al. (2015) trained on the MILANNOTATIONS dataset described below, and with several modifications tailored to our use case. We approximate $p ( d )$ with a two-layer LSTM language model (Hochreiter & Schmidhuber, 1997) trained on the text of MILANNOTATIONS. Details about both models are provided in Appendix B.
66
+
67
+ # 3.3 COLLECTING HUMAN ANNOTATIONS
68
+
69
+ As $p ( d \mid E _ { i } )$ and $p ( d )$ are both estimated using learned models, they require training data. In particular, modeling $p ( d \mid E _ { i } )$ requires a dataset of captions that describe regions from multiple different images, such as the ones shown in Fig. 1. These descriptions must describe not only objects and actions, but all other details that individual neurons select for. Existing image captioning datasets, like MSCOCO (Lin et al., 2014) and Conceptual Captions (Sharma et al., 2018), only focus on scene-level details about a single image and do not provide suitable annotations for this task. We therefore collect a novel dataset of captions for image regions to train the models underlying MILAN.
70
+
71
+ First, we must obtain a set of image regions to annotate. To ensure that these regions have a similar distribution to the target neurons themselves, we derive them directly from the exemplar sets of neurons in a set of seed models. We obtain the exemplar sets for a subset of the units in each seed model in Table 1 using the method from Section 3.1. We then present each set to a human annotator and ask them to describe what is common to the image regions.
72
+
73
+ <table><tr><td>Network</td><td>Arch.</td><td>Task</td><td>Datasets</td><td>Annotated</td><td>#Units</td></tr><tr><td>AlexNet</td><td>CNN</td><td>Class.</td><td>ImageNet Places365</td><td>conv. 1-5</td><td>1152 1376</td></tr><tr><td>ResNet152</td><td>CNN</td><td>Class.</td><td>ImageNet Places365</td><td>conv. 1 res. 1-4</td><td>3904 3904</td></tr><tr><td>BigGAN</td><td>CNN</td><td>Gen.</td><td>ImageNet Places365</td><td>res.0-5</td><td>3744 4992</td></tr><tr><td>DINO</td><td>ViT</td><td>BYOL</td><td>ImageNet</td><td>MLP 1-12 (first 100)</td><td>1200</td></tr></table>
74
+
75
+ Table 1: Summary of MILANNOTATIONS, which labels 20k units across 7 models with different network architectures, datsasets, and tasks. Each unit is annotated by three human participants.
76
+
77
+ Table 1 summarizes the dataset, which we call MILANNOTATIONS. In total, we construct exemplar sets using neurons from seven vision models, totaling 20k neurons. These models include two architectures for supervised image classification, AlexNet (Krizhevsky et al., 2012) and ResNet152 (He et al., 2015); one architecture for image generation, BigGAN (Brock et al., 2018); and one for unsupervised representation learning trained with a “Bootsrap Your Own Latent” (BYOL) objective (Chen & He, 2020; Grill et al., 2020), DINO (Caron et al., 2021). These models cover two datasets, specifically ImageNet (Deng et al., 2009) and Places365 (Zhou et al., 2017), as well as two completely different families of models, CNNs and Vision Transformers (ViT) (Dosovitskiy et al., 2021). Each exemplar set is shown to three distinct human participants, resulting 60k total annotations. Examples are provided in Appendix A (Fig. 10). We recruit participants from Amazon Mechanical Turk. This data collection effort was approved by MIT’s Committee on the Use of Humans as Experimental Subjects. To control for quality, workers were required to have a HIT acceptance rate of at least $9 5 \%$ , have at least 100 approved HITs, and pass a short qualification test. Full details about our data collection process and the collected data can be found in Appendix A.
78
+
79
+ # 3.4 SEARCHING IN THE SPACE OF DESCRIPTIONS
80
+
81
+ Directly decoding descriptions from $\operatorname { p m i } ( d ; E _ { i } )$ tends to generate disfluent descriptions. This is because the $p ( d )$ term inherently discourages common function words like the from appearing in descriptions. Past work language generation (Wang et al., 2020) has found that this can be remedied by first introducing a hyperparameter $\lambda$ to modulate the importance of $p ( d )$ when computing PMI, giving a new weighted PMI objective:
82
+
83
+ $$
84
+ \operatorname { w p m i } ( d ) = \log p ( d \mid E _ { i } ) - \lambda \log p ( d ) .
85
+ $$
86
+
87
+ Next, search is restricted to a set of captions that are high probability under $p ( d \mid E _ { i } )$ , which are reranked according to Eq. (3). Specifically, we run beam search on $p ( \boldsymbol { d } \mid E _ { i } )$ , and use the full beam after the final search step as a set of candidate descriptions. For all experiments, we set $\lambda = . 2$ and beam size to 50.
88
+
89
+ # 4 DOES MILAN GENERALIZE?
90
+
91
+ Because it is trained on a set of human-annotated exemplar sets obtained from a set of seed networks, MILAN is useful as an automated procedure only if it generalizes and correctly describes neurons in trained models with new architectures, new datasets, and new training objectives. Thus, before describing applications of MILAN to specific interpretability problems, we perform crossvalidation experiments within the MILANNOTATIONS data to validate that MILAN can reliably label new neurons. We additionally verify that MILAN provides benefits over other neuron annotation techniques by comparing its descriptions to three baselines: NetDissect (Bau et al., 2017), which assigns a single concept label to each neuron by comparing the neuron’s exemplars to semantic segmentations of the same images; Compositional Explanations (Mu & Andreas, 2020), which follows a similar procedure to generate logical concept labels; and ordinary image captioning (selecting descriptions using $p ( d \mid E )$ instead of $\operatorname { p m i } ( d ; E ) )$ .
92
+
93
+ Method In each experiment, we train MILAN on a subset of MILANNOTATIONS and evaluate its performance on a held-out subset. To compare MILAN to the baselines, we train on all data except a single held-out network; we obtain the baseline labels by running the publicly available code with the default settings on the held-out network. To test generalization within a network, we train on $90 \%$ of neurons from each network and test on the remaining $10 \%$ . To test generalization across architectures, we train on all AlexNet (ResNet) neurons and test on all ResNet (AlexNet) neurons; we also train on all CNN neurons and test on ViT neurons. To test generalization across datasets, we train on all neurons from models trained on ImageNet (Places) and test on neurons from models for the other datasets. To test generalization across tasks, we train on all classifier neurons (GAN neurons) and test on all GAN neurons (classifier neurons). We measure performance via BERTScore (Zhang et al., 2020) relative to the human annotations. Hyperparameters for each of these experiments are in Appendix C.
94
+
95
+ Table 2: BERTScores for neuron labeling methods relative to human annotations. MILAN obtains higher agreement than Compositional Explanations (CE) or NetDissect (ND).
96
+
97
+ <table><tr><td>Model</td><td>CE</td><td>ND</td><td>p(d|E)</td><td>pmi(d; E)</td></tr><tr><td>AlexNet-ImageNet</td><td>.01</td><td>.24</td><td>.34</td><td>.38</td></tr><tr><td>AlexNet-Places</td><td>.02</td><td>.21</td><td>.31</td><td>.37</td></tr><tr><td>ResNet-ImageNet</td><td>.01</td><td>.25</td><td>.27</td><td>.35</td></tr><tr><td>ResNet-Places</td><td>.03</td><td>.22</td><td>.30</td><td>.31</td></tr></table>
98
+
99
+ Table 3: BERTScores on held out neurons relative to the human annotations. Each train/test split evaluates a different kind of generalization, ultimately evaluating how well MILAN generalizes to networks with architectures, datasets, and tasks unseen in the training annotations.
100
+
101
+ <table><tr><td>Generalization</td><td>Train + Test</td><td>BERTScore (f)</td></tr><tr><td>within network</td><td>AlexNet-ImageNet</td><td>.39</td></tr><tr><td></td><td>AlexNet-Places</td><td>.47</td></tr><tr><td></td><td>ResNet152-ImageNet</td><td>.35</td></tr><tr><td></td><td>ResNet152-Places</td><td>.28</td></tr><tr><td></td><td>BigGAN-ImageNet</td><td>.49</td></tr><tr><td></td><td>BigGAN-Places</td><td>.52</td></tr><tr><td></td><td>Train Test</td><td></td></tr><tr><td rowspan="3">across arch.</td><td>AlexNet</td><td>ResNet152</td><td>.28</td></tr><tr><td>ResNet152</td><td>AlexNet</td><td>.35</td></tr><tr><td>CNNs</td><td>ViT</td><td>.34</td></tr><tr><td>across datasets</td><td>ImageNet</td><td>Places</td><td>.30</td></tr><tr><td rowspan="2"></td><td>Places</td><td>ImageNet</td><td>.33</td></tr><tr><td>Classifiers</td><td>BigGAN</td><td>.34</td></tr><tr><td>across tasks</td><td>BigGAN</td><td>Classifiers</td><td>.27</td></tr></table>
102
+
103
+ Results Table 2 shows results for MILAN and all three baselines applied to four different networks. MILAN obtains higher agreement with human annotations on held-out networks than baselines. It is able to surface highly specific behaviors in its descriptions, like the splashes of water neuron shown in Figure 2 (splashes has no clear equivalent in the concept sets used by NetDissect (ND) or Compositional Explanations (CE)). MILAN also outperforms the ablated $p ( d \mid E )$ decoder, justifying the choice of pmi as an objective for obtaining specific and high-quality descriptions.3
104
+
105
+ Table 3 shows that MILAN exhibits different degrees of generalization across models, with generalization to new GAN neurons in the same network easiest and GAN-to-classifier generalization hardest. MILAN can generalize to novel architectures. It correctly labels ViT neurons (in fully connected layers) as often as it correctly labels other convolutional units (e.g., in AlexNet). We observe that transferability across tasks is asymmetric: agreement scores are higher when transferring from classifier neurons to GAN neurons than the reverse. Finally, Figure 3 presents some of MILAN’s failure cases: when faced with new visual concepts, MILAN sometimes mislabels the concept (e.g., by calling brass instruments noodle dishes), prefers a vague description (e.g., similar color patterns), or ignores the highlighted regions and describes the context instead.
106
+
107
+ We emphasize that this section is primarily intended as a sanity check of the learned models underlying MILAN, and not as direct evidence of its usefulness or reliability as a tool for interpretability. We follow Vaughan & Wallach (2020) in arguing that the final test of any such tool must be its ability to produce actionable insights for human users, as in the three applications described below.
108
+
109
+ # 5 ANALYZING FEATURE IMPORTANCE
110
+
111
+ # MILAN failures
112
+
113
+ ![](images/c0c6e0da89bd6517a491b0f5c7f5571d53bb2cbc36c935bec0dedb4103b611eb.jpg)
114
+ AlexNet conv5-239
115
+
116
+ Human:yellow and green animals, food,
117
+ instruments,and objects
118
+ MILAN: Noodle dishes
119
+
120
+ The previous section shows that MILAN can generalize to new architectures, datasets, and tasks. The remainder of this paper focuses on applications that use generated labels to understand how neurons influence model behavior. As a first example: descriptions in Figure 2 reveal that neurons have different degrees of specificity. Some neurons detect objects with spatial constraints (the area on top of the line), while others fire for low-level but highly specific perceptual qualities (long, thin objects). Still others detect perceptually similar but fundamentally different objects (dog faces and cupcakes). How important are these different classes of neurons to model behavior?
121
+
122
+ BigGAN layerl-486
123
+
124
+ ![](images/4563a6da05e5da9d08fa3cc87c537ef1761aa35fb6591780b2a12c2857550346.jpg)
125
+ Human:sea life MILAN: Similar color patterns
126
+
127
+ DINO layer8-72
128
+
129
+ Human: the crowd MILAN: Athletes
130
+
131
+ Method We use MILAN trained on all convolutional units in MILANNOTATIONS to annotate every neuron in ResNet18- ImageNet. We then score each neuron according to one of seven criteria that capture different syntactic or structural properties of the caption. Four syntactic criteria each count the number of times that a specific part of speech appears in a caption: nouns, verbs, prepositions, and adjectives. Three structural criteria measure properties of the entire caption: its length, the depth of its parse tree (a rough measure of its compositional complexity, obtained from the spaCy parser of Honnibal et al. 2020), and its maximum word difference (a measure of the semantic coherence of the description, measured as the maximum Euclidean distance between any two caption words, again obtained via spaCy). Finally, neurons are incrementally ablated in order of their score. The network is tested on the ImageNet validation set and its accuracy recorded. This procedure is then repeated, deleting $2 \%$ of neurons at each step. We also include five trials in which neurons are ordered randomly. Further details and examples of ablated neurons are provided in Appendix D.
132
+
133
+ ![](images/0844a989e9066735290a80ed703038dfa43942c7c63884b01c7e45cb2068971f.jpg)
134
+ Figure 3: Examples of MILAN failures. Failure modes include incorrect generalization (top), vague descriptions for concepts not seen in the training set (middle), and mistaking the context for the highlighted regions (bottom).
135
+
136
+ Results Figure 4 plots accuracy on the ImageNet validation set as a function of the number of ablated neurons. Linguistic features of neuron descriptions highlight several important differences between neurons. First, neurons captioned with many adjectives or prepositions (that is, neurons that capture attributes and relational features) are relatively important to model behavior. Ablating these neurons causes a rapid decline in performance compared to ablating random neurons or nouns. Second, neurons that detect dissimilar concepts appear to be less important. When the caption contains highly dissimilar words (max word diff.), ablation hurts performance substantially less than ablating random neurons. Such neurons sometimes detect non-semantic compositions of concepts like the dog faces and cupcakes neuron shown in Fig. 2; Mu & Andreas (2020) find that these units contribute to non-robust model behavior. We reproduce their robustness experiments using these neurons in Section 5 (Figure 14) and reach similar conclusions. Finally, Figure 4 highlights that neurons satisfying each criterion are not evenly distributed across layers—for example, middle layers contain the largest fraction of relation-selective neurons measured via prepositions.
137
+
138
+ ![](images/cd12a072fa67ded13b6122c7d6b877314f9c79378619868063fcab3bc9d6525d.jpg)
139
+ Figure 4: ResNet18 accuracy on the ImageNet validation set as units are ablated (left, middle), and distribution of neurons matching syntactic and structural criteria in each layer (right). In each configuration, neurons are scored according to a property of their generated description (e.g., number of nouns/words in description, etc.), sorted based on their score, and ablated in that order. Neurons described with adjectives appear crucial for good performance, while neurons described with very different words (measured by word embedding difference; max word diff.) appear less important for good performance. Adjective-selective neurons are most prevalent in early layers, while neurons with large semantic differences are more prevalent in late ones.
140
+
141
+ # 6 AUDITING ANONYMIZED MODELS
142
+
143
+ One recent line of work in computer vision aims to construct privacy-aware datasets, e.g. by detecting and blurring all faces to avoid leakage of information about specific individuals into trained models (Yang et al., 2021). But to what extent does this form of anonymization actually reduce models’ reliance on images of humans? We wish to understand if models trained on blurred data still construct features that can human faces, or even specific categories of faces. A core function of tools for interpretable machine learning is to enable auditing of trained models for such behavior; here, we apply MILAN to investigate the effect of blurringbased dataset privacy.
144
+
145
+ Method We use MILAN to caption a subset of convolutional units in 12 different models pretrained for image classification on the blurred ImageNet images (blurred models). These models are distributed by the original authors of the blurred ImageNet dataset (Yang et al., 2021). We caption the same units in models pretrained on regular ImageNet (unblurred models) obtained from torchvision (Paszke et al., 2019). We then manually inspect all neurons in the blurred and unblurred models for which MILAN descriptions contain the words face, head, nose, eyes, and mouth (using exemplar sets containing only unblurred images).
146
+
147
+ ![](images/b5425fc09c4d2877f6fb87cc116d59a4fd7f8eb8176ba5ef35c45ae86669b3f3.jpg)
148
+ Figure 5: Change in $\#$ o f face neurons found by MILAN (each pair of points is one model architecture). Blurring reduces, but does not eliminate, units selective for unblurred faces.
149
+
150
+ Results Across models trained on ordinary ImageNet, MILAN identified 213 neurons selective for human faces. Across models trained on blurred ImageNet, MILAN identified 142 neurons selective for human faces. MILAN can distinguish between models trained on blurred and unblurred data (Fig. 5). However, it also reveals that models trained on blurred data acquire neurons selective for unblurred faces. Indeed, it is possible to use MILAN’s labels to extract these face-selective neurons directly. Doing so reveals that several of them are not simply face detectors, but appear to selectively identify female faces (Fig. 6b) and Asian faces (Fig. 6c). Blurring does not prevent models from extracting highly specific features for these attributes. Our results in this section highlight the use of MILAN for both quantitative and qualitative, human-in-the loop auditing of model behavior.
151
+
152
+ ![](images/ef900ce852c2efbc0e5303cd1d679f55d90c89354d9089a12802776fc6046cfa.jpg)
153
+ images, we report insights about the effects of face blurring. ContributionsFigure 6: (a) The blurred ImageNet dataset. The validation accuracy drops only slightly (0.13%–0.68%) itates subsequ(b–c) Exemplar sets and labels for two neuhardly surprising since face blurring could remove informa- our knowledgrons in a blurred model that activate on unassures us that we can train privacy-aware visual classifiers privacy-awarenition. Througblurred faces—and appear to preferentially on ILSVRC with less than 1% accuracy drop. training on facaccuracy on bo(but not exclusively) respond to faces in speILSVRC, we observe that they are impacted by cific demographic categories.
154
+
155
+ # 7 EDITING SPURIOUS FEATURES
156
+
157
+ Our results demonstrate the utility of face-blurred ILSVRCfor benchmarking. It enhances privacy with only a marginal chine learningSpurious correlations between features and labels are a persistent problem in machine learning accuracy drop. Models trained on it perform competitivelywith models trained on the original ILSVRC dataset. trying to inferapplications, especially in the presence of mismatches between training and testing data (Storkey, Effects on feature transferability. Besides a classifi- tive attributes (2009). In object recognition, one frequent example is correlation between backgrounds and objects cation benchmark, ILSVRC also serves as pretrainingdata for transferring to domains where labeled images are the model’s ou2017; Li et al., (e.g. cows are more likely to appear with green grass in the background, while fish are more likely tion is: Does face obfuscation hurt the transferability of training (Shokto appear with a blue background; Xiao et al. 2020). In a more recent example, models trained on visual features learned from ILSVRC? et al., 2020). Ttim training dajoint text and image data are subject to “text-based adversarial attacks”, in which e.g. an apple with original/blurred images and finetuning on 4 downstream For defending ageneral framewthe word iPod written on it is classified as an iPod (Goh et al., 2021). Our final experiment shows 2009), scene recognition on SUN (Xithat MILAN can be used to reduce models’ sensitivity to these spurious features.
158
+
159
+ Data We create a controlled dataset imitating Goh et al. (2021)’s spurious text features. The dataset consists of 10 ImageNet classes. In the training split, there are 1000 images per class; 500 are annotated with (correct) text labels in the top-left corner. The test set contains 100 images per class (from the ImageNet validation set); in all these images, a random (usually incorrect) text label is included. We train and evaluate a fresh ResNet18 model on this dataset, holding out $10 \%$ of the training data as a validation dataset for early stopping. Training details can be found in Appendix E.
160
+
161
+ Method We use MILAN to obtain descriptions of every residual neuron in the model as well as the first convolutional layer. We identify all neurons whose description contains text, word, or letter. To identify spurious neurons, we first assign each text neuron an independent importance score by removing it from the network and measuring the resulting drop in validation accuracy (with non-adversarial images). We then sort neurons by importance score (with the least important first), and successively ablate them from the model.
162
+
163
+ ![](images/ea9d70014ad7b696a8b3b1a815de9ec9b213df10282ce89f71695853b711bd5e.jpg)
164
+
165
+ ![](images/7f2d312233ff230167b362a2c7277685ad8b7fb73ee627864f6455f588d47464.jpg)
166
+ layer3-134, “words and letters”
167
+ Figure 7: Network editing. (a) We train an image classifier on a synthetic dataset in which half the images include the class label written in text in the corner. (b) We evaluate the classifier on an adversarial test set, in which every image has a random textual label. (c) Nearly a third of neurons in the trained model model detect text, hurting its performance on the test set.
168
+
169
+ Results The result of this procedure on adversarial test accuracy is shown in Fig. 8. Training on the spurious data substantially reduces ResNet18’s performance on the adversarial test set: the model achieves $5 8 . 8 \%$ accuracy, as opposed to $6 9 . 9 \%$ when tested on non-spurious data. MILAN identifies 300 text-related convolutional units (out of 1024 examined) in the model, confirming that the model has indeed devoted substantial capacity to identifying text labels in the image. Figure 7c shows an example neurons specifically selective for airline and truck text. By deleting only 13 such neurons, test accuracy is improved by $4 . 9 \%$ (a $12 \%$ reduction in overall error rate).4 This increase cannot be explained by the sorting procedure described above: if instead we sort all neurons according to validation accuracy (orange line), accuracy improves by less than $1 \%$ . Thus, while this experiment does not completely eliminate the model’s reliance on text features, it shows that MILAN’s predictions enable direct editing of networks to partially mitigate sensitivity to spurious feature correlations.
170
+
171
+ ![](images/bd8fc9214c56adbc80cd19c5f81425dc87a357edb29914a983424cfbf5b5401f.jpg)
172
+ Figure 8: ResNet18 accuracy on the adversarial test set as neurons are incrementally ablated. Neurons are sorted by the model’s validation accuracy when that single neuron is ablated, then ablated in that order. When ablating neurons that select for the spurious text, the accuracy improves by 4.9 points. When zeroing arbitrary neurons, accuracy still improves, but by much less.
173
+
174
+ # 8 CONCLUSIONS
175
+
176
+ We have presented MILAN, an approach for automatically labeling neurons with natural language descriptions of their behavior. MILAN selects these descriptions by maximizing pointwise mutual information with image regions in which each neuron is active. These mutual information estimates are in turn produced by a pair of learned models trained on MILANNOTATIONS, a dataset of fine-grained image annotations released with this paper. Descriptions generated by MILAN surface diverse aspects of model behavior, and can serve as a foundation for numerous analysis, auditing, and editing techniques workflows for users of deep network models.
177
+
178
+ # IMPACT STATEMENT
179
+
180
+ In contrast to most past work on neuron labeling, MILAN generates neuron labels using another black-box learned model trained on human annotations of visual concepts. With this increase in expressive power come a number of potential limitations: exemplar-based explanations have known shortcomings (Bolukbasi et al., 2021), human annotations of exemplar sets may be noisy, and the captioning model may itself behave in unexpected ways far outside the training domain. The MILANNOTATIONS dataset was collected with annotator tests to address potential data quality issues, and our evaluation in Section 4 characterizes prediction quality on new networks; we nevertheless emphasize that these descriptions are partial and potentially noisy characterizations of neuron function via their behavior on a fixed-sized set of representative inputs. MILAN complements, rather than replaces, both formal verification (Dathathri et al., 2020) and careful review of predictions and datasets by expert humans (Gebru et al., 2018; Mitchell et al., 2019).
181
+
182
+ # ACKNOWLEDGMENTS
183
+
184
+ We thank Ekin Akyurek and Tianxing He for helpful feedback on early drafts of the paper. We ¨ also thank IBM for the donation of the Satori supercomputer that enabled training BigGAN on MIT Places. This work was partially supported by the MIT-IBM Watson AI lab, the SystemsThatLearn initiative at MIT, a Sony Faculty Innovation Award, DARPA SAIL-ON HR0011-20-C-0022, and a hardware gift from NVIDIA under the NVAIL grant program.
185
+
186
+ # REFERENCES
187
+
188
+ Jacob Andreas and Dan Klein. Analogs of linguistic structure in deep representations. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing, pp. 2893– 2897, Copenhagen, Denmark, September 2017. Association for Computational Linguistics. doi: 10.18653/v1/D17-1311. URL https://www.aclweb.org/anthology/D17-1311.
189
+
190
+ Jacob Andreas, Anca D Dragan, and Dan Klein. Translating neuralese. In ACL (1), 2017.
191
+
192
+ Dzmitry Bahdanau, Kyung Hyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In ICLR, January 2015.
193
+
194
+ Anthony Bau, Yonatan Belinkov, Hassan Sajjad, Nadir Durrani, Fahim Dalvi, and James Glass. Identifying and controlling important neurons in neural machine translation. In International Conference on Learning Representations, 2018.
195
+
196
+ David Bau, Bolei Zhou, Aditya Khosla, Aude Oliva, and Antonio Torralba. Network dissection: Quantifying interpretability of deep visual representations. In Computer Vision and Pattern Recognition (CVPR), 2017.
197
+
198
+ David Bau, Jun-Yan Zhu, Hendrik Strobelt, Bolei Zhou, Joshua B Tenenbaum, William T Freeman, and Antonio Torralba. Gan dissection: Visualizing and understanding generative adversarial networks. In International Conference on Learning Representations (ICLR), 2019.
199
+
200
+ David Bau, Jun-Yan Zhu, Hendrik Strobelt, Agata Lapedriza, Bolei Zhou, and Antonio Torralba. Understanding the role of individual units in a deep neural network. Proceedings of the National Academy of Sciences (PNAS), 2020.
201
+
202
+ Tolga Bolukbasi, Adam Pearce, Ann Yuan, Andy Coenen, Emily Reif, Fernanda Viegas, and Martin ´ Wattenberg. An interpretability illusion for bert. arXiv preprint arXiv:2104.07143, 2021.
203
+
204
+ Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale gan training for high fidelity natural image synthesis. In International Conference on Learning Representations, 2018.
205
+
206
+ Oana-Maria Camburu, Tim Rocktaschel, Thomas Lukasiewicz, and Phil Blunsom. e-snli: Natural ¨ language inference with natural language explanations. arXiv preprint arXiv:1812.01193, 2018.
207
+
208
+ Nick Cammarata, Gabriel Goh, Shan Carter, Chelsea Voss, Ludwig Schubert, and Chris Olah. Curve circuits. Distill, 6(1):e00024–006, 2021.
209
+
210
+ Mathilde Caron, Hugo Touvron, Ishan Misra, Herve J ´ egou, Julien Mairal, Piotr Bojanowski, and ´ Armand Joulin. Emerging properties in self-supervised vision transformers. In Proceedings of the International Conference on Computer Vision (ICCV), 2021.
211
+
212
+ Xinlei Chen and Kaiming He. Exploring simple siamese representation learning, 2020.
213
+
214
+ Fahim Dalvi, Nadir Durrani, Hassan Sajjad, Yonatan Belinkov, Anthony Bau, and James Glass. What is one grain of sand in the desert? analyzing individual neurons in deep nlp models. In Proceedings of AAAI, 2019.
215
+
216
+ Sumanth Dathathri, Krishnamurthy Dvijotham, Alexey Kurakin, Aditi Raghunathan, Jonathan Uesato, Rudy Bunel, Shreya Shankar, Jacob Steinhardt, Ian Goodfellow, Percy Liang, et al. Enabling certification of verification-agnostic networks via memory-efficient semidefinite programming. In Neural Information Processing Systems (NeurIPS), 2020.
217
+
218
+ Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Computer Vision and Pattern Recognition (CVPR), 2009.
219
+
220
+ Jeffrey Donahue, Lisa Anne Hendricks, Sergio Guadarrama, Marcus Rohrbach, Subhashini Venugopalan, Kate Saenko, and Trevor Darrell. Long-term recurrent convolutional networks for visual recognition and description. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2625–2634, 2015.
221
+
222
+ Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations (ICLR), 2021.
223
+
224
+ Dumitru Erhan, Yoshua Bengio, Aaron Courville, and Pascal Vincent. Visualizing higher-layer features of a deep network. 2009.
225
+
226
+ Timnit Gebru, Jamie Morgenstern, Briana Vecchione, Jennifer Wortman Vaughan, Hanna Wallach, Hal Daume III, and Kate Crawford. Datasheets for datasets. ´ arXiv preprint arXiv:1803.09010, 2018.
227
+
228
+ Ross Girshick, Jeff Donahue, Trevor Darrell, and Jitendra Malik. Rich feature hierarchies for accurate object detection and semantic segmentation. In computer vision and pattern recognition (CVPR), pp. 580–587, 2014.
229
+
230
+ Gabriel Goh, Nick Cammarata, Chelsea Voss, Shan Carter, Michael Petrov, Ludwig Schubert, Alec Radford, and Chris Olah. Multimodal neurons in artificial neural networks. Distill, 2021.
231
+
232
+ Jean-Bastien Grill, Florian Strub, Florent Altche, Corentin Tallec, Pierre H. Richemond, Elena ´ Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, Bilal Piot, Koray Kavukcuoglu, Remi Munos, and Michal Valko. Bootstrap your own ´ latent: A new approach to self-supervised learning, 2020.
233
+
234
+ Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition, 2015.
235
+
236
+ Lisa Anne Hendricks, Zeynep Akata, Marcus Rohrbach, Jeff Donahue, Bernt Schiele, and Trevor Darrell. Generating visual explanations. In European conference on computer vision, pp. 3–19. Springer, 2016.
237
+
238
+ Lisa Anne Hendricks, Ronghang Hu, Trevor Darrell, and Zeynep Akata. Grounding visual explanations. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 264–279, 2018.
239
+
240
+ Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. In ¨ Neural computation, 1997.
241
+
242
+ Matthew Honnibal, Ines Montani, Sofie Van Landeghem, and Adriane Boyd. spaCy: Industrialstrength Natural Language Processing in Python, 2020. URL https://doi.org/10.5281/ zenodo.1212303.
243
+
244
+ Paul Jaccard. The distribution of the flora in the alpine zone. New Phytologist, 11(2):37–50, 1912.
245
+
246
+ Andrej Karpathy, Justin Johnson, and Li Fei-Fei. Visualizing and understanding recurrent networks. arXiv preprint arXiv:1506.02078, 2015.
247
+
248
+ Been Kim, Martin Wattenberg, Justin Gilmer, Carrie Cai, James Wexler, Fernanda Viegas, et al. Interpretability beyond feature attribution: Quantitative testing with concept activation vectors (tcav). In International conference on machine learning (ICML), 2018.
249
+
250
+ Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems (NeurIPS), 2012.
251
+
252
+ Iro Laina, Ruth C. Fong, and Andrea Vedaldi. Quantifying learnability and describability of visual concepts emerging in representation learning. Advances in Neural Information Processing Systems, 2020-December, 2020. ISSN 1049-5258. Funding Information: We would like to thank Yuki Asano and Christian Rupprecht for helpful discussions and for their feedback on this work. We are also grateful for the EPSRC programme grant Seebibyte EP/M013774/1 (I.L.), ERC starting grant IDIU 638009 (I.L), and Open Philanthropy Project (R.F.). Publisher Copyright: $©$ 2020 Neural information processing systems foundation. All rights reserved.; 34th Conference on Neural Information Processing Systems, NeurIPS 2020 ; Conference date: 06-12-2020 Through 12- 12-2020.
253
+
254
+ Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollar, and C. Lawrence Zitnick. Microsoft coco: Common objects in context. In David Fleet, ´ Tomas Pajdla, Bernt Schiele, and Tinne Tuytelaars (eds.), Computer Vision – ECCV 2014, pp. 740–755, Cham, 2014. Springer International Publishing. ISBN 978-3-319-10602-1.
255
+
256
+ Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In ICLR, 2019.
257
+
258
+ Aravindh Mahendran and Andrea Vedaldi. Understanding deep image representations by inverting them. In computer vision and pattern recognition (CVPR), 2015.
259
+
260
+ Margaret Mitchell, Simone Wu, Andrew Zaldivar, Parker Barnes, Lucy Vasserman, Ben Hutchinson, Elena Spitzer, Inioluwa Deborah Raji, and Timnit Gebru. Model cards for model reporting. In Proceedings of the conference on fairness, accountability, and transparency, pp. 220–229, 2019.
261
+
262
+ Ari S Morcos, David GT Barrett, Neil C Rabinowitz, and Matthew Botvinick. On the importance of single directions for generalization. In International Conference on Learning Representations (ICLR), 2018.
263
+
264
+ Jesse Mu and Jacob Andreas. Compositional explanations of neurons. In Advances in Neural Information Processing Systems, 2020.
265
+
266
+ Sharan Narang, Colin Raffel, Katherine Lee, Adam Roberts, Noah Fiedel, and Karishma Malkan. WT5?! Training text-to-text models to explain their predictions. arXiv preprint arXiv:2004.14546, 2020.
267
+
268
+ Chris Olah, Alexander Mordvintsev, and Ludwig Schubert. Feature visualization. In Distill, 2017.
269
+
270
+ Chris Olah, Arvind Satyanarayan, Ian Johnson, Shan Carter, Ludwig Schubert, Katherine Ye, and Alexander Mordvintsev. The building blocks of interpretability. In Distill, 2018.
271
+
272
+ Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th annual meeting of the Association for Computational Linguistics, pp. 311–318, 2002.
273
+
274
+ Dong Huk Park, Lisa Anne Hendricks, Zeynep Akata, Anna Rohrbach, Bernt Schiele, Trevor Darrell, and Marcus Rohrbach. Multimodal explanations: Justifying decisions and pointing to the evidence. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 8779–8788, 2018.
275
+
276
+ Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, highperformance deep learning library. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alche-´ Buc, E. Fox, and R. Garnett (eds.), Advances in Neural Information Processing Systems 32, pp. 8024–8035. Curran Associates, Inc., 2019. URL http://papers.neurips.cc/paper/ 9015-pytorch-an-imperative-style-high-performance-deep-learning-library.pdf.
277
+
278
+ Kristina Preuer, Gunter Klambauer, Friedrich Rippmann, Sepp Hochreiter, and Thomas Unterthiner. ¨ Interpretable deep learning in drug discovery. In Explainable AI: Interpreting, Explaining and Visualizing Deep Learning, pp. 331–345. Springer, 2019.
279
+
280
+ Alec Radford, Rafal Jozefowicz, and Ilya Sutskever. Learning to generate reviews and discovering sentiment. arXiv preprint arXiv:1704.01444, 2017.
281
+
282
+ Nazneen Fatema Rajani, Bryan McCann, Caiming Xiong, and Richard Socher. Explain yourself! leveraging language models for commonsense reasoning. arXiv preprint arXiv:1906.02361, 2019.
283
+
284
+ Cyrus Rashtchian, Peter Young, Micah Hodosh, and Julia Hockenmaier. Collecting image annotations using amazon’s mechanical turk. In Proceedings of the NAACL HLT 2010 Workshop on Creating Speech and Language Data with Amazon’s Mechanical Turk, pp. 139–147, 2010.
285
+
286
+ Sarah Schwettmann, Evan Hernandez, David Bau, Samuel Klein, Jacob Andreas, and Antonio Torralba. Toward a visual concept vocabulary for gan latent space. International Conference on Computer Vision, 2021.
287
+
288
+ Piyush Sharma, Nan Ding, Sebastian Goodman, and Radu Soricut. Conceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In Proceedings of ACL, 2018.
289
+
290
+ Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In International Conference on Learning Representations (ICLR), 2015.
291
+
292
+ Amos Storkey. When training and test sets are different: characterizing learning transfer. Dataset shift in machine learning, 30:3–28, 2009.
293
+
294
+ Jennifer Wortman Vaughan and Hanna Wallach. A human-centered agenda for intelligible machine learning. Machines We Trust: Getting Along with Artificial Intelligence, 2020.
295
+
296
+ Zeyu Wang, Berthy Feng, Karthik Narasimhan, and Olga Russakovsky. Towards unique and informative captioning of images. In European Conference on Computer Vision (ECCV), 2020.
297
+
298
+ Kai Xiao, Logan Engstrom, Andrew Ilyas, and Aleksander Madry. Noise or signal: The role of image backgrounds in object recognition. arXiv preprint arXiv:2006.09994, 2020.
299
+
300
+ Kelvin Xu, Jimmy Lei Ba, Ryan Kiros, Kyunghyun Cho, Aaron Courville, Ruslan Salakhutdinov, Richard S. Zemel, and Yoshua Bengio. Show, attend and tell: Neural image caption generation with visual attention. In Proceedings of the 32nd International Conference on International Conference on Machine Learning - Volume 37, ICML’15, pp. 2048–2057. JMLR.org, 2015.
301
+
302
+ Kaiyu Yang, Jacqueline Yau, Li Fei-Fei, Jia Deng, and Olga Russakovsky. A study of face obfuscation in imagenet. arXiv preprint arXiv:2103.06191, 2021.
303
+
304
+ Omar Zaidan and Jason Eisner. Modeling annotators: A generative approach to learning from annotator rationales. In Proceedings of the 2008 conference on Empirical methods in natural language processing, pp. 31–40, 2008.
305
+
306
+ Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks. ECCV, 2014.
307
+
308
+ Rowan Zellers, Yonatan Bisk, Ali Farhadi, and Yejin Choi. From recognition to cognition: Visual commonsense reasoning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6720–6731, 2019.
309
+
310
+ ![](images/1624f1a681f4906c5d67e118f70e599f7dbd9eb9b16a6ce4b905d743ca7b7c99.jpg)
311
+ Figure 9: Screenshots of the Amazon Mechanical Turk forms we used to collect the CaNCAn dataset. (a) The qualification test. Workers are asked to pick the best description for two hand-chosen neurons from a model not included in our corpus. (b) The annotation form. Workers are shown the top-15 highest-activating images for a neuron and asked to describe what is common to them in one sentence.
312
+
313
+ Tianyi Zhang, Varsha Kishore, Felix Wu, Kilian Q. Weinberger, and Yoav Artzi. Bertscore: Evaluating text generation with bert. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=SkeHuCVFDr.
314
+
315
+ Bolei Zhou, Agata Lapedriza, Aditya Khosla, Aude Oliva, and Antonio Torralba. Places: A 10 million image database for scene recognition. IEEE transactions on pattern analysis and machine intelligence, 2017.
316
+
317
+ Bolei Zhou, Hang Zhao, Xavier Puig, Tete Xiao, Sanja Fidler, Adela Barriuso, and Antonio Torralba. Semantic understanding of scenes through the ade20k dataset. International Journal of Computer Vision, 127(3):302–321, 2019.
318
+
319
+ # A MILANNOTATIONS
320
+
321
+ We recruited annotators from Amazon Mechanical Turk to describe one neuron at a time given its top-activating images. A screenshot of the template is shown in Figure 9b. Participants were given the instructions:
322
+
323
+ Instructions: In one sentence, summarize everything shown inside the highlighted regions in the images. They might all show the same thing, or they might show several different things.
324
+ In your answer, DO NOT mention that you are describing highlighted regions in images.
325
+
326
+ Workers were given up to an hour to complete each annotation, but early trials revealed they required about 30 seconds per HIT. We paid workers $\$ 0.08$ per annotation, which at $\$ 9.60$ per hour exceeds the United States federal minimum wage.
327
+
328
+ ![](images/90ada5a5ad16bd5d7126e77a70a0c8408176f3a163915ed33d52e2a1ceca404c.jpg)
329
+ Figure 10: Example human annotations for neuron exemplars in MILANNOTATIONS, which contains annotations for neurons in seven networks. Each set of images is annotated by three distinct human participants.
330
+
331
+ To control for quality, we required workers to pass a short qualification test in which they had to choose the most descriptive caption for two manually chosen neurons from VGG-16 (Simonyan & Zisserman, 2015) trained on ImageNet (not included as part of MILANNOTATIONS). A screenshot of this test is shown in Figure 9a.
332
+
333
+ Table 4 shows the inter-annotator agreement of neuron annotations for each model, and Table 5 shows some corpus statistics broken down by model and layer. Layers closest to the image (early layers in CNNs and later layers in GANs) are generally described with more adjectives than other layers, while annotations for layers farther from the image include more nouns, perhaps highlighting the low-level perceptual role of the former and the scene- and objectcentric behavior of the latter. Layers farther from the image tend to have longer descriptions (e.g. in BigGAN-ImageNet, AlexNet
334
+
335
+ <table><tr><td>Model</td><td>Dataset</td><td>IAA</td></tr><tr><td>AlexNet</td><td>ImageNet</td><td>.25</td></tr><tr><td></td><td>Places365</td><td>.27</td></tr><tr><td>ResNet152</td><td>ImageNet</td><td>.21</td></tr><tr><td></td><td>Places365</td><td>.17</td></tr><tr><td>BigGAN</td><td>ImageNet</td><td>.26</td></tr><tr><td></td><td>Places365</td><td>.24</td></tr><tr><td>DINO</td><td>ImageNet</td><td>.23</td></tr></table>
336
+
337
+ Table 4: Average inter-annotator agreement among human annotations, measured in BERTScore. Some models have clearer neuron exemplars than others.
338
+
339
+ ImageNet), but this trend is not consistent across all models (e.g. in models trained on Places365, the middle layers have the longest average caption length).
340
+
341
+ # B MILAN IMPLEMENTATION DETAILS
342
+
343
+ # B.1 IMPLEMENTING $p ( d \mid E )$
344
+
345
+ We build on the Show, Attend, and Tell (SAT) model for describing images (Xu et al., 2015). SAT is designed for describing the high-level content of a single images, so we must make several modifications to support our use case, where our goal is to describe sets of regions in images.
346
+
347
+ Table 5: Corpus statistics for MILANNOTATIONS descriptions broken down by model and layer. The # Words column reports the number of unique words used across all layer annotations, the Len. column reports the average number of words in each caption for that layer, and the $\%$ columns report the percentage of all words across all captions for that layer that are a specific part of speech.
348
+
349
+ <table><tr><td>Model</td><td>Layer</td><td>#Units</td><td>#Words</td><td>Len.</td><td>% Noun</td><td>% Adj</td><td>% Prep</td></tr><tr><td>AlexNet-ImageNet</td><td>conv1</td><td>64</td><td>185</td><td>4.8</td><td>37.5</td><td>24.3</td><td>12.2</td></tr><tr><td></td><td>conv2</td><td>192</td><td>384</td><td>5.5</td><td>37.8</td><td>19.4</td><td>13.2</td></tr><tr><td></td><td>conv3</td><td>384</td><td>661</td><td>5.3</td><td>41.0</td><td>16.4</td><td>13.0</td></tr><tr><td></td><td>conv4</td><td>256</td><td>608</td><td>5.5</td><td>43.1</td><td>11.9</td><td>12.5</td></tr><tr><td></td><td>conv5</td><td>256</td><td>693</td><td>5.5</td><td>46.0</td><td>10.2</td><td>10.4</td></tr><tr><td>AlexNet-Places365</td><td>conv1</td><td>96</td><td>153</td><td>4.3</td><td>38.4</td><td>26.8</td><td>12.7</td></tr><tr><td></td><td>conv2</td><td>256</td><td>297</td><td>4.8</td><td>37.8</td><td>26.0</td><td>12.7</td></tr><tr><td></td><td>conv3</td><td>384</td><td>412</td><td>4.7</td><td>40.2</td><td>24.8</td><td>10.5</td></tr><tr><td></td><td>conv4</td><td>384</td><td>483</td><td>4.4</td><td>43.7</td><td>19.9</td><td>10.3</td></tr><tr><td></td><td>conv5</td><td>256</td><td>486</td><td>4.1</td><td>45.8</td><td>17.6</td><td>10.6</td></tr><tr><td>ResNet152-ImageNet</td><td>conv1</td><td>64</td><td>285</td><td>4.7</td><td>43.8</td><td>11.8</td><td>10.3</td></tr><tr><td></td><td>layer1</td><td>256</td><td>653</td><td>5.5</td><td>43.1</td><td>10.5</td><td>12.5</td></tr><tr><td></td><td>layer2</td><td>512</td><td>936</td><td>5.1</td><td>44.0</td><td>12.7</td><td>12.6</td></tr><tr><td></td><td>layer3</td><td>1024</td><td>1222</td><td>4.2</td><td>49.6</td><td>10.9</td><td>11.3</td></tr><tr><td></td><td>layer4</td><td>2048</td><td>1728</td><td>4.6</td><td>47.8</td><td>8.6</td><td>7.8</td></tr><tr><td>ResNet152-Places365</td><td>conv1</td><td>64</td><td>283</td><td>5.2</td><td>47.3</td><td>11.1</td><td>14.6</td></tr><tr><td></td><td>layer1</td><td>256</td><td>633</td><td>5.3</td><td>46.3</td><td>9.4</td><td>13.3</td></tr><tr><td></td><td>layer2</td><td>512</td><td>986</td><td>5.8</td><td>46.0</td><td>8.3</td><td>13.8</td></tr><tr><td></td><td>layer3</td><td>1024</td><td>1389</td><td>4.8</td><td>48.2</td><td>6.7</td><td>12.7</td></tr><tr><td></td><td>layer4</td><td>2048</td><td>1970</td><td>5.3</td><td>46.3</td><td>5.5</td><td>11.9</td></tr><tr><td>BigGAN-ImageNet</td><td>layer0</td><td>1536</td><td>1147</td><td>3.9</td><td>52.4</td><td>7.8</td><td>8.2</td></tr><tr><td></td><td>layer1</td><td>768</td><td>853</td><td>3.5</td><td>53.0</td><td>9.4</td><td>8.9</td></tr><tr><td></td><td>layer2</td><td>768</td><td>618</td><td>3.2</td><td>52.6</td><td>12.3</td><td>9.5</td></tr><tr><td></td><td>layer3</td><td>384</td><td>495</td><td>3.7</td><td>49.9</td><td>14.3</td><td>10.9</td></tr><tr><td></td><td>layer4</td><td>192</td><td>269</td><td>3.3</td><td>47.9</td><td>18.0</td><td>13.4</td></tr><tr><td></td><td>layer5</td><td>96</td><td>69</td><td>2.6</td><td>53.6</td><td>22.8</td><td>14.6</td></tr><tr><td>BigGAN-Places365</td><td>layer0</td><td>2048</td><td>1062</td><td>4.2</td><td>53.3</td><td>5.4</td><td>8.3</td></tr><tr><td></td><td>layer1</td><td>1024</td><td>708</td><td>3.9</td><td>55.0</td><td>6.1</td><td>11.5</td></tr><tr><td></td><td>layer2</td><td>1024</td><td>410</td><td>4.6</td><td>52.7</td><td>8.1</td><td>16.3</td></tr><tr><td></td><td>layer3</td><td>512</td><td>273</td><td>5.2</td><td>50.4</td><td>7.6</td><td>15.0</td></tr><tr><td></td><td>layer4</td><td>256</td><td>192</td><td>4.6</td><td>47.5</td><td>9.3</td><td>14.9</td></tr><tr><td></td><td>layer5</td><td>128</td><td>123</td><td>4.2</td><td>46.7</td><td>13.5</td><td>13.0</td></tr><tr><td>DINO-ImageNet</td><td>layer0</td><td>100</td><td>320</td><td>4.4</td><td>45.7</td><td>12.7</td><td>4.8</td></tr><tr><td></td><td>layer1</td><td>100</td><td>321</td><td>4.2</td><td>49.8</td><td>9.1</td><td>6.8</td></tr><tr><td></td><td>layer2</td><td>100</td><td>285</td><td>3.9</td><td>53.3</td><td>6.2</td><td>7.5</td></tr><tr><td></td><td>layer3</td><td>100</td><td>312</td><td>3.9</td><td>54.4</td><td>6.2</td><td>7.1</td></tr><tr><td></td><td>layer4</td><td>100</td><td>304</td><td>3.9</td><td>53.5</td><td>4.4</td><td>7.0</td></tr><tr><td></td><td>layer5</td><td>100</td><td>287</td><td>3.5</td><td>55.1</td><td>5.5</td><td>5.2</td></tr><tr><td></td><td>layer6</td><td>100</td><td>377</td><td>3.9</td><td>51.3</td><td>8.2</td><td>5.4</td></tr><tr><td></td><td>layer7</td><td>100</td><td>374</td><td>3.8</td><td>52.0</td><td>6.4</td><td>6.2</td></tr><tr><td></td><td>layer8</td><td>100</td><td>330</td><td>3.4</td><td>53.0</td><td>7.0</td><td>8.8</td></tr><tr><td></td><td>layer9</td><td>100</td><td>350</td><td>3.1</td><td>56.1</td><td>6.3</td><td>9.6</td></tr><tr><td></td><td>layer10</td><td>100</td><td>369</td><td>3.9</td><td>50.3</td><td>9.3</td><td>8.2</td></tr><tr><td></td><td>layer11</td><td>100</td><td>294</td><td>3.3</td><td>52.4</td><td>7.5</td><td>9.4</td></tr><tr><td>Total</td><td></td><td>20272</td><td>4597</td><td>4.5</td><td>48.7</td><td>9.4</td><td>10.9</td></tr></table>
350
+
351
+ ![](images/09c9b7e6284d4598652ed4faa1688281463226aaa0a3a687d6089d8fc01027d1.jpg)
352
+ Figure 11: Neuron captioning model. Given the set of top-activating images for a neuron and masks for the regions of greatest activation, we extract features maps from each convolutional layer of a pretrained image classifier. We then downsample the masks and use them to pool the features before concatenating them into a single feature vector per image. These feature vectors are used as input to the decoder attention mechanism.
353
+
354
+ In the original SAT architecture, a single input image $x$ is first converted to visual features by passing it through an encoder network $g$ , typically an image classifier pretrained on a large dataset. The output of the last convolutional layer is extracted as a matrix of visual features:
355
+
356
+ $$
357
+ v = [ v _ { 1 } ; v _ { 2 } ; \ldots ; v _ { k } ]
358
+ $$
359
+
360
+ These visual features are passed to a decoder LSTM whose hidden state is initialized as a function of the mean of the visual features $\overline { { v } } = 1 / k \textstyle \sum _ { i } v _ { i }$ . At each time step, the decoder attends over the features using an additive attention mechanism (Bahdanau et al., 2015), then consumes the attenuated visual features and previous token as input to predict the next token.
361
+
362
+ The SAT architecture makes few assumptions about the structure of the visual features. We will take advantage of this generality and modify how $v$ is constructed to support our task, leaving the decoder architecture intact.
363
+
364
+ Now, instead of a single image $x$ , the model inputs are the $k$ top-activating images $x _ { j }$ for a neuron as well as a mask $m _ { j }$ for each image that highlights the regions of greatest activation. Our task is to describe what the neuron is detecting, based strictly on the highlighted regions of the $x _ { j }$ . In support of this, the visual features must (1) include information about all $k$ images, (2) encode multiple resolutions of the images to capture both low-level perceptual and high-level scene details about the image, and (3) pay most (but not exclusive) attention to the regions of greatest activation in the image.
365
+
366
+ Describing sets of images The $k$ features in SAT correspond to different spatial localities of a single image. In our architecture, each feature $v _ { j }$ corresponds to one input image $x _ { j }$ .
367
+
368
+ Encoding multiple resolutions Instead of encoding the image with just the last convolutional layer of $g$ , we use pooled convolutional features from every layer. Formally, let $g _ { \ell } ( x )$ denote the output of layer $\ell$ in the pretrained image encoder with $L$ layers, and let pool denote a pooling function that uses the mask to pool the features (described further below). The feature vector for the $j$ th image $x _ { j }$ is:
369
+
370
+ $$
371
+ v _ { j } = \left[ \mathsf { p o o l } ( m _ { j } , g _ { 1 } ( x _ { j } ) ) ; \ldots ; \mathsf { p o o l } ( m _ { i } , g _ { L } ( x _ { j } ) ) \right]
372
+ $$
373
+
374
+ Highlighting regions of greatest activation Each of the top-activating images $x _ { j }$ that we hand to our model comes with a mask $m _ { j }$ highlighting the image regions of greatest activation. We incorporate these masks into the pooling function pool from above. Specifically, we first downsample the mask $m _ { j }$ to the same spatial shape as $g _ { \ell } ( x _ { j } )$ using bilinear interpolation, which we denote upsample $( m _ { j } )$ . We then apply the mask to each channel $c$ at layer $\ell$ , written $g _ { \ell , c } ( x _ { j } )$ , via elementwise multiplication $( \odot )$ with upsample $( m _ { j } )$ . Finally, we sum spatially along each channel, resulting in a length $c$ vector. Formally:
375
+
376
+ $$
377
+ \mathsf { p o o l } _ { c } ( g _ { \ell } ( x _ { j } ) ) = \mathbb { 1 } ^ { \top } \mathsf { v e c } ( \mathsf { u p s a m p l e } ( m _ { j } ) \odot g _ { \ell , c } ( x _ { j } ) )
378
+ $$
379
+
380
+ Each $v _ { i }$ is thus a length $\textstyle \sum _ { \ell } C _ { \ell }$ vector, where $C _ { \ell }$ is the number of channels at layer $\ell$ of $g$
381
+
382
+ Table 6: Statistics for MILAN-generated descriptions on the held-out neurons from the generalization experiments of Section 4. Columns are the same as in Table 5.
383
+
384
+ <table><tr><td>Gen.</td><td colspan="2">Train + Test</td><td># Units</td><td>#Words</td><td>Len.</td><td>% Noun</td><td>% Adj</td><td>%Prep</td></tr><tr><td>within netwok</td><td colspan="2">AlexNet-ImageNet</td><td>115</td><td>100</td><td>3.5</td><td>45.7</td><td>16.4</td><td>11.9</td></tr><tr><td></td><td colspan="2">AlexNet-Places</td><td>137</td><td>46</td><td>2.5</td><td>49.3</td><td>28.7</td><td>9.6</td></tr><tr><td></td><td colspan="2">ResNet-ImageNet</td><td>390</td><td>121</td><td>2.8</td><td>52.2</td><td>23.8</td><td>11.7</td></tr><tr><td></td><td colspan="2">ResNet-Places</td><td>390</td><td>376</td><td>4.3</td><td>46.5</td><td>8.7</td><td>10.9</td></tr><tr><td></td><td colspan="2">BigGAN-ImageNet</td><td>374</td><td>112</td><td>2.2</td><td>59.8</td><td>17.5</td><td>10.4</td></tr><tr><td></td><td colspan="2">BigGAN-Places</td><td>499</td><td>245</td><td>3.8</td><td>54.2</td><td>6.0</td><td>9.0</td></tr><tr><td></td><td>Train</td><td>Test</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>across arch.</td><td>AlexNet</td><td>ResNet</td><td>7808</td><td>326</td><td>3.0</td><td>46.1</td><td>21.0</td><td>8.9</td></tr><tr><td></td><td>ResNet</td><td>AlexNet</td><td>2528</td><td>275</td><td>2.7</td><td>48.0</td><td>27.1</td><td>6.4</td></tr><tr><td></td><td>CNNs</td><td>ViT</td><td>1200</td><td>200</td><td>2.6</td><td>55.0</td><td>18.2</td><td>13.0</td></tr><tr><td>across dataset</td><td>ImageNet</td><td>Places</td><td>10272</td><td>271</td><td>2.2</td><td>58.8</td><td>14.0</td><td>13.8</td></tr><tr><td></td><td>Places</td><td>ImageNet</td><td>8800</td><td>309</td><td>3.1</td><td>47.8</td><td>26.9</td><td>7.8</td></tr><tr><td>across task</td><td>Classifiers</td><td>BigGAN</td><td>8736</td><td>202</td><td>2.1</td><td>53.0</td><td>25.3</td><td>6.1</td></tr><tr><td></td><td>BigGAN</td><td>Classifiers</td><td>10336</td><td>336</td><td>3.2</td><td>54.3</td><td>14.2</td><td>16.8</td></tr><tr><td>Total</td><td></td><td></td><td>51585</td><td>1002</td><td>2.7</td><td>51.9</td><td>19.8</td><td>11.1</td></tr></table>
385
+
386
+ Throughout our experiments, $g$ is a ResNet101 pretrained for image classification on ImageNet, provided by PyTorch Paszke et al. (2019). We extract visual features from the first convolutional layer and all four residual layers. We do not fine tune any parameters in the encoder. The decoder is a single LSTM cell with an input embedding size of 128 and a hidden size of 512. The attention mechanism linearly maps the current hidden state and all visual feature vectors to size 512 vectors before computing attention weights. We always decode for a maximum of 15 steps. The rest of the decoder is exactly the same as in $\mathrm { X u }$ et al. (2015).
387
+
388
+ The model is trained to minimize cross entropy on the training set using the AdamW optimizer Loshchilov & Hutter (2019) with a learning rate of 1e-3 and minibatches of size 64. We include the double stochasticity regularization term used by Xu et al. (2015) with $\lambda = 1$ . We also apply dropout $\left( p = . 5 \right)$ to the hidden state before predicting the next word. Across configurations, $10 \%$ of the training data is held out and used as a validation set, and training stops when the model’s BLEU score (Papineni et al., 2002) does not improve on this set for 4 epochs, up to a maximum of 100 epochs.
389
+
390
+ # B.2 IMPLEMENTING $p ( d )$
391
+
392
+ We implement $p ( d )$ using a two-layer LSTM language model (Hochreiter & Schmidhuber, 1997). We use an input embedding size of 128 with a hidden state size and cell size of 512. We apply dropout to non-recurrent connections $( p = . 5 )$ during training and hold out $10 \%$ of the training dataset as a validation set and following the same early stopping procedure as in Appendix B.1, except we stop on validation loss instead of BLEU.
393
+
394
+ # C GENERALIZATION EXPERIMENT DETAILS
395
+
396
+ In each experiment, MILAN is trained with the hyperparameters described in Appendix B and Section 3.4, with the sole exception being the within-network splits—for these, we increase the early stopping criterion to require 10 epochs of no improvement to account for the training instability caused by the small training set size.
397
+
398
+ To obtain NetDissect labels, we obtain image exemplars with the same settings as we do for MILAN, and we obtain segmentations using the full segmentation vocabulary minus the textures.
399
+
400
+ To obtain Compositional Explanations labels, we search for up to length 3 formulas (comprised of not, and, and or operators) with a beam size of 5 and no length penalty. Image region exemplars and corresponding segmentations come from the ADE20k dataset (Zhou et al., 2019).
401
+
402
+ Finally, Table 6 shows statistics for MILAN descriptions generated on the held out sets from each generalization experiment. Compared to human annotators (Table 5), MILAN descriptions are on
403
+
404
+ # MILAN examples
405
+
406
+ ResNet-ImageNet layer3-982
407
+
408
+ AlexNet-Places conv5-144
409
+
410
+ BigGAN-ImageNet layer2-100
411
+
412
+ ![](images/74c5535355dffbbbf875e9ee25544fe3fb4da953c265b34574cccdaab62efa03.jpg)
413
+
414
+ Human: curvatures of different objects MILAN: The edges of objects
415
+
416
+ ![](images/a5a24d8335d7d23f8f8f879340021e34637ba7b0fe382b29bca90985b9c1a939.jpg)
417
+
418
+ Human: horizontal lines MILAN: Diagonal lines
419
+
420
+ ![](images/e6e6be257a66f2843c47093794fae723ab7517142b94e865e10e421028a64ca5.jpg)
421
+
422
+ Human: noses MILAN: Dog noses
423
+
424
+ ResNet-ImageNet layer3-298
425
+
426
+ ![](images/c995e63658d8558480110d85f9b7aad4dc47011eecaf0271f0b74775c33e4048.jpg)
427
+
428
+ Human: areas that look like keys on a keyboard MILAN: Number pads
429
+
430
+ # AlexNet-Places conv3-196
431
+
432
+ ![](images/266c6ecdcfdbabc9f1acde60d51d9a3e187d998801797e2bf5f56c1d53f72f36.jpg)
433
+
434
+ Human: surfaces that show a pattern
435
+ composed of lines
436
+ MILAN: Grates
437
+
438
+ ![](images/d9ff0446fe63cc1673189480a09d557f6a039e69ffc35a4cbf45bafc19a4754a.jpg)
439
+ BigGAN-Places layer0-1415
440
+
441
+ Human: surfaces MILAN: The ground
442
+
443
+ ResNet-ImageNet conv1-27
444
+
445
+ ![](images/1f6ea8183a09980debcb37e0aa4872395c0effa206a90d906b6bf9810b712d3a.jpg)
446
+
447
+ Human: blue areas in pictures MILAN: Blue lines
448
+
449
+ AlexNet-Places conv4-207
450
+
451
+ ![](images/2524b9a88a800836ad5843965d2791be8868dd4582f38816ac91a451631f1b3a.jpg)
452
+
453
+ Human: heads and balloons MILAN: Faces of things
454
+
455
+ BigGAN-ImageNet layer0-1411
456
+
457
+ ![](images/810d4a45e906f075dbfea158751d28b7149883add0d3a25d5e82e58332e114ae.jpg)
458
+
459
+ Human: fruit, insects,food MILAN: Food
460
+
461
+ AlexNet ImageNet conv2-91
462
+
463
+ ![](images/b5a4edb2e0bcede5ad3c0badb204bc9359bfa8ab533258457565359a25395082.jpg)
464
+
465
+ Human: red colored objects MILAN: Orange and red objects
466
+
467
+ ![](images/8af575b4394c16357dccf5428c8753a280340ec2aad1375808f93effadee61fe.jpg)
468
+ AlexNet-ImageNet conv5-119
469
+
470
+ Human: green animals and plants MILAN: Grass
471
+
472
+ DINO-ImageNet layer9-52
473
+
474
+ ![](images/b48187a58d3ab6cc49c4f2197753447f8d55e8120aadee9d51d710c3bac12022.jpg)
475
+
476
+ Human: hands of a person MILAN: Human hands
477
+
478
+ AlexNet-Places conv4-188
479
+
480
+ ![](images/e833fdaf2a8cedb7a066b717a1987d4677b6bfb5a1b4f44b7bd2644af52b9993.jpg)
481
+
482
+ Human: windows and screens MILAN: Signs and screens
483
+
484
+ ![](images/db599fde3ac301e0b6343e57ece5291ea7d396711165ac496a77720e302091a9.jpg)
485
+ AlexNet-ImageNet conv2-126
486
+
487
+ Human: red-orange text and objects MILAN: Red colored object with text
488
+
489
+ ![](images/d755731b79d5321b33581d0762ba0dd5e9028830de547150ae5e42cfba0ef672.jpg)
490
+ DINO-ImageNet layer8-18
491
+
492
+ Human: sign or monument,keyboard MILAN: Sewer cover, text on a sign, text on a sign, text on
493
+
494
+ AlexNet-Places conv2-77
495
+
496
+ ![](images/55cad8eab17a404591cc5e0640cdf8a981f66d3487d54d32f9a0bf4c1e73abdd.jpg)
497
+
498
+ Human: picture of white fence beams MILAN: Fencing
499
+
500
+ # AlexNet-ImageNet conv4-5
501
+
502
+ ![](images/21b13b94aa993d88323de3ccda5262111e540ac8dad5d8758672c5a839e47321.jpg)
503
+
504
+ Human: circles and rounded edges of many things and people MILAN: Wheels of an object
505
+
506
+ DINO-ImageNet layerl-25
507
+
508
+ ![](images/ba97b0dfcb9000fbddd7adf87f2e241c2ccf4e5533558ab0bf80c37564249da9.jpg)
509
+ Human: vertical white and blue lines MILAN: Brighter areas in objects
510
+
511
+ Figure 12: Randomly chosen examples of MILAN-generated descriptions from the generalization experiments of Section 4.
512
+
513
+ average shorter (2.7 vs. 4.5 tokens), use fewer unique words (1k vs. 4.6k), and contain adjectives twice as often $9 . 4 \%$ vs. $1 9 . 8 \%$ ). Figure 12 contains additional examples, chosen at random.
514
+
515
+ # D ANALYSIS EXPERIMENT DETAILS
516
+
517
+ We obtain the ResNet18 model pretrained on ImageNet from torchvision (Paszke et al., 2019). We obtain neuron descriptions for the same layers that we annotate in ResNet152 (Section 3.3) using the MILAN hyperparameters described in Section 3.2 and Section 3.4. We obtain part of speech tags, parse trees, and word vectors for each description from spaCy (Honnibal et al., 2020).
518
+
519
+ Figure 13 shows examples of neurons that scored high under each criterion (and consequently were among the first ablated in Fig. 5). Note that these examples include some failure cases of MILAN: for example, in the # verbs example, MILAN incorrectly categorizes all brass instruments as flutes; and in the # adjectives example, the description is disfluent. Nevertheless, these examples confirm our intuitions about the kinds of neurons selected for by each scoring criterion, as described in Section 5.
520
+
521
+ ![](images/4e504bdf87394b0837babb7761492a5e336e18cd46d8b12d411d359e4542c1b2.jpg)
522
+ Figure 13: Examples of ablated neurons for each condition Section 5, chosen from among the first 10 ablated.
523
+
524
+ ![](images/5a743a0cc69a59f20d36a5bbaccf0cb85727ba941a21bd311d51ae9dc73cd2d5.jpg)
525
+ Figure 14: Cut-and-paste adversarial attacks highlighting non-robust behavior by a neuron that scored high on the max-word-diff criterion of Section 5. (a) MILAN finds this neuron automatically because the generated description mentions two or more dissimilar concepts: animals and vehicles. The neuron is directly connected to the final fully-connected output layer, and strongly influences amphibian, hermit crab, and jeep predictions according to the connection weights. (b) To construct adversarial inputs, we pick three images from the ImageNet validation set that do not include concepts detected by the neuron. (c) We then select a different set of images to act as distractors that do include the concepts detected by the neuron. (d) By cutting and pasting the central object from the distractor to the original image, the model is fooled into predicting a class label that is completely unrelated to the pasted object: e.g., it predicts amphibian when the military vehicle is pasted.
526
+
527
+ We hypothesized in Section 5 that neurons scoring high on the max-word-diff criterion correspond to non-robust behavior by the model. Figure 14 provides some evidence for this hypothesis: we construct cut-and-paste adversarial inputs in the style of Mu & Andreas (2020). Specifically, we look at the example max-word-diff neuron shown in Figure 13, crudely copy and paste one of the objects mentioned in its description (e.g., a vehicle-related object like a half track), and show that this can cause the model to predict one of the other concepts in the description (e.g., an animal-related class like amphibian).
528
+
529
+ # E EDITING EXPERIMENT DETAILS
530
+
531
+ Hyperparameters We train a randomly initialized ResNet18 on the spurious training dataset for a maximum of 100 epochs with a learning rate of 1e-4 and a minibatch size of 128. We annotate the same convolutional and residual units we did for ResNet152 in Section 3.3. We stop training when validation loss does not improve for 4 epochs.
532
+
533
+ How many neurons should we remove? In practice, we cannot incrementally test our model on an adversarial set. So how do we decide on the number of neurons to zero? One option is to look solely at validation accuracy. Figure 15 recreates Figure 8 with accuracy on the held out validation set (which is distributed like the training dataset) instead of accuracy on the adversarial test set. The accuracy starts peaks and starts decreasing earlier than in Fig. 8, but if we were to choose the number to be the largest before validation accuracy permanently decreases, we would choose 8 neurons, which would still result in a $3 . 1 \%$ increase in adversarial accuracy.
534
+
535
+ ![](images/8d5fc6edd880056e4cba1fdb2415bd7b9a23fe8a4181d709a45d4d9cfd2e7fd3.jpg)
536
+ Figure 15: Same as Fig. 8, but shows accuracy on the validation dataset, which is distributed identically to the training dataset. Dotted line denotes initial accuracy.
parse/dev/NudBMY-tzDr/NudBMY-tzDr_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/NudBMY-tzDr/NudBMY-tzDr_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/NudBMY-tzDr/NudBMY-tzDr_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/RecZ9nB9Q4/RecZ9nB9Q4.md ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/RecZ9nB9Q4/RecZ9nB9Q4_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/RecZ9nB9Q4/RecZ9nB9Q4_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/RecZ9nB9Q4/RecZ9nB9Q4_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/Uynr3iPhksa/Uynr3iPhksa.md ADDED
@@ -0,0 +1,325 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Recurrent Memory Transformer
2
+
3
+ Aydar Bulatov1 bulatov.as@phystech.edu
4
+
5
+ Yuri Kuratov1,2 yurii.kuratov@phystech.edu
6
+
7
+ Mikhail S. Burtsev1,2 burtcev.ms@mipt.ru
8
+
9
+ 1Neural Networks and Deep Learning Lab, Moscow Institute of Physics and Technology, Dolgoprudny, Russia 2AIRI, Moscow, Russia
10
+
11
+ # Abstract
12
+
13
+ Transformer-based models show their effectiveness across multiple domains and tasks. The self-attention allows to combine information from all sequence elements into context-aware representations. However, global and local information has to be stored mostly in the same element-wise representations. Moreover, the length of an input sequence is limited by quadratic computational complexity of selfattention. In this work, we propose and study a memory-augmented segment-level recurrent Transformer (RMT). Memory allows to store and process local and global information as well as to pass information between segments of the long sequence with the help of recurrence. We implement a memory mechanism with no changes to Transformer model by adding special memory tokens to the input or output sequence. Then the model is trained to control both memory operations and sequence representations processing. Results of experiments show that RMT performs on par with the Transformer-XL on language modeling for smaller memory sizes and outperforms it for tasks that require longer sequence processing. We show that adding memory tokens to $\mathrm { T r } \mathrm { X L }$ is able to improve its performance. This makes Recurrent Memory Transformer a promising architecture for applications that require learning of long-term dependencies and general purpose in memory processing, such as algorithmic tasks and reasoning.
14
+
15
+ # 1 Introduction
16
+
17
+ Transformers (Vaswani et al., 2017) have been widely adopted across multiple domains and tasks (Radford et al., 2018; Dong et al., 2018; Devlin et al., 2019; Dosovitskiy et al., 2021; Ramesh et al., 2021; Jaegle et al., 2021). The key component of Transformer layer is a self-attention. Self-attention allows to update each sequence element representation with information from all other elements in the sequence. As a result, rich contextual representation for every element is generated at the end of encoding. This way, global sequence-level and local information are stored in a single representation. However, this mixing of two types of information in a single representation has limitations. Distributed storage of global features across all sequence elements results in global features "blurring" and makes it harder to access them. Another well-known deficiency of Transformers is poor scaling of self-attention with
18
+
19
+ ![](images/5b9df1c81fd854f8279abcb332ba70e58ce21400652c8e7a7d4881c585f76fed.jpg)
20
+ Figure 1: Recurrent Memory Transformer. Memory is added as tokens to the input sequence and memory output is passed to the next segment. During training gradients flow from the current segment through memory to the previous segment.
21
+
22
+ input sequence length that hurts its applications to long inputs (Child et al., 2019; Guo et al., 2019;
23
+ Dai et al., 2019; Beltagy et al., 2020; Ainslie et al., 2020; Zaheer et al., 2020; Wang et al., 2020;
24
+ Choromanski et al., 2020).
25
+
26
+ Our work introduces a memory-augmented segment-level recurrent Transformer named Recurrent Memory Transformer (RMT). RMT uses a memory mechanism based on special memory tokens (Burtsev et al., 2020) added to the input sequence. Memory tokens provide additional reserved capacity to the model that could be used to process information which is not directly representing any element in the input sequence. To process long sequences, we split them into segments and pass memory states from a previous to a current segment. This memory passing makes the model recurrent and removes the input sequence length limitations. RMT model can theoretically work with infinite lengths but, in practice, it is limited by memory capacity and the efficiency of memory access/update operations. Our implementation of both memory and recurrence in RMT requires no changes to the Transformer model because modifications are made only to the input and output sequences of the model.
27
+
28
+ We tested RMT on the tasks that require global information about the whole input sequence to be solved. We use copy, reverse, and associative retrieval tasks in the setting where the input sequence is split into segments. RMT and Transformer-XL perfectly solve these tasks, but exceeding some value of sequence length, RMT starts to outperform Transformer-XL. Also, we experimentally show that the proposed Recurrent Memory Transformer requires less memory size to perform closely to Transformer-XL on language modeling tasks. RMT code and experiments are available1.
29
+
30
+ # Contributions
31
+
32
+ 1. In this study we augment Transformer with token based memory storage and segment-level recurrence.
33
+
34
+ 2. We experimentally evaluate proposed architecture as well as vanilla Transformer and TransformerXL on memory-intensive tasks such as copy, reverse, associative retrieval, and language modeling. We show that RMT outperforms Transformer-XL for sequence processing tasks and on par with Transformer-XL on language modeling but requires less memory.
35
+
36
+ 3. We show that Tr-XL cache could be combined with RMT leading to better performance on language modeling.
37
+
38
+ 4. We analysed how the Transformer model learns to use memory. Specific interpretable memory read-write patterns of attention are shown.
39
+
40
+ # 2 Related work
41
+
42
+ In our study we add a memory to general purpose attention based neural architecture. Memory is a recurrent topic in neural networks research. It had started from the early works (McCulloch and Pitts, 1943; Stephen, 1956) and significantly progressed in 90’s with introduction of Backpropagation Through Time learning algorithm (Werbos, 1990) and Long-Short Term Memory (LSTM) (Hochreiter and Schmidhuber, 1997) neural architecture. Today memory-augmented neural networks (MANNs) usually rely on some kind of recurrent external-memory which is separate from the model’s parameters. Neural Turing Machines (NTMs) (Graves et al., 2014) and Memory Networks (Weston et al., 2014) are equipped with a storage for vector representations that can be accessed with an attention mechanism. Memory Networks (Weston et al., 2014; Sukhbaatar et al., 2015) were designed to enable reasoning by sequential attention over to the content of a memory. NTMs followed by Differentiable Neural Computer (DNC) (Graves et al., 2016) and Sparse DNC (Rae et al., 2016) are implemented as recurrent neural networks able to write to memory storage over time. All these models are differentiable and can be trained via backpropagation through time (BPTT). Parallel line of research extends recurrent neural networks such as LSTM with data structures like stacks, lists, or queues (Joulin and Mikolov, 2015; Grefenstette et al., 2015). MANN architectures with a more advanced addressing mechanisms such as address-content separation and multi-step addressing were proposed in (Gulcehre et al., 2016, 2017; Meng and Rumshisky, 2018). The Global Context Layer model (Meng and Rumshisky, 2018) uses the idea of address-content separation to solve the difficulty of training content-based addressing in the canonical NTM.
43
+
44
+ The recent rise of Transformer models also resulted in introduction of a number of new memory architectures. Transformer-XL (Dai et al., 2019) introduces a segment-level recurrence at the level of hidden representations. These representations of a sequence are computed and stored in the cache to be reused as an extended context for the next segment. Compressive Transformer (Rae et al., 2019) adds the second layer of memory to Transformer-XL. This memory compresses and stores information from the cache. $\infty$ -former (Martins et al., 2021) utilizes continuous-space attention and represents input sequence as a continuous signal to make long-term memory unbounded. Memory Layers (Lample et al., 2019) model has a product key memory layer instead of a feed-forward layer within Transformer block to increase model capacity.
45
+
46
+ In many variations of Transformer different sorts of global representations are added. Among them are Star-Transformer (Guo et al., 2019), Longformer (Beltagy et al., 2020), GMAT (Gupta and Berant, 2020), Extended Transformer Construction (ETC) (Ainslie et al., 2020) and Big Bird (Zaheer et al., 2020). All these architectures re-design self-attention mechanism to reduce it computational complexity with and ensure input coverage with the help of global representations. Memory Transformer (Burtsev et al., 2020) keeps Transformer model intact and adds memory by extending input sequence with special memory tokens. Perceiver IO (Jaegle et al., 2021) maps an entire arbitrary input to the fixed number of latent representations. Transformer layers do further processing over latent memory representations only.
47
+
48
+ Segment-level recurrence in Transformers is actively explored in a number of studies. TransformerXL, Compressive Transformer keep previous states and re-use them in subsequent segments. ErnieDoc (Ding et al., 2021) improves processing by using same-layer recurrence instead of attending to previous layer outputs of a precedent segment. Memformer (Wu et al., 2020) introduces a dedicated memory module to keep previous hidden states in summarized representations. Memformer uses two special layers added to the Transformer model. Memory cross-attention layer reads from memory and memory slot attention layer updates it. MART (Lei et al., 2020) has a similar approach as Memformer but uses memory update rules analogous to LSTM (Hochreiter and Schmidhuber, 1997) and GRU (Cho et al., 2014). FeedBack Transformer (Fan et al., 2020) goes further with full, and not segment-level, recurrence. FeedBack Memory merges past hidden representations from all layers into a single vector and makes it accessible to the computations at any layer. The disadvantage of full recurrence is that it is less parallelizable. FeedBack Memory requires every sequence element to be processed sequentially. In segment-level recurrent models, all elements of a segment are processed by Transformer layers in parallel. Only segments are processed sequentially. Staircase Transformer (Ju et al., 2021) combines segment-level recurrence and depth recurrence. Staircase models use the output for previous segments and pass them as input for the next segment. Our Recurrent Memory Transformer is based on special memory tokens similar to Memory Transformer, segment-level recurrence as in Transformer-XL, and depth-recurrent mechanism for memory processing similar to Staircase.
49
+
50
+ # 3 Recurrent Memory Transformer
51
+
52
+ Transformer-XL (Dai et al., 2019) extends Transformer model with state re-use cache mechanism for segment-level recurrence and relative position encoding. Input sequence is split on segments processed sequentially. Hidden states computed for the previous segment $M ^ { n }$ are cached for each transformer layer $n$ . The input of the layer $n$ consists of the last $m$ states from the cached memory and output of previous Transformer layer for the current segment $\tau$ :
53
+
54
+ $$
55
+ { \tilde { H } } _ { \tau } ^ { n - 1 } = [ S G ( M _ { - m : } ^ { n - 1 } ) \circ H _ { \tau } ^ { n - 1 } ] ,
56
+ $$
57
+
58
+ here, SG stands for stop-gradient, $\circ$ denotes concatenation. Cached states allow to increase effective context size of Transformer model and save on compute operations.
59
+
60
+ Then, $\tilde { H } _ { \tau } ^ { n - 1 }$ goes to Transformer layer $T L$ to produce layer $n$ outputs for segment $\tau$
61
+
62
+ $$
63
+ H _ { \tau } ^ { n } = T L ( Q _ { \tau } ^ { n } , K _ { \tau } ^ { n } , V _ { \tau } ^ { n } ) , Q _ { \tau } ^ { n } = W _ { q } ^ { n } H _ { \tau } ^ { n - 1 } ; K _ { \tau } ^ { n } = W _ { k } ^ { n } \tilde { H } _ { \tau } ^ { n - 1 } , V _ { \tau } ^ { n } = W _ { v } ^ { n } \tilde { H } _ { \tau } ^ { n - 1 } .
64
+ $$
65
+
66
+ In Transformer-XL, self-attention layers are modified to use relative position encodings to improve generalization to longer attention lengths. The overall architecture is shown in the Figure 2.
67
+
68
+ Memory augmented Transformers such as GMAT, ETC, Memory Transformer (Gupta and Berant, 2020; Ainslie et al., 2020; Burtsev et al., 2020) proposed to use special global tokens as storage for representations. Usually, memory tokens are added to the beginning of the input sequence. However, in decoder-only architectures the causal attention mask makes impossible for memory tokens at the start of the sequence to collect information from the subsequent tokens. On the other hand, if memory tokens are placed at the end of the sequence then preceding tokens unable to access their representations. To solve this problem we add a recurrence to the sequence processing. Representations of memory tokens placed at the end of the segment are used as an input memory representations at the start as well as at the end of the next segment.
69
+
70
+ ![](images/17080de9e4443b5cebab052d987ec2f81f981be8bb570aa5a1a47807ec3a715b.jpg)
71
+ Figure 2: Comparison of Recurrent Memory Transformer (RMT) and Transformer-XL architectures. Recurrent Memory Transformer augments Transformer with global memory tokens and passes them to allow a segment-level recurrence. Special read/write memory tokens are added to the input sequence. Multiple memory tokens can be used in each read/write block. Updated representations of write memory are passed to the next segment. During training, RMT uses BPTT to propagate gradient to previous segments through memory tokens representation. Effective context length for recurrence with memory is not limited by the depth of a network which is the case for the cache of Transformer-XL.
72
+
73
+ In the Recurrent Memory Transformer input is augmented with special [mem] tokens, processed in a standard way along with the sequence of tokens. Each memory token is a real-valued vector. $m$ memory tokens are added at the beginning of the segment tokens representations $H _ { \tau } ^ { 0 }$ and the same $m$ tokens are added at the end:
74
+
75
+ $$
76
+ \tilde { H } _ { \tau } ^ { 0 } = [ H _ { \tau } ^ { m e m } \circ H _ { \tau } ^ { 0 } \circ H _ { \tau } ^ { m e m } ] , \bar { H } _ { \tau } ^ { N } = \mathrm { T r a n s f o r m e r } ( \tilde { H } _ { \tau } ^ { 0 } ) , [ H _ { \tau } ^ { r e a d } \circ H _ { \tau } ^ { N } \circ H _ { \tau } ^ { w r i t e } ] : = \bar { H } _ { \tau } ^ { N } ,
77
+ $$
78
+
79
+ here $N$ is a number of Transformer layers.
80
+
81
+ The starting group of memory tokens functions as a read memory that allows sequence tokens to attend to memory states produced at the previous segment. The ending group works as a write memory that can attend to all current segment tokens and update representation stored in the memory. As a result, $H _ { \tau } ^ { w r i t e }$ contains updated memory tokens for the segment $\tau$ .
82
+
83
+ Segments of the input sequence are processed sequentially. To enable recurrent connection between segments, we pass outputs of the memory tokens from the current segment to the input of the next segment:
84
+
85
+ $$
86
+ H _ { \tau + 1 } ^ { m e m } : = H _ { \tau } ^ { w r i t e } , \tilde { H } _ { \tau + 1 } ^ { 0 } = [ H _ { \tau + 1 } ^ { m e m } \circ H _ { \tau + 1 } ^ { 0 } \circ H _ { \tau + 1 } ^ { m e m } ] .
87
+ $$
88
+
89
+ Both memory and recurrence in the RMT are based only on global memory tokens. It allows to keep the backbone Transformer unchanged and make RMT memory augmentation compatible with any model from the Transformer family. Memory tokens operate only on the input and output of the model. In this study we implement RMT on top of the original Transformer-XL code. Both architectures are shown in Figure 2.
90
+
91
+ Recurrence in the RMT is different compared to the Transformer-XL because the former stores only $m$ memory vectors per segment. On the other hand, the Transformer-XL stores $m \times N$ vectors per segment. Also, in the RMT model memory representations from the previous segment are processed by Transformer layers together with the current segment tokens. This makes memory part of RMT effectively deeper in a number of applied Transformer layers $\tau \times N$ . Additionally, we allow all memory tokens in the read/write block to access all other tokens in the same block. The causal attention mask is applied only to tokens of the input sequence (Figure 6(d)).
92
+
93
+ We train the RMT with Backpropagation Through Time (BPTT). During backward pass, unlike in Transformer-XL, memory gradients are not stopped between segments. The number of previous segments to backpropagate is a hyperparameter of a training procedure. We vary BPTT unroll in our experiments from 0 to 4 previous segments. Increasing this parameter is computationally expensive and requires a lot of GPU RAM. However, techniques such as gradient checkpointing could be used to alleviate this problem.
94
+
95
+ # 4 Experiments
96
+
97
+ We designed our experiments to evaluate the ability of Recurrent Memory Transformers to preserve long-term dependencies across multiple input segments. The first set of experiments includes copy, reverse, associative retrieval, and quadratic equations tasks. The second one addresses language modeling task for word-level on WikiText-103 (Merity et al., 2017) and for character-level on enwik8 (Mahoney, 2006). We compare Recurrent Memory Transformer with Transformer and Transformer-XL models.
98
+
99
+ Our RMT implementation is based on Transformer-XL repository2. The full set of hyperparameters is available in our repository as well as in supplementary materials. Language modeling experiments follow the same model and training hyperparameters as Transformer-XL. WikiText-103 experiments use 16-layer Transformers (10 heads, 410 hidden size, 2100 intermediate FF), enwik8 – 12 layer Transformers (8 heads, 512 hidden size, 2048 intermediate FF). We used Adam optimizer Kingma and Ba (2015) with linear schedule learning rate starting from 0.00025 for 200,000 steps for WikiText-103 and 400,000 steps for enwik8. We refer to Transformer-XL with memory size equal to zero as a Baseline. With this experimental setup we were able to reproduce results for the Transformer-XL model close to the original paper.
100
+
101
+ Algorithmic Tasks. We evaluate RMT on algorithmic tasks that require information about the whole input sequence to be solved successfully. In a recurrent setting, the model has to keep information about all previous segments to make predictions.
102
+
103
+ In the Copy task, an input sequence should be replicated twice after a special start-to-generate token. In the Reverse task, an input sequence should be generated in a reverse order. Input for the Associative Retrieval task consists of $N$ key-value pairs. Then one key is randomly selected, and the task is to produce an appropriate value for the selected key. Another task is to solve quadratic equations. One example consists of an equation, its solution with discriminant, and an answer. The task is to generate a solution and answer, while only answer quality is evaluated.
104
+
105
+ For all tasks, input and output sequences are split into segments and processed by models sequentially. Datasets for algorithmic tasks were randomly pre-generated, the same data was used in all experiments, and character-level tokenization was used. Because Transformer-XL and RMT are decoder-only Transformer models, we don’t compute loss over the input sequence before the start-to-generate token. The loss is computed over target sequence segments only (see Appendix A.1 for details).
106
+
107
+ Language Modeling and NLP. We use two standard benchmarks for language modeling: WikiText103 and enwik8. WikiText-103 (Merity et al., 2017) is used for word-level language modeling and contains 103M words from English Wikipedia articles. Enwik8 (Mahoney, 2006) is used for character-level and consists of $1 0 ^ { 8 }$ first bytes of XML text dump of the English Wikipedia. Vocabulary contains 267735 words and 204 characters for Wikitext-103 and enwik8 tokenizers accordingly.
108
+
109
+ We compare Recurrent Memory Transformer with decoder-only Transformer and Transformer-XL as baselines. Model size and training parameters are selected to match Transformer-XL paper. For Wikitext-103 an input context length was set to 150 tokens, and for enwik8 it was set to 512 characters. Another set of experiments inspected how RMT handles long-term dependencies and recurrence. We increased the number of segments and recurrent steps by making segments smaller (50 tokens for WikiText-103, 128 characters for enwik8). The increased number of recurrent steps makes language modeling tasks harder for RMT because information has to be stored in the same amount of memory for more steps.
110
+
111
+ As a testbed for the real-life application scenario we select popular long-text classification benchmark Hyperpartisan news (Kiesel et al., 2019). Instead of pre-training RMT from scratch we add recurrent memory mechanism to the most widely adopted models from HuggingFace Transformers (Wolf et al., 2020). Specifically, we augment 500 input tokens of already pretrained BERT-base, RoBERTa-base, DeBERTa-base and T5-base with the recurrent memory of size 10 and fine-tune on the target task.
112
+
113
+ # 5 Results
114
+
115
+ Baseline, Transformer-XL (Tr-XL) and RMT perform perfectly in the single segment setting on copy and reverse tasks (Figure 3). In this case, the models do not need recurrence because the whole sequence is available. When the number of segments is larger than one, non-recurrent baseline struggles to solve tasks, but both memory models demonstrate ability to retain required information from the previous segments in memory.
116
+
117
+ ![](images/dfb7a71a371b9f7236b2f187cbb44441f761d3708ffee03589bade5df4f0187b.jpg)
118
+ Figure 3: RMT outperforms Transformer-XL on Copy and Reverse tasks as a number of segments increases. Panels show test set per-character accuracy on copy, reverse, and associative retrieval tasks (from left to right). Memory/cache size equals to the length of a segment for both models. RMT does not pass gradients between segments in this experiment. MT results are the same as for the Baseline. Source/target sequence lengths for copy, reverse, and associative retrieval tasks: 24/48, 24/24, 10/1.
119
+
120
+ On Copy and Reverse tasks as a number of segments increases, RMT starts to outperform TransformerXL with memory sizes less than the number of all previous tokens. With the number of segments up to 6 mean accuracy of Transformer-XL drops by up to 0.2 points, and with 9 segments plunges close to the baseline without memory. Associative Retrieval results are similar with the number of segments up to 4. RMT manages to solve the task with Transformer-XL closely behind. However, in the setting with 5 segments, RMT performance slightly decreases and Transformer-XL average accuracy rises higher.
121
+
122
+ We analyze how a number of segments, sequence length, a length of training context, and memory size affect models’ performance on Copy task (Figure 4). As we split a sequence into more segments it becomes more crucial to be able to pass information between segments. We split 360 tokens of source $^ +$ target sequence into multiple segments. In Figure 4a we observe that Transformer-XL performance starts to degrade and eventually falls to the baseline model performance as the number of segments increases. In contrast, RMT continues to solve the task perfectly. In a more extreme setting, when we keep memory size fixed, but increase the total length of a sequence to copy Transformer-XL fails shortly, while RMT starts to gradually degrade only after the length of 720 tokens (Figure 4b).
123
+
124
+ On the Quadratic Equations task (Table 1) we have checked that it is possible to solve the task with the Transformer baseline and no segmentation used. The baseline in this case defines upper bound for this task. With multiple segments recurrency RMT solves the task perfectly, while Transformer-XL finds the task challenging.
125
+
126
+ The results of experiments on word-level language modeling on WikiText-103 are shown in Table 2. In the first section with a segment length of 150, Tr-XL and RMT outperform the baseline and Memory Transformer (MemTr) by a large margin. It shows the significance of increased effective context length by Tr-XL cache or RMT memory for language modeling. RMT improves over MemTr memory mechanism with read/write blocks. The best RMT models with
127
+
128
+ Table 1: Quadratic equations task. Sequence of 180 tokens consists of quadratic equation, a solution, and an answer. It is split into a number of segments with an answer in the last segment. Accuracy equals 1.0 if the full answer is predicted correctly.
129
+
130
+ <table><tr><td>MODEL</td><td>MEMORY</td><td>SEGMENTS</td><td>ACC±STD</td></tr><tr><td>BASELINE</td><td>0</td><td>1</td><td>0.99 ±0.01</td></tr><tr><td>TRANSFORMER-XL</td><td>30</td><td>6</td><td>0.93 ±0.02</td></tr><tr><td>RMT</td><td>30</td><td>6</td><td>0.99 ±0.002</td></tr></table>
131
+
132
+ memory size 10 and 25 show similar performance as Transformer-XL with a memory size equal to 75. RMT learns to use smaller memory more effectively than Transformer-XL. Additionally, the smaller memory size of RMT leads to reducing required GPU memory for running the model.
133
+
134
+ To force models to process longer recurrent dependencies the size of a segment is set to 50, so the number of recurrent steps increases. RMT with memory size 1 shows similar results to Transformer
135
+
136
+ ![](images/7d65f4844ae0fd26ce2093bfab284a52e8d9c07a793feb9c0983cd3a7f0a316a.jpg)
137
+ Figure 4: RMT scales better with a number of segments and sequence size. (a) RMT is able to solve copy task perfectly up to 9 segments for a fixed sequence length of 360, while Tr-XL fails. (b) RMT learns to use memory of the same fixed size (60 tokens) more effectively than TR-XL as a sequence length to copy increases (a segment size is 120 for the both models).
138
+
139
+ XL with memory size 10. It is worth noting that Transformer-XL memory consists of hidden representations from all layers (in this case, it is $1 0 \times 1 6$ vectors) when RMT memory is only memory_size vectors. Transformer-XL with memory size 50 and RMT with memory size 5 show similar perplexity values (see Appendix A.5).
140
+
141
+ RMT could be combined with Tr-XL cache. In this case Tr-XL cache could be seen as short-term memory keeping the nearest context and RMT memory as long-term memory. Such combination leads to the best results on WikiText-103 improving over Tr-XL.
142
+
143
+ Table 2: Language modeling on WikiText-103. Average perplexity for the best performed variations of RMT models reported (see full results in Appendix A.5). Underlined values show Tr-XL and RMT models with close results. RMT models with smaller memory sizes achieve similar scores to $\mathrm { T r } \mathrm { X L }$ models with larger memory. Combination of cache with recurrent memory (Tr$\mathbf { X L + R M T }$ ) shows the best performance.
144
+
145
+ <table><tr><td>MODEL</td><td>MEMORY</td><td>SEGMENT LEN</td><td>PPL±STD</td></tr><tr><td>TR-XL (PAPER)</td><td>150</td><td>150</td><td>24.0</td></tr><tr><td>BASELINE</td><td>0</td><td>150</td><td>29.95 ± 0.15</td></tr><tr><td>MEMTR</td><td>10</td><td>150</td><td>29.63 ±0.06</td></tr><tr><td>TR-XL (OURS)</td><td>150</td><td>150</td><td>24.12 ±0.05</td></tr><tr><td>TR-XL</td><td>25</td><td>150</td><td>25.57 ±0.02</td></tr><tr><td>TR-XL</td><td>75</td><td>150</td><td>24.68 ±0.01</td></tr><tr><td>RMTBPTT-3</td><td>10</td><td>150</td><td>25.04 ± 0.07</td></tr><tr><td>RMTBPTT-2</td><td>25</td><td>150</td><td>24.85 ±0.31</td></tr><tr><td>TR-XL+RMT</td><td>75+5</td><td>150</td><td>24.47 ± 0.05</td></tr><tr><td>TR-XL+RMT</td><td>150+10</td><td>150</td><td>23.99 ± 0.09</td></tr><tr><td>BASELINE</td><td>0</td><td>50</td><td>39.05 ± 0.01</td></tr><tr><td>TR-XL</td><td>100</td><td>50</td><td>25.66 ± 0.01</td></tr><tr><td>TR-XL</td><td>50</td><td>50</td><td>26.54 ± 0.01</td></tr><tr><td>TR-XL</td><td>25</td><td>50</td><td>27.57 ± 0.09</td></tr><tr><td>TR-XL</td><td>10</td><td>50</td><td>28.98 ±0.11</td></tr><tr><td>RMTBPTT-1</td><td>1</td><td>50</td><td>28.71 ±0.03</td></tr><tr><td>RMTBPTT-3</td><td>10</td><td>50</td><td>26.37 ± 0.01</td></tr></table>
146
+
147
+ On enwik8 RMT models with memory size 5 and Transformer-XL with memory size 40 show similar results. Confirming that RMT learns to use smaller amounts of memory representation more effectively. All results for enwik8 dataset are shown in Appendix A.4.
148
+
149
+ Recurrent Memory Transformer learns to make predictions depending on #BPTT_unrolls over previous segments $+ 1$ current segment. Transformer-XL does not use BPTT and relies only on memory_size cached states and current segment making in total: memory_size + segment_length tokens. In Figure 5a, we compare RMT and Tr-XL according to the described value of visible context at training time.
150
+
151
+ RMT with a single memory vector could be trained to achieve lower perplexity as Transformer-XL with memory size 10. This means that RMT can learn to compress information from the previous observations better. Another observation is that RMT with memory sizes 10 and 25 performs only a bit weaker compared to Transformer-XL even when Transformer-XL has access to more non
152
+
153
+ compressed states (50, 100, 200) from previous segments. In general, training RMT with unrolling gradients in earlier segments drastically improves scores thus showing the importance of BPTT training but, we observe instabilities and out-of-memory issues during RMT training for a larger memory sizes with deeper BPTT unrolls.
154
+
155
+ RMT wins a lot when only one memory token is added but then the effect from increasing memory size from 5 to 50 fades (Figure 5b). Still, RMT with memory size 5 have performance on par with Transformer-XL with cache 50, confirming that RMT learns to store more compact representations. The results suggest that there is some optimal memory size for RMT to solve the task, and further increase does not add much.
156
+
157
+ Proposed recurrent memory mechanism affects only input and gradient flows of the augmented core model. This might be an important advantage because the memory can be added to already pretrained model. Evaluation results for four memory augmented language models fine tuned for long text classification are presented in the Table 3. Incorporation of 10 memory tokens in the input sequence of 512 allows to encode longer stretches of a text up to 2000 tokens and significantly improve metrics for the majority of models. Moreover, a combination of recurrent memory with RoBERTa-base results in state of the art performance for the Hyperpartisan news classification task (Kiesel et al., 2019). Interestingly, many competing models have input size of 4096 that is at least twice longer compared to RMT extended counterparts but still lag behind.
158
+
159
+ ![](images/335470cb923817b05711179cb5131eb30e7408129792f49aae4dc9b2b66050c7.jpg)
160
+ Figure 5: Deeper BPPT unrolling improves RMT scores on WikiText-103 (a) Visible context at training time can be increased by deeper BPTT unrolls for RMT or enlarging cache for $\mathrm { T r } \mathrm { X L }$ . Larger visible context leads to lower perplexity for both models (marker size corresponds to memory size). (b) Recurrence improves performance of RMT compared to $\mathrm { T r } \mathrm { X L }$ for the same memory sizes.
161
+
162
+ Table 3: Hyperpartisan news detection. Models starting with RMT are taken from HuggingFace Transformers and augmented with 10 memory tokens and recurrence before fine-tuning. Train/valid/test split as in (Beltagy et al., 2020) and metric is F1.
163
+
164
+ <table><tr><td>MODEL [INPUT SIZE]</td><td colspan="4">NUMBER OF SEGMENTS 2 3</td></tr><tr><td></td><td>1</td><td></td><td></td><td></td></tr><tr><td>BIG BIRD [4096] (ZAHEER ET AL.,2020) LONGFORMER [4096] (BELTAGY ET AL.,2020)</td><td>92.20 94.80</td><td></td><td></td><td></td></tr><tr><td>GRAPH-ROBERTA [512X100](XU ET AL.,2021)</td><td>96.15</td><td></td><td></td><td></td></tr><tr><td>ERNIE-DOC-LARGE [640] (DING ET AL.,2021)</td><td>96.60</td><td></td><td></td><td></td></tr><tr><td>ERNIE-SPARSE [4096] (LIU ET AL.,2022)</td><td>92.81</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>RMT BERT-BASE-CASE [512]</td><td>91.60</td><td>94.12 97.20</td><td>93.06 96.72</td><td>94.34</td></tr><tr><td>RMT ROBERTA-BASE [512] RMT DEBERTA-V3-BASE[512]</td><td>94.87 94.17</td><td>96.78</td><td>94.80</td><td>98.11 94.80</td></tr><tr><td>RMTT5-BASE[512]</td><td>94.99</td><td>95.32</td><td>96.12</td><td>97.20</td></tr></table>
165
+
166
+ To get an understanding of memory operations, learned by RMT for algorithmic tasks we visualise attention maps for copy and reverse tasks (Figure 6). In each RMT attention map sequence tokens are preceded by read memory, located at the top left corner, and followed by write memory at the bottom right. Diagonal at the central part of the fig.6(a) (top) shows classic attention of token sequence
167
+
168
+ to itself, but the bottom diagonal represents the operation of writing of sequence tokens to memory in straight order. When completing reverse (fig.6(a) bottom) the model learns to write the sequence to the memory in the reversed order, which is in line with common sense.
169
+
170
+ When it comes to reproducing the target sequence, the model accesses memory (fig.6(b)) and writes to the output sequence. Another operation (fig.6(c)) is rewriting from read memory to write memory. It is commonly used by RMT in settings with larger number of segments to keep information about recent segments longer.
171
+
172
+ Transformer-XL mechanism of accessing memory (fig.6(d)) does not allow straightforward writing to memory without changing sequence token representations. Sequential reading from cache is represented by diagonals on Transformer-XL attention maps. Using token representations as storage harms model performance in tasks with larger number of segments. For reverse task with 4 segments Transformer-XL with limited memory size 6 (Appendix B Figure 9(b)) attempts to mix representations of tokens and read multiple symbols from one cached state in the next segments giving average accuracy of 0.8 on the target task. Despite having the same memory size, RMT manages to compress the whole segment in memory tokens (Appendix B Figure 9(a)) and achieve mean accuracy 1.
173
+
174
+ Visualizations from Figure 6 and Appendix B Figure 9 provide evidence to support our hypotheses that Tr-XL has to mix representations from previous and current segments in the same hidden states to pass information between segments. Also, visualizations show how memory tokens in RMT help mitigate such kind of mixing. RMT ability of sequence compression to memory is illustrated in Appendix A.1 Figure 8. For copy with 6 segments RMT compresses and then reads the sequence of 12 tokens with just 6 memory tokens. For Transformer-XL decreasing memory size harms the accuracy score significantly with number of segments larger than 2.
175
+
176
+ ![](images/d2d3cfdc0f59f3fb51f66df6c2a6e55fe1e8eab228c9fa8082be1bafcb722725.jpg)
177
+ Figure 6: Selected attention map patterns of memory models. (color intensity corresponds to attention score) RMT with segment length $^ { 1 = 2 4 }$ , memory size $= 2 4$ (a) write to memory, (b) read from memory. (c) RMT, segment length $^ { = 8 }$ , memory size ${ : = } 8$ , rewrite from read memory to write memory. (d) Transformer-XL, segment length $^ { 1 = 2 4 }$ , memory siz ${ \romannumeral 2 4 }$ read from the previous hidden states.
178
+
179
+ # 6 Conclusions
180
+
181
+ In this paper we introduced Recurrent Memory Transformer a simple recurrent memory augmentation of Transformer model. RMT is implemented by extension of an input sequence with special global memory tokens and segment-level recurrence. Importantly, our method allows to learn more compact sequence representations and improve existing pretrained models without extensive additional compute, thus making practical machine learning applications more energy efficient and environmentally friendly.
182
+
183
+ In our experiments we compared RMT with Transformer baseline and Transformer-XL which is a well-known modification of Transformer for long sequences. RMT almost perfectly solves Copy, Reverse as well as quadratic equations tasks for sequences consisting of multiple segments outperforming Transformer-XL. It also demonstrates quality for associative retrieval task on par with Transformer-XL. As expected, baseline Transformer fails to solve these tasks for multi-segment settings.
184
+
185
+ RMT trained as a language model performs significantly ahead of Transformer baseline and shows quality metrics similar to Transformer-XL but for up to 10 times smaller memory size. Experimental results demonstrate that for fixed memory size backpropagating gradients for more segments improves performance of RMT. Proposed approach to memory augmentation is quite universal and might be easily applied to any pretrained transformer based model as demonstrated by achievement of state of the art results for long text classification task by fine tuning a combination of RoBERTa and RMT.
186
+
187
+ Analysis of attention maps suggests that better RMT performance can be related to more effective storage of input representations in dedicated memory tokens compared to mixing representations storage in Transformer-XL. RMT could be combined with Transformer-XL cache and improve the performance of both models.
188
+
189
+ Overall, results of the study show that dedicated memory storage and recurrence provided by Recurrent Memory Transformer make it a promising architecture for applications that require learning of long-term dependencies and general purpose in-memory processing, such as algorithmic tasks and reasoning. Furthermore, we believe that RMT could open the way for adding memory and recurrence to other models in the Transformer family.
190
+
191
+ # Acknowledgments and Disclosure of Funding
192
+
193
+ This work was supported by a grant for research centers in the field of artificial intelligence, provided by the Analytical Center for the Government of the Russian Federation in accordance with the subsidy agreement (agreement identifier 000000D730321P5Q0002) and the agreement with the Moscow Institute of Physics and Technology dated November 1, 2021 No. 70-2021-00138.
194
+
195
+ # References
196
+
197
+ Joshua Ainslie, Santiago Ontanon, Chris Alberti, Philip Pham, Anirudh Ravula, and Sumit Sanghai. Etc: Encoding long and structured data in transformers, 2020.
198
+
199
+ Jimmy Ba, Geoffrey E Hinton, Volodymyr Mnih, Joel Z Leibo, and Catalin Ionescu. Using fast weights to attend to the recent past. In D. Lee, M. Sugiyama, U. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 29. Curran Associates, Inc., 2016. URL https://proceedings. neurips.cc/paper/2016/file/9f44e956e3a2b7b5598c625fcc802c36-Paper.pdf.
200
+
201
+ Iz Beltagy, Matthew E Peters, and Arman Cohan. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150, 2020.
202
+
203
+ Mikhail S Burtsev, Yuri Kuratov, Anton Peganov, and Grigory V Sapunov. Memory transformer. arXiv preprint arXiv:2006.11527, 2020.
204
+
205
+ Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers, 2019.
206
+
207
+ Kyunghyun Cho, Bart van Merriënboer, Dzmitry Bahdanau, and Yoshua Bengio. On the properties of neural machine translation: Encoder–decoder approaches. In Proceedings of SSST-8, Eighth Workshop on Syntax, Semantics and Structure in Statistical Translation, pages 103–111, Doha, Qatar, October 2014. Association for Computational Linguistics. doi: 10.3115/v1/W14-4012. URL https://aclanthology.org/W14-4012.
208
+
209
+ Krzysztof Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane, Tamas Sarlos, Peter Hawkins, Jared Davis, Afroz Mohiuddin, Lukasz Kaiser, et al. Rethinking attention with performers. arXiv preprint arXiv:2009.14794, 2020.
210
+
211
+ Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V. Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context, 2019.
212
+
213
+ Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171–4186, 2019. URL https://aclweb.org/anthology/papers/N/N19/ N19-1423/.
214
+
215
+ SiYu Ding, Junyuan Shang, Shuohuan Wang, Yu Sun, Hao Tian, Hua Wu, and Haifeng Wang. ERNIE-Doc: A retrospective long-document modeling transformer. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 2914–2927, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.227. URL https://aclanthology.org/2021.acl-long. 227.
216
+
217
+ Linhao Dong, Shuang Xu, and Bo Xu. Speech-transformer: A no-recurrence sequence-to-sequence model for speech recognition. In 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 5884–5888, 2018. doi: 10.1109/ICASSP.2018.8462506.
218
+
219
+ Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=YicbFdNTTy.
220
+
221
+ Angela Fan, Thibaut Lavril, Edouard Grave, Armand Joulin, and Sainbayar Sukhbaatar. Addressing some limitations of transformers with feedback memory. arXiv preprint arXiv:2002.09402, 2020.
222
+
223
+ Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines, 2014.
224
+
225
+ Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka Grabska-Barwinska, ´ Sergio Gómez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, Adrià Puigdomènech Badia, Karl Moritz Hermann, Yori Zwols, Georg Ostrovski, Adam Cain, Helen King, Christopher Summerfield, Phil Blunsom, Koray Kavukcuoglu, and Demis Hassabis. Hybrid computing using a neural network with dynamic external memory. Nature, 538(7626):471–476, October 2016. ISSN 00280836. URL http: //dx.doi.org/10.1038/nature20101.
226
+
227
+ Edward Grefenstette, Karl Moritz Hermann, Mustafa Suleyman, and Phil Blunsom. Learning to transduce with unbounded memory, 2015.
228
+
229
+ Caglar Gulcehre, Sarath Chandar, Kyunghyun Cho, and Yoshua Bengio. Dynamic neural turing machine with soft and hard addressing schemes. arXiv preprint arXiv:1607.00036, 2016.
230
+
231
+ Caglar Gulcehre, Sarath Chandar, and Yoshua Bengio. Memory augmented neural networks with wormhole connections. arXiv preprint arXiv:1701.08718, 2017.
232
+
233
+ Qipeng Guo, Xipeng Qiu, Pengfei Liu, Yunfan Shao, Xiangyang Xue, and Zheng Zhang. Star-transformer, 2019.
234
+
235
+ Ankit Gupta and Jonathan Berant. Gmat: Global memory augmentation for transformers. arXiv preprint arXiv:2006.03274, 2020.
236
+
237
+ Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Comput., 9(8):1735–1780, November 1997. ISSN 0899-7667. doi: 10.1162/neco.1997.9.8.1735. URL https://doi.org/10.1162/ neco.1997.9.8.1735.
238
+
239
+ Andrew Jaegle, Sebastian Borgeaud, Jean-Baptiste Alayrac, Carl Doersch, Catalin Ionescu, David Ding, Skanda Koppula, Daniel Zoran, Andrew Brock, Evan Shelhamer, et al. Perceiver io: A general architecture for structured inputs & outputs. arXiv preprint arXiv:2107.14795, 2021.
240
+
241
+ Armand Joulin and Tomas Mikolov. Inferring algorithmic patterns with stack-augmented recurrent nets, 2015.
242
+
243
+ Da Ju, Stephen Roller, Sainbayar Sukhbaatar, and Jason Weston. Staircase attention for recurrent processing of sequences. arXiv preprint arXiv:2106.04279, 2021.
244
+
245
+ Johannes Kiesel, Maria Mestre, Rishabh Shukla, Emmanuel Vincent, Payam Adineh, David Corney, Benno Stein, and Martin Potthast. Semeval-2019 task 4: Hyperpartisan news detection. In Proceedings of the 13th International Workshop on Semantic Evaluation, pages 829–839, 2019.
246
+
247
+ Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR (Poster), 2015. URL http://arxiv.org/abs/1412.6980.
248
+
249
+ Guillaume Lample, Alexandre Sablayrolles, Marc’Aurelio Ranzato, Ludovic Denoyer, and Hervé Jégou. Large memory layers with product keys, 2019.
250
+
251
+ Jie Lei, Liwei Wang, Yelong Shen, Dong Yu, Tamara L. Berg, and Mohit Bansal. Mart: Memory-augmented recurrent transformer for coherent video paragraph captioning, 2020.
252
+
253
+ Yang Liu, Jiaxiang Liu, Li Chen, Yuxiang Lu, Shikun Feng, Zhida Feng, Yu Sun, Hao Tian, Hua Wu, and Haifeng Wang. Ernie-sparse: Learning hierarchical efficient transformer through regularized self-attention. arXiv preprint arXiv:2203.12276, 2022.
254
+
255
+ Matt Mahoney. Large text compression benchmark, 2006. URL http://www.mattmahoney.net/dc/text. html.
256
+
257
+ Pedro Henrique Martins, Zita Marinho, and André FT Martins. $\infty$ -former: Infinite memory transformer. arXiv preprint arXiv:2109.00301, 2021.
258
+
259
+ Warren S McCulloch and Walter Pitts. A logical calculus of the ideas immanent in nervous activity. The bulletin of mathematical biophysics, 5(4):115–133, 1943.
260
+
261
+ Yuanliang Meng and Anna Rumshisky. Context-aware neural model for temporal information extraction. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 527–536, 2018.
262
+
263
+ Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017. URL https://openreview.net/forum? id=Byj72udxe.
264
+
265
+ Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. 2018. URL https://www.cs.ubc.ca/\~amuham01/LING530/papers/ radford2018improving.pdf.
266
+
267
+ Jack W Rae, Jonathan J Hunt, Tim Harley, Ivo Danihelka, Andrew Senior, Greg Wayne, Alex Graves, and Timothy P Lillicrap. Scaling memory-augmented neural networks with sparse reads and writes, 2016.
268
+
269
+ Jack W. Rae, Anna Potapenko, Siddhant M. Jayakumar, and Timothy P. Lillicrap. Compressive transformers for long-range sequence modelling, 2019.
270
+
271
+ Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. Zero-shot text-to-image generation. In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 8821–8831. PMLR, 18–24 Jul 2021. URL https://proceedings.mlr.press/v139/ ramesh21a.html.
272
+
273
+ C Stephen. Kleene. representation of events in nerve nets and finite automata. Automata studies, 1956.
274
+
275
+ Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, and Rob Fergus. End-to-end memory networks, 2015.
276
+
277
+ Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is All you Need. In Advances in neural information processing systems, pages 5998–6008, 2017. URL http://papers.nips.cc/paper/7181-attention-is-all-you-need.
278
+
279
+ Sinong Wang, Belinda Z. Li, Madian Khabsa, Han Fang, and Hao Ma. Linformer: Self-attention with linear complexity, 2020.
280
+
281
+ Paul J Werbos. Backpropagation through time: what it does and how to do it. Proceedings of the IEEE, 78(10): 1550–1560, 1990.
282
+
283
+ Jason Weston, Sumit Chopra, and Antoine Bordes. Memory networks, 2014.
284
+
285
+ Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, et al. Transformers: State-of-the-art natural language processing. In Proceedings of the 2020 conference on empirical methods in natural language processing: system demonstrations, pages 38–45, 2020.
286
+
287
+ Qingyang Wu, Zhenzhong Lan, Jing Gu, and Zhou Yu. Memformer: The memory-augmented transformer. arXiv preprint arXiv:2010.06891, 2020.
288
+
289
+ Peng Xu, Xinchi Chen, Xiaofei Ma, Zhiheng Huang, and Bing Xiang. Contrastive document representation learning with graph attention networks. arXiv preprint arXiv:2110.10778, 2021.
290
+
291
+ Manzil Zaheer, Guru Guruganesh, Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, et al. Big bird: Transformers for longer sequences. arXiv preprint arXiv:2007.14062, 2020.
292
+
293
+ # Checklist
294
+
295
+ 1. For all authors...
296
+
297
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
298
+ (b) Did you describe the limitations of your work? [Yes] We mention training instabilities and GPU RAM issues in Section 5.
299
+ (c) Did you discuss any potential negative societal impacts of your work? [No] The proposed model and method do not have any specific impacts. All general negative societal impacts applicable to the field could be potentially relative.
300
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
301
+
302
+ 2. If you are including theoretical results...
303
+
304
+ (a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
305
+
306
+ 3. If you ran experiments...
307
+
308
+ (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] We include code, training scripts, and raw experimental data in the supplementary material. The supplemental materials would be published on github with the final version of the paper. Instructions for language modeling data&experiments are taken from Tr-XL repo.
309
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 4, Appendix A, and provided supplementary material.
310
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] All the key experiments results are reported with std. Furthermore, we provide raw experimental data in the supplementary materials.
311
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] We used different GPUs depending on the task: 1080Ti, V100, A100. We provide this information in Appendix A for each task.
312
+
313
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
314
+
315
+ (a) If your work uses existing assets, did you cite the creators? [Yes] We refer to the original Tr-XL code and Tr-XL paper. We use it for establishing baselines and setting our methods. See Section 4
316
+ (b) Did you mention the license of the assets? [No] Tr-XL license is Apache 2.0 and available at its github repo.
317
+ (c) Did you include any new assets either in the supplemental material or as a URL? [Yes] Our code is in the supplemental material and on GitHub: https://github.com/ booydar/LM-RMT
318
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [No] We used publicly available Tr-XL code (Apache 2.0) and datasets.
319
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [No] We use either synthetic data or datasets collected from the Wikipedia (Wikitext-103, enwik8).
320
+
321
+ 5. If you used crowdsourcing or conducted research with human subjects...
322
+
323
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
324
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
325
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
parse/dev/Uynr3iPhksa/Uynr3iPhksa_content_list.json ADDED
@@ -0,0 +1,1731 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Recurrent Memory Transformer ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 299,
8
+ 122,
9
+ 697,
10
+ 147
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Aydar Bulatov1 bulatov.as@phystech.edu ",
17
+ "bbox": [
18
+ 189,
19
+ 200,
20
+ 383,
21
+ 229
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Yuri Kuratov1,2 yurii.kuratov@phystech.edu ",
28
+ "bbox": [
29
+ 408,
30
+ 200,
31
+ 632,
32
+ 229
33
+ ],
34
+ "page_idx": 0
35
+ },
36
+ {
37
+ "type": "text",
38
+ "text": "Mikhail S. Burtsev1,2 burtcev.ms@mipt.ru ",
39
+ "bbox": [
40
+ 655,
41
+ 200,
42
+ 810,
43
+ 228
44
+ ],
45
+ "page_idx": 0
46
+ },
47
+ {
48
+ "type": "text",
49
+ "text": "1Neural Networks and Deep Learning Lab, Moscow Institute of Physics and Technology, Dolgoprudny, Russia 2AIRI, Moscow, Russia ",
50
+ "bbox": [
51
+ 279,
52
+ 263,
53
+ 718,
54
+ 308
55
+ ],
56
+ "page_idx": 0
57
+ },
58
+ {
59
+ "type": "text",
60
+ "text": "Abstract ",
61
+ "text_level": 1,
62
+ "bbox": [
63
+ 462,
64
+ 343,
65
+ 535,
66
+ 359
67
+ ],
68
+ "page_idx": 0
69
+ },
70
+ {
71
+ "type": "text",
72
+ "text": "Transformer-based models show their effectiveness across multiple domains and tasks. The self-attention allows to combine information from all sequence elements into context-aware representations. However, global and local information has to be stored mostly in the same element-wise representations. Moreover, the length of an input sequence is limited by quadratic computational complexity of selfattention. In this work, we propose and study a memory-augmented segment-level recurrent Transformer (RMT). Memory allows to store and process local and global information as well as to pass information between segments of the long sequence with the help of recurrence. We implement a memory mechanism with no changes to Transformer model by adding special memory tokens to the input or output sequence. Then the model is trained to control both memory operations and sequence representations processing. Results of experiments show that RMT performs on par with the Transformer-XL on language modeling for smaller memory sizes and outperforms it for tasks that require longer sequence processing. We show that adding memory tokens to $\\mathrm { T r } \\mathrm { X L }$ is able to improve its performance. This makes Recurrent Memory Transformer a promising architecture for applications that require learning of long-term dependencies and general purpose in memory processing, such as algorithmic tasks and reasoning. ",
73
+ "bbox": [
74
+ 232,
75
+ 375,
76
+ 766,
77
+ 623
78
+ ],
79
+ "page_idx": 0
80
+ },
81
+ {
82
+ "type": "text",
83
+ "text": "1 Introduction ",
84
+ "text_level": 1,
85
+ "bbox": [
86
+ 174,
87
+ 648,
88
+ 310,
89
+ 665
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "Transformers (Vaswani et al., 2017) have been widely adopted across multiple domains and tasks (Radford et al., 2018; Dong et al., 2018; Devlin et al., 2019; Dosovitskiy et al., 2021; Ramesh et al., 2021; Jaegle et al., 2021). The key component of Transformer layer is a self-attention. Self-attention allows to update each sequence element representation with information from all other elements in the sequence. As a result, rich contextual representation for every element is generated at the end of encoding. This way, global sequence-level and local information are stored in a single representation. However, this mixing of two types of information in a single representation has limitations. Distributed storage of global features across all sequence elements results in global features \"blurring\" and makes it harder to access them. Another well-known deficiency of Transformers is poor scaling of self-attention with ",
96
+ "bbox": [
97
+ 174,
98
+ 680,
99
+ 517,
100
+ 873
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "image",
106
+ "img_path": "images/5b9df1c81fd854f8279abcb332ba70e58ce21400652c8e7a7d4881c585f76fed.jpg",
107
+ "image_caption": [
108
+ "Figure 1: Recurrent Memory Transformer. Memory is added as tokens to the input sequence and memory output is passed to the next segment. During training gradients flow from the current segment through memory to the previous segment. "
109
+ ],
110
+ "image_footnote": [],
111
+ "bbox": [
112
+ 531,
113
+ 695,
114
+ 823,
115
+ 787
116
+ ],
117
+ "page_idx": 0
118
+ },
119
+ {
120
+ "type": "text",
121
+ "text": "",
122
+ "bbox": [
123
+ 176,
124
+ 873,
125
+ 825,
126
+ 901
127
+ ],
128
+ "page_idx": 0
129
+ },
130
+ {
131
+ "type": "text",
132
+ "text": "input sequence length that hurts its applications to long inputs (Child et al., 2019; Guo et al., 2019; \nDai et al., 2019; Beltagy et al., 2020; Ainslie et al., 2020; Zaheer et al., 2020; Wang et al., 2020; \nChoromanski et al., 2020). ",
133
+ "bbox": [
134
+ 174,
135
+ 90,
136
+ 826,
137
+ 132
138
+ ],
139
+ "page_idx": 1
140
+ },
141
+ {
142
+ "type": "text",
143
+ "text": "Our work introduces a memory-augmented segment-level recurrent Transformer named Recurrent Memory Transformer (RMT). RMT uses a memory mechanism based on special memory tokens (Burtsev et al., 2020) added to the input sequence. Memory tokens provide additional reserved capacity to the model that could be used to process information which is not directly representing any element in the input sequence. To process long sequences, we split them into segments and pass memory states from a previous to a current segment. This memory passing makes the model recurrent and removes the input sequence length limitations. RMT model can theoretically work with infinite lengths but, in practice, it is limited by memory capacity and the efficiency of memory access/update operations. Our implementation of both memory and recurrence in RMT requires no changes to the Transformer model because modifications are made only to the input and output sequences of the model. ",
144
+ "bbox": [
145
+ 173,
146
+ 140,
147
+ 825,
148
+ 277
149
+ ],
150
+ "page_idx": 1
151
+ },
152
+ {
153
+ "type": "text",
154
+ "text": "We tested RMT on the tasks that require global information about the whole input sequence to be solved. We use copy, reverse, and associative retrieval tasks in the setting where the input sequence is split into segments. RMT and Transformer-XL perfectly solve these tasks, but exceeding some value of sequence length, RMT starts to outperform Transformer-XL. Also, we experimentally show that the proposed Recurrent Memory Transformer requires less memory size to perform closely to Transformer-XL on language modeling tasks. RMT code and experiments are available1. ",
155
+ "bbox": [
156
+ 174,
157
+ 284,
158
+ 825,
159
+ 367
160
+ ],
161
+ "page_idx": 1
162
+ },
163
+ {
164
+ "type": "text",
165
+ "text": "Contributions ",
166
+ "text_level": 1,
167
+ "bbox": [
168
+ 174,
169
+ 373,
170
+ 274,
171
+ 387
172
+ ],
173
+ "page_idx": 1
174
+ },
175
+ {
176
+ "type": "text",
177
+ "text": "1. In this study we augment Transformer with token based memory storage and segment-level recurrence. ",
178
+ "bbox": [
179
+ 173,
180
+ 395,
181
+ 823,
182
+ 422
183
+ ],
184
+ "page_idx": 1
185
+ },
186
+ {
187
+ "type": "text",
188
+ "text": "2. We experimentally evaluate proposed architecture as well as vanilla Transformer and TransformerXL on memory-intensive tasks such as copy, reverse, associative retrieval, and language modeling. We show that RMT outperforms Transformer-XL for sequence processing tasks and on par with Transformer-XL on language modeling but requires less memory. ",
189
+ "bbox": [
190
+ 173,
191
+ 429,
192
+ 826,
193
+ 484
194
+ ],
195
+ "page_idx": 1
196
+ },
197
+ {
198
+ "type": "text",
199
+ "text": "3. We show that Tr-XL cache could be combined with RMT leading to better performance on language modeling. ",
200
+ "bbox": [
201
+ 171,
202
+ 491,
203
+ 823,
204
+ 520
205
+ ],
206
+ "page_idx": 1
207
+ },
208
+ {
209
+ "type": "text",
210
+ "text": "4. We analysed how the Transformer model learns to use memory. Specific interpretable memory read-write patterns of attention are shown. ",
211
+ "bbox": [
212
+ 174,
213
+ 525,
214
+ 823,
215
+ 553
216
+ ],
217
+ "page_idx": 1
218
+ },
219
+ {
220
+ "type": "text",
221
+ "text": "2 Related work ",
222
+ "text_level": 1,
223
+ "bbox": [
224
+ 174,
225
+ 574,
226
+ 316,
227
+ 592
228
+ ],
229
+ "page_idx": 1
230
+ },
231
+ {
232
+ "type": "text",
233
+ "text": "In our study we add a memory to general purpose attention based neural architecture. Memory is a recurrent topic in neural networks research. It had started from the early works (McCulloch and Pitts, 1943; Stephen, 1956) and significantly progressed in 90’s with introduction of Backpropagation Through Time learning algorithm (Werbos, 1990) and Long-Short Term Memory (LSTM) (Hochreiter and Schmidhuber, 1997) neural architecture. Today memory-augmented neural networks (MANNs) usually rely on some kind of recurrent external-memory which is separate from the model’s parameters. Neural Turing Machines (NTMs) (Graves et al., 2014) and Memory Networks (Weston et al., 2014) are equipped with a storage for vector representations that can be accessed with an attention mechanism. Memory Networks (Weston et al., 2014; Sukhbaatar et al., 2015) were designed to enable reasoning by sequential attention over to the content of a memory. NTMs followed by Differentiable Neural Computer (DNC) (Graves et al., 2016) and Sparse DNC (Rae et al., 2016) are implemented as recurrent neural networks able to write to memory storage over time. All these models are differentiable and can be trained via backpropagation through time (BPTT). Parallel line of research extends recurrent neural networks such as LSTM with data structures like stacks, lists, or queues (Joulin and Mikolov, 2015; Grefenstette et al., 2015). MANN architectures with a more advanced addressing mechanisms such as address-content separation and multi-step addressing were proposed in (Gulcehre et al., 2016, 2017; Meng and Rumshisky, 2018). The Global Context Layer model (Meng and Rumshisky, 2018) uses the idea of address-content separation to solve the difficulty of training content-based addressing in the canonical NTM. ",
234
+ "bbox": [
235
+ 174,
236
+ 608,
237
+ 825,
238
+ 869
239
+ ],
240
+ "page_idx": 1
241
+ },
242
+ {
243
+ "type": "text",
244
+ "text": "The recent rise of Transformer models also resulted in introduction of a number of new memory architectures. Transformer-XL (Dai et al., 2019) introduces a segment-level recurrence at the level of hidden representations. These representations of a sequence are computed and stored in the cache to be reused as an extended context for the next segment. Compressive Transformer (Rae et al., 2019) adds the second layer of memory to Transformer-XL. This memory compresses and stores information from the cache. $\\infty$ -former (Martins et al., 2021) utilizes continuous-space attention and represents input sequence as a continuous signal to make long-term memory unbounded. Memory Layers (Lample et al., 2019) model has a product key memory layer instead of a feed-forward layer within Transformer block to increase model capacity. ",
245
+ "bbox": [
246
+ 174,
247
+ 90,
248
+ 825,
249
+ 217
250
+ ],
251
+ "page_idx": 2
252
+ },
253
+ {
254
+ "type": "text",
255
+ "text": "In many variations of Transformer different sorts of global representations are added. Among them are Star-Transformer (Guo et al., 2019), Longformer (Beltagy et al., 2020), GMAT (Gupta and Berant, 2020), Extended Transformer Construction (ETC) (Ainslie et al., 2020) and Big Bird (Zaheer et al., 2020). All these architectures re-design self-attention mechanism to reduce it computational complexity with and ensure input coverage with the help of global representations. Memory Transformer (Burtsev et al., 2020) keeps Transformer model intact and adds memory by extending input sequence with special memory tokens. Perceiver IO (Jaegle et al., 2021) maps an entire arbitrary input to the fixed number of latent representations. Transformer layers do further processing over latent memory representations only. ",
256
+ "bbox": [
257
+ 174,
258
+ 222,
259
+ 825,
260
+ 347
261
+ ],
262
+ "page_idx": 2
263
+ },
264
+ {
265
+ "type": "text",
266
+ "text": "Segment-level recurrence in Transformers is actively explored in a number of studies. TransformerXL, Compressive Transformer keep previous states and re-use them in subsequent segments. ErnieDoc (Ding et al., 2021) improves processing by using same-layer recurrence instead of attending to previous layer outputs of a precedent segment. Memformer (Wu et al., 2020) introduces a dedicated memory module to keep previous hidden states in summarized representations. Memformer uses two special layers added to the Transformer model. Memory cross-attention layer reads from memory and memory slot attention layer updates it. MART (Lei et al., 2020) has a similar approach as Memformer but uses memory update rules analogous to LSTM (Hochreiter and Schmidhuber, 1997) and GRU (Cho et al., 2014). FeedBack Transformer (Fan et al., 2020) goes further with full, and not segment-level, recurrence. FeedBack Memory merges past hidden representations from all layers into a single vector and makes it accessible to the computations at any layer. The disadvantage of full recurrence is that it is less parallelizable. FeedBack Memory requires every sequence element to be processed sequentially. In segment-level recurrent models, all elements of a segment are processed by Transformer layers in parallel. Only segments are processed sequentially. Staircase Transformer (Ju et al., 2021) combines segment-level recurrence and depth recurrence. Staircase models use the output for previous segments and pass them as input for the next segment. Our Recurrent Memory Transformer is based on special memory tokens similar to Memory Transformer, segment-level recurrence as in Transformer-XL, and depth-recurrent mechanism for memory processing similar to Staircase. ",
267
+ "bbox": [
268
+ 174,
269
+ 353,
270
+ 825,
271
+ 616
272
+ ],
273
+ "page_idx": 2
274
+ },
275
+ {
276
+ "type": "text",
277
+ "text": "3 Recurrent Memory Transformer ",
278
+ "text_level": 1,
279
+ "bbox": [
280
+ 176,
281
+ 633,
282
+ 478,
283
+ 651
284
+ ],
285
+ "page_idx": 2
286
+ },
287
+ {
288
+ "type": "text",
289
+ "text": "Transformer-XL (Dai et al., 2019) extends Transformer model with state re-use cache mechanism for segment-level recurrence and relative position encoding. Input sequence is split on segments processed sequentially. Hidden states computed for the previous segment $M ^ { n }$ are cached for each transformer layer $n$ . The input of the layer $n$ consists of the last $m$ states from the cached memory and output of previous Transformer layer for the current segment $\\tau$ : ",
290
+ "bbox": [
291
+ 174,
292
+ 665,
293
+ 825,
294
+ 736
295
+ ],
296
+ "page_idx": 2
297
+ },
298
+ {
299
+ "type": "equation",
300
+ "img_path": "images/fa36d576ab92a393a5370a3b42b097383d7bf96495d914b4570e0a4b9b383d31.jpg",
301
+ "text": "$$\n{ \\tilde { H } } _ { \\tau } ^ { n - 1 } = [ S G ( M _ { - m : } ^ { n - 1 } ) \\circ H _ { \\tau } ^ { n - 1 } ] ,\n$$",
302
+ "text_format": "latex",
303
+ "bbox": [
304
+ 392,
305
+ 741,
306
+ 604,
307
+ 761
308
+ ],
309
+ "page_idx": 2
310
+ },
311
+ {
312
+ "type": "text",
313
+ "text": "here, SG stands for stop-gradient, $\\circ$ denotes concatenation. Cached states allow to increase effective context size of Transformer model and save on compute operations. ",
314
+ "bbox": [
315
+ 173,
316
+ 766,
317
+ 825,
318
+ 795
319
+ ],
320
+ "page_idx": 2
321
+ },
322
+ {
323
+ "type": "text",
324
+ "text": "Then, $\\tilde { H } _ { \\tau } ^ { n - 1 }$ goes to Transformer layer $T L$ to produce layer $n$ outputs for segment $\\tau$ ",
325
+ "bbox": [
326
+ 176,
327
+ 801,
328
+ 732,
329
+ 818
330
+ ],
331
+ "page_idx": 2
332
+ },
333
+ {
334
+ "type": "equation",
335
+ "img_path": "images/8099f608880f2a6085115dee16e2230817038a4fb93647f1675aab52b7727cb6.jpg",
336
+ "text": "$$\nH _ { \\tau } ^ { n } = T L ( Q _ { \\tau } ^ { n } , K _ { \\tau } ^ { n } , V _ { \\tau } ^ { n } ) , Q _ { \\tau } ^ { n } = W _ { q } ^ { n } H _ { \\tau } ^ { n - 1 } ; K _ { \\tau } ^ { n } = W _ { k } ^ { n } \\tilde { H } _ { \\tau } ^ { n - 1 } , V _ { \\tau } ^ { n } = W _ { v } ^ { n } \\tilde { H } _ { \\tau } ^ { n - 1 } .\n$$",
337
+ "text_format": "latex",
338
+ "bbox": [
339
+ 235,
340
+ 824,
341
+ 761,
342
+ 844
343
+ ],
344
+ "page_idx": 2
345
+ },
346
+ {
347
+ "type": "text",
348
+ "text": "In Transformer-XL, self-attention layers are modified to use relative position encodings to improve generalization to longer attention lengths. The overall architecture is shown in the Figure 2. ",
349
+ "bbox": [
350
+ 173,
351
+ 848,
352
+ 825,
353
+ 877
354
+ ],
355
+ "page_idx": 2
356
+ },
357
+ {
358
+ "type": "text",
359
+ "text": "Memory augmented Transformers such as GMAT, ETC, Memory Transformer (Gupta and Berant, 2020; Ainslie et al., 2020; Burtsev et al., 2020) proposed to use special global tokens as storage for representations. Usually, memory tokens are added to the beginning of the input sequence. However, in decoder-only architectures the causal attention mask makes impossible for memory tokens at the start of the sequence to collect information from the subsequent tokens. On the other hand, if memory tokens are placed at the end of the sequence then preceding tokens unable to access their representations. To solve this problem we add a recurrence to the sequence processing. Representations of memory tokens placed at the end of the segment are used as an input memory representations at the start as well as at the end of the next segment. ",
360
+ "bbox": [
361
+ 173,
362
+ 882,
363
+ 826,
364
+ 912
365
+ ],
366
+ "page_idx": 2
367
+ },
368
+ {
369
+ "type": "image",
370
+ "img_path": "images/17080de9e4443b5cebab052d987ec2f81f981be8bb570aa5a1a47807ec3a715b.jpg",
371
+ "image_caption": [
372
+ "Figure 2: Comparison of Recurrent Memory Transformer (RMT) and Transformer-XL architectures. Recurrent Memory Transformer augments Transformer with global memory tokens and passes them to allow a segment-level recurrence. Special read/write memory tokens are added to the input sequence. Multiple memory tokens can be used in each read/write block. Updated representations of write memory are passed to the next segment. During training, RMT uses BPTT to propagate gradient to previous segments through memory tokens representation. Effective context length for recurrence with memory is not limited by the depth of a network which is the case for the cache of Transformer-XL. "
373
+ ],
374
+ "image_footnote": [],
375
+ "bbox": [
376
+ 174,
377
+ 89,
378
+ 825,
379
+ 234
380
+ ],
381
+ "page_idx": 3
382
+ },
383
+ {
384
+ "type": "text",
385
+ "text": "",
386
+ "bbox": [
387
+ 173,
388
+ 337,
389
+ 825,
390
+ 435
391
+ ],
392
+ "page_idx": 3
393
+ },
394
+ {
395
+ "type": "text",
396
+ "text": "In the Recurrent Memory Transformer input is augmented with special [mem] tokens, processed in a standard way along with the sequence of tokens. Each memory token is a real-valued vector. $m$ memory tokens are added at the beginning of the segment tokens representations $H _ { \\tau } ^ { 0 }$ and the same $m$ tokens are added at the end: ",
397
+ "bbox": [
398
+ 174,
399
+ 440,
400
+ 825,
401
+ 496
402
+ ],
403
+ "page_idx": 3
404
+ },
405
+ {
406
+ "type": "equation",
407
+ "img_path": "images/ed9c5cd1e595919013b0295d1a00274834b008ab1a7f8020526ea8e814a74c9c.jpg",
408
+ "text": "$$\n\\tilde { H } _ { \\tau } ^ { 0 } = [ H _ { \\tau } ^ { m e m } \\circ H _ { \\tau } ^ { 0 } \\circ H _ { \\tau } ^ { m e m } ] , \\bar { H } _ { \\tau } ^ { N } = \\mathrm { T r a n s f o r m e r } ( \\tilde { H } _ { \\tau } ^ { 0 } ) , [ H _ { \\tau } ^ { r e a d } \\circ H _ { \\tau } ^ { N } \\circ H _ { \\tau } ^ { w r i t e } ] : = \\bar { H } _ { \\tau } ^ { N } ,\n$$",
409
+ "text_format": "latex",
410
+ "bbox": [
411
+ 200,
412
+ 501,
413
+ 795,
414
+ 521
415
+ ],
416
+ "page_idx": 3
417
+ },
418
+ {
419
+ "type": "text",
420
+ "text": "here $N$ is a number of Transformer layers. ",
421
+ "bbox": [
422
+ 176,
423
+ 526,
424
+ 452,
425
+ 541
426
+ ],
427
+ "page_idx": 3
428
+ },
429
+ {
430
+ "type": "text",
431
+ "text": "The starting group of memory tokens functions as a read memory that allows sequence tokens to attend to memory states produced at the previous segment. The ending group works as a write memory that can attend to all current segment tokens and update representation stored in the memory. As a result, $H _ { \\tau } ^ { w r i t e }$ contains updated memory tokens for the segment $\\tau$ . ",
432
+ "bbox": [
433
+ 173,
434
+ 546,
435
+ 826,
436
+ 603
437
+ ],
438
+ "page_idx": 3
439
+ },
440
+ {
441
+ "type": "text",
442
+ "text": "Segments of the input sequence are processed sequentially. To enable recurrent connection between segments, we pass outputs of the memory tokens from the current segment to the input of the next segment: ",
443
+ "bbox": [
444
+ 173,
445
+ 609,
446
+ 825,
447
+ 650
448
+ ],
449
+ "page_idx": 3
450
+ },
451
+ {
452
+ "type": "equation",
453
+ "img_path": "images/8fc62e3150b612bf489c999dc11d9517503d6bcb3eb173ad2c8632742f6ba210.jpg",
454
+ "text": "$$\nH _ { \\tau + 1 } ^ { m e m } : = H _ { \\tau } ^ { w r i t e } , \\tilde { H } _ { \\tau + 1 } ^ { 0 } = [ H _ { \\tau + 1 } ^ { m e m } \\circ H _ { \\tau + 1 } ^ { 0 } \\circ H _ { \\tau + 1 } ^ { m e m } ] .\n$$",
455
+ "text_format": "latex",
456
+ "bbox": [
457
+ 318,
458
+ 647,
459
+ 679,
460
+ 669
461
+ ],
462
+ "page_idx": 3
463
+ },
464
+ {
465
+ "type": "text",
466
+ "text": "Both memory and recurrence in the RMT are based only on global memory tokens. It allows to keep the backbone Transformer unchanged and make RMT memory augmentation compatible with any model from the Transformer family. Memory tokens operate only on the input and output of the model. In this study we implement RMT on top of the original Transformer-XL code. Both architectures are shown in Figure 2. ",
467
+ "bbox": [
468
+ 173,
469
+ 675,
470
+ 825,
471
+ 746
472
+ ],
473
+ "page_idx": 3
474
+ },
475
+ {
476
+ "type": "text",
477
+ "text": "Recurrence in the RMT is different compared to the Transformer-XL because the former stores only $m$ memory vectors per segment. On the other hand, the Transformer-XL stores $m \\times N$ vectors per segment. Also, in the RMT model memory representations from the previous segment are processed by Transformer layers together with the current segment tokens. This makes memory part of RMT effectively deeper in a number of applied Transformer layers $\\tau \\times N$ . Additionally, we allow all memory tokens in the read/write block to access all other tokens in the same block. The causal attention mask is applied only to tokens of the input sequence (Figure 6(d)). ",
478
+ "bbox": [
479
+ 173,
480
+ 751,
481
+ 825,
482
+ 849
483
+ ],
484
+ "page_idx": 3
485
+ },
486
+ {
487
+ "type": "text",
488
+ "text": "We train the RMT with Backpropagation Through Time (BPTT). During backward pass, unlike in Transformer-XL, memory gradients are not stopped between segments. The number of previous segments to backpropagate is a hyperparameter of a training procedure. We vary BPTT unroll in our experiments from 0 to 4 previous segments. Increasing this parameter is computationally expensive and requires a lot of GPU RAM. However, techniques such as gradient checkpointing could be used to alleviate this problem. ",
489
+ "bbox": [
490
+ 174,
491
+ 854,
492
+ 825,
493
+ 911
494
+ ],
495
+ "page_idx": 3
496
+ },
497
+ {
498
+ "type": "text",
499
+ "text": "",
500
+ "bbox": [
501
+ 173,
502
+ 92,
503
+ 823,
504
+ 119
505
+ ],
506
+ "page_idx": 4
507
+ },
508
+ {
509
+ "type": "text",
510
+ "text": "4 Experiments ",
511
+ "text_level": 1,
512
+ "bbox": [
513
+ 174,
514
+ 145,
515
+ 312,
516
+ 161
517
+ ],
518
+ "page_idx": 4
519
+ },
520
+ {
521
+ "type": "text",
522
+ "text": "We designed our experiments to evaluate the ability of Recurrent Memory Transformers to preserve long-term dependencies across multiple input segments. The first set of experiments includes copy, reverse, associative retrieval, and quadratic equations tasks. The second one addresses language modeling task for word-level on WikiText-103 (Merity et al., 2017) and for character-level on enwik8 (Mahoney, 2006). We compare Recurrent Memory Transformer with Transformer and Transformer-XL models. ",
523
+ "bbox": [
524
+ 174,
525
+ 179,
526
+ 825,
527
+ 262
528
+ ],
529
+ "page_idx": 4
530
+ },
531
+ {
532
+ "type": "text",
533
+ "text": "Our RMT implementation is based on Transformer-XL repository2. The full set of hyperparameters is available in our repository as well as in supplementary materials. Language modeling experiments follow the same model and training hyperparameters as Transformer-XL. WikiText-103 experiments use 16-layer Transformers (10 heads, 410 hidden size, 2100 intermediate FF), enwik8 – 12 layer Transformers (8 heads, 512 hidden size, 2048 intermediate FF). We used Adam optimizer Kingma and Ba (2015) with linear schedule learning rate starting from 0.00025 for 200,000 steps for WikiText-103 and 400,000 steps for enwik8. We refer to Transformer-XL with memory size equal to zero as a Baseline. With this experimental setup we were able to reproduce results for the Transformer-XL model close to the original paper. ",
534
+ "bbox": [
535
+ 174,
536
+ 268,
537
+ 825,
538
+ 393
539
+ ],
540
+ "page_idx": 4
541
+ },
542
+ {
543
+ "type": "text",
544
+ "text": "Algorithmic Tasks. We evaluate RMT on algorithmic tasks that require information about the whole input sequence to be solved successfully. In a recurrent setting, the model has to keep information about all previous segments to make predictions. ",
545
+ "bbox": [
546
+ 174,
547
+ 400,
548
+ 825,
549
+ 441
550
+ ],
551
+ "page_idx": 4
552
+ },
553
+ {
554
+ "type": "text",
555
+ "text": "In the Copy task, an input sequence should be replicated twice after a special start-to-generate token. In the Reverse task, an input sequence should be generated in a reverse order. Input for the Associative Retrieval task consists of $N$ key-value pairs. Then one key is randomly selected, and the task is to produce an appropriate value for the selected key. Another task is to solve quadratic equations. One example consists of an equation, its solution with discriminant, and an answer. The task is to generate a solution and answer, while only answer quality is evaluated. ",
556
+ "bbox": [
557
+ 173,
558
+ 449,
559
+ 825,
560
+ 532
561
+ ],
562
+ "page_idx": 4
563
+ },
564
+ {
565
+ "type": "text",
566
+ "text": "For all tasks, input and output sequences are split into segments and processed by models sequentially. Datasets for algorithmic tasks were randomly pre-generated, the same data was used in all experiments, and character-level tokenization was used. Because Transformer-XL and RMT are decoder-only Transformer models, we don’t compute loss over the input sequence before the start-to-generate token. The loss is computed over target sequence segments only (see Appendix A.1 for details). ",
567
+ "bbox": [
568
+ 174,
569
+ 537,
570
+ 825,
571
+ 608
572
+ ],
573
+ "page_idx": 4
574
+ },
575
+ {
576
+ "type": "text",
577
+ "text": "Language Modeling and NLP. We use two standard benchmarks for language modeling: WikiText103 and enwik8. WikiText-103 (Merity et al., 2017) is used for word-level language modeling and contains 103M words from English Wikipedia articles. Enwik8 (Mahoney, 2006) is used for character-level and consists of $1 0 ^ { 8 }$ first bytes of XML text dump of the English Wikipedia. Vocabulary contains 267735 words and 204 characters for Wikitext-103 and enwik8 tokenizers accordingly. ",
578
+ "bbox": [
579
+ 174,
580
+ 614,
581
+ 825,
582
+ 683
583
+ ],
584
+ "page_idx": 4
585
+ },
586
+ {
587
+ "type": "text",
588
+ "text": "We compare Recurrent Memory Transformer with decoder-only Transformer and Transformer-XL as baselines. Model size and training parameters are selected to match Transformer-XL paper. For Wikitext-103 an input context length was set to 150 tokens, and for enwik8 it was set to 512 characters. Another set of experiments inspected how RMT handles long-term dependencies and recurrence. We increased the number of segments and recurrent steps by making segments smaller (50 tokens for WikiText-103, 128 characters for enwik8). The increased number of recurrent steps makes language modeling tasks harder for RMT because information has to be stored in the same amount of memory for more steps. ",
589
+ "bbox": [
590
+ 173,
591
+ 689,
592
+ 825,
593
+ 801
594
+ ],
595
+ "page_idx": 4
596
+ },
597
+ {
598
+ "type": "text",
599
+ "text": "As a testbed for the real-life application scenario we select popular long-text classification benchmark Hyperpartisan news (Kiesel et al., 2019). Instead of pre-training RMT from scratch we add recurrent memory mechanism to the most widely adopted models from HuggingFace Transformers (Wolf et al., 2020). Specifically, we augment 500 input tokens of already pretrained BERT-base, RoBERTa-base, DeBERTa-base and T5-base with the recurrent memory of size 10 and fine-tune on the target task. ",
600
+ "bbox": [
601
+ 174,
602
+ 806,
603
+ 825,
604
+ 876
605
+ ],
606
+ "page_idx": 4
607
+ },
608
+ {
609
+ "type": "text",
610
+ "text": "5 Results ",
611
+ "text_level": 1,
612
+ "bbox": [
613
+ 174,
614
+ 89,
615
+ 266,
616
+ 106
617
+ ],
618
+ "page_idx": 5
619
+ },
620
+ {
621
+ "type": "text",
622
+ "text": "Baseline, Transformer-XL (Tr-XL) and RMT perform perfectly in the single segment setting on copy and reverse tasks (Figure 3). In this case, the models do not need recurrence because the whole sequence is available. When the number of segments is larger than one, non-recurrent baseline struggles to solve tasks, but both memory models demonstrate ability to retain required information from the previous segments in memory. ",
623
+ "bbox": [
624
+ 174,
625
+ 121,
626
+ 825,
627
+ 190
628
+ ],
629
+ "page_idx": 5
630
+ },
631
+ {
632
+ "type": "image",
633
+ "img_path": "images/dfb7a71a371b9f7236b2f187cbb44441f761d3708ffee03589bade5df4f0187b.jpg",
634
+ "image_caption": [
635
+ "Figure 3: RMT outperforms Transformer-XL on Copy and Reverse tasks as a number of segments increases. Panels show test set per-character accuracy on copy, reverse, and associative retrieval tasks (from left to right). Memory/cache size equals to the length of a segment for both models. RMT does not pass gradients between segments in this experiment. MT results are the same as for the Baseline. Source/target sequence lengths for copy, reverse, and associative retrieval tasks: 24/48, 24/24, 10/1. "
636
+ ],
637
+ "image_footnote": [],
638
+ "bbox": [
639
+ 176,
640
+ 196,
641
+ 825,
642
+ 337
643
+ ],
644
+ "page_idx": 5
645
+ },
646
+ {
647
+ "type": "text",
648
+ "text": "On Copy and Reverse tasks as a number of segments increases, RMT starts to outperform TransformerXL with memory sizes less than the number of all previous tokens. With the number of segments up to 6 mean accuracy of Transformer-XL drops by up to 0.2 points, and with 9 segments plunges close to the baseline without memory. Associative Retrieval results are similar with the number of segments up to 4. RMT manages to solve the task with Transformer-XL closely behind. However, in the setting with 5 segments, RMT performance slightly decreases and Transformer-XL average accuracy rises higher. ",
649
+ "bbox": [
650
+ 173,
651
+ 415,
652
+ 825,
653
+ 512
654
+ ],
655
+ "page_idx": 5
656
+ },
657
+ {
658
+ "type": "text",
659
+ "text": "We analyze how a number of segments, sequence length, a length of training context, and memory size affect models’ performance on Copy task (Figure 4). As we split a sequence into more segments it becomes more crucial to be able to pass information between segments. We split 360 tokens of source $^ +$ target sequence into multiple segments. In Figure 4a we observe that Transformer-XL performance starts to degrade and eventually falls to the baseline model performance as the number of segments increases. In contrast, RMT continues to solve the task perfectly. In a more extreme setting, when we keep memory size fixed, but increase the total length of a sequence to copy Transformer-XL fails shortly, while RMT starts to gradually degrade only after the length of 720 tokens (Figure 4b). ",
660
+ "bbox": [
661
+ 173,
662
+ 517,
663
+ 825,
664
+ 630
665
+ ],
666
+ "page_idx": 5
667
+ },
668
+ {
669
+ "type": "text",
670
+ "text": "On the Quadratic Equations task (Table 1) we have checked that it is possible to solve the task with the Transformer baseline and no segmentation used. The baseline in this case defines upper bound for this task. With multiple segments recurrency RMT solves the task perfectly, while Transformer-XL finds the task challenging. ",
671
+ "bbox": [
672
+ 174,
673
+ 635,
674
+ 825,
675
+ 690
676
+ ],
677
+ "page_idx": 5
678
+ },
679
+ {
680
+ "type": "text",
681
+ "text": "The results of experiments on word-level language modeling on WikiText-103 are shown in Table 2. In the first section with a segment length of 150, Tr-XL and RMT outperform the baseline and Memory Transformer (MemTr) by a large margin. It shows the significance of increased effective context length by Tr-XL cache or RMT memory for language modeling. RMT improves over MemTr memory mechanism with read/write blocks. The best RMT models with ",
682
+ "bbox": [
683
+ 174,
684
+ 696,
685
+ 485,
686
+ 835
687
+ ],
688
+ "page_idx": 5
689
+ },
690
+ {
691
+ "type": "table",
692
+ "img_path": "images/94fb121960d9451bf4aebdc333f74e7cdb781e3e48d5c491401994a418f5f954.jpg",
693
+ "table_caption": [
694
+ "Table 1: Quadratic equations task. Sequence of 180 tokens consists of quadratic equation, a solution, and an answer. It is split into a number of segments with an answer in the last segment. Accuracy equals 1.0 if the full answer is predicted correctly. "
695
+ ],
696
+ "table_footnote": [],
697
+ "table_body": "<table><tr><td>MODEL</td><td>MEMORY</td><td>SEGMENTS</td><td>ACC±STD</td></tr><tr><td>BASELINE</td><td>0</td><td>1</td><td>0.99 ±0.01</td></tr><tr><td>TRANSFORMER-XL</td><td>30</td><td>6</td><td>0.93 ±0.02</td></tr><tr><td>RMT</td><td>30</td><td>6</td><td>0.99 ±0.002</td></tr></table>",
698
+ "bbox": [
699
+ 495,
700
+ 776,
701
+ 830,
702
+ 833
703
+ ],
704
+ "page_idx": 5
705
+ },
706
+ {
707
+ "type": "text",
708
+ "text": "memory size 10 and 25 show similar performance as Transformer-XL with a memory size equal to 75. RMT learns to use smaller memory more effectively than Transformer-XL. Additionally, the smaller memory size of RMT leads to reducing required GPU memory for running the model. ",
709
+ "bbox": [
710
+ 174,
711
+ 835,
712
+ 828,
713
+ 877
714
+ ],
715
+ "page_idx": 5
716
+ },
717
+ {
718
+ "type": "text",
719
+ "text": "To force models to process longer recurrent dependencies the size of a segment is set to 50, so the number of recurrent steps increases. RMT with memory size 1 shows similar results to Transformer",
720
+ "bbox": [
721
+ 173,
722
+ 883,
723
+ 826,
724
+ 911
725
+ ],
726
+ "page_idx": 5
727
+ },
728
+ {
729
+ "type": "image",
730
+ "img_path": "images/7d65f4844ae0fd26ce2093bfab284a52e8d9c07a793feb9c0983cd3a7f0a316a.jpg",
731
+ "image_caption": [
732
+ "Figure 4: RMT scales better with a number of segments and sequence size. (a) RMT is able to solve copy task perfectly up to 9 segments for a fixed sequence length of 360, while Tr-XL fails. (b) RMT learns to use memory of the same fixed size (60 tokens) more effectively than TR-XL as a sequence length to copy increases (a segment size is 120 for the both models). "
733
+ ],
734
+ "image_footnote": [],
735
+ "bbox": [
736
+ 236,
737
+ 87,
738
+ 761,
739
+ 227
740
+ ],
741
+ "page_idx": 6
742
+ },
743
+ {
744
+ "type": "text",
745
+ "text": "XL with memory size 10. It is worth noting that Transformer-XL memory consists of hidden representations from all layers (in this case, it is $1 0 \\times 1 6$ vectors) when RMT memory is only memory_size vectors. Transformer-XL with memory size 50 and RMT with memory size 5 show similar perplexity values (see Appendix A.5). ",
746
+ "bbox": [
747
+ 173,
748
+ 290,
749
+ 825,
750
+ 347
751
+ ],
752
+ "page_idx": 6
753
+ },
754
+ {
755
+ "type": "text",
756
+ "text": "RMT could be combined with Tr-XL cache. In this case Tr-XL cache could be seen as short-term memory keeping the nearest context and RMT memory as long-term memory. Such combination leads to the best results on WikiText-103 improving over Tr-XL. ",
757
+ "bbox": [
758
+ 174,
759
+ 353,
760
+ 820,
761
+ 395
762
+ ],
763
+ "page_idx": 6
764
+ },
765
+ {
766
+ "type": "text",
767
+ "text": "Table 2: Language modeling on WikiText-103. Average perplexity for the best performed variations of RMT models reported (see full results in Appendix A.5). Underlined values show Tr-XL and RMT models with close results. RMT models with smaller memory sizes achieve similar scores to $\\mathrm { T r } \\mathrm { X L }$ models with larger memory. Combination of cache with recurrent memory (Tr$\\mathbf { X L + R M T }$ ) shows the best performance. ",
768
+ "bbox": [
769
+ 174,
770
+ 400,
771
+ 501,
772
+ 502
773
+ ],
774
+ "page_idx": 6
775
+ },
776
+ {
777
+ "type": "table",
778
+ "img_path": "images/b2a316dd611deecb078c03fd076adc05737dd2288aafe9a3b28ff69dc130f2c9.jpg",
779
+ "table_caption": [],
780
+ "table_footnote": [],
781
+ "table_body": "<table><tr><td>MODEL</td><td>MEMORY</td><td>SEGMENT LEN</td><td>PPL±STD</td></tr><tr><td>TR-XL (PAPER)</td><td>150</td><td>150</td><td>24.0</td></tr><tr><td>BASELINE</td><td>0</td><td>150</td><td>29.95 ± 0.15</td></tr><tr><td>MEMTR</td><td>10</td><td>150</td><td>29.63 ±0.06</td></tr><tr><td>TR-XL (OURS)</td><td>150</td><td>150</td><td>24.12 ±0.05</td></tr><tr><td>TR-XL</td><td>25</td><td>150</td><td>25.57 ±0.02</td></tr><tr><td>TR-XL</td><td>75</td><td>150</td><td>24.68 ±0.01</td></tr><tr><td>RMTBPTT-3</td><td>10</td><td>150</td><td>25.04 ± 0.07</td></tr><tr><td>RMTBPTT-2</td><td>25</td><td>150</td><td>24.85 ±0.31</td></tr><tr><td>TR-XL+RMT</td><td>75+5</td><td>150</td><td>24.47 ± 0.05</td></tr><tr><td>TR-XL+RMT</td><td>150+10</td><td>150</td><td>23.99 ± 0.09</td></tr><tr><td>BASELINE</td><td>0</td><td>50</td><td>39.05 ± 0.01</td></tr><tr><td>TR-XL</td><td>100</td><td>50</td><td>25.66 ± 0.01</td></tr><tr><td>TR-XL</td><td>50</td><td>50</td><td>26.54 ± 0.01</td></tr><tr><td>TR-XL</td><td>25</td><td>50</td><td>27.57 ± 0.09</td></tr><tr><td>TR-XL</td><td>10</td><td>50</td><td>28.98 ±0.11</td></tr><tr><td>RMTBPTT-1</td><td>1</td><td>50</td><td>28.71 ±0.03</td></tr><tr><td>RMTBPTT-3</td><td>10</td><td>50</td><td>26.37 ± 0.01</td></tr></table>",
782
+ "bbox": [
783
+ 173,
784
+ 517,
785
+ 506,
786
+ 734
787
+ ],
788
+ "page_idx": 6
789
+ },
790
+ {
791
+ "type": "text",
792
+ "text": "On enwik8 RMT models with memory size 5 and Transformer-XL with memory size 40 show similar results. Confirming that RMT learns to use smaller amounts of memory representation more effectively. All results for enwik8 dataset are shown in Appendix A.4. ",
793
+ "bbox": [
794
+ 514,
795
+ 401,
796
+ 823,
797
+ 484
798
+ ],
799
+ "page_idx": 6
800
+ },
801
+ {
802
+ "type": "text",
803
+ "text": "Recurrent Memory Transformer learns to make predictions depending on #BPTT_unrolls over previous segments $+ 1$ current segment. Transformer-XL does not use BPTT and relies only on memory_size cached states and current segment making in total: memory_size + segment_length tokens. In Figure 5a, we compare RMT and Tr-XL according to the described value of visible context at training time. ",
804
+ "bbox": [
805
+ 514,
806
+ 491,
807
+ 825,
808
+ 614
809
+ ],
810
+ "page_idx": 6
811
+ },
812
+ {
813
+ "type": "text",
814
+ "text": "RMT with a single memory vector could be trained to achieve lower perplexity as Transformer-XL with memory size 10. This means that RMT can learn to compress information from the previous observations better. Another observation is that RMT with memory sizes 10 and 25 performs only a bit weaker compared to Transformer-XL even when Transformer-XL has access to more non",
815
+ "bbox": [
816
+ 514,
817
+ 622,
818
+ 825,
819
+ 744
820
+ ],
821
+ "page_idx": 6
822
+ },
823
+ {
824
+ "type": "text",
825
+ "text": "compressed states (50, 100, 200) from previous segments. In general, training RMT with unrolling gradients in earlier segments drastically improves scores thus showing the importance of BPTT training but, we observe instabilities and out-of-memory issues during RMT training for a larger memory sizes with deeper BPTT unrolls. ",
826
+ "bbox": [
827
+ 174,
828
+ 746,
829
+ 825,
830
+ 800
831
+ ],
832
+ "page_idx": 6
833
+ },
834
+ {
835
+ "type": "text",
836
+ "text": "RMT wins a lot when only one memory token is added but then the effect from increasing memory size from 5 to 50 fades (Figure 5b). Still, RMT with memory size 5 have performance on par with Transformer-XL with cache 50, confirming that RMT learns to store more compact representations. The results suggest that there is some optimal memory size for RMT to solve the task, and further increase does not add much. ",
837
+ "bbox": [
838
+ 174,
839
+ 808,
840
+ 825,
841
+ 877
842
+ ],
843
+ "page_idx": 6
844
+ },
845
+ {
846
+ "type": "text",
847
+ "text": "Proposed recurrent memory mechanism affects only input and gradient flows of the augmented core model. This might be an important advantage because the memory can be added to already pretrained model. Evaluation results for four memory augmented language models fine tuned for long text classification are presented in the Table 3. Incorporation of 10 memory tokens in the input sequence of 512 allows to encode longer stretches of a text up to 2000 tokens and significantly improve metrics for the majority of models. Moreover, a combination of recurrent memory with RoBERTa-base results in state of the art performance for the Hyperpartisan news classification task (Kiesel et al., 2019). Interestingly, many competing models have input size of 4096 that is at least twice longer compared to RMT extended counterparts but still lag behind. ",
848
+ "bbox": [
849
+ 173,
850
+ 882,
851
+ 821,
852
+ 911
853
+ ],
854
+ "page_idx": 6
855
+ },
856
+ {
857
+ "type": "image",
858
+ "img_path": "images/335470cb923817b05711179cb5131eb30e7408129792f49aae4dc9b2b66050c7.jpg",
859
+ "image_caption": [
860
+ "Figure 5: Deeper BPPT unrolling improves RMT scores on WikiText-103 (a) Visible context at training time can be increased by deeper BPTT unrolls for RMT or enlarging cache for $\\mathrm { T r } \\mathrm { X L }$ . Larger visible context leads to lower perplexity for both models (marker size corresponds to memory size). (b) Recurrence improves performance of RMT compared to $\\mathrm { T r } \\mathrm { X L }$ for the same memory sizes. "
861
+ ],
862
+ "image_footnote": [],
863
+ "bbox": [
864
+ 191,
865
+ 95,
866
+ 794,
867
+ 262
868
+ ],
869
+ "page_idx": 7
870
+ },
871
+ {
872
+ "type": "text",
873
+ "text": "",
874
+ "bbox": [
875
+ 173,
876
+ 332,
877
+ 825,
878
+ 429
879
+ ],
880
+ "page_idx": 7
881
+ },
882
+ {
883
+ "type": "table",
884
+ "img_path": "images/329537f60a761bfe177694006ebffadb9b1195eed53c1ca7497ad18c7bd9be31.jpg",
885
+ "table_caption": [
886
+ "Table 3: Hyperpartisan news detection. Models starting with RMT are taken from HuggingFace Transformers and augmented with 10 memory tokens and recurrence before fine-tuning. Train/valid/test split as in (Beltagy et al., 2020) and metric is F1. "
887
+ ],
888
+ "table_footnote": [],
889
+ "table_body": "<table><tr><td>MODEL [INPUT SIZE]</td><td colspan=\"4\">NUMBER OF SEGMENTS 2 3</td></tr><tr><td></td><td>1</td><td></td><td></td><td></td></tr><tr><td>BIG BIRD [4096] (ZAHEER ET AL.,2020) LONGFORMER [4096] (BELTAGY ET AL.,2020)</td><td>92.20 94.80</td><td></td><td></td><td></td></tr><tr><td>GRAPH-ROBERTA [512X100](XU ET AL.,2021)</td><td>96.15</td><td></td><td></td><td></td></tr><tr><td>ERNIE-DOC-LARGE [640] (DING ET AL.,2021)</td><td>96.60</td><td></td><td></td><td></td></tr><tr><td>ERNIE-SPARSE [4096] (LIU ET AL.,2022)</td><td>92.81</td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td></tr><tr><td>RMT BERT-BASE-CASE [512]</td><td>91.60</td><td>94.12 97.20</td><td>93.06 96.72</td><td>94.34</td></tr><tr><td>RMT ROBERTA-BASE [512] RMT DEBERTA-V3-BASE[512]</td><td>94.87 94.17</td><td>96.78</td><td>94.80</td><td>98.11 94.80</td></tr><tr><td>RMTT5-BASE[512]</td><td>94.99</td><td>95.32</td><td>96.12</td><td>97.20</td></tr></table>",
890
+ "bbox": [
891
+ 367,
892
+ 500,
893
+ 823,
894
+ 633
895
+ ],
896
+ "page_idx": 7
897
+ },
898
+ {
899
+ "type": "text",
900
+ "text": "To get an understanding of memory operations, learned by RMT for algorithmic tasks we visualise attention maps for copy and reverse tasks (Figure 6). In each RMT attention map sequence tokens are preceded by read memory, located at the top left corner, and followed by write memory at the bottom right. Diagonal at the central part of the fig.6(a) (top) shows classic attention of token sequence ",
901
+ "bbox": [
902
+ 174,
903
+ 435,
904
+ 356,
905
+ 642
906
+ ],
907
+ "page_idx": 7
908
+ },
909
+ {
910
+ "type": "text",
911
+ "text": "to itself, but the bottom diagonal represents the operation of writing of sequence tokens to memory in straight order. When completing reverse (fig.6(a) bottom) the model learns to write the sequence to the memory in the reversed order, which is in line with common sense. ",
912
+ "bbox": [
913
+ 174,
914
+ 642,
915
+ 823,
916
+ 684
917
+ ],
918
+ "page_idx": 7
919
+ },
920
+ {
921
+ "type": "text",
922
+ "text": "When it comes to reproducing the target sequence, the model accesses memory (fig.6(b)) and writes to the output sequence. Another operation (fig.6(c)) is rewriting from read memory to write memory. It is commonly used by RMT in settings with larger number of segments to keep information about recent segments longer. ",
923
+ "bbox": [
924
+ 174,
925
+ 690,
926
+ 825,
927
+ 746
928
+ ],
929
+ "page_idx": 7
930
+ },
931
+ {
932
+ "type": "text",
933
+ "text": "Transformer-XL mechanism of accessing memory (fig.6(d)) does not allow straightforward writing to memory without changing sequence token representations. Sequential reading from cache is represented by diagonals on Transformer-XL attention maps. Using token representations as storage harms model performance in tasks with larger number of segments. For reverse task with 4 segments Transformer-XL with limited memory size 6 (Appendix B Figure 9(b)) attempts to mix representations of tokens and read multiple symbols from one cached state in the next segments giving average accuracy of 0.8 on the target task. Despite having the same memory size, RMT manages to compress the whole segment in memory tokens (Appendix B Figure 9(a)) and achieve mean accuracy 1. ",
934
+ "bbox": [
935
+ 174,
936
+ 752,
937
+ 825,
938
+ 863
939
+ ],
940
+ "page_idx": 7
941
+ },
942
+ {
943
+ "type": "text",
944
+ "text": "Visualizations from Figure 6 and Appendix B Figure 9 provide evidence to support our hypotheses that Tr-XL has to mix representations from previous and current segments in the same hidden states to pass information between segments. Also, visualizations show how memory tokens in RMT help mitigate such kind of mixing. RMT ability of sequence compression to memory is illustrated in Appendix A.1 Figure 8. For copy with 6 segments RMT compresses and then reads the sequence of 12 tokens with just 6 memory tokens. For Transformer-XL decreasing memory size harms the accuracy score significantly with number of segments larger than 2. ",
945
+ "bbox": [
946
+ 174,
947
+ 869,
948
+ 825,
949
+ 911
950
+ ],
951
+ "page_idx": 7
952
+ },
953
+ {
954
+ "type": "text",
955
+ "text": "",
956
+ "bbox": [
957
+ 173,
958
+ 90,
959
+ 825,
960
+ 147
961
+ ],
962
+ "page_idx": 8
963
+ },
964
+ {
965
+ "type": "image",
966
+ "img_path": "images/d2d3cfdc0f59f3fb51f66df6c2a6e55fe1e8eab228c9fa8082be1bafcb722725.jpg",
967
+ "image_caption": [
968
+ "Figure 6: Selected attention map patterns of memory models. (color intensity corresponds to attention score) RMT with segment length $^ { 1 = 2 4 }$ , memory size $= 2 4$ (a) write to memory, (b) read from memory. (c) RMT, segment length $^ { = 8 }$ , memory size ${ : = } 8$ , rewrite from read memory to write memory. (d) Transformer-XL, segment length $^ { 1 = 2 4 }$ , memory siz ${ \\romannumeral 2 4 }$ read from the previous hidden states. "
969
+ ],
970
+ "image_footnote": [],
971
+ "bbox": [
972
+ 173,
973
+ 161,
974
+ 823,
975
+ 406
976
+ ],
977
+ "page_idx": 8
978
+ },
979
+ {
980
+ "type": "text",
981
+ "text": "6 Conclusions ",
982
+ "text_level": 1,
983
+ "bbox": [
984
+ 174,
985
+ 479,
986
+ 305,
987
+ 496
988
+ ],
989
+ "page_idx": 8
990
+ },
991
+ {
992
+ "type": "text",
993
+ "text": "In this paper we introduced Recurrent Memory Transformer a simple recurrent memory augmentation of Transformer model. RMT is implemented by extension of an input sequence with special global memory tokens and segment-level recurrence. Importantly, our method allows to learn more compact sequence representations and improve existing pretrained models without extensive additional compute, thus making practical machine learning applications more energy efficient and environmentally friendly. ",
994
+ "bbox": [
995
+ 174,
996
+ 511,
997
+ 825,
998
+ 594
999
+ ],
1000
+ "page_idx": 8
1001
+ },
1002
+ {
1003
+ "type": "text",
1004
+ "text": "In our experiments we compared RMT with Transformer baseline and Transformer-XL which is a well-known modification of Transformer for long sequences. RMT almost perfectly solves Copy, Reverse as well as quadratic equations tasks for sequences consisting of multiple segments outperforming Transformer-XL. It also demonstrates quality for associative retrieval task on par with Transformer-XL. As expected, baseline Transformer fails to solve these tasks for multi-segment settings. ",
1005
+ "bbox": [
1006
+ 173,
1007
+ 599,
1008
+ 825,
1009
+ 684
1010
+ ],
1011
+ "page_idx": 8
1012
+ },
1013
+ {
1014
+ "type": "text",
1015
+ "text": "RMT trained as a language model performs significantly ahead of Transformer baseline and shows quality metrics similar to Transformer-XL but for up to 10 times smaller memory size. Experimental results demonstrate that for fixed memory size backpropagating gradients for more segments improves performance of RMT. Proposed approach to memory augmentation is quite universal and might be easily applied to any pretrained transformer based model as demonstrated by achievement of state of the art results for long text classification task by fine tuning a combination of RoBERTa and RMT. ",
1016
+ "bbox": [
1017
+ 174,
1018
+ 690,
1019
+ 825,
1020
+ 773
1021
+ ],
1022
+ "page_idx": 8
1023
+ },
1024
+ {
1025
+ "type": "text",
1026
+ "text": "Analysis of attention maps suggests that better RMT performance can be related to more effective storage of input representations in dedicated memory tokens compared to mixing representations storage in Transformer-XL. RMT could be combined with Transformer-XL cache and improve the performance of both models. ",
1027
+ "bbox": [
1028
+ 174,
1029
+ 780,
1030
+ 825,
1031
+ 835
1032
+ ],
1033
+ "page_idx": 8
1034
+ },
1035
+ {
1036
+ "type": "text",
1037
+ "text": "Overall, results of the study show that dedicated memory storage and recurrence provided by Recurrent Memory Transformer make it a promising architecture for applications that require learning of long-term dependencies and general purpose in-memory processing, such as algorithmic tasks and reasoning. Furthermore, we believe that RMT could open the way for adding memory and recurrence to other models in the Transformer family. ",
1038
+ "bbox": [
1039
+ 174,
1040
+ 842,
1041
+ 823,
1042
+ 911
1043
+ ],
1044
+ "page_idx": 8
1045
+ },
1046
+ {
1047
+ "type": "text",
1048
+ "text": "Acknowledgments and Disclosure of Funding ",
1049
+ "text_level": 1,
1050
+ "bbox": [
1051
+ 174,
1052
+ 88,
1053
+ 553,
1054
+ 107
1055
+ ],
1056
+ "page_idx": 9
1057
+ },
1058
+ {
1059
+ "type": "text",
1060
+ "text": "This work was supported by a grant for research centers in the field of artificial intelligence, provided by the Analytical Center for the Government of the Russian Federation in accordance with the subsidy agreement (agreement identifier 000000D730321P5Q0002) and the agreement with the Moscow Institute of Physics and Technology dated November 1, 2021 No. 70-2021-00138. ",
1061
+ "bbox": [
1062
+ 174,
1063
+ 121,
1064
+ 825,
1065
+ 178
1066
+ ],
1067
+ "page_idx": 9
1068
+ },
1069
+ {
1070
+ "type": "text",
1071
+ "text": "References ",
1072
+ "text_level": 1,
1073
+ "bbox": [
1074
+ 174,
1075
+ 196,
1076
+ 266,
1077
+ 213
1078
+ ],
1079
+ "page_idx": 9
1080
+ },
1081
+ {
1082
+ "type": "text",
1083
+ "text": "Joshua Ainslie, Santiago Ontanon, Chris Alberti, Philip Pham, Anirudh Ravula, and Sumit Sanghai. Etc: Encoding long and structured data in transformers, 2020. ",
1084
+ "bbox": [
1085
+ 173,
1086
+ 220,
1087
+ 825,
1088
+ 246
1089
+ ],
1090
+ "page_idx": 9
1091
+ },
1092
+ {
1093
+ "type": "text",
1094
+ "text": "Jimmy Ba, Geoffrey E Hinton, Volodymyr Mnih, Joel Z Leibo, and Catalin Ionescu. Using fast weights to attend to the recent past. In D. Lee, M. Sugiyama, U. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 29. Curran Associates, Inc., 2016. URL https://proceedings. neurips.cc/paper/2016/file/9f44e956e3a2b7b5598c625fcc802c36-Paper.pdf. ",
1095
+ "bbox": [
1096
+ 173,
1097
+ 257,
1098
+ 826,
1099
+ 309
1100
+ ],
1101
+ "page_idx": 9
1102
+ },
1103
+ {
1104
+ "type": "text",
1105
+ "text": "Iz Beltagy, Matthew E Peters, and Arman Cohan. Longformer: The long-document transformer. arXiv preprint arXiv:2004.05150, 2020. ",
1106
+ "bbox": [
1107
+ 169,
1108
+ 320,
1109
+ 823,
1110
+ 347
1111
+ ],
1112
+ "page_idx": 9
1113
+ },
1114
+ {
1115
+ "type": "text",
1116
+ "text": "Mikhail S Burtsev, Yuri Kuratov, Anton Peganov, and Grigory V Sapunov. Memory transformer. arXiv preprint arXiv:2006.11527, 2020. ",
1117
+ "bbox": [
1118
+ 173,
1119
+ 358,
1120
+ 823,
1121
+ 383
1122
+ ],
1123
+ "page_idx": 9
1124
+ },
1125
+ {
1126
+ "type": "text",
1127
+ "text": "Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers, 2019. ",
1128
+ "bbox": [
1129
+ 171,
1130
+ 395,
1131
+ 825,
1132
+ 421
1133
+ ],
1134
+ "page_idx": 9
1135
+ },
1136
+ {
1137
+ "type": "text",
1138
+ "text": "Kyunghyun Cho, Bart van Merriënboer, Dzmitry Bahdanau, and Yoshua Bengio. On the properties of neural machine translation: Encoder–decoder approaches. In Proceedings of SSST-8, Eighth Workshop on Syntax, Semantics and Structure in Statistical Translation, pages 103–111, Doha, Qatar, October 2014. Association for Computational Linguistics. doi: 10.3115/v1/W14-4012. URL https://aclanthology.org/W14-4012. ",
1139
+ "bbox": [
1140
+ 174,
1141
+ 433,
1142
+ 826,
1143
+ 484
1144
+ ],
1145
+ "page_idx": 9
1146
+ },
1147
+ {
1148
+ "type": "text",
1149
+ "text": "Krzysztof Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane, Tamas Sarlos, Peter Hawkins, Jared Davis, Afroz Mohiuddin, Lukasz Kaiser, et al. Rethinking attention with performers. arXiv preprint arXiv:2009.14794, 2020. ",
1150
+ "bbox": [
1151
+ 174,
1152
+ 496,
1153
+ 825,
1154
+ 535
1155
+ ],
1156
+ "page_idx": 9
1157
+ },
1158
+ {
1159
+ "type": "text",
1160
+ "text": "Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V. Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context, 2019. ",
1161
+ "bbox": [
1162
+ 174,
1163
+ 546,
1164
+ 823,
1165
+ 573
1166
+ ],
1167
+ "page_idx": 9
1168
+ },
1169
+ {
1170
+ "type": "text",
1171
+ "text": "Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171–4186, 2019. URL https://aclweb.org/anthology/papers/N/N19/ N19-1423/. ",
1172
+ "bbox": [
1173
+ 173,
1174
+ 583,
1175
+ 825,
1176
+ 647
1177
+ ],
1178
+ "page_idx": 9
1179
+ },
1180
+ {
1181
+ "type": "text",
1182
+ "text": "SiYu Ding, Junyuan Shang, Shuohuan Wang, Yu Sun, Hao Tian, Hua Wu, and Haifeng Wang. ERNIE-Doc: A retrospective long-document modeling transformer. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pages 2914–2927, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-long.227. URL https://aclanthology.org/2021.acl-long. 227. ",
1183
+ "bbox": [
1184
+ 174,
1185
+ 659,
1186
+ 826,
1187
+ 736
1188
+ ],
1189
+ "page_idx": 9
1190
+ },
1191
+ {
1192
+ "type": "text",
1193
+ "text": "Linhao Dong, Shuang Xu, and Bo Xu. Speech-transformer: A no-recurrence sequence-to-sequence model for speech recognition. In 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 5884–5888, 2018. doi: 10.1109/ICASSP.2018.8462506. ",
1194
+ "bbox": [
1195
+ 173,
1196
+ 747,
1197
+ 823,
1198
+ 785
1199
+ ],
1200
+ "page_idx": 9
1201
+ },
1202
+ {
1203
+ "type": "text",
1204
+ "text": "Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=YicbFdNTTy. ",
1205
+ "bbox": [
1206
+ 174,
1207
+ 796,
1208
+ 825,
1209
+ 848
1210
+ ],
1211
+ "page_idx": 9
1212
+ },
1213
+ {
1214
+ "type": "text",
1215
+ "text": "Angela Fan, Thibaut Lavril, Edouard Grave, Armand Joulin, and Sainbayar Sukhbaatar. Addressing some limitations of transformers with feedback memory. arXiv preprint arXiv:2002.09402, 2020. ",
1216
+ "bbox": [
1217
+ 176,
1218
+ 859,
1219
+ 823,
1220
+ 886
1221
+ ],
1222
+ "page_idx": 9
1223
+ },
1224
+ {
1225
+ "type": "text",
1226
+ "text": "Alex Graves, Greg Wayne, and Ivo Danihelka. Neural turing machines, 2014. ",
1227
+ "bbox": [
1228
+ 174,
1229
+ 897,
1230
+ 632,
1231
+ 911
1232
+ ],
1233
+ "page_idx": 9
1234
+ },
1235
+ {
1236
+ "type": "text",
1237
+ "text": "Alex Graves, Greg Wayne, Malcolm Reynolds, Tim Harley, Ivo Danihelka, Agnieszka Grabska-Barwinska, ´ Sergio Gómez Colmenarejo, Edward Grefenstette, Tiago Ramalho, John Agapiou, Adrià Puigdomènech Badia, Karl Moritz Hermann, Yori Zwols, Georg Ostrovski, Adam Cain, Helen King, Christopher Summerfield, Phil Blunsom, Koray Kavukcuoglu, and Demis Hassabis. Hybrid computing using a neural network with dynamic external memory. Nature, 538(7626):471–476, October 2016. ISSN 00280836. URL http: //dx.doi.org/10.1038/nature20101. ",
1238
+ "bbox": [
1239
+ 174,
1240
+ 92,
1241
+ 828,
1242
+ 169
1243
+ ],
1244
+ "page_idx": 10
1245
+ },
1246
+ {
1247
+ "type": "text",
1248
+ "text": "Edward Grefenstette, Karl Moritz Hermann, Mustafa Suleyman, and Phil Blunsom. Learning to transduce with unbounded memory, 2015. ",
1249
+ "bbox": [
1250
+ 173,
1251
+ 178,
1252
+ 823,
1253
+ 205
1254
+ ],
1255
+ "page_idx": 10
1256
+ },
1257
+ {
1258
+ "type": "text",
1259
+ "text": "Caglar Gulcehre, Sarath Chandar, Kyunghyun Cho, and Yoshua Bengio. Dynamic neural turing machine with soft and hard addressing schemes. arXiv preprint arXiv:1607.00036, 2016. ",
1260
+ "bbox": [
1261
+ 173,
1262
+ 213,
1263
+ 823,
1264
+ 239
1265
+ ],
1266
+ "page_idx": 10
1267
+ },
1268
+ {
1269
+ "type": "text",
1270
+ "text": "Caglar Gulcehre, Sarath Chandar, and Yoshua Bengio. Memory augmented neural networks with wormhole connections. arXiv preprint arXiv:1701.08718, 2017. ",
1271
+ "bbox": [
1272
+ 173,
1273
+ 250,
1274
+ 823,
1275
+ 276
1276
+ ],
1277
+ "page_idx": 10
1278
+ },
1279
+ {
1280
+ "type": "text",
1281
+ "text": "Qipeng Guo, Xipeng Qiu, Pengfei Liu, Yunfan Shao, Xiangyang Xue, and Zheng Zhang. Star-transformer, 2019. ",
1282
+ "bbox": [
1283
+ 171,
1284
+ 285,
1285
+ 823,
1286
+ 300
1287
+ ],
1288
+ "page_idx": 10
1289
+ },
1290
+ {
1291
+ "type": "text",
1292
+ "text": "Ankit Gupta and Jonathan Berant. Gmat: Global memory augmentation for transformers. arXiv preprint arXiv:2006.03274, 2020. ",
1293
+ "bbox": [
1294
+ 173,
1295
+ 308,
1296
+ 823,
1297
+ 335
1298
+ ],
1299
+ "page_idx": 10
1300
+ },
1301
+ {
1302
+ "type": "text",
1303
+ "text": "Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural Comput., 9(8):1735–1780, November 1997. ISSN 0899-7667. doi: 10.1162/neco.1997.9.8.1735. URL https://doi.org/10.1162/ neco.1997.9.8.1735. ",
1304
+ "bbox": [
1305
+ 173,
1306
+ 344,
1307
+ 823,
1308
+ 383
1309
+ ],
1310
+ "page_idx": 10
1311
+ },
1312
+ {
1313
+ "type": "text",
1314
+ "text": "Andrew Jaegle, Sebastian Borgeaud, Jean-Baptiste Alayrac, Carl Doersch, Catalin Ionescu, David Ding, Skanda Koppula, Daniel Zoran, Andrew Brock, Evan Shelhamer, et al. Perceiver io: A general architecture for structured inputs & outputs. arXiv preprint arXiv:2107.14795, 2021. ",
1315
+ "bbox": [
1316
+ 174,
1317
+ 392,
1318
+ 821,
1319
+ 433
1320
+ ],
1321
+ "page_idx": 10
1322
+ },
1323
+ {
1324
+ "type": "text",
1325
+ "text": "Armand Joulin and Tomas Mikolov. Inferring algorithmic patterns with stack-augmented recurrent nets, 2015. ",
1326
+ "bbox": [
1327
+ 171,
1328
+ 440,
1329
+ 823,
1330
+ 457
1331
+ ],
1332
+ "page_idx": 10
1333
+ },
1334
+ {
1335
+ "type": "text",
1336
+ "text": "Da Ju, Stephen Roller, Sainbayar Sukhbaatar, and Jason Weston. Staircase attention for recurrent processing of sequences. arXiv preprint arXiv:2106.04279, 2021. ",
1337
+ "bbox": [
1338
+ 171,
1339
+ 464,
1340
+ 823,
1341
+ 491
1342
+ ],
1343
+ "page_idx": 10
1344
+ },
1345
+ {
1346
+ "type": "text",
1347
+ "text": "Johannes Kiesel, Maria Mestre, Rishabh Shukla, Emmanuel Vincent, Payam Adineh, David Corney, Benno Stein, and Martin Potthast. Semeval-2019 task 4: Hyperpartisan news detection. In Proceedings of the 13th International Workshop on Semantic Evaluation, pages 829–839, 2019. ",
1348
+ "bbox": [
1349
+ 174,
1350
+ 500,
1351
+ 823,
1352
+ 540
1353
+ ],
1354
+ "page_idx": 10
1355
+ },
1356
+ {
1357
+ "type": "text",
1358
+ "text": "Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR (Poster), 2015. URL http://arxiv.org/abs/1412.6980. ",
1359
+ "bbox": [
1360
+ 173,
1361
+ 547,
1362
+ 823,
1363
+ 575
1364
+ ],
1365
+ "page_idx": 10
1366
+ },
1367
+ {
1368
+ "type": "text",
1369
+ "text": "Guillaume Lample, Alexandre Sablayrolles, Marc’Aurelio Ranzato, Ludovic Denoyer, and Hervé Jégou. Large memory layers with product keys, 2019. ",
1370
+ "bbox": [
1371
+ 173,
1372
+ 584,
1373
+ 823,
1374
+ 611
1375
+ ],
1376
+ "page_idx": 10
1377
+ },
1378
+ {
1379
+ "type": "text",
1380
+ "text": "Jie Lei, Liwei Wang, Yelong Shen, Dong Yu, Tamara L. Berg, and Mohit Bansal. Mart: Memory-augmented recurrent transformer for coherent video paragraph captioning, 2020. ",
1381
+ "bbox": [
1382
+ 171,
1383
+ 619,
1384
+ 823,
1385
+ 647
1386
+ ],
1387
+ "page_idx": 10
1388
+ },
1389
+ {
1390
+ "type": "text",
1391
+ "text": "Yang Liu, Jiaxiang Liu, Li Chen, Yuxiang Lu, Shikun Feng, Zhida Feng, Yu Sun, Hao Tian, Hua Wu, and Haifeng Wang. Ernie-sparse: Learning hierarchical efficient transformer through regularized self-attention. arXiv preprint arXiv:2203.12276, 2022. ",
1392
+ "bbox": [
1393
+ 174,
1394
+ 655,
1395
+ 823,
1396
+ 694
1397
+ ],
1398
+ "page_idx": 10
1399
+ },
1400
+ {
1401
+ "type": "text",
1402
+ "text": "Matt Mahoney. Large text compression benchmark, 2006. URL http://www.mattmahoney.net/dc/text. html. ",
1403
+ "bbox": [
1404
+ 171,
1405
+ 703,
1406
+ 823,
1407
+ 731
1408
+ ],
1409
+ "page_idx": 10
1410
+ },
1411
+ {
1412
+ "type": "text",
1413
+ "text": "Pedro Henrique Martins, Zita Marinho, and André FT Martins. $\\infty$ -former: Infinite memory transformer. arXiv preprint arXiv:2109.00301, 2021. ",
1414
+ "bbox": [
1415
+ 173,
1416
+ 739,
1417
+ 823,
1418
+ 767
1419
+ ],
1420
+ "page_idx": 10
1421
+ },
1422
+ {
1423
+ "type": "text",
1424
+ "text": "Warren S McCulloch and Walter Pitts. A logical calculus of the ideas immanent in nervous activity. The bulletin of mathematical biophysics, 5(4):115–133, 1943. ",
1425
+ "bbox": [
1426
+ 173,
1427
+ 775,
1428
+ 823,
1429
+ 803
1430
+ ],
1431
+ "page_idx": 10
1432
+ },
1433
+ {
1434
+ "type": "text",
1435
+ "text": "Yuanliang Meng and Anna Rumshisky. Context-aware neural model for temporal information extraction. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 527–536, 2018. ",
1436
+ "bbox": [
1437
+ 174,
1438
+ 811,
1439
+ 823,
1440
+ 851
1441
+ ],
1442
+ "page_idx": 10
1443
+ },
1444
+ {
1445
+ "type": "text",
1446
+ "text": "Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017. URL https://openreview.net/forum? id=Byj72udxe. ",
1447
+ "bbox": [
1448
+ 174,
1449
+ 859,
1450
+ 825,
1451
+ 911
1452
+ ],
1453
+ "page_idx": 10
1454
+ },
1455
+ {
1456
+ "type": "text",
1457
+ "text": "Alec Radford, Karthik Narasimhan, Tim Salimans, and Ilya Sutskever. Improving language understanding by generative pre-training. 2018. URL https://www.cs.ubc.ca/\\~amuham01/LING530/papers/ radford2018improving.pdf. ",
1458
+ "bbox": [
1459
+ 171,
1460
+ 92,
1461
+ 825,
1462
+ 131
1463
+ ],
1464
+ "page_idx": 11
1465
+ },
1466
+ {
1467
+ "type": "text",
1468
+ "text": "Jack W Rae, Jonathan J Hunt, Tim Harley, Ivo Danihelka, Andrew Senior, Greg Wayne, Alex Graves, and Timothy P Lillicrap. Scaling memory-augmented neural networks with sparse reads and writes, 2016. ",
1469
+ "bbox": [
1470
+ 174,
1471
+ 140,
1472
+ 823,
1473
+ 166
1474
+ ],
1475
+ "page_idx": 11
1476
+ },
1477
+ {
1478
+ "type": "text",
1479
+ "text": "Jack W. Rae, Anna Potapenko, Siddhant M. Jayakumar, and Timothy P. Lillicrap. Compressive transformers for long-range sequence modelling, 2019. ",
1480
+ "bbox": [
1481
+ 174,
1482
+ 174,
1483
+ 823,
1484
+ 202
1485
+ ],
1486
+ "page_idx": 11
1487
+ },
1488
+ {
1489
+ "type": "text",
1490
+ "text": "Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. Zero-shot text-to-image generation. In Marina Meila and Tong Zhang, editors, Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pages 8821–8831. PMLR, 18–24 Jul 2021. URL https://proceedings.mlr.press/v139/ ramesh21a.html. ",
1491
+ "bbox": [
1492
+ 174,
1493
+ 209,
1494
+ 826,
1495
+ 273
1496
+ ],
1497
+ "page_idx": 11
1498
+ },
1499
+ {
1500
+ "type": "text",
1501
+ "text": "C Stephen. Kleene. representation of events in nerve nets and finite automata. Automata studies, 1956. ",
1502
+ "bbox": [
1503
+ 176,
1504
+ 282,
1505
+ 779,
1506
+ 297
1507
+ ],
1508
+ "page_idx": 11
1509
+ },
1510
+ {
1511
+ "type": "text",
1512
+ "text": "Sainbayar Sukhbaatar, Arthur Szlam, Jason Weston, and Rob Fergus. End-to-end memory networks, 2015. ",
1513
+ "bbox": [
1514
+ 176,
1515
+ 305,
1516
+ 802,
1517
+ 320
1518
+ ],
1519
+ "page_idx": 11
1520
+ },
1521
+ {
1522
+ "type": "text",
1523
+ "text": "Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is All you Need. In Advances in neural information processing systems, pages 5998–6008, 2017. URL http://papers.nips.cc/paper/7181-attention-is-all-you-need. ",
1524
+ "bbox": [
1525
+ 174,
1526
+ 328,
1527
+ 823,
1528
+ 368
1529
+ ],
1530
+ "page_idx": 11
1531
+ },
1532
+ {
1533
+ "type": "text",
1534
+ "text": "Sinong Wang, Belinda Z. Li, Madian Khabsa, Han Fang, and Hao Ma. Linformer: Self-attention with linear complexity, 2020. ",
1535
+ "bbox": [
1536
+ 174,
1537
+ 376,
1538
+ 823,
1539
+ 402
1540
+ ],
1541
+ "page_idx": 11
1542
+ },
1543
+ {
1544
+ "type": "text",
1545
+ "text": "Paul J Werbos. Backpropagation through time: what it does and how to do it. Proceedings of the IEEE, 78(10): 1550–1560, 1990. ",
1546
+ "bbox": [
1547
+ 173,
1548
+ 411,
1549
+ 823,
1550
+ 438
1551
+ ],
1552
+ "page_idx": 11
1553
+ },
1554
+ {
1555
+ "type": "text",
1556
+ "text": "Jason Weston, Sumit Chopra, and Antoine Bordes. Memory networks, 2014. ",
1557
+ "bbox": [
1558
+ 173,
1559
+ 446,
1560
+ 627,
1561
+ 460
1562
+ ],
1563
+ "page_idx": 11
1564
+ },
1565
+ {
1566
+ "type": "text",
1567
+ "text": "Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Rémi Louf, Morgan Funtowicz, et al. Transformers: State-of-the-art natural language processing. In Proceedings of the 2020 conference on empirical methods in natural language processing: system demonstrations, pages 38–45, 2020. ",
1568
+ "bbox": [
1569
+ 174,
1570
+ 468,
1571
+ 826,
1572
+ 520
1573
+ ],
1574
+ "page_idx": 11
1575
+ },
1576
+ {
1577
+ "type": "text",
1578
+ "text": "Qingyang Wu, Zhenzhong Lan, Jing Gu, and Zhou Yu. Memformer: The memory-augmented transformer. arXiv preprint arXiv:2010.06891, 2020. ",
1579
+ "bbox": [
1580
+ 171,
1581
+ 530,
1582
+ 823,
1583
+ 556
1584
+ ],
1585
+ "page_idx": 11
1586
+ },
1587
+ {
1588
+ "type": "text",
1589
+ "text": "Peng Xu, Xinchi Chen, Xiaofei Ma, Zhiheng Huang, and Bing Xiang. Contrastive document representation learning with graph attention networks. arXiv preprint arXiv:2110.10778, 2021. ",
1590
+ "bbox": [
1591
+ 169,
1592
+ 564,
1593
+ 823,
1594
+ 592
1595
+ ],
1596
+ "page_idx": 11
1597
+ },
1598
+ {
1599
+ "type": "text",
1600
+ "text": "Manzil Zaheer, Guru Guruganesh, Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontanon, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, et al. Big bird: Transformers for longer sequences. arXiv preprint arXiv:2007.14062, 2020. ",
1601
+ "bbox": [
1602
+ 174,
1603
+ 601,
1604
+ 826,
1605
+ 638
1606
+ ],
1607
+ "page_idx": 11
1608
+ },
1609
+ {
1610
+ "type": "text",
1611
+ "text": "Checklist ",
1612
+ "text_level": 1,
1613
+ "bbox": [
1614
+ 174,
1615
+ 89,
1616
+ 254,
1617
+ 106
1618
+ ],
1619
+ "page_idx": 12
1620
+ },
1621
+ {
1622
+ "type": "text",
1623
+ "text": "1. For all authors... ",
1624
+ "bbox": [
1625
+ 214,
1626
+ 116,
1627
+ 339,
1628
+ 130
1629
+ ],
1630
+ "page_idx": 12
1631
+ },
1632
+ {
1633
+ "type": "text",
1634
+ "text": "(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] \n(b) Did you describe the limitations of your work? [Yes] We mention training instabilities and GPU RAM issues in Section 5. \n(c) Did you discuss any potential negative societal impacts of your work? [No] The proposed model and method do not have any specific impacts. All general negative societal impacts applicable to the field could be potentially relative. \n(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] ",
1635
+ "bbox": [
1636
+ 238,
1637
+ 135,
1638
+ 825,
1639
+ 267
1640
+ ],
1641
+ "page_idx": 12
1642
+ },
1643
+ {
1644
+ "type": "text",
1645
+ "text": "2. If you are including theoretical results... ",
1646
+ "bbox": [
1647
+ 215,
1648
+ 272,
1649
+ 493,
1650
+ 286
1651
+ ],
1652
+ "page_idx": 12
1653
+ },
1654
+ {
1655
+ "type": "text",
1656
+ "text": "(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A] ",
1657
+ "bbox": [
1658
+ 238,
1659
+ 290,
1660
+ 736,
1661
+ 321
1662
+ ],
1663
+ "page_idx": 12
1664
+ },
1665
+ {
1666
+ "type": "text",
1667
+ "text": "3. If you ran experiments... ",
1668
+ "bbox": [
1669
+ 212,
1670
+ 325,
1671
+ 393,
1672
+ 340
1673
+ ],
1674
+ "page_idx": 12
1675
+ },
1676
+ {
1677
+ "type": "text",
1678
+ "text": "(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] We include code, training scripts, and raw experimental data in the supplementary material. The supplemental materials would be published on github with the final version of the paper. Instructions for language modeling data&experiments are taken from Tr-XL repo. \n(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 4, Appendix A, and provided supplementary material. \n(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] All the key experiments results are reported with std. Furthermore, we provide raw experimental data in the supplementary materials. \n(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] We used different GPUs depending on the task: 1080Ti, V100, A100. We provide this information in Appendix A for each task. ",
1679
+ "bbox": [
1680
+ 238,
1681
+ 344,
1682
+ 826,
1683
+ 544
1684
+ ],
1685
+ "page_idx": 12
1686
+ },
1687
+ {
1688
+ "type": "text",
1689
+ "text": "4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... ",
1690
+ "bbox": [
1691
+ 210,
1692
+ 550,
1693
+ 823,
1694
+ 564
1695
+ ],
1696
+ "page_idx": 12
1697
+ },
1698
+ {
1699
+ "type": "text",
1700
+ "text": "(a) If your work uses existing assets, did you cite the creators? [Yes] We refer to the original Tr-XL code and Tr-XL paper. We use it for establishing baselines and setting our methods. See Section 4 \n(b) Did you mention the license of the assets? [No] Tr-XL license is Apache 2.0 and available at its github repo. \n(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] Our code is in the supplemental material and on GitHub: https://github.com/ booydar/LM-RMT \n(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [No] We used publicly available Tr-XL code (Apache 2.0) and datasets. \n(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [No] We use either synthetic data or datasets collected from the Wikipedia (Wikitext-103, enwik8). ",
1701
+ "bbox": [
1702
+ 238,
1703
+ 568,
1704
+ 825,
1705
+ 757
1706
+ ],
1707
+ "page_idx": 12
1708
+ },
1709
+ {
1710
+ "type": "text",
1711
+ "text": "5. If you used crowdsourcing or conducted research with human subjects... ",
1712
+ "bbox": [
1713
+ 215,
1714
+ 762,
1715
+ 705,
1716
+ 776
1717
+ ],
1718
+ "page_idx": 12
1719
+ },
1720
+ {
1721
+ "type": "text",
1722
+ "text": "(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] \n(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] \n(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] ",
1723
+ "bbox": [
1724
+ 238,
1725
+ 781,
1726
+ 826,
1727
+ 869
1728
+ ],
1729
+ "page_idx": 12
1730
+ }
1731
+ ]
parse/dev/Uynr3iPhksa/Uynr3iPhksa_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/Uynr3iPhksa/Uynr3iPhksa_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/ZBESeIUB5k/ZBESeIUB5k.md ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/ZBESeIUB5k/ZBESeIUB5k_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/ZBESeIUB5k/ZBESeIUB5k_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/ZBESeIUB5k/ZBESeIUB5k_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/aa8KsqfTPa/aa8KsqfTPa.md ADDED
@@ -0,0 +1,240 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MarioGPT: Open-Ended Text2Level Generation through Large Language Models
2
+
3
+ Shyam Sudhakaran1, Miguel González-Duque∗1, Matthias Freiberger∗1, Claire Glanois1, Elias Najarro1, Sebastian Risi1,2 1IT University of Copenhagen, 2modl.ai, Copenhagen shyamsnair@protonmail.com, sebr@itu.dk
4
+
5
+ ![](images/52126a6124ad6c7cc1b5a0732fb14907f3b8a00de0206f8909adb73db7da2f21.jpg)
6
+ Figure 1: MarioGPT is able to successfully generate levels that follow the text prompt (a–e). Failure cases rarely happen: for example in (f) the model manages to generate many pipes and some blocks, but it still generates enemies even though it was prompted with "no enemies".
7
+
8
+ # Abstract
9
+
10
+ Procedural Content Generation (PCG) is a technique to generate complex and diverse environments in an automated way. However, while generating content with PCG methods is often straightforward, generating meaningful content that reflects specific intentions and constraints remains challenging. Furthermore, many PCG algorithms lack the ability to generate content in an open-ended manner. Recently, Large Language Models (LLMs) have shown to be incredibly effective in many diverse domains. These trained LLMs can be fine-tuned, re-using information and accelerating training for new tasks. Here, we introduce MarioGPT, a fine-tuned GPT2 model trained to generate tile-based game levels, in our case Super Mario Bros levels. MarioGPT can not only generate diverse levels, but can be text-prompted for controllable level generation, addressing one of the key challenges of current PCG techniques. As far as we know, MarioGPT is the first text-to-level model and combined with novelty search it enables the generation of diverse levels with varying play-style dynamics (i.e. player paths) and the openended discovery of an increasingly diverse range of content. Code available at https://github.com/shyamsn97/mario-gpt.
11
+
12
+ # 1 Introduction
13
+
14
+ Procedural Content Generation (PCG) refers to techniques that can automatically create game content, such as levels, maps, or characters [36]. Some of the benefits of PCG are an increase in the replayability of a game and reduced production costs.
15
+
16
+ ![](images/9f449b787212abc4b1bc31e2af92c5b21e9247026302321260eaaf567f1ac8ce.jpg)
17
+ Figure 2: MarioGPT prediction pipeline. Our MarioGPT model is a finetuned version of the distilled GPT2 language model. Like GPT2, MarioGPT is trained to predict next token sequences. Levels are represented as strings, which are tokenized by a Byte-Pair Encoding, similar to the original GPT2 model. The level is split by columns and flattened into a single vector (or batch of vectors for multiple levels). To incorporate prompt information, we utilize a frozen text encoder in the form of a pretrained bidirectional LLM (BART), and output the average hidden states of the model’s forward pass. This average hidden state is then used in the cross attention layers of the GPT2 architecture in combination with the actual level sequence being passed into the model.
18
+
19
+ Recently, developments in PCG and machine learning have started to influence each other in different ways [30]. PCG researchers are now incorporating machine learning-based approaches into their systems and models such as Generative Adversarial Networks (GANs) [13] can be trained to generate levels for games as diverse as Doom [10] or Super Mario Bros, training on levels from the Video Game Level Corpus [45]. However, current approaches in this field of Procedural Content Generation via Machine Learning (PCGML) [39] often rely on costly searching inside of the latent space of the underlying neural networks. It would be more desirable to being able to directly condition a generator to create levels with certain properties, ideally in natural language.
20
+
21
+ To address these challenges, we propose MarioGPT (Figure 2), a fine-tuned GPT-2 model trained to generate Mario levels. Our model demonstrates how LLMs can be combined with PCG techniques, enabling the effective creation of new and diverse levels through natural language prompts (Figure 1). Large language models (LLMs) trained on a diverse corpus such as the GPT-n family model [29], capture the statistical correlations of the human experience in the form of language correlations. Through this process, GPT acquires knowledge of how to represent and predict intricate sequences. We utilize this knowledge to provide our model with the ability to generate levels that incorporate simple artefacts as well as more complex relational properties. Surprisingly, a high percentage $( 8 8 \% )$ of MarioGPT generated levels are in fact playable.
22
+
23
+ Furthermore, we combine MarioGPT with novelty search [22], a diversity-seeking algorithm, to continually generate diverse levels in an open-ended manner. The combination of LLMs with algorithms such as novelty search opens up many interesting new directions for future research. We hope our work opens the door to more flexible and controllable PCG methods that can generate infinite content that is complex, diverse, and functional. To facilitate this, the code to run the experiments in this paper is publicly available at: https://github.com/shyamsn97/mario-gpt.
24
+
25
+ # 2 Background and Related Work
26
+
27
+ Procedural Content Generation. Procedural Content Generation (PCG) algorithms [36] deal with the automatic creation of game content (e.g. for level design, character generation, environment modeling, etc.). As reviewed in [36, 46], earlier works often focused on evolutionary computation [4], solver-based methods [37] or constructive generation methods (such as cellular automata, grammarbased methods, etc). More recently, deep learning for PCG [27, 39] has emerged as a promising approach to learning to generate high-quality game content in a data-driven manner, which is not only aesthetically pleasing but also functional and challenging. However, the diversity, originality and playability of the generated content in addition to the controllability of its generation, remain major challenges [39]. Our work aims to show how conditioned language models, paired with novelty-driven approaches to content generation [26, 2], could help tackle these shortcomings.
28
+
29
+ Neural Network-based Level Generation. Recent works in the space of video game level generation, particularly for Super Mario [2, 8, 45, 33, 35, 34], also leveraged neural network architectures to create levels. Beukman et al. [2] evolved neural networks in order to generate levels, while others [8, 45, 12, 34] performed evolution / search in the latent space of a trained generative model. These works showed that guided sampling of the latent space of the learned generative model could result in a diverse set of levels.
30
+
31
+ Previous works that utilize a trained generative model [8, 45, 34, 12] also explored the abilities to control characteristics in generated levels. However, to do so these methods relied on searching the latent space (e.g. through quality diversity algorithms [28, 9] or evolutionary strategies [14]) for levels with specific target characteristics (e.g. a level with many pipes). This is a significant limitation because even though the generative models may represent a rich set of content, one has to search through its latent space to try to find the content that actually satisfies specific characteristics. MarioGPT is able to improve upon this limitation by incorporating text prompts into the actual generative process, allowing for easily controllable level generation. In other words, instead of searching for a level with specific characteristics, MarioGPT allows us to just ask for it. Concurrently to our work, Todd et al. [42] showed that LLMs can also be used to generate levels for other games such as Sokoban but their model did not allow for any text-prompting.
32
+
33
+ Open-Endedness and Genetic Algorithms. The open-endedness paradigm focuses on algorithms that can produce infinite innovation [24]. These open-ended algorithms are popular in the field of PCG, where designers and players both can benefit from diverse and never-ending content. However, PCG must balance the hard task of generating content with diversity as well as playability. Genetic algorithms (GA), a family of optimization algorithms that are inspired by the principles of natural selection, are commonly used as the backbone for more open-ended search methods. Because GAs allow the integration of multiple objectives, they are particularly suitable for achieving a balance between fitness and diversity.
34
+
35
+ In that regard, novelty search approaches [23] aim at finding the most novel solutions at each generation, in comparison to what has been seen (i.e. an archive of previously discovered highlynovel individuals). What makes novelty-search powerful, and motivated its use in this paper, is that it guides the generation towards increasingly diverse solutions in an open-ended fashion. Novelty search keeps track of solutions in an archive and measures diversity by the distance between their behavior characteristics (BCs) compared to that of their $k$ closest neighbors. This makes novelty search very flexible, allowing for the use of many different behavior characteristic types.
36
+
37
+ Sequence Modelling and Transformers. Classic approaches to sequence modelling using recurrent neural networks (RNNs) [31] and Long Short Term Memory (LSTM) networks [15] have traditionally been constrained by the fading memory of the network’s state vector, as well as limited scalability due to the temporal interdependency of the operations. Transformers [44] address both challenges by applying associative attention [1] to learned reprojections of the windowed input sequence, which is commonly referred to as self-attention. These architectural innovations have enabled Large Language Models (LLMs) to learn from massive datasets. Additionally, such models have also shown to be effective in accelerated learning of down-stream tasks. Fine-tuning LLMs [7] involves using pre-trained model weights as a weight initialization for new tasks.
38
+
39
+ One particularly relevant use of pretrained / fine-tuned LLMs comes from the method Evolution through Large Models (ELM), proposed in Lehman et al. [21]. ELM utilizes an LLM diff model [3], which is trained on code diffs obtained by Github data, giving the model the ability to modify a code snippet based on a particular commit message. This diff model is used as a "mutation operator", for a GA that evolves a population of programs. The wide generative capabilities of the LLM produce diverse mutations, resulting in novel individuals that vary increasingly over the course of the GA.
40
+
41
+ # 3 Open-Ended Level Generation through LLMs
42
+
43
+ Here we present our complete approach to open-ended level generation through LLMs, which is composed of two parts. First, we introduce our prompt-conditioned model MarioGPT (Figure 2) in Section 3.1, which generates levels –encoded as text– given a natural-language prompt. Second, we detail how MarioGPT can be used in a novelty-search evolutionary loop (Figure 3) in Section 3.2, allowing the approach to produce a continual stream of diverse levels.
44
+
45
+ Level Representation. Mario levels are represented similarly to previous works [45, 8, 35, 33, 34, 12], using the levels provided in the Video Game Level Corpus (VGLC) [40]. We utilize a relatively small set of path-annotated levels, taken from Super Mario Bros. and Super Mario Bros.: The Lost Levels (in total 37 levels). For more details on specific tiles present, see Section 6.1 in the Appendix. These levels are stitched together, to essentially make one giant level, allowing us to sample freely without worrying about the ends of the levels. Each tile is represented as a string. The string representation and characters are tokenized into discrete values using a Byte Pair Encoding tokenizer used in the original GPT2 model [29]. The tokenizer learns a mapping that maps each tile to its own unique token. One limitation from the dataset is the simplified representation of enemies. Even though levels contain many different enemies, each with different behaviors and features, the dataset represents them all as the same token.
46
+
47
+ ![](images/c7dc2c6fdb7821d852c4b6296feaf5113a60c91d29ae427824319eec7c7b20b7.jpg)
48
+ Figure 3: Novelty search setup and MarioGPT mutation operators. A level is sampled from a set of top elites in the archive, mutated, and, if novel enough, added to the archive. The mutation process involves two main steps: (1) Pick a random slice from the level and replace it with a new MarioGPT sample, using a random prompt. (2) Inpaint the border region with MarioBert to preserve path consistency.
49
+
50
+ # 3.1 MarioGPT Model
51
+
52
+ Our model, MarioGPT, is a prompt-conditioned unidirectional language model, optimized for long sequence level prediction. More precisely, MarioGPT’s architecture relies on a distilled, lightweight version of GPT2 [29] transformer architecture called DistilGPT2 [32] \*. Encoding slices of Mario levels as strings, similar to the approach taken in Summerville and Mateas [38], we can fine-tune this distilled version of GPT2 on predicting next tokens in Mario levels. To generate levels, we concatenate a window of previous 50 columns into a single vector and feed them into MarioGPT.
53
+
54
+ Architecture: MarioGPT’s architecture is the same as the DistilGPT2 architecture, except the cross attention weights are utilized for prompting. Even though DistilGPT2 supports context lengths up to size 1024, we limit our context lengths to 700, as we found increasing it did little to increase performance. In total, MarioGPT has 96 million parameters (86 million of the original DistilGPT2 parameters and 10 million from cross attention weights). We train MarioGPT for 50,000 steps, sampling 4 random slices of levels at each iteration and optimize the model using the Adam optimizer [20]. In total, MarioGPT sees 200,000 training samples. Because the model is relatively small, it can be trained using a single Nvidia GeForce RTX 2080 Ti GPU.
55
+
56
+ Prompting details: In order to incorporate prompt information, we fine-tune the attention layers’ cross attention weights, as illustrated in Figure 2. Prompts are encoded through BART [25], a frozen pre-trained language model. Prompts are passed through the frozen language model and the hidden states from the forward pass are averaged into a single vector. This average hidden state is then used in the cross attention layers of the GPT2 architecture in combination with the actual level sequence being passed into the model. We represent our prompts as combinations of specific features along with keywords that correspond to quantiles (e.g. none, little, some, many). This allows us to easily generate level/prompt pairs by counting corresponding tile values. For more details on the prompts, see Section 6.2 in the Appendix.
57
+
58
+ In addition, it is possible to use synonyms for words. For example, changing “many” to “a lot” or “a ton”, produces similar results because the BART encoder can generalize well.
59
+
60
+ # 3.2 Open-Ended Mario Level Generation with Novelty Search
61
+
62
+ In the realm of PCG, it is important to not only generate levels with diverse physical features, but also levels that elicit a wide range of player behavior. When it comes to creating Mario levels, the focus is on the different paths a player can take to complete the level. This is often a challenge for many algorithms (such as [45, 8]) and requires the use of an external agent for evaluation. However, with MarioGPT, it is possible to generate diverse and controllable levels that approximate a realistic player path, reducing the need for an external agent and producing levels that are directly playable. To encourage diversity in generated levels, we integrate MarioGPT within a novelty search augmented genetic algorithm (NS-MarioGPT), where language-models play the role of mutation operators. As illustrated in Figure 3, NS-MarioGPT iteratively samples and mutates elite levels from an archive of generated levels.
63
+
64
+ Novelty Search: Mutated levels are only stored in the archive if they achieve a higher novelty score compared to the previous elites. The novelty score is measured as the mean distance between the behavioral characteristic vector of the levels and the behavioral characteristic vector of the $K$ closest elements from the archive $K$ -means). Our goal in level generation is to create paths that result in diverse player behavior, so we use predicted player paths as our basis for these behavior characteristics. More specifically, we are interested in the relative patterns of predicted paths. For instance, if a player character moves in a straight line on high elevated blocks, we want the path’s representation to be close in behavior space to a path that moves straight in lower elevation. To achieve this, we represent the behavior characteristic as the normalized average of the predicted path’s coordinates, allowing a smooth representation of paths (Figure 4). Thus the significance of a single block difference is reduced, making it harder for mutated levels to be added to the archive. This is desired because we don’t want the archive to fill up with levels that only vary slightly from the existing levels in the archive. For all our novelty search experiments, we use a small neighborhood of size 4, which results in a behavioral characteristic of dimension 100. We initialize our archive with a small number of levels (30), as we found mutations are significant enough to generate a diverse set of levels without a big starting population.
65
+
66
+ ![](images/042a059868c0553a7a60e438afd451a3c9c6cc9b670ad7daaf595ec5078a860b.jpg)
67
+ Figure 4: Novelty search behavior characteristic. Left: level, Right: smoothed moving average of generated path.
68
+
69
+ Mutations: The LLM-based mutation operation introduced in this paper (Figure 3) transforms a randomly picked slice of a level (a slice between $4 0 - 8 0$ columns) with a new MarioGPT prediction, guided by a random prompt. By itself, MarioGPT is able, through mutations, to produce a variety of levels with varying agent paths. However, because MarioGPT is a unidirectional model, we cannot guarantee that the new generated path is consistent with the rest of the level. To further improve path consistency, we incorporate a fine-tuned mask prediction model (which we call MarioBert), based on the Bert architecture. The BERT language model [7] is a bidirectional LLM that shows impressive performance in the task of mask prediction, which is analogous to image in-painting. This ability is ideal for our use case, where MarioBert is used to inpaint its border region after the newly sampled slice, smoothly joining the mutated slice and the rest of level. This can be observed in the second step of the "Mutation process" part of Figure 3.
70
+
71
+ # 4 Experiments and Results
72
+
73
+ # 4.1 Tile Prediction Accuracy
74
+
75
+ To measure how proficient MarioGPT is in generating levels and because the majority of tiles in these levels are air tiles, we focus on comparing non-air tile prediction accuracy. We compare to baselines: LSTM, as proposed in Summerville and Mateas [38] and MarioGPT that is trained from scratch (without using pretrained GPT2 weights), with results reported in Table 1. For all our baselines, we train for the same amount (200,000 samples). The results show that MarioGPT (using a pretrained GPT2 model) outperforms all other baselines with regards to tile prediction. In addition, training MarioGPT from scratch and training an adapter layer (a small multi layer network on top of the original prediction layer) results in models that performs worse than even the LSTM baseline (given the 200,000 training samples). These models were trained with minimal hyperparameter search, so their performance can likely be improved. However, as a tangential point, this shows a major benefit of fine-tuning pretrained models, which seem to require much less effort in regards to hyperparameters.
76
+
77
+ Table 1: Training Reconstruction Accuracy – Validation Set
78
+
79
+ <table><tr><td>Model</td><td>Tile Acc.</td><td>Path Acc.</td><td>Promptable?</td></tr><tr><td>LSTM</td><td>46%</td><td>39%</td><td>NO</td></tr><tr><td>from-scratch-MarioGPT</td><td>31%</td><td>23%</td><td>YES</td></tr><tr><td>adapter-MarioGPT</td><td>21%</td><td>11%</td><td>YES</td></tr><tr><td>MarioGPT</td><td>93%</td><td>91%</td><td>YES</td></tr></table>
80
+
81
+ # 4.2 Measuring Playability of Levels
82
+
83
+ To test for playability, we deploy Robin Baumgarten’s $\mathbf { A } ^ { * }$ agent [43, 19] in 250 generated levels\*. The reason for choosing Robin Baumgarten’s $\mathbf { A } ^ { * }$ agent for measuring playability comes from its performance on the 2009 Mario AI competition, where it beat handcrafted controllers and even simple evolved neural networks on getting the furthest in an infinite-level setting, as well as solving a corpus of levels [43]. We find that $8 8 . 4 \%$ of all MarioGPT-generated levels can be completed by the agent, and are therefore considered playable (compared to the best baseline, the LSTM, which achieves around $31 \%$ solvable levels). Moreover, we find that only one of the successful levels needed a retry with the $\mathbf { A } ^ { * }$ agent. We further test whether the path generated by the model matches that of the $\mathbf { A } ^ { * }$ agent to assess their feasibility. Table 2 shows the mean absolute error (MAE) between suggested and actual agent path for playable and not playable levels respectively. We see that for playable levels, the MAE between the path generated by the model and the actually taken path by the agent is 1.15 tiles, i.e. paths are on average about 1 tile apart. For the non-playable levels, this average difference of taken paths is significantly higher with 4.56 tiles. Thus, we can conclude that in playable levels, the agent mostly takes a similar path as the one generated by the model. The significantly higher MAE of 4.56 in non-playable levels on the other hand indicates that the path generated by the models in these cases may not be feasible for the agent.
84
+
85
+ Table 2: Mean average error (MAE) between paths suggested by model and Baumgarten’s $\mathbf { A } ^ { * }$ agent. Results are averaged over 5 runs per level to account for minor stochastic variation in agent simulation. MAEs are computed between $y$ coordinates of path trajectories for every point on the $x$ axis (which goes across the level) both trajectories have visited.
86
+
87
+ <table><tr><td>Playable</td><td>Not Playable</td><td>All</td></tr><tr><td>1.15</td><td>4.56</td><td>1.56</td></tr></table>
88
+
89
+ Considering the MAE of 1.56 tiles for paths in all levels, we can conclude that in the majority of the cases, the path generated by the model is similar to the path taken by an actual agent, and having the model generate a path through the level jointly with the level is an effective approach to obtain high-quality levels in terms of playability.
90
+
91
+ To investigate the quality of the generated paths further, we visualize the paths with the most, least and median overlap (i.e. the levels corresponding to the maximum, minimum and median values for the mean absolute error in height) as well as two interesting handpicked examples in Figure 5.
92
+
93
+ Figures 5d and 5e show that paths generated by MarioGPT tend to have more airtime than Baumgarten’s agent in the sense that they only weakly take into account "gravity". This result may be attributed to the nature of the path annotations in the models training set. In Summerville et al. [40], the authors use an $\mathbf { A } ^ { * }$ path solver to find a path through the level, while an actual agent, such as the one we used for comparison here, is more strongly bound by game physics (especially "gravity") and has to avoid enemies in the level. A second reason for non-playable levels can be seen in Figure 5c: Baumgarten’s agent is spawned in a tight space from which it can not escape, while the model has generated a path that traverses beyond the actual level, again a path that would likely be suggested by a solver. We argue that these issues can in part be attributed to the paths in the training data stemming from a solver rather than an actual agent, and could be alleviated in future work by annotating the training data with the trajectories of actual agents.
94
+
95
+ ![](images/b78426ce06283b9732abb3b14fa1a167f5be8825be0c2fcd2139ac575dcb3141.jpg)
96
+ Figure 5: $\mathbf { A } ^ { * }$ vs. MarioGPT generated paths. Levels with (a) minimum (0.02), (a) median (0.89) and (a) maximum (11.0) mean absolute error (MAE) between trajectory of actual $\mathbf { A } ^ { * }$ agent (denoted as A), and model suggestion (denoted as P), as well as interesting hand-picked examples. Positions where both trajectories overlap are marked with \*. Paths suggested by the model generally tend to have more airtime than the $\mathbf { A } ^ { * }$ agent (d, e), likely due to game physics not being accounted for in the original path annotations of the training data.
97
+
98
+ # 4.3 Is MarioGPT memorizing?
99
+
100
+ ![](images/03847a0c8d25f6319ea8e373ca069b827d2df759372e6d48ae6240ba803a9e47.jpg)
101
+ Figure 6: Generated levels vs closest in dataset. Temperature of 1.0 ends up spitting out almost exactly what is in the dataset, while increasing temperature improves sample diversity.
102
+
103
+ Memorization dynamics in LLMs remain an open problem when training transformer architectures [41, 5, 16]. While LLMs are incredibly powerful, they can sometimes overfit extremely and end up regurgitating training data. One popular way to alleviate this issue is to add some randomness in predictions in the form a tunable "temperature" parameter [17]. To evaluate whether MarioGPT is generating levels that are identical to the training set, we sample with different temperature parameters and compare them the closest level in the training dataset. From Figure 6, we can see that increasing temperature results in samples that are more diverse, but lack quality. In our case, when generating levels we use a temperature of 2.4-2.7, as it can generate diverse samples while still retaining some quality. There are many possible improvements to explore in the future. One common way is to simply increase the richness of the dataset. The more samples the model has access to, the less likely it is to overfit. We could also improve MarioGPT’s sampling abilities by introducing different search methods other than sampling with temperature, such as constrained beam search [6] and dataset augmented search [16], to increase diversity while preserving more quality.
104
+
105
+ # 4.4 Guided Level Generation via Prompting
106
+
107
+ Through simple prompting, we are able to guide MarioGPT towards controllable and diverse level generation. We empirically evaluate the prompting ability of MarioGPT by generating 1,000 samples with various combinations of prompts, and check how accurate the generated levels are to the prompt descriptions. The results suggest that MarioGPT can generate levels that match their given prompts most of the time (Table 3). MarioGPT is the most accurate with blocks and the least accurate with enemies. This is expected because there are fewer total tiles of enemies, while there are many more block tiles observed during training.
108
+
109
+ Table 3: Prompt vs actual description accuracy
110
+
111
+ <table><tr><td>pipes</td><td>enemies</td><td>blocks</td><td>elevation</td></tr><tr><td>81%</td><td>68%</td><td>92%</td><td>76%</td></tr></table>
112
+
113
+ We visually evaluated the system, displaying selected prompt-conditioned generations in Figure 1. In addition, we evaluate the importance of the keywords in the prompt by comparing the distribution of the number of pipes between levels generated with random prompts without pipes-related commands (e.g. "some enemies, some blocks, high elevation") versus random prompts with pipes-related commands (e.g. "little pipes, some enemies, some blocks, high elevation"). The distribution without pipe prompts is scattered, while the ones with pipe prompts result in distributions with peaks, indicating that the keywords actually have an effect on the level generated (see Figure 11 in the Appendix).
114
+
115
+ MarioGPT is also able to generate levels from text descriptions that are not represented in the dataset. For instance, Figure 1e shows a successful approximation of the prompt, "many pipes, no enemies, many blocks", with a slight inaccuracy in that it has 1 less pipe (5 pipes is considered "many", while 4 are present). However, this is not always the case, as can be seen in Figure 1f, where the model, prompted by "many pipes, no enemies, some blocks", generates a level with the correct number of pipes and blocks but generates too many enemies. In future work, we hope to explore more ways to incorporate prompt importance, such as editing levels with tiles to create more samples or prompt tuning [18].
116
+
117
+ # 4.5 Generating Diverse Levels with Novelty Search
118
+
119
+ Through the combination of an LLM (Section 3.1) and novelty search (Section 3.2), we are able to continuously generate diverse levels in an open-ended fashion. Specifically, NS-MarioGPT is able to generate a collection of levels with a diverse set of predicted agent paths. We project the archive as a set of 2D embeddings in Figure 7 and darken the embedding points that are added later in the process. We can see that the levels are increasingly filling up empty spots in the embedding space. We also compare the distribution of levels generated by novelty search to levels generated by random prompts in Figure 8a. Visually, we can see that the levels generated by novelty search are more spread out in t-SNE space and the sampled ones, indicating that they are more diverse. Finally, we have also evaluated the playability of levels generated by novelty search, and find that the majority are solvable and non-playable levels are not clustered but rather scattered across t-SNE space. This indicates that there is no trade-off between path diversity and the ability to generate solvable levels. Figure 8b shows the corresponding results.
120
+
121
+ Figure 9 displays all the overlayed predicted paths (in a level grid) as more and more levels get added to the archive during novelty search. Similar as in Figure 7, we can see that over time, the space of possible predicted agent paths gets filled, as increasingly diverse levels are mutated and added to the archive. As more levels are added to the archive, more and more of the tiles / empty space in the grid are being filled up, indicating that NS-MarioGPT is discovering a variety of levels that produce diverse paths. Concretely, we found that after 300 levels are added to the archive, around $78 \%$ of the possible coordinates are filled up. However, there are still many overlapping paths in the archive, meaning that similar paths are still being added to the archive. This is an issue that could be improved by using more related time series distance metrics that account for patterns in a path [11].
122
+
123
+ ![](images/208fe07045a41ef1c234698159461b3e3cd2f821cf7f5a044a07747c1839e0f7.jpg)
124
+ Figure 7: t-SNE of the levels in the archive. t-SNE embeddings are computed from the behavioral characteristic. Darker points indicate more recently added elements. Although novelty search is using the behavioral characteristics of the player paths, the levels also demonstrate visual novelty.
125
+
126
+ ![](images/28891b163aea4c875fc0f487d07616dc91f2294ba644197603eac33c1243be2c.jpg)
127
+ Figure 8: Comparing exploration for novelty search vs. random sampling and playable vs. nonplayable levels. (a) t-SNE of both the embeddings of novelty-search levels and levels generated with random prompts. The visualization suggests that novelty search enables a much wider exploration of the space of levels. (b) Unsolvable levels are not clustered together but instead scattered across the t-SNE space. This distribution indicates that there is no correlation between the diversity of levels and their solvability.
128
+
129
+ Levels with the highest and lowest novelty score from the archive are also shown in Figure 10. The level with the lowest novelty, shown in Figure 10a, has a path that is much more common in the archive, which can be seen by its almost identical look compared to the 2nd lowest in Figure 10c. The levels with higher novelty, Figure 10b and Figure 10d, have more unique patterns, but share a similar pattern towards the end. This indicates that one was created by mutating the other. We also found that the diversity starts to plateau after around 350-400 generations. However, this is very sensitive to the behavior characteristic (the smoothed predicted path of the level), so it may be different for other behavior characteristics.
130
+
131
+ ![](images/39fca1654f1547662e8c385c1835c123b21894c3bed3191849bea4be43b74e3c.jpg)
132
+ Figure 9: Generated path populations during novelty search. Each line is a path through a level. Over time, NS-MarioGPT fills more and more of the space of all possible paths.
133
+
134
+ ![](images/02ab5e11dc7a2d88c5d832860de48fd1ecff1b09e57bc4a3694ae36a0002a1b4.jpg)
135
+ Figure 10: Comparison of most and least novel levels in the archive. The two least novel levels are very similar to each other, while the most novel levels have more distinct path patterns.
136
+
137
+ While NS-MarioGPT is still able to discover many diverse levels through its simple mutation process, more complex functions could also be explored. For instance, crossover, a common mutation utilized in many genetic algorithms, would increase mutation diversity which can lead to more diverse levels.
138
+
139
+ # 5 Conclusion
140
+
141
+ Here we introduced MarioGPT, a fine-tuned GPT2 LLM that can not only generate diverse levels, but can guide its generation via a language prompt. This ability is useful in the field of Procedural Content Generation, where balancing controllable and diverse generation is a difficult task. We showed that MarioGPT is also able to (1) predict player interaction in generated levels, (2) generate diverse and playable environments, and (3) reduce the need for expensive external agent interactions (MarioGPT can generate playable levels approximately $8 8 \%$ of the time). Additionally, when combined with a diversity-driven algorithm like novelty search, MarioGPT can generate open-ended and functional content. While MarioGPT can generate diverse content, it is still limited. It can sometimes not follow prompt instruction and it is also subject to memorizing the dataset. We hope to improve these limitations by introducing richer data to the system.
142
+
143
+ One major benefit of re-using an existing LLM is that we can take advantage of all the research and improvements that have gone into these architectures. We plan to leverage the scalability of LLMs and train MarioGPT on bigger, more detailed annotated levels. Also, we are particularly excited about incorporating human feedback into the level generation process through reinforcement learning from human feedback (RLHF) [47]. The ability to fine-tune these models on human feedback allows users to continually tune their generated levels towards desired characteristics. Ultimately, we hope that MarioGPT opens the door to more controllable and diverse PCG systems.
144
+
145
+ # Acknowledgements
146
+
147
+ This project was supported by a DFF-Research Project1 grant (9131- 00042B) and a European Research Council (ERC) grant (GA no. 101045094, project ”GROW-AI”).
148
+
149
+ References
150
+ [1] Dzmitry Bahdanau, KyungHyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
151
+ [2] Michael Beukman, Christopher W Cleghorn, and Steven James. Procedural content generation using neuroevolution and novelty search for diverse video game levels. In Proceedings of the Genetic and Evolutionary Computation Conference, GECCO ’22, page 1028–1037, New York, NY, USA, 2022. Association for Computing Machinery.
152
+ [3] Herbie Bradley, Honglu Fan, Harry Saini, Reshinth Adithyan, Shivanshu Purohit, and Joel Lehman. Diff models - a new way to edit code. CarperAI Blog, Jan 2023.
153
+ [4] Cameron Browne and Frederic Maire. Evolutionary game design. IEEE Transactions on Computational Intelligence and AI in Games, 2(1):1–16, 2010.
154
+ [5] Nicholas Carlini, Daphne Ippolito, Matthew Jagielski, Katherine Lee, Florian Tramer, and Chiyuan Zhang. Quantifying memorization across neural language models, 2022.
155
+ [6] Katsuki Chousa and Makoto Morishita. Input augmentation improves constrained beam search for neural machine translation: Ntt at wat 2021, 2021.
156
+ [7] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding, 2018.
157
+ [8] Matthew C. Fontaine, Ruilin Liu, Ahmed Khalifa, Jignesh Modi, Julian Togelius, Amy K. Hoover, and Stefanos Nikolaidis. Illuminating Mario scenes in the latent space of a generative adversarial network, 2020.
158
+ [9] Matthew C. Fontaine, Julian Togelius, Stefanos Nikolaidis, and Amy K. Hoover. Covariance matrix adaptation for the rapid illumination of behavior space. In Proceedings of the 2020 Genetic and Evolutionary Computation Conference. ACM, jun 2020.
159
+ [10] Edoardo Giacomello, Pier Luca Lanzi, and Daniele Loiacono. Doom level generation using generative adversarial networks. In 2018 IEEE Games, Entertainment, Media Conference (GEM), pages 316–323. IEEE, 2018.
160
+ [11] Omer Gold and Micha Sharir. Dynamic time warping and geometric edit distance: Breaking the quadratic barrier, 2016.
161
+ [12] Miguel González-Duque, Rasmus Berg Palm, Søren Hauberg, and Sebastian Risi. Mario plays on a manifold: Generating functional content in latent space through differential geometry, 2022.
162
+ [13] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks. Communications of the ACM, 63(11):139–144, 2020.
163
+ [14] Nikolaus Hansen. The CMA evolution strategy: A tutorial, 2016. hal-01297037v2f.
164
+ [15] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997.
165
+ [16] Daphne Ippolito, Florian Tramèr, Milad Nasr, Chiyuan Zhang, Matthew Jagielski, Katherine Lee, Christopher A. Choquette-Choo, and Nicholas Carlini. Preventing verbatim memorization in language models gives a false sense of privacy, 2022.
166
+ [17] Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax, 2016.
167
+ [18] Zhengbao Jiang, Frank F. Xu, Jun Araki, and Graham Neubig. How can we know what language models know?, 2019.
168
+ [19] Ahmed. Khalifa. The mario AI framework. https://github.com/amidos2006/ Mario-AI-Framework, 2009.
169
+
170
+ [20] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization, 2014.
171
+
172
+ [21] Joel Lehman, Jonathan Gordon, Shawn Jain, Kamal Ndousse, Cathy Yeh, and Kenneth O. Stanley. Evolution through large models, 2022.
173
+
174
+ [22] Joel Lehman and Kenneth O. Stanley. Abandoning Objectives: Evolution Through the Search for Novelty Alone. Evolutionary Computation, 19(2):189–223, 06 2011.
175
+
176
+ [23] Joel Lehman, Kenneth O Stanley, et al. Exploiting open-endedness to solve problems through the search for novelty. In ALIFE, pages 329–336, 2008.
177
+
178
+ [24] Joel Lehman, Kenneth O. Stanley, and Lisa Soros. Open-endedness: The last grand challenge you’ve never heard of. https://www.oreilly.com/radar/ open-endedness-the-last-grand-challenge-youve-never-heard-of/. Accessed: 2017-12-19.
179
+
180
+ [25] Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov, and Luke Zettlemoyer. Bart: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension, 2019.
181
+
182
+ [26] Antonios Liapis, Georgios N Yannakakis, and Julian Togelius. Constrained novelty search: A study on game content generation. Evolutionary computation, 23(1):101–129, 2015.
183
+
184
+ [27] Jialin Liu, Sam Snodgrass, Ahmed Khalifa, Sebastian Risi, Georgios N Yannakakis, and Julian Togelius. Deep learning for procedural content generation. Neural Computing and Applications, 33(1):19–37, 2021.
185
+
186
+ [28] Jean-Baptiste Mouret and Jeff Clune. Illuminating search spaces by mapping elites, 2015.
187
+
188
+ [29] Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019.
189
+
190
+ [30] Sebastian Risi and Julian Togelius. Increasing generality in machine learning through procedural content generation. Nature Machine Intelligence, 2(8):428–436, 2020.
191
+
192
+ [31] David E Rumelhart, Geoffrey E Hinton, and Ronald J Williams. Learning internal representations by error propagation. Technical report, California Univ San Diego La Jolla Inst for Cognitive Science, 1985.
193
+
194
+ [32] Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. Distilbert, a distilled version of BERT: smaller, faster, cheaper and lighter, 2019.
195
+
196
+ [33] Anurag Sarkar and Seth Cooper. Dungeon and platformer level blending and generation using conditional vaes. In Proceedings of the IEEE Conference on Games (CoG), 2021.
197
+
198
+ [34] Anurag Sarkar and Seth Cooper. Generating and blending game levels via quality-diversity in the latent space of a variational autoencoder. In Proceedings of the Foundations of Digital Games, 2021.
199
+
200
+ [35] Anurag Sarkar, Zhihan Yang, and Seth Cooper. Conditional level generation and game blending. In Proceedings of the Experimental AI in Games (EXAG) Workshop at AIIDE, 2020.
201
+
202
+ [36] Noor Shaker, Julian Togelius, and Mark J Nelson. Procedural content generation in games. Springer, 2016.
203
+
204
+ [37] Adam M Smith and Michael Mateas. Answer set programming for procedural content generation: A design space approach. IEEE Transactions on Computational Intelligence and AI in Games, 3(3):187–200, 2011.
205
+
206
+ [38] Adam Summerville and Michael Mateas. Super Mario as a string: Platformer level generation via lstms, 2016.
207
+
208
+ [39] Adam Summerville, Sam Snodgrass, Matthew Guzdial, Christoffer Holmgård, Amy K Hoover, Aaron Isaksen, Andy Nealen, and Julian Togelius. Procedural content generation via machine learning (PCGML). IEEE Transactions on Games, 10(3):257–270, 2018.
209
+
210
+ [40] Adam James Summerville, Sam Snodgrass, Michael Mateas, and Santiago Ontañón. The VGLC: The video game level corpus, 2016.
211
+ [41] Kushal Tirumala, Aram H. Markosyan, Luke Zettlemoyer, and Armen Aghajanyan. Memorization without overfitting: Analyzing the training dynamics of large language models, 2022.
212
+ [42] Graham Todd, Sam Earle, Muhammad Umair Nasir, Michael Cerny Green, and Julian Togelius. Level generation through large language models. In Proceedings of the 18th International Conference on the Foundations of Digital Games, pages 1–8, 2023.
213
+ [43] Julian Togelius, Sergey Karakovskiy, and Robin Baumgarten. The 2009 Mario AI competition. In IEEE Congress on Evolutionary Computation, pages 1–8, 2010.
214
+ [44] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017.
215
+ [45] Vanessa Volz, Jacob Schrum, Jialin Liu, Simon M. Lucas, Adam Smith, and Sebastian Risi. Evolving Mario levels in the latent space of a deep convolutional generative adversarial network, 2018.
216
+ [46] Georgios N Yannakakis and Julian Togelius. Artificial intelligence and games, volume 2. Springer, 2018.
217
+ [47] Daniel M. Ziegler, Nisan Stiennon, Jeffrey Wu, Tom B. Brown, Alec Radford, Dario Amodei, Paul Christiano, and Geoffrey Irving. Fine-tuning language models from human preferences, 2019.
218
+
219
+ # 6 Appendix
220
+
221
+ # 6.1 Dataset Details
222
+
223
+ Table 4: Unique Mario tiles
224
+
225
+ <table><tr><td>Tile Type</td><td>Symbol</td><td>Visualization</td></tr><tr><td>Empty</td><td>1</td><td>?</td></tr><tr><td>Unbreakable</td><td>X</td><td>口</td></tr><tr><td>Breakable</td><td>S</td><td>喜</td></tr><tr><td>Question Block</td><td>?/Q</td><td>?</td></tr><tr><td>Coin</td><td>0</td><td>0</td></tr><tr><td>Enemy</td><td>E</td><td>□</td></tr><tr><td>Left pipe top</td><td>&lt;</td><td>T</td></tr><tr><td>Right pipe top</td><td>V</td><td>T</td></tr><tr><td>Left pipe lower</td><td>[</td><td></td></tr><tr><td>Right pipe lower</td><td>1</td><td>■</td></tr><tr><td>Cannon Top</td><td>B</td><td>同</td></tr><tr><td>Cannon Body</td><td>b</td><td>□</td></tr><tr><td>Path</td><td>X</td><td>P</td></tr></table>
226
+
227
+ # 6.2 Constructing Prompts
228
+
229
+ Prompts are represented as combinations of specific features (e.g. pipes, enemies, blocks, elevation) alongside quantitative keywords:
230
+
231
+ • { no, little, some, many, [0-1000]} pipes • { no, little, some, many, [0-1000] } enemies • { little, some, many, [0-1000]} blocks • { low, high} elevation
232
+
233
+ As an example, "no pipes, many enemies, low elevation" or "many pipes, many enemies, many blocks" are both possible prompts. The keywords "no", "little", "some", "many" are calculated from quantiles of the corresponding count within a 50 column window (Table 5). The "low" and "high" elevation are determined from the height of the highest unbreakable blocks in a segment of the level.
234
+
235
+ Table 5: Prompt Quantiles and corresponding counts within a 50 column window
236
+
237
+ <table><tr><td>tile</td><td>no</td><td>little</td><td>some</td><td>many</td></tr><tr><td>pipes</td><td>0</td><td>1</td><td>2</td><td>5</td></tr><tr><td>enemies</td><td>0</td><td>1</td><td>3</td><td>7</td></tr><tr><td>blocks</td><td>0</td><td>50</td><td>75</td><td>176</td></tr></table>
238
+
239
+ ![](images/10df4768e1712dda7107c01bf02b54c8ef44c75d1b29eca59eaa5effe083c825.jpg)
240
+ Figure 11: Effect of prompt conditioning. Comparison of the distribution of the number of pipes between levels generated with random prompts without pipes-related commands (e.g. "some enemies, some blocks, high elevation") versus random prompts with pipes-related commands (e.g. "little pipes, some enemies, some blocks, high elevation"). The distribution without pipe prompts is scattered, while the ones with pipe prompts result in distributions with peaks.
parse/dev/aa8KsqfTPa/aa8KsqfTPa_content_list.json ADDED
@@ -0,0 +1,1222 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "MarioGPT: Open-Ended Text2Level Generation through Large Language Models ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 207,
8
+ 122,
9
+ 790,
10
+ 172
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Shyam Sudhakaran1, Miguel González-Duque∗1, Matthias Freiberger∗1, Claire Glanois1, Elias Najarro1, Sebastian Risi1,2 1IT University of Copenhagen, 2modl.ai, Copenhagen shyamsnair@protonmail.com, sebr@itu.dk ",
17
+ "bbox": [
18
+ 245,
19
+ 224,
20
+ 751,
21
+ 284
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "image",
27
+ "img_path": "images/52126a6124ad6c7cc1b5a0732fb14907f3b8a00de0206f8909adb73db7da2f21.jpg",
28
+ "image_caption": [
29
+ "Figure 1: MarioGPT is able to successfully generate levels that follow the text prompt (a–e). Failure cases rarely happen: for example in (f) the model manages to generate many pipes and some blocks, but it still generates enemies even though it was prompted with \"no enemies\". "
30
+ ],
31
+ "image_footnote": [],
32
+ "bbox": [
33
+ 202,
34
+ 296,
35
+ 794,
36
+ 478
37
+ ],
38
+ "page_idx": 0
39
+ },
40
+ {
41
+ "type": "text",
42
+ "text": "Abstract ",
43
+ "text_level": 1,
44
+ "bbox": [
45
+ 462,
46
+ 544,
47
+ 535,
48
+ 559
49
+ ],
50
+ "page_idx": 0
51
+ },
52
+ {
53
+ "type": "text",
54
+ "text": "Procedural Content Generation (PCG) is a technique to generate complex and diverse environments in an automated way. However, while generating content with PCG methods is often straightforward, generating meaningful content that reflects specific intentions and constraints remains challenging. Furthermore, many PCG algorithms lack the ability to generate content in an open-ended manner. Recently, Large Language Models (LLMs) have shown to be incredibly effective in many diverse domains. These trained LLMs can be fine-tuned, re-using information and accelerating training for new tasks. Here, we introduce MarioGPT, a fine-tuned GPT2 model trained to generate tile-based game levels, in our case Super Mario Bros levels. MarioGPT can not only generate diverse levels, but can be text-prompted for controllable level generation, addressing one of the key challenges of current PCG techniques. As far as we know, MarioGPT is the first text-to-level model and combined with novelty search it enables the generation of diverse levels with varying play-style dynamics (i.e. player paths) and the openended discovery of an increasingly diverse range of content. Code available at https://github.com/shyamsn97/mario-gpt. ",
55
+ "bbox": [
56
+ 233,
57
+ 564,
58
+ 766,
59
+ 785
60
+ ],
61
+ "page_idx": 0
62
+ },
63
+ {
64
+ "type": "text",
65
+ "text": "1 Introduction ",
66
+ "text_level": 1,
67
+ "bbox": [
68
+ 174,
69
+ 808,
70
+ 312,
71
+ 824
72
+ ],
73
+ "page_idx": 0
74
+ },
75
+ {
76
+ "type": "text",
77
+ "text": "Procedural Content Generation (PCG) refers to techniques that can automatically create game content, such as levels, maps, or characters [36]. Some of the benefits of PCG are an increase in the replayability of a game and reduced production costs. ",
78
+ "bbox": [
79
+ 176,
80
+ 838,
81
+ 823,
82
+ 881
83
+ ],
84
+ "page_idx": 0
85
+ },
86
+ {
87
+ "type": "image",
88
+ "img_path": "images/9f449b787212abc4b1bc31e2af92c5b21e9247026302321260eaaf567f1ac8ce.jpg",
89
+ "image_caption": [
90
+ "Figure 2: MarioGPT prediction pipeline. Our MarioGPT model is a finetuned version of the distilled GPT2 language model. Like GPT2, MarioGPT is trained to predict next token sequences. Levels are represented as strings, which are tokenized by a Byte-Pair Encoding, similar to the original GPT2 model. The level is split by columns and flattened into a single vector (or batch of vectors for multiple levels). To incorporate prompt information, we utilize a frozen text encoder in the form of a pretrained bidirectional LLM (BART), and output the average hidden states of the model’s forward pass. This average hidden state is then used in the cross attention layers of the GPT2 architecture in combination with the actual level sequence being passed into the model. "
91
+ ],
92
+ "image_footnote": [],
93
+ "bbox": [
94
+ 246,
95
+ 88,
96
+ 759,
97
+ 205
98
+ ],
99
+ "page_idx": 1
100
+ },
101
+ {
102
+ "type": "text",
103
+ "text": "Recently, developments in PCG and machine learning have started to influence each other in different ways [30]. PCG researchers are now incorporating machine learning-based approaches into their systems and models such as Generative Adversarial Networks (GANs) [13] can be trained to generate levels for games as diverse as Doom [10] or Super Mario Bros, training on levels from the Video Game Level Corpus [45]. However, current approaches in this field of Procedural Content Generation via Machine Learning (PCGML) [39] often rely on costly searching inside of the latent space of the underlying neural networks. It would be more desirable to being able to directly condition a generator to create levels with certain properties, ideally in natural language. ",
104
+ "bbox": [
105
+ 174,
106
+ 329,
107
+ 825,
108
+ 440
109
+ ],
110
+ "page_idx": 1
111
+ },
112
+ {
113
+ "type": "text",
114
+ "text": "To address these challenges, we propose MarioGPT (Figure 2), a fine-tuned GPT-2 model trained to generate Mario levels. Our model demonstrates how LLMs can be combined with PCG techniques, enabling the effective creation of new and diverse levels through natural language prompts (Figure 1). Large language models (LLMs) trained on a diverse corpus such as the GPT-n family model [29], capture the statistical correlations of the human experience in the form of language correlations. Through this process, GPT acquires knowledge of how to represent and predict intricate sequences. We utilize this knowledge to provide our model with the ability to generate levels that incorporate simple artefacts as well as more complex relational properties. Surprisingly, a high percentage $( 8 8 \\% )$ of MarioGPT generated levels are in fact playable. ",
115
+ "bbox": [
116
+ 173,
117
+ 445,
118
+ 826,
119
+ 571
120
+ ],
121
+ "page_idx": 1
122
+ },
123
+ {
124
+ "type": "text",
125
+ "text": "Furthermore, we combine MarioGPT with novelty search [22], a diversity-seeking algorithm, to continually generate diverse levels in an open-ended manner. The combination of LLMs with algorithms such as novelty search opens up many interesting new directions for future research. We hope our work opens the door to more flexible and controllable PCG methods that can generate infinite content that is complex, diverse, and functional. To facilitate this, the code to run the experiments in this paper is publicly available at: https://github.com/shyamsn97/mario-gpt. ",
126
+ "bbox": [
127
+ 174,
128
+ 577,
129
+ 825,
130
+ 661
131
+ ],
132
+ "page_idx": 1
133
+ },
134
+ {
135
+ "type": "text",
136
+ "text": "2 Background and Related Work ",
137
+ "text_level": 1,
138
+ "bbox": [
139
+ 176,
140
+ 679,
141
+ 465,
142
+ 696
143
+ ],
144
+ "page_idx": 1
145
+ },
146
+ {
147
+ "type": "text",
148
+ "text": "Procedural Content Generation. Procedural Content Generation (PCG) algorithms [36] deal with the automatic creation of game content (e.g. for level design, character generation, environment modeling, etc.). As reviewed in [36, 46], earlier works often focused on evolutionary computation [4], solver-based methods [37] or constructive generation methods (such as cellular automata, grammarbased methods, etc). More recently, deep learning for PCG [27, 39] has emerged as a promising approach to learning to generate high-quality game content in a data-driven manner, which is not only aesthetically pleasing but also functional and challenging. However, the diversity, originality and playability of the generated content in addition to the controllability of its generation, remain major challenges [39]. Our work aims to show how conditioned language models, paired with novelty-driven approaches to content generation [26, 2], could help tackle these shortcomings. ",
149
+ "bbox": [
150
+ 174,
151
+ 710,
152
+ 825,
153
+ 849
154
+ ],
155
+ "page_idx": 1
156
+ },
157
+ {
158
+ "type": "text",
159
+ "text": "Neural Network-based Level Generation. Recent works in the space of video game level generation, particularly for Super Mario [2, 8, 45, 33, 35, 34], also leveraged neural network architectures to create levels. Beukman et al. [2] evolved neural networks in order to generate levels, while others [8, 45, 12, 34] performed evolution / search in the latent space of a trained generative model. These works showed that guided sampling of the latent space of the learned generative model could result in a diverse set of levels. ",
160
+ "bbox": [
161
+ 174,
162
+ 856,
163
+ 825,
164
+ 911
165
+ ],
166
+ "page_idx": 1
167
+ },
168
+ {
169
+ "type": "text",
170
+ "text": "",
171
+ "bbox": [
172
+ 174,
173
+ 92,
174
+ 823,
175
+ 119
176
+ ],
177
+ "page_idx": 2
178
+ },
179
+ {
180
+ "type": "text",
181
+ "text": "Previous works that utilize a trained generative model [8, 45, 34, 12] also explored the abilities to control characteristics in generated levels. However, to do so these methods relied on searching the latent space (e.g. through quality diversity algorithms [28, 9] or evolutionary strategies [14]) for levels with specific target characteristics (e.g. a level with many pipes). This is a significant limitation because even though the generative models may represent a rich set of content, one has to search through its latent space to try to find the content that actually satisfies specific characteristics. MarioGPT is able to improve upon this limitation by incorporating text prompts into the actual generative process, allowing for easily controllable level generation. In other words, instead of searching for a level with specific characteristics, MarioGPT allows us to just ask for it. Concurrently to our work, Todd et al. [42] showed that LLMs can also be used to generate levels for other games such as Sokoban but their model did not allow for any text-prompting. ",
182
+ "bbox": [
183
+ 174,
184
+ 126,
185
+ 825,
186
+ 277
187
+ ],
188
+ "page_idx": 2
189
+ },
190
+ {
191
+ "type": "text",
192
+ "text": "Open-Endedness and Genetic Algorithms. The open-endedness paradigm focuses on algorithms that can produce infinite innovation [24]. These open-ended algorithms are popular in the field of PCG, where designers and players both can benefit from diverse and never-ending content. However, PCG must balance the hard task of generating content with diversity as well as playability. Genetic algorithms (GA), a family of optimization algorithms that are inspired by the principles of natural selection, are commonly used as the backbone for more open-ended search methods. Because GAs allow the integration of multiple objectives, they are particularly suitable for achieving a balance between fitness and diversity. ",
193
+ "bbox": [
194
+ 174,
195
+ 284,
196
+ 825,
197
+ 395
198
+ ],
199
+ "page_idx": 2
200
+ },
201
+ {
202
+ "type": "text",
203
+ "text": "In that regard, novelty search approaches [23] aim at finding the most novel solutions at each generation, in comparison to what has been seen (i.e. an archive of previously discovered highlynovel individuals). What makes novelty-search powerful, and motivated its use in this paper, is that it guides the generation towards increasingly diverse solutions in an open-ended fashion. Novelty search keeps track of solutions in an archive and measures diversity by the distance between their behavior characteristics (BCs) compared to that of their $k$ closest neighbors. This makes novelty search very flexible, allowing for the use of many different behavior characteristic types. ",
204
+ "bbox": [
205
+ 174,
206
+ 401,
207
+ 825,
208
+ 498
209
+ ],
210
+ "page_idx": 2
211
+ },
212
+ {
213
+ "type": "text",
214
+ "text": "Sequence Modelling and Transformers. Classic approaches to sequence modelling using recurrent neural networks (RNNs) [31] and Long Short Term Memory (LSTM) networks [15] have traditionally been constrained by the fading memory of the network’s state vector, as well as limited scalability due to the temporal interdependency of the operations. Transformers [44] address both challenges by applying associative attention [1] to learned reprojections of the windowed input sequence, which is commonly referred to as self-attention. These architectural innovations have enabled Large Language Models (LLMs) to learn from massive datasets. Additionally, such models have also shown to be effective in accelerated learning of down-stream tasks. Fine-tuning LLMs [7] involves using pre-trained model weights as a weight initialization for new tasks. ",
215
+ "bbox": [
216
+ 174,
217
+ 505,
218
+ 825,
219
+ 628
220
+ ],
221
+ "page_idx": 2
222
+ },
223
+ {
224
+ "type": "text",
225
+ "text": "One particularly relevant use of pretrained / fine-tuned LLMs comes from the method Evolution through Large Models (ELM), proposed in Lehman et al. [21]. ELM utilizes an LLM diff model [3], which is trained on code diffs obtained by Github data, giving the model the ability to modify a code snippet based on a particular commit message. This diff model is used as a \"mutation operator\", for a GA that evolves a population of programs. The wide generative capabilities of the LLM produce diverse mutations, resulting in novel individuals that vary increasingly over the course of the GA. ",
226
+ "bbox": [
227
+ 174,
228
+ 636,
229
+ 825,
230
+ 719
231
+ ],
232
+ "page_idx": 2
233
+ },
234
+ {
235
+ "type": "text",
236
+ "text": "3 Open-Ended Level Generation through LLMs ",
237
+ "text_level": 1,
238
+ "bbox": [
239
+ 173,
240
+ 744,
241
+ 591,
242
+ 762
243
+ ],
244
+ "page_idx": 2
245
+ },
246
+ {
247
+ "type": "text",
248
+ "text": "Here we present our complete approach to open-ended level generation through LLMs, which is composed of two parts. First, we introduce our prompt-conditioned model MarioGPT (Figure 2) in Section 3.1, which generates levels –encoded as text– given a natural-language prompt. Second, we detail how MarioGPT can be used in a novelty-search evolutionary loop (Figure 3) in Section 3.2, allowing the approach to produce a continual stream of diverse levels. ",
249
+ "bbox": [
250
+ 174,
251
+ 779,
252
+ 825,
253
+ 849
254
+ ],
255
+ "page_idx": 2
256
+ },
257
+ {
258
+ "type": "text",
259
+ "text": "Level Representation. Mario levels are represented similarly to previous works [45, 8, 35, 33, 34, 12], using the levels provided in the Video Game Level Corpus (VGLC) [40]. We utilize a relatively small set of path-annotated levels, taken from Super Mario Bros. and Super Mario Bros.: The Lost Levels (in total 37 levels). For more details on specific tiles present, see Section 6.1 in the Appendix. These levels are stitched together, to essentially make one giant level, allowing us to sample freely without worrying about the ends of the levels. Each tile is represented as a string. The string representation and characters are tokenized into discrete values using a Byte Pair Encoding tokenizer used in the original GPT2 model [29]. The tokenizer learns a mapping that maps each tile to its own unique token. One limitation from the dataset is the simplified representation of enemies. Even though levels contain many different enemies, each with different behaviors and features, the dataset represents them all as the same token. ",
260
+ "bbox": [
261
+ 174,
262
+ 856,
263
+ 825,
264
+ 911
265
+ ],
266
+ "page_idx": 2
267
+ },
268
+ {
269
+ "type": "image",
270
+ "img_path": "images/c7dc2c6fdb7821d852c4b6296feaf5113a60c91d29ae427824319eec7c7b20b7.jpg",
271
+ "image_caption": [
272
+ "Figure 3: Novelty search setup and MarioGPT mutation operators. A level is sampled from a set of top elites in the archive, mutated, and, if novel enough, added to the archive. The mutation process involves two main steps: (1) Pick a random slice from the level and replace it with a new MarioGPT sample, using a random prompt. (2) Inpaint the border region with MarioBert to preserve path consistency. "
273
+ ],
274
+ "image_footnote": [],
275
+ "bbox": [
276
+ 253,
277
+ 87,
278
+ 743,
279
+ 301
280
+ ],
281
+ "page_idx": 3
282
+ },
283
+ {
284
+ "type": "text",
285
+ "text": "",
286
+ "bbox": [
287
+ 174,
288
+ 393,
289
+ 825,
290
+ 491
291
+ ],
292
+ "page_idx": 3
293
+ },
294
+ {
295
+ "type": "text",
296
+ "text": "3.1 MarioGPT Model ",
297
+ "text_level": 1,
298
+ "bbox": [
299
+ 176,
300
+ 515,
301
+ 338,
302
+ 530
303
+ ],
304
+ "page_idx": 3
305
+ },
306
+ {
307
+ "type": "text",
308
+ "text": "Our model, MarioGPT, is a prompt-conditioned unidirectional language model, optimized for long sequence level prediction. More precisely, MarioGPT’s architecture relies on a distilled, lightweight version of GPT2 [29] transformer architecture called DistilGPT2 [32] \\*. Encoding slices of Mario levels as strings, similar to the approach taken in Summerville and Mateas [38], we can fine-tune this distilled version of GPT2 on predicting next tokens in Mario levels. To generate levels, we concatenate a window of previous 50 columns into a single vector and feed them into MarioGPT. ",
309
+ "bbox": [
310
+ 174,
311
+ 542,
312
+ 825,
313
+ 626
314
+ ],
315
+ "page_idx": 3
316
+ },
317
+ {
318
+ "type": "text",
319
+ "text": "Architecture: MarioGPT’s architecture is the same as the DistilGPT2 architecture, except the cross attention weights are utilized for prompting. Even though DistilGPT2 supports context lengths up to size 1024, we limit our context lengths to 700, as we found increasing it did little to increase performance. In total, MarioGPT has 96 million parameters (86 million of the original DistilGPT2 parameters and 10 million from cross attention weights). We train MarioGPT for 50,000 steps, sampling 4 random slices of levels at each iteration and optimize the model using the Adam optimizer [20]. In total, MarioGPT sees 200,000 training samples. Because the model is relatively small, it can be trained using a single Nvidia GeForce RTX 2080 Ti GPU. ",
320
+ "bbox": [
321
+ 174,
322
+ 632,
323
+ 825,
324
+ 743
325
+ ],
326
+ "page_idx": 3
327
+ },
328
+ {
329
+ "type": "text",
330
+ "text": "Prompting details: In order to incorporate prompt information, we fine-tune the attention layers’ cross attention weights, as illustrated in Figure 2. Prompts are encoded through BART [25], a frozen pre-trained language model. Prompts are passed through the frozen language model and the hidden states from the forward pass are averaged into a single vector. This average hidden state is then used in the cross attention layers of the GPT2 architecture in combination with the actual level sequence being passed into the model. We represent our prompts as combinations of specific features along with keywords that correspond to quantiles (e.g. none, little, some, many). This allows us to easily generate level/prompt pairs by counting corresponding tile values. For more details on the prompts, see Section 6.2 in the Appendix. ",
331
+ "bbox": [
332
+ 174,
333
+ 750,
334
+ 825,
335
+ 875
336
+ ],
337
+ "page_idx": 3
338
+ },
339
+ {
340
+ "type": "text",
341
+ "text": "In addition, it is possible to use synonyms for words. For example, changing “many” to “a lot” or “a ton”, produces similar results because the BART encoder can generalize well. ",
342
+ "bbox": [
343
+ 173,
344
+ 92,
345
+ 823,
346
+ 119
347
+ ],
348
+ "page_idx": 4
349
+ },
350
+ {
351
+ "type": "text",
352
+ "text": "3.2 Open-Ended Mario Level Generation with Novelty Search ",
353
+ "text_level": 1,
354
+ "bbox": [
355
+ 173,
356
+ 136,
357
+ 617,
358
+ 150
359
+ ],
360
+ "page_idx": 4
361
+ },
362
+ {
363
+ "type": "text",
364
+ "text": "In the realm of PCG, it is important to not only generate levels with diverse physical features, but also levels that elicit a wide range of player behavior. When it comes to creating Mario levels, the focus is on the different paths a player can take to complete the level. This is often a challenge for many algorithms (such as [45, 8]) and requires the use of an external agent for evaluation. However, with MarioGPT, it is possible to generate diverse and controllable levels that approximate a realistic player path, reducing the need for an external agent and producing levels that are directly playable. To encourage diversity in generated levels, we integrate MarioGPT within a novelty search augmented genetic algorithm (NS-MarioGPT), where language-models play the role of mutation operators. As illustrated in Figure 3, NS-MarioGPT iteratively samples and mutates elite levels from an archive of generated levels. ",
365
+ "bbox": [
366
+ 173,
367
+ 161,
368
+ 825,
369
+ 299
370
+ ],
371
+ "page_idx": 4
372
+ },
373
+ {
374
+ "type": "text",
375
+ "text": "Novelty Search: Mutated levels are only stored in the archive if they achieve a higher novelty score compared to the previous elites. The novelty score is measured as the mean distance between the behavioral characteristic vector of the levels and the behavioral characteristic vector of the $K$ closest elements from the archive $K$ -means). Our goal in level generation is to create paths that result in diverse player behavior, so we use predicted player paths as our basis for these behavior characteristics. More specifically, we are interested in the relative patterns of predicted paths. For instance, if a player character moves in a straight line on high elevated blocks, we want the path’s representation to be close in behavior space to a path that moves straight in lower elevation. To achieve this, we represent the behavior characteristic as the normalized average of the predicted path’s coordinates, allowing a smooth representation of paths (Figure 4). Thus the significance of a single block difference is reduced, making it harder for mutated levels to be added to the archive. This is desired because we don’t want the archive to fill up with levels that only vary slightly from the existing levels in the archive. For all our novelty search experiments, we use a small neighborhood of size 4, which results in a behavioral characteristic of dimension 100. We initialize our archive with a small number of levels (30), as we found mutations are significant enough to generate a diverse set of levels without a big starting population. ",
376
+ "bbox": [
377
+ 174,
378
+ 306,
379
+ 825,
380
+ 526
381
+ ],
382
+ "page_idx": 4
383
+ },
384
+ {
385
+ "type": "image",
386
+ "img_path": "images/042a059868c0553a7a60e438afd451a3c9c6cc9b670ad7daaf595ec5078a860b.jpg",
387
+ "image_caption": [
388
+ "Figure 4: Novelty search behavior characteristic. Left: level, Right: smoothed moving average of generated path. "
389
+ ],
390
+ "image_footnote": [],
391
+ "bbox": [
392
+ 202,
393
+ 541,
394
+ 794,
395
+ 577
396
+ ],
397
+ "page_idx": 4
398
+ },
399
+ {
400
+ "type": "text",
401
+ "text": "Mutations: The LLM-based mutation operation introduced in this paper (Figure 3) transforms a randomly picked slice of a level (a slice between $4 0 - 8 0$ columns) with a new MarioGPT prediction, guided by a random prompt. By itself, MarioGPT is able, through mutations, to produce a variety of levels with varying agent paths. However, because MarioGPT is a unidirectional model, we cannot guarantee that the new generated path is consistent with the rest of the level. To further improve path consistency, we incorporate a fine-tuned mask prediction model (which we call MarioBert), based on the Bert architecture. The BERT language model [7] is a bidirectional LLM that shows impressive performance in the task of mask prediction, which is analogous to image in-painting. This ability is ideal for our use case, where MarioBert is used to inpaint its border region after the newly sampled slice, smoothly joining the mutated slice and the rest of level. This can be observed in the second step of the \"Mutation process\" part of Figure 3. ",
402
+ "bbox": [
403
+ 173,
404
+ 640,
405
+ 825,
406
+ 792
407
+ ],
408
+ "page_idx": 4
409
+ },
410
+ {
411
+ "type": "text",
412
+ "text": "4 Experiments and Results ",
413
+ "text_level": 1,
414
+ "bbox": [
415
+ 176,
416
+ 813,
417
+ 413,
418
+ 829
419
+ ],
420
+ "page_idx": 4
421
+ },
422
+ {
423
+ "type": "text",
424
+ "text": "4.1 Tile Prediction Accuracy ",
425
+ "text_level": 1,
426
+ "bbox": [
427
+ 174,
428
+ 843,
429
+ 385,
430
+ 858
431
+ ],
432
+ "page_idx": 4
433
+ },
434
+ {
435
+ "type": "text",
436
+ "text": "To measure how proficient MarioGPT is in generating levels and because the majority of tiles in these levels are air tiles, we focus on comparing non-air tile prediction accuracy. We compare to baselines: LSTM, as proposed in Summerville and Mateas [38] and MarioGPT that is trained from scratch (without using pretrained GPT2 weights), with results reported in Table 1. For all our baselines, we train for the same amount (200,000 samples). The results show that MarioGPT (using a pretrained GPT2 model) outperforms all other baselines with regards to tile prediction. In addition, training MarioGPT from scratch and training an adapter layer (a small multi layer network on top of the original prediction layer) results in models that performs worse than even the LSTM baseline (given the 200,000 training samples). These models were trained with minimal hyperparameter search, so their performance can likely be improved. However, as a tangential point, this shows a major benefit of fine-tuning pretrained models, which seem to require much less effort in regards to hyperparameters. ",
437
+ "bbox": [
438
+ 174,
439
+ 869,
440
+ 823,
441
+ 911
442
+ ],
443
+ "page_idx": 4
444
+ },
445
+ {
446
+ "type": "table",
447
+ "img_path": "images/fd7503bc856b6f5020a8e0441e611cb5211e64a2ebdb6a26f4d6e684a18df2bb.jpg",
448
+ "table_caption": [
449
+ "Table 1: Training Reconstruction Accuracy – Validation Set "
450
+ ],
451
+ "table_footnote": [],
452
+ "table_body": "<table><tr><td>Model</td><td>Tile Acc.</td><td>Path Acc.</td><td>Promptable?</td></tr><tr><td>LSTM</td><td>46%</td><td>39%</td><td>NO</td></tr><tr><td>from-scratch-MarioGPT</td><td>31%</td><td>23%</td><td>YES</td></tr><tr><td>adapter-MarioGPT</td><td>21%</td><td>11%</td><td>YES</td></tr><tr><td>MarioGPT</td><td>93%</td><td>91%</td><td>YES</td></tr></table>",
453
+ "bbox": [
454
+ 274,
455
+ 112,
456
+ 723,
457
+ 198
458
+ ],
459
+ "page_idx": 5
460
+ },
461
+ {
462
+ "type": "text",
463
+ "text": "",
464
+ "bbox": [
465
+ 173,
466
+ 226,
467
+ 825,
468
+ 352
469
+ ],
470
+ "page_idx": 5
471
+ },
472
+ {
473
+ "type": "text",
474
+ "text": "4.2 Measuring Playability of Levels ",
475
+ "text_level": 1,
476
+ "bbox": [
477
+ 176,
478
+ 369,
479
+ 433,
480
+ 386
481
+ ],
482
+ "page_idx": 5
483
+ },
484
+ {
485
+ "type": "text",
486
+ "text": "To test for playability, we deploy Robin Baumgarten’s $\\mathbf { A } ^ { * }$ agent [43, 19] in 250 generated levels\\*. The reason for choosing Robin Baumgarten’s $\\mathbf { A } ^ { * }$ agent for measuring playability comes from its performance on the 2009 Mario AI competition, where it beat handcrafted controllers and even simple evolved neural networks on getting the furthest in an infinite-level setting, as well as solving a corpus of levels [43]. We find that $8 8 . 4 \\%$ of all MarioGPT-generated levels can be completed by the agent, and are therefore considered playable (compared to the best baseline, the LSTM, which achieves around $31 \\%$ solvable levels). Moreover, we find that only one of the successful levels needed a retry with the $\\mathbf { A } ^ { * }$ agent. We further test whether the path generated by the model matches that of the $\\mathbf { A } ^ { * }$ agent to assess their feasibility. Table 2 shows the mean absolute error (MAE) between suggested and actual agent path for playable and not playable levels respectively. We see that for playable levels, the MAE between the path generated by the model and the actually taken path by the agent is 1.15 tiles, i.e. paths are on average about 1 tile apart. For the non-playable levels, this average difference of taken paths is significantly higher with 4.56 tiles. Thus, we can conclude that in playable levels, the agent mostly takes a similar path as the one generated by the model. The significantly higher MAE of 4.56 in non-playable levels on the other hand indicates that the path generated by the models in these cases may not be feasible for the agent. ",
487
+ "bbox": [
488
+ 173,
489
+ 396,
490
+ 825,
491
+ 618
492
+ ],
493
+ "page_idx": 5
494
+ },
495
+ {
496
+ "type": "table",
497
+ "img_path": "images/d9701067ac77f16799d9a12493db1efca3e920680e9c02df606d1ea65a192347.jpg",
498
+ "table_caption": [
499
+ "Table 2: Mean average error (MAE) between paths suggested by model and Baumgarten’s $\\mathbf { A } ^ { * }$ agent. Results are averaged over 5 runs per level to account for minor stochastic variation in agent simulation. MAEs are computed between $y$ coordinates of path trajectories for every point on the $x$ axis (which goes across the level) both trajectories have visited. "
500
+ ],
501
+ "table_footnote": [],
502
+ "table_body": "<table><tr><td>Playable</td><td>Not Playable</td><td>All</td></tr><tr><td>1.15</td><td>4.56</td><td>1.56</td></tr></table>",
503
+ "bbox": [
504
+ 382,
505
+ 698,
506
+ 614,
507
+ 742
508
+ ],
509
+ "page_idx": 5
510
+ },
511
+ {
512
+ "type": "text",
513
+ "text": "Considering the MAE of 1.56 tiles for paths in all levels, we can conclude that in the majority of the cases, the path generated by the model is similar to the path taken by an actual agent, and having the model generate a path through the level jointly with the level is an effective approach to obtain high-quality levels in terms of playability. ",
514
+ "bbox": [
515
+ 173,
516
+ 765,
517
+ 825,
518
+ 821
519
+ ],
520
+ "page_idx": 5
521
+ },
522
+ {
523
+ "type": "text",
524
+ "text": "To investigate the quality of the generated paths further, we visualize the paths with the most, least and median overlap (i.e. the levels corresponding to the maximum, minimum and median values for the mean absolute error in height) as well as two interesting handpicked examples in Figure 5. ",
525
+ "bbox": [
526
+ 176,
527
+ 828,
528
+ 821,
529
+ 869
530
+ ],
531
+ "page_idx": 5
532
+ },
533
+ {
534
+ "type": "text",
535
+ "text": "Figures 5d and 5e show that paths generated by MarioGPT tend to have more airtime than Baumgarten’s agent in the sense that they only weakly take into account \"gravity\". This result may be attributed to the nature of the path annotations in the models training set. In Summerville et al. [40], the authors use an $\\mathbf { A } ^ { * }$ path solver to find a path through the level, while an actual agent, such as the one we used for comparison here, is more strongly bound by game physics (especially \"gravity\") and has to avoid enemies in the level. A second reason for non-playable levels can be seen in Figure 5c: Baumgarten’s agent is spawned in a tight space from which it can not escape, while the model has generated a path that traverses beyond the actual level, again a path that would likely be suggested by a solver. We argue that these issues can in part be attributed to the paths in the training data stemming from a solver rather than an actual agent, and could be alleviated in future work by annotating the training data with the trajectories of actual agents. ",
536
+ "bbox": [
537
+ 173,
538
+ 90,
539
+ 826,
540
+ 243
541
+ ],
542
+ "page_idx": 6
543
+ },
544
+ {
545
+ "type": "image",
546
+ "img_path": "images/b78426ce06283b9732abb3b14fa1a167f5be8825be0c2fcd2139ac575dcb3141.jpg",
547
+ "image_caption": [
548
+ "Figure 5: $\\mathbf { A } ^ { * }$ vs. MarioGPT generated paths. Levels with (a) minimum (0.02), (a) median (0.89) and (a) maximum (11.0) mean absolute error (MAE) between trajectory of actual $\\mathbf { A } ^ { * }$ agent (denoted as A), and model suggestion (denoted as P), as well as interesting hand-picked examples. Positions where both trajectories overlap are marked with \\*. Paths suggested by the model generally tend to have more airtime than the $\\mathbf { A } ^ { * }$ agent (d, e), likely due to game physics not being accounted for in the original path annotations of the training data. "
549
+ ],
550
+ "image_footnote": [],
551
+ "bbox": [
552
+ 267,
553
+ 256,
554
+ 730,
555
+ 494
556
+ ],
557
+ "page_idx": 6
558
+ },
559
+ {
560
+ "type": "text",
561
+ "text": "4.3 Is MarioGPT memorizing? ",
562
+ "text_level": 1,
563
+ "bbox": [
564
+ 174,
565
+ 611,
566
+ 401,
567
+ 626
568
+ ],
569
+ "page_idx": 6
570
+ },
571
+ {
572
+ "type": "image",
573
+ "img_path": "images/03847a0c8d25f6319ea8e373ca069b827d2df759372e6d48ae6240ba803a9e47.jpg",
574
+ "image_caption": [
575
+ "Figure 6: Generated levels vs closest in dataset. Temperature of 1.0 ends up spitting out almost exactly what is in the dataset, while increasing temperature improves sample diversity. "
576
+ ],
577
+ "image_footnote": [],
578
+ "bbox": [
579
+ 235,
580
+ 642,
581
+ 763,
582
+ 791
583
+ ],
584
+ "page_idx": 6
585
+ },
586
+ {
587
+ "type": "text",
588
+ "text": "Memorization dynamics in LLMs remain an open problem when training transformer architectures [41, 5, 16]. While LLMs are incredibly powerful, they can sometimes overfit extremely and end up regurgitating training data. One popular way to alleviate this issue is to add some randomness in predictions in the form a tunable \"temperature\" parameter [17]. To evaluate whether MarioGPT is generating levels that are identical to the training set, we sample with different temperature parameters and compare them the closest level in the training dataset. From Figure 6, we can see that increasing temperature results in samples that are more diverse, but lack quality. In our case, when generating levels we use a temperature of 2.4-2.7, as it can generate diverse samples while still retaining some quality. There are many possible improvements to explore in the future. One common way is to simply increase the richness of the dataset. The more samples the model has access to, the less likely it is to overfit. We could also improve MarioGPT’s sampling abilities by introducing different search methods other than sampling with temperature, such as constrained beam search [6] and dataset augmented search [16], to increase diversity while preserving more quality. ",
589
+ "bbox": [
590
+ 174,
591
+ 842,
592
+ 825,
593
+ 911
594
+ ],
595
+ "page_idx": 6
596
+ },
597
+ {
598
+ "type": "text",
599
+ "text": "",
600
+ "bbox": [
601
+ 174,
602
+ 90,
603
+ 825,
604
+ 203
605
+ ],
606
+ "page_idx": 7
607
+ },
608
+ {
609
+ "type": "text",
610
+ "text": "4.4 Guided Level Generation via Prompting ",
611
+ "text_level": 1,
612
+ "bbox": [
613
+ 174,
614
+ 219,
615
+ 493,
616
+ 234
617
+ ],
618
+ "page_idx": 7
619
+ },
620
+ {
621
+ "type": "text",
622
+ "text": "Through simple prompting, we are able to guide MarioGPT towards controllable and diverse level generation. We empirically evaluate the prompting ability of MarioGPT by generating 1,000 samples with various combinations of prompts, and check how accurate the generated levels are to the prompt descriptions. The results suggest that MarioGPT can generate levels that match their given prompts most of the time (Table 3). MarioGPT is the most accurate with blocks and the least accurate with enemies. This is expected because there are fewer total tiles of enemies, while there are many more block tiles observed during training. ",
623
+ "bbox": [
624
+ 174,
625
+ 244,
626
+ 825,
627
+ 343
628
+ ],
629
+ "page_idx": 7
630
+ },
631
+ {
632
+ "type": "table",
633
+ "img_path": "images/dba01289c61600c3718a12ea7c44df8bc369c526e93c0f51b80b6a96e0c0e73a.jpg",
634
+ "table_caption": [
635
+ "Table 3: Prompt vs actual description accuracy "
636
+ ],
637
+ "table_footnote": [],
638
+ "table_body": "<table><tr><td>pipes</td><td>enemies</td><td>blocks</td><td>elevation</td></tr><tr><td>81%</td><td>68%</td><td>92%</td><td>76%</td></tr></table>",
639
+ "bbox": [
640
+ 364,
641
+ 381,
642
+ 633,
643
+ 424
644
+ ],
645
+ "page_idx": 7
646
+ },
647
+ {
648
+ "type": "text",
649
+ "text": "We visually evaluated the system, displaying selected prompt-conditioned generations in Figure 1. In addition, we evaluate the importance of the keywords in the prompt by comparing the distribution of the number of pipes between levels generated with random prompts without pipes-related commands (e.g. \"some enemies, some blocks, high elevation\") versus random prompts with pipes-related commands (e.g. \"little pipes, some enemies, some blocks, high elevation\"). The distribution without pipe prompts is scattered, while the ones with pipe prompts result in distributions with peaks, indicating that the keywords actually have an effect on the level generated (see Figure 11 in the Appendix). ",
650
+ "bbox": [
651
+ 173,
652
+ 439,
653
+ 825,
654
+ 550
655
+ ],
656
+ "page_idx": 7
657
+ },
658
+ {
659
+ "type": "text",
660
+ "text": "MarioGPT is also able to generate levels from text descriptions that are not represented in the dataset. For instance, Figure 1e shows a successful approximation of the prompt, \"many pipes, no enemies, many blocks\", with a slight inaccuracy in that it has 1 less pipe (5 pipes is considered \"many\", while 4 are present). However, this is not always the case, as can be seen in Figure 1f, where the model, prompted by \"many pipes, no enemies, some blocks\", generates a level with the correct number of pipes and blocks but generates too many enemies. In future work, we hope to explore more ways to incorporate prompt importance, such as editing levels with tiles to create more samples or prompt tuning [18]. ",
661
+ "bbox": [
662
+ 173,
663
+ 556,
664
+ 825,
665
+ 667
666
+ ],
667
+ "page_idx": 7
668
+ },
669
+ {
670
+ "type": "text",
671
+ "text": "4.5 Generating Diverse Levels with Novelty Search ",
672
+ "text_level": 1,
673
+ "bbox": [
674
+ 174,
675
+ 684,
676
+ 539,
677
+ 700
678
+ ],
679
+ "page_idx": 7
680
+ },
681
+ {
682
+ "type": "text",
683
+ "text": "Through the combination of an LLM (Section 3.1) and novelty search (Section 3.2), we are able to continuously generate diverse levels in an open-ended fashion. Specifically, NS-MarioGPT is able to generate a collection of levels with a diverse set of predicted agent paths. We project the archive as a set of 2D embeddings in Figure 7 and darken the embedding points that are added later in the process. We can see that the levels are increasingly filling up empty spots in the embedding space. We also compare the distribution of levels generated by novelty search to levels generated by random prompts in Figure 8a. Visually, we can see that the levels generated by novelty search are more spread out in t-SNE space and the sampled ones, indicating that they are more diverse. Finally, we have also evaluated the playability of levels generated by novelty search, and find that the majority are solvable and non-playable levels are not clustered but rather scattered across t-SNE space. This indicates that there is no trade-off between path diversity and the ability to generate solvable levels. Figure 8b shows the corresponding results. ",
684
+ "bbox": [
685
+ 174,
686
+ 710,
687
+ 825,
688
+ 877
689
+ ],
690
+ "page_idx": 7
691
+ },
692
+ {
693
+ "type": "text",
694
+ "text": "Figure 9 displays all the overlayed predicted paths (in a level grid) as more and more levels get added to the archive during novelty search. Similar as in Figure 7, we can see that over time, the space of possible predicted agent paths gets filled, as increasingly diverse levels are mutated and added to the archive. As more levels are added to the archive, more and more of the tiles / empty space in the grid are being filled up, indicating that NS-MarioGPT is discovering a variety of levels that produce diverse paths. Concretely, we found that after 300 levels are added to the archive, around $78 \\%$ of the possible coordinates are filled up. However, there are still many overlapping paths in the archive, meaning that similar paths are still being added to the archive. This is an issue that could be improved by using more related time series distance metrics that account for patterns in a path [11]. ",
695
+ "bbox": [
696
+ 173,
697
+ 883,
698
+ 821,
699
+ 911
700
+ ],
701
+ "page_idx": 7
702
+ },
703
+ {
704
+ "type": "image",
705
+ "img_path": "images/208fe07045a41ef1c234698159461b3e3cd2f821cf7f5a044a07747c1839e0f7.jpg",
706
+ "image_caption": [
707
+ "Figure 7: t-SNE of the levels in the archive. t-SNE embeddings are computed from the behavioral characteristic. Darker points indicate more recently added elements. Although novelty search is using the behavioral characteristics of the player paths, the levels also demonstrate visual novelty. "
708
+ ],
709
+ "image_footnote": [],
710
+ "bbox": [
711
+ 240,
712
+ 92,
713
+ 758,
714
+ 335
715
+ ],
716
+ "page_idx": 8
717
+ },
718
+ {
719
+ "type": "image",
720
+ "img_path": "images/28891b163aea4c875fc0f487d07616dc91f2294ba644197603eac33c1243be2c.jpg",
721
+ "image_caption": [
722
+ "Figure 8: Comparing exploration for novelty search vs. random sampling and playable vs. nonplayable levels. (a) t-SNE of both the embeddings of novelty-search levels and levels generated with random prompts. The visualization suggests that novelty search enables a much wider exploration of the space of levels. (b) Unsolvable levels are not clustered together but instead scattered across the t-SNE space. This distribution indicates that there is no correlation between the diversity of levels and their solvability. "
723
+ ],
724
+ "image_footnote": [],
725
+ "bbox": [
726
+ 243,
727
+ 431,
728
+ 735,
729
+ 630
730
+ ],
731
+ "page_idx": 8
732
+ },
733
+ {
734
+ "type": "text",
735
+ "text": "",
736
+ "bbox": [
737
+ 173,
738
+ 752,
739
+ 825,
740
+ 849
741
+ ],
742
+ "page_idx": 8
743
+ },
744
+ {
745
+ "type": "text",
746
+ "text": "Levels with the highest and lowest novelty score from the archive are also shown in Figure 10. The level with the lowest novelty, shown in Figure 10a, has a path that is much more common in the archive, which can be seen by its almost identical look compared to the 2nd lowest in Figure 10c. The levels with higher novelty, Figure 10b and Figure 10d, have more unique patterns, but share a similar pattern towards the end. This indicates that one was created by mutating the other. We also found that the diversity starts to plateau after around 350-400 generations. However, this is very sensitive to the behavior characteristic (the smoothed predicted path of the level), so it may be different for other behavior characteristics. ",
747
+ "bbox": [
748
+ 174,
749
+ 856,
750
+ 823,
751
+ 911
752
+ ],
753
+ "page_idx": 8
754
+ },
755
+ {
756
+ "type": "image",
757
+ "img_path": "images/39fca1654f1547662e8c385c1835c123b21894c3bed3191849bea4be43b74e3c.jpg",
758
+ "image_caption": [
759
+ "Figure 9: Generated path populations during novelty search. Each line is a path through a level. Over time, NS-MarioGPT fills more and more of the space of all possible paths. "
760
+ ],
761
+ "image_footnote": [],
762
+ "bbox": [
763
+ 181,
764
+ 88,
765
+ 818,
766
+ 157
767
+ ],
768
+ "page_idx": 9
769
+ },
770
+ {
771
+ "type": "image",
772
+ "img_path": "images/02ab5e11dc7a2d88c5d832860de48fd1ecff1b09e57bc4a3694ae36a0002a1b4.jpg",
773
+ "image_caption": [
774
+ "Figure 10: Comparison of most and least novel levels in the archive. The two least novel levels are very similar to each other, while the most novel levels have more distinct path patterns. "
775
+ ],
776
+ "image_footnote": [],
777
+ "bbox": [
778
+ 178,
779
+ 218,
780
+ 820,
781
+ 321
782
+ ],
783
+ "page_idx": 9
784
+ },
785
+ {
786
+ "type": "text",
787
+ "text": "",
788
+ "bbox": [
789
+ 174,
790
+ 396,
791
+ 825,
792
+ 452
793
+ ],
794
+ "page_idx": 9
795
+ },
796
+ {
797
+ "type": "text",
798
+ "text": "While NS-MarioGPT is still able to discover many diverse levels through its simple mutation process, more complex functions could also be explored. For instance, crossover, a common mutation utilized in many genetic algorithms, would increase mutation diversity which can lead to more diverse levels. ",
799
+ "bbox": [
800
+ 176,
801
+ 458,
802
+ 825,
803
+ 500
804
+ ],
805
+ "page_idx": 9
806
+ },
807
+ {
808
+ "type": "text",
809
+ "text": "5 Conclusion ",
810
+ "text_level": 1,
811
+ "bbox": [
812
+ 174,
813
+ 531,
814
+ 297,
815
+ 549
816
+ ],
817
+ "page_idx": 9
818
+ },
819
+ {
820
+ "type": "text",
821
+ "text": "Here we introduced MarioGPT, a fine-tuned GPT2 LLM that can not only generate diverse levels, but can guide its generation via a language prompt. This ability is useful in the field of Procedural Content Generation, where balancing controllable and diverse generation is a difficult task. We showed that MarioGPT is also able to (1) predict player interaction in generated levels, (2) generate diverse and playable environments, and (3) reduce the need for expensive external agent interactions (MarioGPT can generate playable levels approximately $8 8 \\%$ of the time). Additionally, when combined with a diversity-driven algorithm like novelty search, MarioGPT can generate open-ended and functional content. While MarioGPT can generate diverse content, it is still limited. It can sometimes not follow prompt instruction and it is also subject to memorizing the dataset. We hope to improve these limitations by introducing richer data to the system. ",
822
+ "bbox": [
823
+ 174,
824
+ 570,
825
+ 825,
826
+ 708
827
+ ],
828
+ "page_idx": 9
829
+ },
830
+ {
831
+ "type": "text",
832
+ "text": "One major benefit of re-using an existing LLM is that we can take advantage of all the research and improvements that have gone into these architectures. We plan to leverage the scalability of LLMs and train MarioGPT on bigger, more detailed annotated levels. Also, we are particularly excited about incorporating human feedback into the level generation process through reinforcement learning from human feedback (RLHF) [47]. The ability to fine-tune these models on human feedback allows users to continually tune their generated levels towards desired characteristics. Ultimately, we hope that MarioGPT opens the door to more controllable and diverse PCG systems. ",
833
+ "bbox": [
834
+ 174,
835
+ 715,
836
+ 825,
837
+ 811
838
+ ],
839
+ "page_idx": 9
840
+ },
841
+ {
842
+ "type": "text",
843
+ "text": "Acknowledgements ",
844
+ "text_level": 1,
845
+ "bbox": [
846
+ 176,
847
+ 844,
848
+ 336,
849
+ 861
850
+ ],
851
+ "page_idx": 9
852
+ },
853
+ {
854
+ "type": "text",
855
+ "text": "This project was supported by a DFF-Research Project1 grant (9131- 00042B) and a European Research Council (ERC) grant (GA no. 101045094, project ”GROW-AI”). ",
856
+ "bbox": [
857
+ 174,
858
+ 883,
859
+ 823,
860
+ 911
861
+ ],
862
+ "page_idx": 9
863
+ },
864
+ {
865
+ "type": "text",
866
+ "text": "References \n[1] Dzmitry Bahdanau, KyungHyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014. \n[2] Michael Beukman, Christopher W Cleghorn, and Steven James. Procedural content generation using neuroevolution and novelty search for diverse video game levels. In Proceedings of the Genetic and Evolutionary Computation Conference, GECCO ’22, page 1028–1037, New York, NY, USA, 2022. Association for Computing Machinery. \n[3] Herbie Bradley, Honglu Fan, Harry Saini, Reshinth Adithyan, Shivanshu Purohit, and Joel Lehman. Diff models - a new way to edit code. CarperAI Blog, Jan 2023. \n[4] Cameron Browne and Frederic Maire. Evolutionary game design. IEEE Transactions on Computational Intelligence and AI in Games, 2(1):1–16, 2010. \n[5] Nicholas Carlini, Daphne Ippolito, Matthew Jagielski, Katherine Lee, Florian Tramer, and Chiyuan Zhang. Quantifying memorization across neural language models, 2022. \n[6] Katsuki Chousa and Makoto Morishita. Input augmentation improves constrained beam search for neural machine translation: Ntt at wat 2021, 2021. \n[7] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding, 2018. \n[8] Matthew C. Fontaine, Ruilin Liu, Ahmed Khalifa, Jignesh Modi, Julian Togelius, Amy K. Hoover, and Stefanos Nikolaidis. Illuminating Mario scenes in the latent space of a generative adversarial network, 2020. \n[9] Matthew C. Fontaine, Julian Togelius, Stefanos Nikolaidis, and Amy K. Hoover. Covariance matrix adaptation for the rapid illumination of behavior space. In Proceedings of the 2020 Genetic and Evolutionary Computation Conference. ACM, jun 2020. \n[10] Edoardo Giacomello, Pier Luca Lanzi, and Daniele Loiacono. Doom level generation using generative adversarial networks. In 2018 IEEE Games, Entertainment, Media Conference (GEM), pages 316–323. IEEE, 2018. \n[11] Omer Gold and Micha Sharir. Dynamic time warping and geometric edit distance: Breaking the quadratic barrier, 2016. \n[12] Miguel González-Duque, Rasmus Berg Palm, Søren Hauberg, and Sebastian Risi. Mario plays on a manifold: Generating functional content in latent space through differential geometry, 2022. \n[13] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks. Communications of the ACM, 63(11):139–144, 2020. \n[14] Nikolaus Hansen. The CMA evolution strategy: A tutorial, 2016. hal-01297037v2f. \n[15] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8):1735–1780, 1997. \n[16] Daphne Ippolito, Florian Tramèr, Milad Nasr, Chiyuan Zhang, Matthew Jagielski, Katherine Lee, Christopher A. Choquette-Choo, and Nicholas Carlini. Preventing verbatim memorization in language models gives a false sense of privacy, 2022. \n[17] Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax, 2016. \n[18] Zhengbao Jiang, Frank F. Xu, Jun Araki, and Graham Neubig. How can we know what language models know?, 2019. \n[19] Ahmed. Khalifa. The mario AI framework. https://github.com/amidos2006/ Mario-AI-Framework, 2009. ",
867
+ "bbox": [
868
+ 169,
869
+ 83,
870
+ 828,
871
+ 919
872
+ ],
873
+ "page_idx": 10
874
+ },
875
+ {
876
+ "type": "text",
877
+ "text": "[20] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization, 2014. ",
878
+ "bbox": [
879
+ 173,
880
+ 90,
881
+ 787,
882
+ 107
883
+ ],
884
+ "page_idx": 11
885
+ },
886
+ {
887
+ "type": "text",
888
+ "text": "[21] Joel Lehman, Jonathan Gordon, Shawn Jain, Kamal Ndousse, Cathy Yeh, and Kenneth O. Stanley. Evolution through large models, 2022. ",
889
+ "bbox": [
890
+ 174,
891
+ 114,
892
+ 825,
893
+ 143
894
+ ],
895
+ "page_idx": 11
896
+ },
897
+ {
898
+ "type": "text",
899
+ "text": "[22] Joel Lehman and Kenneth O. Stanley. Abandoning Objectives: Evolution Through the Search for Novelty Alone. Evolutionary Computation, 19(2):189–223, 06 2011. ",
900
+ "bbox": [
901
+ 174,
902
+ 151,
903
+ 823,
904
+ 181
905
+ ],
906
+ "page_idx": 11
907
+ },
908
+ {
909
+ "type": "text",
910
+ "text": "[23] Joel Lehman, Kenneth O Stanley, et al. Exploiting open-endedness to solve problems through the search for novelty. In ALIFE, pages 329–336, 2008. ",
911
+ "bbox": [
912
+ 173,
913
+ 189,
914
+ 823,
915
+ 218
916
+ ],
917
+ "page_idx": 11
918
+ },
919
+ {
920
+ "type": "text",
921
+ "text": "[24] Joel Lehman, Kenneth O. Stanley, and Lisa Soros. Open-endedness: The last grand challenge you’ve never heard of. https://www.oreilly.com/radar/ open-endedness-the-last-grand-challenge-youve-never-heard-of/. Accessed: 2017-12-19. ",
922
+ "bbox": [
923
+ 173,
924
+ 227,
925
+ 825,
926
+ 282
927
+ ],
928
+ "page_idx": 11
929
+ },
930
+ {
931
+ "type": "text",
932
+ "text": "[25] Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Ves Stoyanov, and Luke Zettlemoyer. Bart: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension, 2019. ",
933
+ "bbox": [
934
+ 173,
935
+ 291,
936
+ 823,
937
+ 334
938
+ ],
939
+ "page_idx": 11
940
+ },
941
+ {
942
+ "type": "text",
943
+ "text": "[26] Antonios Liapis, Georgios N Yannakakis, and Julian Togelius. Constrained novelty search: A study on game content generation. Evolutionary computation, 23(1):101–129, 2015. ",
944
+ "bbox": [
945
+ 173,
946
+ 342,
947
+ 825,
948
+ 372
949
+ ],
950
+ "page_idx": 11
951
+ },
952
+ {
953
+ "type": "text",
954
+ "text": "[27] Jialin Liu, Sam Snodgrass, Ahmed Khalifa, Sebastian Risi, Georgios N Yannakakis, and Julian Togelius. Deep learning for procedural content generation. Neural Computing and Applications, 33(1):19–37, 2021. ",
955
+ "bbox": [
956
+ 176,
957
+ 380,
958
+ 823,
959
+ 422
960
+ ],
961
+ "page_idx": 11
962
+ },
963
+ {
964
+ "type": "text",
965
+ "text": "[28] Jean-Baptiste Mouret and Jeff Clune. Illuminating search spaces by mapping elites, 2015. ",
966
+ "bbox": [
967
+ 178,
968
+ 431,
969
+ 799,
970
+ 446
971
+ ],
972
+ "page_idx": 11
973
+ },
974
+ {
975
+ "type": "text",
976
+ "text": "[29] Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019. ",
977
+ "bbox": [
978
+ 174,
979
+ 454,
980
+ 825,
981
+ 484
982
+ ],
983
+ "page_idx": 11
984
+ },
985
+ {
986
+ "type": "text",
987
+ "text": "[30] Sebastian Risi and Julian Togelius. Increasing generality in machine learning through procedural content generation. Nature Machine Intelligence, 2(8):428–436, 2020. ",
988
+ "bbox": [
989
+ 176,
990
+ 491,
991
+ 823,
992
+ 521
993
+ ],
994
+ "page_idx": 11
995
+ },
996
+ {
997
+ "type": "text",
998
+ "text": "[31] David E Rumelhart, Geoffrey E Hinton, and Ronald J Williams. Learning internal representations by error propagation. Technical report, California Univ San Diego La Jolla Inst for Cognitive Science, 1985. ",
999
+ "bbox": [
1000
+ 176,
1001
+ 529,
1002
+ 823,
1003
+ 571
1004
+ ],
1005
+ "page_idx": 11
1006
+ },
1007
+ {
1008
+ "type": "text",
1009
+ "text": "[32] Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. Distilbert, a distilled version of BERT: smaller, faster, cheaper and lighter, 2019. ",
1010
+ "bbox": [
1011
+ 173,
1012
+ 580,
1013
+ 823,
1014
+ 609
1015
+ ],
1016
+ "page_idx": 11
1017
+ },
1018
+ {
1019
+ "type": "text",
1020
+ "text": "[33] Anurag Sarkar and Seth Cooper. Dungeon and platformer level blending and generation using conditional vaes. In Proceedings of the IEEE Conference on Games (CoG), 2021. ",
1021
+ "bbox": [
1022
+ 173,
1023
+ 617,
1024
+ 825,
1025
+ 647
1026
+ ],
1027
+ "page_idx": 11
1028
+ },
1029
+ {
1030
+ "type": "text",
1031
+ "text": "[34] Anurag Sarkar and Seth Cooper. Generating and blending game levels via quality-diversity in the latent space of a variational autoencoder. In Proceedings of the Foundations of Digital Games, 2021. ",
1032
+ "bbox": [
1033
+ 176,
1034
+ 655,
1035
+ 823,
1036
+ 698
1037
+ ],
1038
+ "page_idx": 11
1039
+ },
1040
+ {
1041
+ "type": "text",
1042
+ "text": "[35] Anurag Sarkar, Zhihan Yang, and Seth Cooper. Conditional level generation and game blending. In Proceedings of the Experimental AI in Games (EXAG) Workshop at AIIDE, 2020. ",
1043
+ "bbox": [
1044
+ 174,
1045
+ 705,
1046
+ 825,
1047
+ 734
1048
+ ],
1049
+ "page_idx": 11
1050
+ },
1051
+ {
1052
+ "type": "text",
1053
+ "text": "[36] Noor Shaker, Julian Togelius, and Mark J Nelson. Procedural content generation in games. Springer, 2016. ",
1054
+ "bbox": [
1055
+ 174,
1056
+ 742,
1057
+ 825,
1058
+ 772
1059
+ ],
1060
+ "page_idx": 11
1061
+ },
1062
+ {
1063
+ "type": "text",
1064
+ "text": "[37] Adam M Smith and Michael Mateas. Answer set programming for procedural content generation: A design space approach. IEEE Transactions on Computational Intelligence and AI in Games, 3(3):187–200, 2011. ",
1065
+ "bbox": [
1066
+ 174,
1067
+ 780,
1068
+ 823,
1069
+ 823
1070
+ ],
1071
+ "page_idx": 11
1072
+ },
1073
+ {
1074
+ "type": "text",
1075
+ "text": "[38] Adam Summerville and Michael Mateas. Super Mario as a string: Platformer level generation via lstms, 2016. ",
1076
+ "bbox": [
1077
+ 174,
1078
+ 832,
1079
+ 821,
1080
+ 861
1081
+ ],
1082
+ "page_idx": 11
1083
+ },
1084
+ {
1085
+ "type": "text",
1086
+ "text": "[39] Adam Summerville, Sam Snodgrass, Matthew Guzdial, Christoffer Holmgård, Amy K Hoover, Aaron Isaksen, Andy Nealen, and Julian Togelius. Procedural content generation via machine learning (PCGML). IEEE Transactions on Games, 10(3):257–270, 2018. ",
1087
+ "bbox": [
1088
+ 174,
1089
+ 869,
1090
+ 826,
1091
+ 912
1092
+ ],
1093
+ "page_idx": 11
1094
+ },
1095
+ {
1096
+ "type": "text",
1097
+ "text": "[40] Adam James Summerville, Sam Snodgrass, Michael Mateas, and Santiago Ontañón. The VGLC: The video game level corpus, 2016. \n[41] Kushal Tirumala, Aram H. Markosyan, Luke Zettlemoyer, and Armen Aghajanyan. Memorization without overfitting: Analyzing the training dynamics of large language models, 2022. \n[42] Graham Todd, Sam Earle, Muhammad Umair Nasir, Michael Cerny Green, and Julian Togelius. Level generation through large language models. In Proceedings of the 18th International Conference on the Foundations of Digital Games, pages 1–8, 2023. \n[43] Julian Togelius, Sergey Karakovskiy, and Robin Baumgarten. The 2009 Mario AI competition. In IEEE Congress on Evolutionary Computation, pages 1–8, 2010. \n[44] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017. \n[45] Vanessa Volz, Jacob Schrum, Jialin Liu, Simon M. Lucas, Adam Smith, and Sebastian Risi. Evolving Mario levels in the latent space of a deep convolutional generative adversarial network, 2018. \n[46] Georgios N Yannakakis and Julian Togelius. Artificial intelligence and games, volume 2. Springer, 2018. \n[47] Daniel M. Ziegler, Nisan Stiennon, Jeffrey Wu, Tom B. Brown, Alec Radford, Dario Amodei, Paul Christiano, and Geoffrey Irving. Fine-tuning language models from human preferences, 2019. ",
1098
+ "bbox": [
1099
+ 171,
1100
+ 90,
1101
+ 828,
1102
+ 439
1103
+ ],
1104
+ "page_idx": 12
1105
+ },
1106
+ {
1107
+ "type": "text",
1108
+ "text": "6 Appendix ",
1109
+ "text_level": 1,
1110
+ "bbox": [
1111
+ 173,
1112
+ 89,
1113
+ 287,
1114
+ 107
1115
+ ],
1116
+ "page_idx": 13
1117
+ },
1118
+ {
1119
+ "type": "text",
1120
+ "text": "6.1 Dataset Details ",
1121
+ "text_level": 1,
1122
+ "bbox": [
1123
+ 174,
1124
+ 119,
1125
+ 318,
1126
+ 135
1127
+ ],
1128
+ "page_idx": 13
1129
+ },
1130
+ {
1131
+ "type": "table",
1132
+ "img_path": "images/b76eae879d2de4d0d5a83faa656bb68d7b2855fcfd4b311d9a111f3f4b62ff94.jpg",
1133
+ "table_caption": [
1134
+ "Table 4: Unique Mario tiles "
1135
+ ],
1136
+ "table_footnote": [],
1137
+ "table_body": "<table><tr><td>Tile Type</td><td>Symbol</td><td>Visualization</td></tr><tr><td>Empty</td><td>1</td><td>?</td></tr><tr><td>Unbreakable</td><td>X</td><td>口</td></tr><tr><td>Breakable</td><td>S</td><td>喜</td></tr><tr><td>Question Block</td><td>?/Q</td><td>?</td></tr><tr><td>Coin</td><td>0</td><td>0</td></tr><tr><td>Enemy</td><td>E</td><td>□</td></tr><tr><td>Left pipe top</td><td>&lt;</td><td>T</td></tr><tr><td>Right pipe top</td><td>V</td><td>T</td></tr><tr><td>Left pipe lower</td><td>[</td><td></td></tr><tr><td>Right pipe lower</td><td>1</td><td>■</td></tr><tr><td>Cannon Top</td><td>B</td><td>同</td></tr><tr><td>Cannon Body</td><td>b</td><td>□</td></tr><tr><td>Path</td><td>X</td><td>P</td></tr></table>",
1138
+ "bbox": [
1139
+ 344,
1140
+ 174,
1141
+ 651,
1142
+ 382
1143
+ ],
1144
+ "page_idx": 13
1145
+ },
1146
+ {
1147
+ "type": "text",
1148
+ "text": "6.2 Constructing Prompts ",
1149
+ "text_level": 1,
1150
+ "bbox": [
1151
+ 174,
1152
+ 409,
1153
+ 367,
1154
+ 424
1155
+ ],
1156
+ "page_idx": 13
1157
+ },
1158
+ {
1159
+ "type": "text",
1160
+ "text": "Prompts are represented as combinations of specific features (e.g. pipes, enemies, blocks, elevation) alongside quantitative keywords: ",
1161
+ "bbox": [
1162
+ 173,
1163
+ 434,
1164
+ 825,
1165
+ 463
1166
+ ],
1167
+ "page_idx": 13
1168
+ },
1169
+ {
1170
+ "type": "text",
1171
+ "text": "• { no, little, some, many, [0-1000]} pipes • { no, little, some, many, [0-1000] } enemies • { little, some, many, [0-1000]} blocks • { low, high} elevation ",
1172
+ "bbox": [
1173
+ 217,
1174
+ 472,
1175
+ 521,
1176
+ 545
1177
+ ],
1178
+ "page_idx": 13
1179
+ },
1180
+ {
1181
+ "type": "text",
1182
+ "text": "As an example, \"no pipes, many enemies, low elevation\" or \"many pipes, many enemies, many blocks\" are both possible prompts. The keywords \"no\", \"little\", \"some\", \"many\" are calculated from quantiles of the corresponding count within a 50 column window (Table 5). The \"low\" and \"high\" elevation are determined from the height of the highest unbreakable blocks in a segment of the level. ",
1183
+ "bbox": [
1184
+ 174,
1185
+ 556,
1186
+ 825,
1187
+ 612
1188
+ ],
1189
+ "page_idx": 13
1190
+ },
1191
+ {
1192
+ "type": "table",
1193
+ "img_path": "images/b278fee8609644b74962879b6be3c0a106c4943f43ad37e1079755466636bbd8.jpg",
1194
+ "table_caption": [
1195
+ "Table 5: Prompt Quantiles and corresponding counts within a 50 column window "
1196
+ ],
1197
+ "table_footnote": [],
1198
+ "table_body": "<table><tr><td>tile</td><td>no</td><td>little</td><td>some</td><td>many</td></tr><tr><td>pipes</td><td>0</td><td>1</td><td>2</td><td>5</td></tr><tr><td>enemies</td><td>0</td><td>1</td><td>3</td><td>7</td></tr><tr><td>blocks</td><td>0</td><td>50</td><td>75</td><td>176</td></tr></table>",
1199
+ "bbox": [
1200
+ 235,
1201
+ 648,
1202
+ 761,
1203
+ 719
1204
+ ],
1205
+ "page_idx": 13
1206
+ },
1207
+ {
1208
+ "type": "image",
1209
+ "img_path": "images/10df4768e1712dda7107c01bf02b54c8ef44c75d1b29eca59eaa5effe083c825.jpg",
1210
+ "image_caption": [
1211
+ "Figure 11: Effect of prompt conditioning. Comparison of the distribution of the number of pipes between levels generated with random prompts without pipes-related commands (e.g. \"some enemies, some blocks, high elevation\") versus random prompts with pipes-related commands (e.g. \"little pipes, some enemies, some blocks, high elevation\"). The distribution without pipe prompts is scattered, while the ones with pipe prompts result in distributions with peaks. "
1212
+ ],
1213
+ "image_footnote": [],
1214
+ "bbox": [
1215
+ 212,
1216
+ 409,
1217
+ 779,
1218
+ 518
1219
+ ],
1220
+ "page_idx": 14
1221
+ }
1222
+ ]
parse/dev/c5Inzw6giM/c5Inzw6giM.md ADDED
@@ -0,0 +1,327 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Privacy-Preserving CNN Training with Transfer Learning
2
+
3
+ Anonymous Author(s)
4
+ Affiliation
5
+ Address
6
+ email
7
+
8
+ # Abstract
9
+
10
+ Privacy-preserving nerual network inference has been well studied while homomorphic CNN training still remains an open challenging task. In this paper, we present a practical solution to implement privacy-preserving CNN training based on mere Homomorphic Encryption (HE) technique. To our best knowledge, this is the first attempt successfully to crack this nut and no work ever before has achieved this goal. Several techniques combine to accomplish the task:: (1) with transfer learning, privacy-preserving CNN training can be reduced to homomorphic neural network training, or even multiclass logistic regression (MLR) training; (2) via a faster gradient variant called Quadratic Gradient, an enhanced gradient method for MLR with a state-of-the-art performance in convergence speed is applied in this work to achieve high performance; (3) we employ the thought of transformation in mathematics to transform approximating Softmax function in the encryption domain to the approximation of the Sigmoid function. A new type of loss function termed Squared Likelihood Error has been developed alongside to align with this change.; and (4) we use a simple but flexible matrix-encoding method named Volley Revolver to manage the data flow in the ciphertexts, which is the key factor to complete the whole homomorphic CNN training. The complete, runnable $\mathrm { C } { + } { + }$ code to implement our work can be found at: https://anonymous.4open.science/r/HE-CNNtraining-B355/.
11
+
12
+ We select REGNET_X_400MF as our pre-trained model for transfer learning. We use the first 128 MNIST training images as training data and the whole MNIST testing dataset as the testing data. The client only needs to upload 6 ciphertexts to the cloud and it takes $\sim 2 1$ mins to perform 2 iterations on a cloud with 64 vCPUs, resulting in a precision of $2 1 . 4 9 \%$ .
13
+
14
+ # 25 1 Introduction
15
+
16
+ # 1.1 Background
17
+
18
+ 27 Applying machine learning to problems involving sensitive data requires not only accurate predictions
19
+ 28 but also careful attention to model training. Legal and ethical requirements might limit the use of
20
+ 29 machine learning solutions based on a cloud service for such tasks. As a particular encryption scheme,
21
+ 30 homomorphic encryption provides the ultimate security for these machine learning applications and
22
+ 31 ensures that the data remains confidential since the cloud does not need private keys to decrypt it.
23
+ 32 However, it is a big challenge to train the machine learning model, such as neural networks or even
24
+ 33 convolution neural networks, in such encrypted domains. Nonetheless, we will demonstrate that
25
+ 34 cloud services are capable of applying neural networks over the encrypted data to make encrypted
26
+ 35 training, and also return them in encrypted form.
27
+
28
+ Several studies on machine learning solutions are based on homomorphic encryption in the cloud environment. Since Gilad-Bachrach et al. [1] firstly considered privacy-preserving deep learning prediction models and proposed the private evaluation protocol CryptoNets for CNN, many other approaches [2, 3, 4, 5] for privacy-preserving deep learning prediction based on HE or its combination with other techniques have been developed. Also, there are several studies [6, 7, 8, 9] working on logistic regression models based on homomorphic encryption.
29
+
30
+ However, to our best knowledge, no work ever before based on mere HE techique has presented an solution to successfully perform homomorphic CNN training.
31
+
32
+ # 1.3 Contributions
33
+
34
+ 46 Our specific contributions in this paper are as follows:
35
+
36
+ 1. with various techniques, we initiate to propose a practical solution for privacy-preserving CNN training, demonstrating the feasibility of homomorphic CNN training.
37
+ 2. We suggest a new type of loss function, Squared Likelihood Error (SLE), which is friendly to pervacy-perserving manner. As a result, we can use the Sigmoid function to replace the Softmax function which is too diffuclt to calculate in the encryption domain due to its uncertainty.
38
+ 3. We develop a new algorithm with SLE loss function for MLR using quadratic gradient. Experiments show that this HE-friendly algorithm has a state-of-the-art performance in convergence speed.
39
+
40
+ # 2 Preliminaries
41
+
42
+ We adopt “ $\otimes$ ” to denote the kronecker product and “ $\odot ^ { \bullet }$ ” to denote the component-wise multiplication between matrices.
43
+
44
+ # 2.1 Fully Homomorphic Encryption
45
+
46
+ 60 Homomorphic Encryption (HE) is one type of encryption scheme with a special characteristic called
47
+ 61 Homomorphic, which allows to compute on encrypted data without having access to the secret key.
48
+ 62 Fully HE means that the scheme is fully homomorphic, namely, homomorphic with regards to both
49
+ 63 addition and multiplication, and that it allows arbitrary computation on encrypted data. Since Gentry
50
+ 64 proposed the first fully HE scheme [10] in 2009, some technological progress on HE has been made.
51
+ 65 For example, Brakerski, Gentry and Vaikuntanathan [11] present a novel way of constructing leveled
52
+ 66 fully homomorphic encryption schemes (BGV) and Smart and Vercauteren [12] introduced one of the
53
+ 67 most important features of HE systems, a packing technique based on polynomial-CRT called Single
54
+ 68 Instruction Multiple Data (aka SIMD) to encrypt multiple values into a single ciphertext. Another
55
+ 69 great progress in terms of machine learning applications is the rescaling procedure [13], which can
56
+ 70 manage the magnitude of plaintext effectively.
57
+ 71 Modern fully HE schemes, such as HEAAN, usually support seveal common homomorphic opera
58
+ 72 tions: the encryption algorithm Enc encrypting a vector, the decryption algorithm Dec decrypting
59
+ 73 a ciphertext, the homomorphic addition Add and multiplication Mult between two ciphertexts, the
60
+ 74 multiplication cMult of a contant vector with a ciphertext, the rescaling operation ReScale to reduce
61
+ 75 the magnitude of a plaintext to an appropriate level, the rotation operation Rot generating a new
62
+ 76 ciphertext encrypting the shifted plaintext vector, and the bootstrapping operation bootstrap to
63
+ 77 refresh a ciphertext usually with a small ciphertext modulus.
64
+
65
+ # 8 2.2 Database Encoding Method
66
+
67
+ 79 For a given database $Z$ , Kim et al. [6] first developed an efficient database encoding method, in order
68
+ 80 to make full use of the HE computation and storage resources. They first expand the matrix database
69
+ 81 to a vector form $V$ in a row-by-row manner and then encrypt this vector $V$ to obtain a ciphertext
70
+ 82 $Z = E n c ( V )$ . Also, based on this database encoding, they mentioned two simple operations via
71
+
72
+ 83 shifting the encrypted vector by two different positions, respectively: the complete row shifting 84 and the incomplete column shifting. These two operations performing on the matrix $Z$ output the matrices 85 $Z ^ { ' }$ and $Z ^ { ' \prime }$ , as follows:
73
+
74
+ $$
75
+ \begin{array} { c c } { { Z = \left[ \begin{array} { c c c c } { { x _ { 1 0 } } } & { { x _ { 1 1 } } } & { { \ldots } } & { { x _ { 1 d } } } \\ { { x _ { 2 0 } } } & { { x _ { 2 1 } } } & { { \ldots } } & { { x _ { 2 d } } } \\ { { \vdots } } & { { \vdots } } & { { \ddots } } & { { \vdots } } \\ { { x _ { n 0 } } } & { { x _ { n 1 } } } & { { \ldots } } & { { x _ { n d } } } \end{array} \right] , } } & { { Z ^ { ' } = E n c \left[ \begin{array} { c c c c } { { x _ { 2 0 } } } & { { x _ { 2 1 } } } & { { \ldots } } & { { x _ { 2 d } } } \\ { { \vdots } } & { { \vdots } } & { { \ddots } } & { { \vdots } } \\ { { x _ { n 0 } } } & { { x _ { n 1 } } } & { { \ldots } } & { { x _ { n d } } } \\ { { x _ { 1 0 } } } & { { x _ { 1 1 } } } & { { \ldots } } & { { x _ { 1 d } } } \end{array} \right] , } } \\ { { Z ^ { ' } = E n c \left[ \begin{array} { c c c c } { { x _ { 1 1 } } } & { { \ldots } } & { { x _ { 1 d } } } & { { x _ { 2 0 } } } \\ { { x _ { 2 1 } } } & { { \ldots } } & { { x _ { 2 d } } } & { { x _ { 3 0 } } } \\ { { \vdots } } & { { \vdots } } & { { \ddots } } & { { \vdots } } \\ { { x _ { n 1 } } } & { { \ldots } } & { { x _ { n d } } } & { { x _ { 1 0 } } } \end{array} \right] , } } & { { Z ^ { ' \prime \prime } = E n c \left[ \begin{array} { c c c c } { { x _ { 1 1 } } } & { { \ldots } } & { { x _ { 1 d } } } & { { x _ { 1 0 } } } \\ { { x _ { 2 1 } } } & { { \ldots } } & { { x _ { 2 d } } } & { { x _ { 2 0 } } } \\ { { \vdots } } & { { \vdots } } & { { \ddots } } & { { \vdots } } \\ { { x _ { n 1 } } } & { { x _ { n 1 } } } & { { x _ { n 0 } } } \end{array} \right] . } } \end{array}
76
+ $$
77
+
78
+ The complete column shifting to obtain the matrix 86 $Z ^ { ^ { \prime \prime \prime } }$ can also be achieved by two Rot, two cMult, 87 and an Add.
79
+
80
+ 88 Other works [14, 4] using the same encoding method also developed some other procedures, such
81
+ 89 as SumRowVec and SumColVec to calculate the summation of each row and column, respectively.
82
+ 90 Such basic common and simple operations consisting of a series of HE operations are significantly
83
+ 91 important for more complex calculations such as the homomorphic evaluation of gradient.
84
+
85
+ # 2.3 Convolutional Neural Network
86
+
87
+ Inspired by biological processes, Convolutional Neural Networks (CNN) are a type of artificial neural network most commonly used to analyze visual images. CNNs play a significant role in image recognition due to their powerful performance. It is also worth mentioning that the CNN model is one of a few deep learning models built with reference to the visual organization of the human brain.
88
+
89
+ # 2.3.1 Transfer Learning
90
+
91
+ 98 Transfer learning in machine learning is a class of methods in which a pretrained model can be used
92
+ 99 as an optimization for a new model on a related task, allowing rapid progress in modeling the new
93
+ 00 task. In real-world applications, very few researchers train entire convolutional neural networks
94
+ 01 from scratch for image processing-related tasks. Instead, it is common to use a well-trained CNN
95
+ 02 as a fixed feature extractor for the task of interest. In our case, we freeze all the weights of the
96
+ 03 selected pre-trained CNN except that of the final fully-connected layer. We then replace the last
97
+ 04 fully-connected layer with a new layer with random weights (such as zeros) and only train this layer.
98
+ 105 REGNET_X_400MF To use transfer learning in our privacy-preserving CNN training, we adopt
99
+ 106 a new network design paradigm called RegNet, recently introduced by Facebook AI researchers,
100
+ 107 as our pre-trained model. RegNet is a low-dimensional design space consisting of simple, regular
101
+ 108 networks. In particular, we apply REGNET_X_400MF as a fixed feature extractor and replaced the final
102
+ 109 fully connected layer with a new one of zero weights. CNN training in this case can be simplified
103
+ 110 to multiclass logistic regression training. Since REGNET_X_400MF only receive color images of size
104
+ 111 $2 2 4 \times 2 2 4$ , the grayscale images will be stacked threefold and images of different sizes will be resized
105
+ 112 to the same size in advance. These two transformations can be done by using PyTorch.
106
+
107
+ # 2.3.2 Datasets
108
+
109
+ We adopt three common datasets in our experiments: MNIST, USPS, and CIFAR10. Table 1 describes the three datasets.
110
+
111
+ # 3 Technical details
112
+
113
+ # 3.1 Multiclass Logistic Regression
114
+
115
+ 118 Multiclass Logistic Regression, or Multinomial Logistic Regression, can be seen as an extension of logistic regression for multi-class classification problems. Supposing that the matrix 119 $X \in \mathbb { R } ^ { n \times ( 1 + d ) }$ ,
116
+
117
+ Table 1: Characteristics of the several datasets used in our experiments
118
+
119
+ <table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>No. Samples(training)</td><td rowspan=1 colspan=1>No. Samples(testing)</td><td rowspan=1 colspan=1>No. Features</td><td rowspan=1 colspan=1>No. Classes</td></tr><tr><td rowspan=1 colspan=1>USPS</td><td rowspan=1 colspan=1>7,291</td><td rowspan=1 colspan=1>2,007</td><td rowspan=1 colspan=1>16×16</td><td rowspan=1 colspan=1>10</td></tr><tr><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>60,000</td><td rowspan=1 colspan=1>10,000</td><td rowspan=1 colspan=1>28×28</td><td rowspan=1 colspan=1>10</td></tr><tr><td rowspan=1 colspan=1>CIFAR-10</td><td rowspan=1 colspan=1>50,000</td><td rowspan=1 colspan=1>10,000</td><td rowspan=1 colspan=1>3×32×32</td><td rowspan=1 colspan=1>10</td></tr></table>
120
+
121
+ the column vector 120 $Y \in \mathbb { N } ^ { n \times 1 }$ , the matrix $\bar { Y } \in \mathbb { R } ^ { n \times c }$ , and the matrix $W \in \mathbb { R } ^ { c \times ( 1 + d ) }$ represent 121 the dataset, class labels, the one-hot encoding of the class labels, and the MLR model parameter, 122 respectively:
122
+
123
+ $$
124
+ \begin{array} { c } { { X = \left[ \begin{array} { c } { { \alpha ^ { 2 } } } \\ { { \vdots } } \\ { { \vdots } } \\ { { \vdots } } \\ { { \vdots } } \\ { { \zeta _ { n } } } \end{array} \right] = \left[ \begin{array} { c c c c c } { { \boxed { { 2 1 } [ 0 ] } } } & { { \alpha ^ { [ 2 } [ 1 ] } } & { { \cdots } } & { { \cdots } } & { { \boxed { { 2 1 } [ 2 ] } } } \\ { { \vdots } } & { { \vdots } } & { { \ddots } } & { { \vdots } } \\ { { \vdots } } & { { \vdots } } & { { \ddots } } & { { \vdots } } \\ { { \alpha ^ { [ } n ] ( 0 ] } } & { { \alpha ^ { [ } n ] [ 1 ] } } & { { \cdots } } & { { \cdots } } & { { \alpha [ n ] [ d ] } } \end{array} \right] , } } \\ { { Y = \left[ \begin{array} { c } { { \beta _ { 1 } } } \\ { { y _ { 2 } } } \\ { { \vdots } } \\ { { \vdots } } \\ { { \xi _ { n } } } \end{array} \right] , \overset { \mathrm { o u c h o t s o d i n g ~ } } { \longrightarrow } \bar { Y } = \left[ \begin{array} { c } { { \boxed { { \bar { Y } } _ { 1 } } } } \\ { { \bar { Y } _ { 2 } } } \\ { { \bar { Y } _ { n } } } \\ { { \bar { Y } _ { n } } } \end{array} \right] = \left[ \begin{array} { c c c c c } { { \beta _ { 1 } [ 1 ] } } & { { \beta _ { 1 } [ 1 ] } } & { { \cdots } } & { { \beta _ { 1 } [ 1 ] [ c - 1 ] } } \\ { { \beta _ { 2 } [ 2 ] } } & { { \beta _ { 2 } [ 1 ] } } & { { \cdots } } & { { \beta _ { 2 } [ 2 ] [ c - 1 ] } } \\ { { \vdots } } & { { \vdots } } & { { \ddots } } & { { \vdots } } \\ { { \beta _ { [ n ] } ( 1 ) } } & { { \beta _ { [ n ] [ 2 ] } } } & { { \cdots } } & { { \beta _ { [ n ] [ - 1 ] } } } \end{array} \right] , } } \\ W = \left[ \begin{array} { c } { { w _ { [ 0 ] } } } \\ { { w _ { [ 1 ] } } } \\ { { \vdots } } \\ { { w _ { [ - 1 ] } } } \\ { { w _ { [ - 1 ] } } } \end{array} \right] = \end{array}
125
+ $$
126
+
127
+ MLR aims to maxsize $L$ or $\ln { \cal L }$ :
128
+
129
+ $$
130
+ { \cal L } = \prod _ { i = 1 } ^ { n } \frac { \exp ( x _ { i } \cdot w _ { [ y _ { i } ] } ^ { \top } ) } { \sum _ { k = 0 } ^ { c - 1 } \exp ( x _ { i } \cdot w _ { [ k ] } ^ { \top } ) } \longmapsto \ln { \cal L } = \sum _ { i = 1 } ^ { n } [ x _ { i } \cdot w _ { [ y _ { i } ] } ^ { \top } - \ln \sum _ { k = 0 } ^ { c - 1 } \exp ( x _ { i } \cdot w _ { [ k ] } ^ { \top } ) ] .
131
+ $$
132
+
133
+ 123 The loss function $\ln { \cal L }$ is a multivariate function of $[ ( 1 + c ) ( 1 + d ) ]$ variables, which has its column
134
+ 124 vector gradient $\nabla$ of size $[ ( 1 + c ) ( 1 + d ) ]$ and Hessian square matrix $\nabla ^ { 2 }$ of order $[ ( 1 + c ) ( 1 + d ) ]$ as
135
+ 125 follows:
136
+
137
+ $$
138
+ \begin{array} { r l } & { \nabla = \frac { \partial \ln L } { \partial \pi } = \left[ \frac { \partial \ln L } { \partial w _ { [ 0 ] } } , \frac { \partial \ln L } { \partial w _ { [ 1 ] } } , \ldots , \frac { \partial \ln L } { \partial w _ { [ c - 1 ] } } \right] ^ { \top } , } \\ & { \nabla ^ { 2 } = \left[ \begin{array} { c c c c } { \frac { \partial ^ { 2 } \ln L } { \partial w _ { [ 0 ] } \partial w _ { [ 0 ] } } } & { \frac { \partial ^ { 2 } \ln L } { \partial w _ { [ 0 ] } \partial w _ { [ 1 ] } } } & { \cdots } & { \frac { \partial ^ { 2 } \ln L } { \partial w _ { [ 0 ] } \partial w _ { [ c - 1 ] } } } \\ { \frac { \partial ^ { 2 } \ln L } { \partial w _ { [ 1 ] } \partial w _ { [ 0 ] } } } & { \frac { \partial ^ { 2 } \ln L } { \partial w _ { [ 1 ] } \partial w _ { [ 1 ] } } } & { \cdots } & { \frac { \partial ^ { 2 } \ln L } { \partial w _ { [ 1 ] } \partial w _ { [ - 1 ] } } } \\ { \vdots } & { \vdots } & { \ddots } & { \vdots } \\ { \frac { \partial ^ { 2 } \ln L } { \partial w _ { [ c - 1 ] } \partial w _ { [ 0 ] } } } & { \frac { \partial ^ { 2 } \ln L } { \partial w _ { [ c - 1 ] } \partial w _ { [ 1 ] } } } & { \cdots } & { \frac { \partial ^ { 2 } \ln L } { \partial w _ { [ c - 1 ] } \partial w _ { [ c - 1 ] } } } \end{array} \right] . } \end{array}
139
+ $$
140
+
141
+ 126 Nesterov’s Accelerated Gradient With $\nabla$ or $\nabla ^ { 2 }$ , first-order gradient algorithms or second-order
142
+ 127 Newton–Raphson method are commonly applied in MLE to maxmise $\ln { \cal L }$ . In particular, Nesterov’s
143
+ 128 Accelerated Gradient (NAG) is a practical solution for homomorphic MLR without frequent inversion
144
+ 129 operations. It seems plausible that the NAG method is probably the best choice for privacy-preserving
145
+ 130 model training.
146
+
147
+ # 3.2 Chiang’s Quadratic Gradient
148
+
149
+ 132 Chiang's Quadratic Gradient (CQG) [15, 16, 9] is a faster, promising gradient variant that can
150
+ 133 combine the first-order gradient descent/ascent algorithms and the second-order Newton–Raphson
151
+ 134 method, accelerating the raw Newton–Raphson method with various gradient algorithms and probably
152
+
153
+ 135 helpful to build super-quadratic algorithms. For a function $F _ { _ - } ( x )$ with its gradient $g$ and Hessian matrix 136 $H$ , to build CQG, we first construct a diagonal matrix $\bar { B }$ from the Hessian $H$ itself:
154
+
155
+ $$
156
+ \bar { B } = \left[ \begin{array} { c c c c c } { \frac { 1 } { \varepsilon + \sum _ { i = 0 } ^ { d } \vert \bar { h } _ { 0 i } \vert } } & { 0 } & { \dots } & { 0 } \\ { 0 } & { \frac { 1 } { \varepsilon + \sum _ { i = 0 } ^ { d } \vert \bar { h } _ { 1 i } \vert } } & { \dots } & { 0 } \\ { \vdots } & { \vdots } & { \ddots } & { \vdots } \\ { 0 } & { 0 } & { \dots } & { \frac { 1 } { \varepsilon + \sum _ { i = 0 } ^ { d } \vert \bar { h } _ { d i } \vert } } \end{array} \right] ,
157
+ $$
158
+
159
+ where 137 $\bar { h } _ { j i }$ is the elements of the matrix $H$ and $\varepsilon$ is a small constant positive number.
160
+
161
+ 138 CQG for the function $F ( \mathbf { x } )$ , defined as $G = \bar { B } \cdot g$ , has the same dimension as the raw gradient $g$ . To
162
+ 139 apply CQG in practice, we can use it in the same way as the first-order gradient algorithms, except
163
+ 140 that we need to replace the naive gradient with the quadratic gradient and adopt a new learning rate
164
+ 141 (usually by increasing 1 to the original learning rate).
165
+ 142 For efficiency in applying CQG, a good bound matrix should be attempted to obtain in order to
166
+ 143 replace the Hessian itself. Chiang has proposed the enhanced NAG method via CQG for MLR with a
167
+ 144 fixed Hessian [17, 7, 18] substitute built from ${ \frac { 1 } { 2 } } X ^ { \mathsf { \tau } } X$ .
168
+
169
+ # 45 3.3 Approximating Softmax Function
170
+
171
+ 146 It might be impractical to perfectly approximate Softmax function in the privacy-preserving domain
172
+ 147 due to its uncertainty. To address this issue, we employ the thought of transformation from mathemat
173
+ 148 ics: transforming one tough problem into another easier one. That is, instead of trying to approximate
174
+ 149 the Softmax function, we attempt to approximate the Sigmoid function in the encryption domain,
175
+ 150 which has been well-studied by several works using the least-square method.
176
+
177
+ In line with standard practice of the log-likelihood loss function involving the Softmax function, we should try to maximize the new loss function
178
+
179
+ $$
180
+ L _ { 1 } = \prod _ { i = 1 } ^ { n } \frac { 1 } { 1 + \exp ( - x _ { i } \cdot w _ { [ y _ { i } ] } ^ { \mathsf { T } } ) } .
181
+ $$
182
+
183
+ 151 We can prove that $\ln { \cal L } _ { 1 }$ is concave and deduce that ${ \scriptstyle { \frac { 1 } { 4 } } } E \otimes X ^ { \tau } X$ can be used to build the CQG for
184
+ 152 $\ln { \cal L } _ { 1 }$ . However, the performance of this loss function $\ln { \cal L } _ { 1 }$ is not ideal, probably because for the
185
+ 153 individual example its gradient and Hessian contain no information about any other class weights not
186
+ 154 related to this example.
187
+
188
+ Squared Likelihood Error After many attempts to finding a proper loss function, we develop a novel loss function that can have a competitive performance to the log-likelihood loss function, which we term Squared Likelihood Error (SLE):
189
+
190
+ $$
191
+ { \cal L } _ { 2 } = \prod _ { i = 1 } ^ { n } \prod _ { j = 0 } ^ { c - 1 } ( \bar { y } _ { i } - { \cal S } i g m o i d ( x _ { i } \cdot w _ { [ y _ { i } ] } ^ { \top } ) ^ { 2 } \longmapsto \ln { \cal L } _ { 2 } = \sum _ { i = 1 } ^ { n } \sum _ { j = 0 } ^ { c - 1 } \ln \left| \bar { y } _ { i } - { \cal S } i g m o i d ( x _ { i } \cdot w _ { [ y _ { i } ] } ^ { \top } ) \right| .
192
+ $$
193
+
194
+ 155 We can also prove that $\ln { \cal L } _ { 2 }$ is concave and that ${ \scriptstyle { \frac { 1 } { 4 } } } E \otimes X ^ { \tau } X$ can be used to build the CQG for $\ln { \cal L } _ { 2 }$
195
+ 156 The loss function SLE might be related to Mean Squared Error (MSE): the MSE loss function sums
196
+ 157 all the squared errors while SLE calculates the cumulative product of all the squared likelihood errors.
197
+ 158 Combining together all the techniques above, we now have the enhanced NAG method with the SLE
198
+ 159 loss function for MLR training, described in detail in Algorithm 1.
199
+ 160 Performance Evaluation We test the convergence speed of the raw NAG method with log
200
+ 161 likelihood loss function (denoted as RawNAG), the NAG method with SLE loss function (denoted
201
+ 162 as SigmoidNAG), and the enhanced NAG method via CQG with SLE loss function (denoted as
202
+ 163 SigmoidNAGQG) on the three datasets described above: USPS, MNIST, and CIFAR10. Since two
203
+ 164 different types of loss functions are used in these three methods, the loss function directly measuring
204
+ 165 the performance of various methods will not be selected as the indicator. Instead, we select precision
205
+ 166 as the only indicator in the following Python experiments. Note that we use REGNET_X_400MF to in
206
+
207
+ Input: training dataset $X \in \mathbb { R } ^ { n \times ( 1 + d ) }$ ; one-hot encoding training label $Y \in \mathbb { R } ^ { n \times c }$ ; and the number $\kappa$ of iterations;
208
+
209
+ Output: the parameter matrix $V \in \mathbb { R } ^ { c \times ( 1 + d ) }$ of the MLR
210
+ 1: Set $\bar { H } - { \textstyle \frac { 1 } { 4 } } X ^ { \intercal } X$ $\begin{array} { r l r } & { } & { \triangleright \bar { H } \in \mathbb { R } ^ { ( 1 + d ) \times ( 1 + d ) } } \\ & { } & { \triangleright V \in \mathbb { R } ^ { c \times ( 1 + d ) } , W \in \mathbb { R } ^ { c \times ( 1 + d ) } , \bar { B } \in \mathbb { R } ^ { c \times ( 1 + d ) } } \end{array}$
211
+ 2: Set $V \mathbf { 0 }$ , $W \mathbf { 0 }$ , $\bar { B } { \bf 0 }$
212
+ 3: for $j : = 0$ to $d$ do
213
+ 4: $\bar { B } [ 0 ] [ j ] \varepsilon$ . $\varepsilon$ is a small positive constant such as $1 e - 1 0$
214
+ 5: for $i : = 0$ to $d$ do
215
+ 6: $\bar { B } [ 0 ] [ j ] \bar { B } [ 0 ] [ j ] + | \bar { H } [ i ] [ j ] |$
216
+ 7: end for
217
+ 8: for $i : = 1$ to $c - 1$ do
218
+ 9: $\bar { B } [ i ] [ j ] \bar { B } [ 0 ] [ j ]$
219
+ 10: end for
220
+ 11: for $i : = 0$ to $c - 1$ do
221
+ 12: $\bar { B } [ i ] [ j ] 1 . 0 / \bar { B } [ i ] [ j ]$
222
+ 13: end for
223
+ 14: end for
224
+ 15: Set $\alpha _ { 0 } \gets 0 . 0 1$ , $\alpha _ { 1 } 0 . 5 \times ( 1 + \sqrt { 1 + 4 \times \alpha _ { 0 } ^ { 2 } } )$
225
+ 16: for count $: = 1$ to $\kappa$ do
226
+ 17: Set $Z X \times V ^ { \tau }$ $\mathsf { D } Z \in \mathbb { R } ^ { n \times c }$ and $V ^ { \intercal }$ means the transpose of matrix V
227
+ 18: for $i : = 1$ to $n$ do . $Z$ is going to store the inputs to the Sigmoid function
228
+ 19: for $j : = 0$ to $d$ do
229
+ 20: $Z [ i ] [ j ] 1 / ( 1 + e ^ { - Z [ i ] [ j ] } )$
230
+ 21: end for
231
+ 22: end for
232
+ 23: Set $\pmb { g } ( Y - Z ) \ d { \tau } \times X$ . g Rc×(1+d)
233
+ 24: Set $G 0$
234
+ 25: for $i : = 0$ to $c - 1$ do
235
+ 26: for $j : = 0$ to $d$ do
236
+ 27: $\mathsf { \bar { \mathbf { { G } } } } [ i ] [ j ] \gets \bar { B } [ i ] [ j ] \times \mathbf { \mathbf { \mathbf { \mathbf { g } } } } [ i ] [ j ]$
237
+ 28: end for
238
+ 29: end for
239
+ 30: $\begin{array} { l } { { \mathrm { S e t } \eta ( 1 - \alpha _ { 0 } ) / \alpha _ { 1 } , \gamma 1 / ( n \times c o u n t ) } } \\ { { w _ { t e m p } W + ( 1 + \gamma ) \times G } } \\ { { W ( 1 - \eta ) \times w _ { t e m p } + \eta \times V } } \\ { { V w _ { t e m p } } } \\ { { \alpha _ { 0 } \alpha _ { 1 } , \alpha _ { 1 } 0 . 5 \times ( 1 + \sqrt { 1 + 4 \times \alpha _ { 0 } ^ { 2 } } ) } } \end{array}$ $\triangleright n$ is the size of training data
240
+ 31:
241
+ 32:
242
+ 33:
243
+ 34:
244
+ 35: end for
245
+ 36: return W
246
+ 167 advance extract the features of USPS, MNIST, and CIFAR10, resulting in a new same-size dataset
247
+ 168 with 401 features of each example. Figure 1 shows that our enhanced methods all converge faster
248
+ 169 than other algorithms on the three datasets.
249
+
250
+ # 170 3.4 Double Volley Revolver
251
+
252
+ 171 Unlike those efficient, complex encoding methods [3], Volley Revolver is a simple, flexible
253
+ 172 matrix-encoding method specialized for privacy-preserving machine-learning applications, whose
254
+ 173 basic idea in a simple version is to encrypt the transpose of the second matrix for two matrices to
255
+ 174 perform multiplication. Figure 2 describes a simple case for the algorithm adopted in this encoding
256
+ 175 method.
257
+ 176 The encoding method actually plays a significant role in implementing privacy-preserving CNN
258
+ 177 training. Just as Chiang mentioned in [4], we show that Volley Revolver can indeed be used to
259
+ 178 implement homomorphic CNN training. This simple encoding method can help to control and
260
+ 179 manage the data flow through ciphertexts.
261
+ 180 However, we don’t need to stick to encrypting the transpose of the second matrix. Instead, either of
262
+ 181 the two matrices is transposed would do the trick: we could also encrypt the transpose of the first
263
+ 182 matrix, and the corresponding multiplication algorithm due to this change is similar to the Algorithm
264
+ 183 2 from [4].
265
+ 184 Also, if each of the two matrices are too large to be encrypted into a single ciphertext, we could also
266
+ 185 encrypt the two matrices into two teams $A$ and $B$ of multiple ciphertexts. In this case, we can see this
267
+ 186 encoding method as Double Volley Revolver, which has two loops: the outside loop deals with
268
+ 187 the calculations between ciphertexts from two teams while the inside loop literally calculates two
269
+ 188 sub-matrices encrypted by two ciphertexts $A _ { [ i ] }$ and $B _ { [ j ] }$ using the raw algorithm of Volley Revolver.
270
+
271
+ ![](images/0fe4d2a0bee0fe6745d45aaacf25e661015c03bbbb0e73b9580001bfe7ac960d.jpg)
272
+ Figure 1: Training and Testing precision results for raw NAG vs. NAG with SLE vs. The enhanced NAG with SLE
273
+
274
+ ![](images/b826681a550108370bd962cafafb3fd0a0e4d2c2a1a1bedb827e813e075433b0.jpg)
275
+ Figure 2: The matrix multiplication algorithm of Volley Revolver for the $4 \times 2$ matrix $A$ and the matrix $B$ of size $2 \times 2$
276
+
277
+ # 189 4 Privacy-preserving CNN Training
278
+
279
+ # 4.1 Polynomial Approximation
280
+
281
+ 191 Although Algorithm 1 enables us to avoid computing the Softmax function in the encryption domain,
282
+ 192 we still need to calculate the Sigmoid function using HE technique. This problem has been well
283
+ 193 studied by several works and we adopt a simple one [19], that is (1) we first use the least-square method
284
+ 194 to perfectly approximate the sigmoid function over the range $[ - 8 , + 8 ]$ , obtaining a polynomial $Z _ { 1 1 }$
285
+ 195 of degree 11; and (2) we use a polynomial $Z _ { 3 }$ of degree 3 to approximate the Sigmoid by minimizing
286
+ 196 the cost function $F$ including the squared gradient difference:
287
+
288
+ $$
289
+ F = \lambda _ { 0 } \cdot \int _ { - 8 } ^ { + 8 } ( Z _ { 1 1 } - Z _ { 3 } ) ^ { 2 } d x + \lambda _ { 1 } \cdot \int _ { - 8 } ^ { + 8 } ( Z _ { 1 1 } ^ { ' } - Z _ { 3 } ^ { ' } ) ^ { 2 } d x ,
290
+ $$
291
+
292
+ 197 where $\lambda _ { 0 }$ and $\lambda _ { 1 }$ are two positive float numbers to control the shape of the polynomial to approximate.
293
+
294
+ 198 Setting $\lambda _ { 0 } = 1 2 8$ and $\lambda _ { 1 } = 1$ would result in the polynomial we used in our privacy-preserving CNN training:199 $Z _ { 3 } = 0 . 5 + 0 . 1 0 6 7 9 5 3 4 5 0 3 2 \cdot x - 0 . 0 0 0 3 8 5 0 3 2 5 9 8 \cdot x ^ { 3 }$ .
295
+
296
+ Before the homomorphic CNN training starts, the client needs to encrypt the dataset $X$ , the data labels $\bar { Y }$ , the matrix $\vec { B }$ and the weight $W$ into ciphertexts $E n c ( X ) , E n c ( \hat { Y } ) , E n c ( \hat { B } )$ and $E n c ( W )$ , respectively, and upload them to the cloud. For simplicity in presentation, we can just regard the whole pipeline of homomorphic evaluation of Algorithm 1 as updating the weight ciphertext: $W = W \dot { + } \hat { B } \odot ( \bar { Y } - Z _ { 3 } ( X \times \hat { W } ^ { \bar { \mathsf { T } } } ) ) ^ { \bar { \mathsf { T } } } \times X$ , regardless of the subtle control of the enhanced NAG method with the SLE loss function.
297
+
298
+ Since Volley Revolver only needs one of the two matrices to be transposed ahead before encryption and $( \bar { Y } - Z _ { 3 } ( X \times \bar { W } ^ { \bar { \mathsf { T } } } ) ) ^ { \bar { \mathsf { T } } } \times X$ happened to suffice this situation between any matrix multiplication, we can complete the homomorphic evaluation of CQG for MLR.
299
+
300
+ # 5 Experiments
301
+
302
+ The $\mathrm { C } { + } { + }$ source code to implement the experiments in this section is openly available at: https://anonymous.4open.science/r/HE-CNNtraining-B355/ .
303
+
304
+ Implementation We implement the enhanced NAG with the SLE loss function based on HE with the library HEAAN. All the experiments on the ciphertexts were conducted on a public cloud with 64 vCPUs and 192 GB RAM.
305
+
306
+ We adopt the first 128 MNIST training images as the training data and the whole test dataset as the testing data. Both the training images and testing images have been processed in advance with the pre-trained model REGNET_X_400MF, resulting in a new dataset with each example of size 401.
307
+
308
+ # 5.1 Parameters
309
+
310
+ The parameters of HEAAN we selected are: $l o g N = 1 6$ , $l o g Q = 9 9 0$ , $l o g p = 4 5$ , $s l o t s = 3 2 7 6 8$ , which ensure the security level $\lambda = 1 2 8$ . Refer [6] for the details of these parameters. We didn’t use bootstrapping to refresh the weight ciphertexts and thus it can only perform 2 iterations of our algorithm. Each iteration takes $\sim 1 1$ mins. The maximum runtime memory in this case is $\sim 1 8$ GB. The 128 MNIST training images are encrypted into 2 ciphertexts. The client who own the private data has to upload these two ciphertexts, two ciphertexts encrypting the one-hot labels $\bar { Y }$ , one ciphertext encrypting the $\bar { B }$ and one ciphertext encrypting the weight $W$ to the cloud. The inticial weight matrix $W _ { 0 }$ we adopted is the zero matrix. The resulting MLR model after 2-iteration training has reached a pricision of $2 1 . 4 9 \%$ and obtain the loss of −147206, which are consistent with the Python simulation experiment.
311
+
312
+ # 6 Conclusion
313
+
314
+ In this work, we initiated to implement privacy-persevering CNN training based on mere HE techniques by presenting a faster HE-friendly algorithm.
315
+
316
+ The HE operation bootstrapping could be adopted to refresh the weight ciphertexts. Python experiments imitating the privacy-preserving CNN training using $Z _ { 3 }$ as Sigmoid substitution showed that using a large amount of data such as 8,192 images to train the MLE model for hundreds of iterations would finally reach $9 5 \%$ precision. The real experiments over ciphertexts conducted on a high-performance cloud with many vCPUs would take weeks to complete this test, if not months.
317
+
318
+ # References
319
+
320
+ [1] Ran Gilad-Bachrach, Nathan Dowlin, Kim Laine, Kristin Lauter, Michael Naehrig, and John Wernsing. Cryptonets: Applying neural networks to encrypted data with high throughput and accuracy. In International conference on machine learning, pages 201–210. PMLR, 2016.
321
+
322
+ [2] Hervé Chabanne, Amaury De Wargny, Jonathan Milgram, Constance Morel, and Emmanuel Prouff. Privacy-preserving classification on deep neural network. Cryptology ePrint Archive, 2017.
323
+
324
+ [3] Xiaoqian Jiang, Miran Kim, Kristin Lauter, and Yongsoo Song. Secure outsourced matrix computation and application to neural networks. In Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security, pages 1209–1222, 2018. [4] John Chiang. A novel matrix-encoding method for privacy-preserving neural networks (inference). arXiv preprint arXiv:2201.12577, 2022. [5] Florian Bourse, Michele Minelli, Matthias Minihold, and Pascal Paillier. Fast homomorphic evaluation of deep discretized neural networks. In Advances in Cryptology–CRYPTO 2018: 38th Annual International Cryptology Conference, Santa Barbara, CA, USA, August 19–23, 2018, Proceedings, Part III 38, pages 483–512. Springer, 2018. [6] Andrey Kim, Yongsoo Song, Miran Kim, Keewoo Lee, and Jung Hee Cheon. Logistic regression model training based on the approximate homomorphic encryption. BMC medical genomics, 11(4):83, 2018. [7] Charlotte Bonte and Frederik Vercauteren. Privacy-preserving logistic regression training. BMC medical genomics, 11(4):86, 2018. [8] Miran Kim, Yongsoo Song, Shuang Wang, Yuhou Xia, and Xiaoqian Jiang. Secure logistic regression based on homomorphic encryption: Design and evaluation. JMIR medical informatics, 6(2):e19, 2018. [9] John Chiang. Privacy-preserving logistic regression training with a faster gradient variant. arXiv preprint arXiv:2201.10838, 2022. [10] Craig Gentry. Fully homomorphic encryption using ideal lattices. In Proceedings of the forty-first annual ACM symposium on Theory of computing, pages 169–178, 2009. [11] Zvika Brakerski, Craig Gentry, and Vinod Vaikuntanathan. (leveled) fully homomorphic encryption without bootstrapping. ACM Transactions on Computation Theory (TOCT), 6(3):1– 36, 2014. [12] N.P. Smart and F. Vercauteren. Fully homomorphic simd operations. Cryptology ePrint Archive, Report 2011/133, 2011. https://ia.cr/2011/133. [13] Jung Hee Cheon, Andrey Kim, Miran Kim, and Yongsoo Song. Homomorphic encryption for arithmetic of approximate numbers. In International Conference on the Theory and Application of Cryptology and Information Security, pages 409–437. Springer, 2017. [14] Kyoohyung Han, Seungwan Hong, Jung Hee Cheon, and Daejun Park. Logistic regression on homomorphic encrypted data at scale. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 9466–9471, 2019.
325
+ 7 [15] John Chiang. Multinomial logistic regression algorithms via quadratic gradient, 2023.
326
+ 78 [16] John Chiang. Quadratic gradient: Uniting gradient algorithm and newton method as one. arXiv preprint arXiv:2209.03282, 2022. [17] Dankmar Böhning and Bruce G Lindsay. Monotonicity of quadratic-approximation algorithms. Annals of the Institute of Statistical Mathematics, 40(4):641–663, 1988. [18] Dankmar Böhning. Multinomial logistic regression algorithm. Annals of the institute of Statistical Mathematics, 44(1):197–200, 1992.
327
+ 84 [19] John Chiang. On polynomial approximation of activation function. arXiv preprint arXiv:2202.00004, 2022.
parse/dev/c5Inzw6giM/c5Inzw6giM_content_list.json ADDED
@@ -0,0 +1,1043 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Privacy-Preserving CNN Training with Transfer Learning ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 207,
8
+ 122,
9
+ 790,
10
+ 172
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Anonymous Author(s) \nAffiliation \nAddress \nemail ",
17
+ "bbox": [
18
+ 423,
19
+ 226,
20
+ 580,
21
+ 281
22
+ ],
23
+ "page_idx": 0
24
+ },
25
+ {
26
+ "type": "text",
27
+ "text": "Abstract ",
28
+ "text_level": 1,
29
+ "bbox": [
30
+ 462,
31
+ 318,
32
+ 535,
33
+ 334
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "Privacy-preserving nerual network inference has been well studied while homomorphic CNN training still remains an open challenging task. In this paper, we present a practical solution to implement privacy-preserving CNN training based on mere Homomorphic Encryption (HE) technique. To our best knowledge, this is the first attempt successfully to crack this nut and no work ever before has achieved this goal. Several techniques combine to accomplish the task:: (1) with transfer learning, privacy-preserving CNN training can be reduced to homomorphic neural network training, or even multiclass logistic regression (MLR) training; (2) via a faster gradient variant called Quadratic Gradient, an enhanced gradient method for MLR with a state-of-the-art performance in convergence speed is applied in this work to achieve high performance; (3) we employ the thought of transformation in mathematics to transform approximating Softmax function in the encryption domain to the approximation of the Sigmoid function. A new type of loss function termed Squared Likelihood Error has been developed alongside to align with this change.; and (4) we use a simple but flexible matrix-encoding method named Volley Revolver to manage the data flow in the ciphertexts, which is the key factor to complete the whole homomorphic CNN training. The complete, runnable $\\mathrm { C } { + } { + }$ code to implement our work can be found at: https://anonymous.4open.science/r/HE-CNNtraining-B355/. ",
40
+ "bbox": [
41
+ 158,
42
+ 351,
43
+ 766,
44
+ 613
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "We select REGNET_X_400MF as our pre-trained model for transfer learning. We use the first 128 MNIST training images as training data and the whole MNIST testing dataset as the testing data. The client only needs to upload 6 ciphertexts to the cloud and it takes $\\sim 2 1$ mins to perform 2 iterations on a cloud with 64 vCPUs, resulting in a precision of $2 1 . 4 9 \\%$ . ",
51
+ "bbox": [
52
+ 230,
53
+ 616,
54
+ 764,
55
+ 685
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "25 1 Introduction ",
62
+ "text_level": 1,
63
+ "bbox": [
64
+ 150,
65
+ 715,
66
+ 310,
67
+ 732
68
+ ],
69
+ "page_idx": 0
70
+ },
71
+ {
72
+ "type": "text",
73
+ "text": "1.1 Background ",
74
+ "text_level": 1,
75
+ "bbox": [
76
+ 163,
77
+ 747,
78
+ 299,
79
+ 762
80
+ ],
81
+ "page_idx": 0
82
+ },
83
+ {
84
+ "type": "text",
85
+ "text": "27 Applying machine learning to problems involving sensitive data requires not only accurate predictions \n28 but also careful attention to model training. Legal and ethical requirements might limit the use of \n29 machine learning solutions based on a cloud service for such tasks. As a particular encryption scheme, \n30 homomorphic encryption provides the ultimate security for these machine learning applications and \n31 ensures that the data remains confidential since the cloud does not need private keys to decrypt it. \n32 However, it is a big challenge to train the machine learning model, such as neural networks or even \n33 convolution neural networks, in such encrypted domains. Nonetheless, we will demonstrate that \n34 cloud services are capable of applying neural networks over the encrypted data to make encrypted \n35 training, and also return them in encrypted form. ",
86
+ "bbox": [
87
+ 151,
88
+ 773,
89
+ 825,
90
+ 898
91
+ ],
92
+ "page_idx": 0
93
+ },
94
+ {
95
+ "type": "text",
96
+ "text": "Several studies on machine learning solutions are based on homomorphic encryption in the cloud environment. Since Gilad-Bachrach et al. [1] firstly considered privacy-preserving deep learning prediction models and proposed the private evaluation protocol CryptoNets for CNN, many other approaches [2, 3, 4, 5] for privacy-preserving deep learning prediction based on HE or its combination with other techniques have been developed. Also, there are several studies [6, 7, 8, 9] working on logistic regression models based on homomorphic encryption. ",
97
+ "bbox": [
98
+ 166,
99
+ 116,
100
+ 825,
101
+ 200
102
+ ],
103
+ "page_idx": 1
104
+ },
105
+ {
106
+ "type": "text",
107
+ "text": "However, to our best knowledge, no work ever before based on mere HE techique has presented an solution to successfully perform homomorphic CNN training. ",
108
+ "bbox": [
109
+ 165,
110
+ 205,
111
+ 823,
112
+ 234
113
+ ],
114
+ "page_idx": 1
115
+ },
116
+ {
117
+ "type": "text",
118
+ "text": "1.3 Contributions ",
119
+ "text_level": 1,
120
+ "bbox": [
121
+ 176,
122
+ 251,
123
+ 310,
124
+ 265
125
+ ],
126
+ "page_idx": 1
127
+ },
128
+ {
129
+ "type": "text",
130
+ "text": "46 Our specific contributions in this paper are as follows: ",
131
+ "bbox": [
132
+ 150,
133
+ 276,
134
+ 527,
135
+ 291
136
+ ],
137
+ "page_idx": 1
138
+ },
139
+ {
140
+ "type": "text",
141
+ "text": "1. with various techniques, we initiate to propose a practical solution for privacy-preserving CNN training, demonstrating the feasibility of homomorphic CNN training. \n2. We suggest a new type of loss function, Squared Likelihood Error (SLE), which is friendly to pervacy-perserving manner. As a result, we can use the Sigmoid function to replace the Softmax function which is too diffuclt to calculate in the encryption domain due to its uncertainty. \n3. We develop a new algorithm with SLE loss function for MLR using quadratic gradient. Experiments show that this HE-friendly algorithm has a state-of-the-art performance in convergence speed. ",
142
+ "bbox": [
143
+ 205,
144
+ 303,
145
+ 825,
146
+ 439
147
+ ],
148
+ "page_idx": 1
149
+ },
150
+ {
151
+ "type": "text",
152
+ "text": "2 Preliminaries ",
153
+ "text_level": 1,
154
+ "bbox": [
155
+ 163,
156
+ 457,
157
+ 318,
158
+ 474
159
+ ],
160
+ "page_idx": 1
161
+ },
162
+ {
163
+ "type": "text",
164
+ "text": "We adopt “ $\\otimes$ ” to denote the kronecker product and “ $\\odot ^ { \\bullet }$ ” to denote the component-wise multiplication between matrices. ",
165
+ "bbox": [
166
+ 176,
167
+ 488,
168
+ 823,
169
+ 516
170
+ ],
171
+ "page_idx": 1
172
+ },
173
+ {
174
+ "type": "text",
175
+ "text": "2.1 Fully Homomorphic Encryption ",
176
+ "text_level": 1,
177
+ "bbox": [
178
+ 166,
179
+ 532,
180
+ 437,
181
+ 547
182
+ ],
183
+ "page_idx": 1
184
+ },
185
+ {
186
+ "type": "text",
187
+ "text": "60 Homomorphic Encryption (HE) is one type of encryption scheme with a special characteristic called \n61 Homomorphic, which allows to compute on encrypted data without having access to the secret key. \n62 Fully HE means that the scheme is fully homomorphic, namely, homomorphic with regards to both \n63 addition and multiplication, and that it allows arbitrary computation on encrypted data. Since Gentry \n64 proposed the first fully HE scheme [10] in 2009, some technological progress on HE has been made. \n65 For example, Brakerski, Gentry and Vaikuntanathan [11] present a novel way of constructing leveled \n66 fully homomorphic encryption schemes (BGV) and Smart and Vercauteren [12] introduced one of the \n67 most important features of HE systems, a packing technique based on polynomial-CRT called Single \n68 Instruction Multiple Data (aka SIMD) to encrypt multiple values into a single ciphertext. Another \n69 great progress in terms of machine learning applications is the rescaling procedure [13], which can \n70 manage the magnitude of plaintext effectively. \n71 Modern fully HE schemes, such as HEAAN, usually support seveal common homomorphic opera \n72 tions: the encryption algorithm Enc encrypting a vector, the decryption algorithm Dec decrypting \n73 a ciphertext, the homomorphic addition Add and multiplication Mult between two ciphertexts, the \n74 multiplication cMult of a contant vector with a ciphertext, the rescaling operation ReScale to reduce \n75 the magnitude of a plaintext to an appropriate level, the rotation operation Rot generating a new \n76 ciphertext encrypting the shifted plaintext vector, and the bootstrapping operation bootstrap to \n77 refresh a ciphertext usually with a small ciphertext modulus. ",
188
+ "bbox": [
189
+ 147,
190
+ 558,
191
+ 825,
192
+ 710
193
+ ],
194
+ "page_idx": 1
195
+ },
196
+ {
197
+ "type": "text",
198
+ "text": "",
199
+ "bbox": [
200
+ 147,
201
+ 717,
202
+ 825,
203
+ 814
204
+ ],
205
+ "page_idx": 1
206
+ },
207
+ {
208
+ "type": "text",
209
+ "text": "8 2.2 Database Encoding Method ",
210
+ "text_level": 1,
211
+ "bbox": [
212
+ 158,
213
+ 830,
214
+ 405,
215
+ 844
216
+ ],
217
+ "page_idx": 1
218
+ },
219
+ {
220
+ "type": "text",
221
+ "text": "79 For a given database $Z$ , Kim et al. [6] first developed an efficient database encoding method, in order \n80 to make full use of the HE computation and storage resources. They first expand the matrix database \n81 to a vector form $V$ in a row-by-row manner and then encrypt this vector $V$ to obtain a ciphertext \n82 $Z = E n c ( V )$ . Also, based on this database encoding, they mentioned two simple operations via ",
222
+ "bbox": [
223
+ 147,
224
+ 856,
225
+ 823,
226
+ 911
227
+ ],
228
+ "page_idx": 1
229
+ },
230
+ {
231
+ "type": "text",
232
+ "text": "83 shifting the encrypted vector by two different positions, respectively: the complete row shifting 84 and the incomplete column shifting. These two operations performing on the matrix $Z$ output the matrices 85 $Z ^ { ' }$ and $Z ^ { ' \\prime }$ , as follows: ",
233
+ "bbox": [
234
+ 147,
235
+ 90,
236
+ 825,
237
+ 136
238
+ ],
239
+ "page_idx": 2
240
+ },
241
+ {
242
+ "type": "equation",
243
+ "img_path": "images/5177a2639c6950e999c5f26d09f48af73174dc45b6dd5f887ad630d9bf05f164.jpg",
244
+ "text": "$$\n\\begin{array} { c c } { { Z = \\left[ \\begin{array} { c c c c } { { x _ { 1 0 } } } & { { x _ { 1 1 } } } & { { \\ldots } } & { { x _ { 1 d } } } \\\\ { { x _ { 2 0 } } } & { { x _ { 2 1 } } } & { { \\ldots } } & { { x _ { 2 d } } } \\\\ { { \\vdots } } & { { \\vdots } } & { { \\ddots } } & { { \\vdots } } \\\\ { { x _ { n 0 } } } & { { x _ { n 1 } } } & { { \\ldots } } & { { x _ { n d } } } \\end{array} \\right] , } } & { { Z ^ { ' } = E n c \\left[ \\begin{array} { c c c c } { { x _ { 2 0 } } } & { { x _ { 2 1 } } } & { { \\ldots } } & { { x _ { 2 d } } } \\\\ { { \\vdots } } & { { \\vdots } } & { { \\ddots } } & { { \\vdots } } \\\\ { { x _ { n 0 } } } & { { x _ { n 1 } } } & { { \\ldots } } & { { x _ { n d } } } \\\\ { { x _ { 1 0 } } } & { { x _ { 1 1 } } } & { { \\ldots } } & { { x _ { 1 d } } } \\end{array} \\right] , } } \\\\ { { Z ^ { ' } = E n c \\left[ \\begin{array} { c c c c } { { x _ { 1 1 } } } & { { \\ldots } } & { { x _ { 1 d } } } & { { x _ { 2 0 } } } \\\\ { { x _ { 2 1 } } } & { { \\ldots } } & { { x _ { 2 d } } } & { { x _ { 3 0 } } } \\\\ { { \\vdots } } & { { \\vdots } } & { { \\ddots } } & { { \\vdots } } \\\\ { { x _ { n 1 } } } & { { \\ldots } } & { { x _ { n d } } } & { { x _ { 1 0 } } } \\end{array} \\right] , } } & { { Z ^ { ' \\prime \\prime } = E n c \\left[ \\begin{array} { c c c c } { { x _ { 1 1 } } } & { { \\ldots } } & { { x _ { 1 d } } } & { { x _ { 1 0 } } } \\\\ { { x _ { 2 1 } } } & { { \\ldots } } & { { x _ { 2 d } } } & { { x _ { 2 0 } } } \\\\ { { \\vdots } } & { { \\vdots } } & { { \\ddots } } & { { \\vdots } } \\\\ { { x _ { n 1 } } } & { { x _ { n 1 } } } & { { x _ { n 0 } } } \\end{array} \\right] . } } \\end{array}\n$$",
245
+ "text_format": "latex",
246
+ "bbox": [
247
+ 227,
248
+ 145,
249
+ 774,
250
+ 284
251
+ ],
252
+ "page_idx": 2
253
+ },
254
+ {
255
+ "type": "text",
256
+ "text": "The complete column shifting to obtain the matrix 86 $Z ^ { ^ { \\prime \\prime \\prime } }$ can also be achieved by two Rot, two cMult, 87 and an Add. ",
257
+ "bbox": [
258
+ 148,
259
+ 292,
260
+ 826,
261
+ 323
262
+ ],
263
+ "page_idx": 2
264
+ },
265
+ {
266
+ "type": "text",
267
+ "text": "88 Other works [14, 4] using the same encoding method also developed some other procedures, such \n89 as SumRowVec and SumColVec to calculate the summation of each row and column, respectively. \n90 Such basic common and simple operations consisting of a series of HE operations are significantly \n91 important for more complex calculations such as the homomorphic evaluation of gradient. ",
268
+ "bbox": [
269
+ 147,
270
+ 329,
271
+ 826,
272
+ 386
273
+ ],
274
+ "page_idx": 2
275
+ },
276
+ {
277
+ "type": "text",
278
+ "text": "2.3 Convolutional Neural Network ",
279
+ "text_level": 1,
280
+ "bbox": [
281
+ 169,
282
+ 400,
283
+ 426,
284
+ 415
285
+ ],
286
+ "page_idx": 2
287
+ },
288
+ {
289
+ "type": "text",
290
+ "text": "Inspired by biological processes, Convolutional Neural Networks (CNN) are a type of artificial neural network most commonly used to analyze visual images. CNNs play a significant role in image recognition due to their powerful performance. It is also worth mentioning that the CNN model is one of a few deep learning models built with reference to the visual organization of the human brain. ",
291
+ "bbox": [
292
+ 163,
293
+ 426,
294
+ 825,
295
+ 482
296
+ ],
297
+ "page_idx": 2
298
+ },
299
+ {
300
+ "type": "text",
301
+ "text": "2.3.1 Transfer Learning ",
302
+ "text_level": 1,
303
+ "bbox": [
304
+ 161,
305
+ 496,
306
+ 354,
307
+ 511
308
+ ],
309
+ "page_idx": 2
310
+ },
311
+ {
312
+ "type": "text",
313
+ "text": "98 Transfer learning in machine learning is a class of methods in which a pretrained model can be used \n99 as an optimization for a new model on a related task, allowing rapid progress in modeling the new \n00 task. In real-world applications, very few researchers train entire convolutional neural networks \n01 from scratch for image processing-related tasks. Instead, it is common to use a well-trained CNN \n02 as a fixed feature extractor for the task of interest. In our case, we freeze all the weights of the \n03 selected pre-trained CNN except that of the final fully-connected layer. We then replace the last \n04 fully-connected layer with a new layer with random weights (such as zeros) and only train this layer. \n105 REGNET_X_400MF To use transfer learning in our privacy-preserving CNN training, we adopt \n106 a new network design paradigm called RegNet, recently introduced by Facebook AI researchers, \n107 as our pre-trained model. RegNet is a low-dimensional design space consisting of simple, regular \n108 networks. In particular, we apply REGNET_X_400MF as a fixed feature extractor and replaced the final \n109 fully connected layer with a new one of zero weights. CNN training in this case can be simplified \n110 to multiclass logistic regression training. Since REGNET_X_400MF only receive color images of size \n111 $2 2 4 \\times 2 2 4$ , the grayscale images will be stacked threefold and images of different sizes will be resized \n112 to the same size in advance. These two transformations can be done by using PyTorch. ",
314
+ "bbox": [
315
+ 150,
316
+ 520,
317
+ 825,
318
+ 617
319
+ ],
320
+ "page_idx": 2
321
+ },
322
+ {
323
+ "type": "text",
324
+ "text": "",
325
+ "bbox": [
326
+ 140,
327
+ 630,
328
+ 825,
329
+ 742
330
+ ],
331
+ "page_idx": 2
332
+ },
333
+ {
334
+ "type": "text",
335
+ "text": "2.3.2 Datasets ",
336
+ "text_level": 1,
337
+ "bbox": [
338
+ 176,
339
+ 756,
340
+ 284,
341
+ 770
342
+ ],
343
+ "page_idx": 2
344
+ },
345
+ {
346
+ "type": "text",
347
+ "text": "We adopt three common datasets in our experiments: MNIST, USPS, and CIFAR10. Table 1 describes the three datasets. ",
348
+ "bbox": [
349
+ 171,
350
+ 779,
351
+ 825,
352
+ 808
353
+ ],
354
+ "page_idx": 2
355
+ },
356
+ {
357
+ "type": "text",
358
+ "text": "3 Technical details ",
359
+ "text_level": 1,
360
+ "bbox": [
361
+ 173,
362
+ 825,
363
+ 344,
364
+ 842
365
+ ],
366
+ "page_idx": 2
367
+ },
368
+ {
369
+ "type": "text",
370
+ "text": "3.1 Multiclass Logistic Regression ",
371
+ "text_level": 1,
372
+ "bbox": [
373
+ 168,
374
+ 856,
375
+ 424,
376
+ 871
377
+ ],
378
+ "page_idx": 2
379
+ },
380
+ {
381
+ "type": "text",
382
+ "text": "118 Multiclass Logistic Regression, or Multinomial Logistic Regression, can be seen as an extension of logistic regression for multi-class classification problems. Supposing that the matrix 119 $X \\in \\mathbb { R } ^ { n \\times ( 1 + d ) }$ , ",
383
+ "bbox": [
384
+ 147,
385
+ 881,
386
+ 826,
387
+ 911
388
+ ],
389
+ "page_idx": 2
390
+ },
391
+ {
392
+ "type": "table",
393
+ "img_path": "images/e89f84dca67e9fa39548b92b5f1319c548137286b7a94a939abf7689861a9e02.jpg",
394
+ "table_caption": [
395
+ "Table 1: Characteristics of the several datasets used in our experiments "
396
+ ],
397
+ "table_footnote": [],
398
+ "table_body": "<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>No. Samples(training)</td><td rowspan=1 colspan=1>No. Samples(testing)</td><td rowspan=1 colspan=1>No. Features</td><td rowspan=1 colspan=1>No. Classes</td></tr><tr><td rowspan=1 colspan=1>USPS</td><td rowspan=1 colspan=1>7,291</td><td rowspan=1 colspan=1>2,007</td><td rowspan=1 colspan=1>16×16</td><td rowspan=1 colspan=1>10</td></tr><tr><td rowspan=1 colspan=1>MNIST</td><td rowspan=1 colspan=1>60,000</td><td rowspan=1 colspan=1>10,000</td><td rowspan=1 colspan=1>28×28</td><td rowspan=1 colspan=1>10</td></tr><tr><td rowspan=1 colspan=1>CIFAR-10</td><td rowspan=1 colspan=1>50,000</td><td rowspan=1 colspan=1>10,000</td><td rowspan=1 colspan=1>3×32×32</td><td rowspan=1 colspan=1>10</td></tr></table>",
399
+ "bbox": [
400
+ 243,
401
+ 112,
402
+ 754,
403
+ 185
404
+ ],
405
+ "page_idx": 3
406
+ },
407
+ {
408
+ "type": "text",
409
+ "text": "the column vector 120 $Y \\in \\mathbb { N } ^ { n \\times 1 }$ , the matrix $\\bar { Y } \\in \\mathbb { R } ^ { n \\times c }$ , and the matrix $W \\in \\mathbb { R } ^ { c \\times ( 1 + d ) }$ represent 121 the dataset, class labels, the one-hot encoding of the class labels, and the MLR model parameter, 122 respectively: ",
410
+ "bbox": [
411
+ 142,
412
+ 209,
413
+ 825,
414
+ 253
415
+ ],
416
+ "page_idx": 3
417
+ },
418
+ {
419
+ "type": "equation",
420
+ "img_path": "images/349e74ebae22237c3af68ba9b48b58057dac1bb8fa5a18358dcd4eb842c61d4e.jpg",
421
+ "text": "$$\n\\begin{array} { c } { { X = \\left[ \\begin{array} { c } { { \\alpha ^ { 2 } } } \\\\ { { \\vdots } } \\\\ { { \\vdots } } \\\\ { { \\vdots } } \\\\ { { \\vdots } } \\\\ { { \\zeta _ { n } } } \\end{array} \\right] = \\left[ \\begin{array} { c c c c c } { { \\boxed { { 2 1 } [ 0 ] } } } & { { \\alpha ^ { [ 2 } [ 1 ] } } & { { \\cdots } } & { { \\cdots } } & { { \\boxed { { 2 1 } [ 2 ] } } } \\\\ { { \\vdots } } & { { \\vdots } } & { { \\ddots } } & { { \\vdots } } \\\\ { { \\vdots } } & { { \\vdots } } & { { \\ddots } } & { { \\vdots } } \\\\ { { \\alpha ^ { [ } n ] ( 0 ] } } & { { \\alpha ^ { [ } n ] [ 1 ] } } & { { \\cdots } } & { { \\cdots } } & { { \\alpha [ n ] [ d ] } } \\end{array} \\right] , } } \\\\ { { Y = \\left[ \\begin{array} { c } { { \\beta _ { 1 } } } \\\\ { { y _ { 2 } } } \\\\ { { \\vdots } } \\\\ { { \\vdots } } \\\\ { { \\xi _ { n } } } \\end{array} \\right] , \\overset { \\mathrm { o u c h o t s o d i n g ~ } } { \\longrightarrow } \\bar { Y } = \\left[ \\begin{array} { c } { { \\boxed { { \\bar { Y } } _ { 1 } } } } \\\\ { { \\bar { Y } _ { 2 } } } \\\\ { { \\bar { Y } _ { n } } } \\\\ { { \\bar { Y } _ { n } } } \\end{array} \\right] = \\left[ \\begin{array} { c c c c c } { { \\beta _ { 1 } [ 1 ] } } & { { \\beta _ { 1 } [ 1 ] } } & { { \\cdots } } & { { \\beta _ { 1 } [ 1 ] [ c - 1 ] } } \\\\ { { \\beta _ { 2 } [ 2 ] } } & { { \\beta _ { 2 } [ 1 ] } } & { { \\cdots } } & { { \\beta _ { 2 } [ 2 ] [ c - 1 ] } } \\\\ { { \\vdots } } & { { \\vdots } } & { { \\ddots } } & { { \\vdots } } \\\\ { { \\beta _ { [ n ] } ( 1 ) } } & { { \\beta _ { [ n ] [ 2 ] } } } & { { \\cdots } } & { { \\beta _ { [ n ] [ - 1 ] } } } \\end{array} \\right] , } } \\\\ W = \\left[ \\begin{array} { c } { { w _ { [ 0 ] } } } \\\\ { { w _ { [ 1 ] } } } \\\\ { { \\vdots } } \\\\ { { w _ { [ - 1 ] } } } \\\\ { { w _ { [ - 1 ] } } } \\end{array} \\right] = \\end{array}\n$$",
422
+ "text_format": "latex",
423
+ "bbox": [
424
+ 245,
425
+ 291,
426
+ 748,
427
+ 481
428
+ ],
429
+ "page_idx": 3
430
+ },
431
+ {
432
+ "type": "text",
433
+ "text": "MLR aims to maxsize $L$ or $\\ln { \\cal L }$ : ",
434
+ "bbox": [
435
+ 173,
436
+ 492,
437
+ 390,
438
+ 507
439
+ ],
440
+ "page_idx": 3
441
+ },
442
+ {
443
+ "type": "equation",
444
+ "img_path": "images/aaaeba564d44ff4b4d6a1d652be9cafe1ab9c897d9a0ce709ca96141dc3cf594.jpg",
445
+ "text": "$$\n{ \\cal L } = \\prod _ { i = 1 } ^ { n } \\frac { \\exp ( x _ { i } \\cdot w _ { [ y _ { i } ] } ^ { \\top } ) } { \\sum _ { k = 0 } ^ { c - 1 } \\exp ( x _ { i } \\cdot w _ { [ k ] } ^ { \\top } ) } \\longmapsto \\ln { \\cal L } = \\sum _ { i = 1 } ^ { n } [ x _ { i } \\cdot w _ { [ y _ { i } ] } ^ { \\top } - \\ln \\sum _ { k = 0 } ^ { c - 1 } \\exp ( x _ { i } \\cdot w _ { [ k ] } ^ { \\top } ) ] .\n$$",
446
+ "text_format": "latex",
447
+ "bbox": [
448
+ 232,
449
+ 511,
450
+ 764,
451
+ 556
452
+ ],
453
+ "page_idx": 3
454
+ },
455
+ {
456
+ "type": "text",
457
+ "text": "123 The loss function $\\ln { \\cal L }$ is a multivariate function of $[ ( 1 + c ) ( 1 + d ) ]$ variables, which has its column \n124 vector gradient $\\nabla$ of size $[ ( 1 + c ) ( 1 + d ) ]$ and Hessian square matrix $\\nabla ^ { 2 }$ of order $[ ( 1 + c ) ( 1 + d ) ]$ as \n125 follows: ",
458
+ "bbox": [
459
+ 143,
460
+ 570,
461
+ 825,
462
+ 612
463
+ ],
464
+ "page_idx": 3
465
+ },
466
+ {
467
+ "type": "equation",
468
+ "img_path": "images/6f45e69d3c1a3eba8b761f3bdf810e8c06bebb0a9f598696817ba10ebfc9e67e.jpg",
469
+ "text": "$$\n\\begin{array} { r l } & { \\nabla = \\frac { \\partial \\ln L } { \\partial \\pi } = \\left[ \\frac { \\partial \\ln L } { \\partial w _ { [ 0 ] } } , \\frac { \\partial \\ln L } { \\partial w _ { [ 1 ] } } , \\ldots , \\frac { \\partial \\ln L } { \\partial w _ { [ c - 1 ] } } \\right] ^ { \\top } , } \\\\ & { \\nabla ^ { 2 } = \\left[ \\begin{array} { c c c c } { \\frac { \\partial ^ { 2 } \\ln L } { \\partial w _ { [ 0 ] } \\partial w _ { [ 0 ] } } } & { \\frac { \\partial ^ { 2 } \\ln L } { \\partial w _ { [ 0 ] } \\partial w _ { [ 1 ] } } } & { \\cdots } & { \\frac { \\partial ^ { 2 } \\ln L } { \\partial w _ { [ 0 ] } \\partial w _ { [ c - 1 ] } } } \\\\ { \\frac { \\partial ^ { 2 } \\ln L } { \\partial w _ { [ 1 ] } \\partial w _ { [ 0 ] } } } & { \\frac { \\partial ^ { 2 } \\ln L } { \\partial w _ { [ 1 ] } \\partial w _ { [ 1 ] } } } & { \\cdots } & { \\frac { \\partial ^ { 2 } \\ln L } { \\partial w _ { [ 1 ] } \\partial w _ { [ - 1 ] } } } \\\\ { \\vdots } & { \\vdots } & { \\ddots } & { \\vdots } \\\\ { \\frac { \\partial ^ { 2 } \\ln L } { \\partial w _ { [ c - 1 ] } \\partial w _ { [ 0 ] } } } & { \\frac { \\partial ^ { 2 } \\ln L } { \\partial w _ { [ c - 1 ] } \\partial w _ { [ 1 ] } } } & { \\cdots } & { \\frac { \\partial ^ { 2 } \\ln L } { \\partial w _ { [ c - 1 ] } \\partial w _ { [ c - 1 ] } } } \\end{array} \\right] . } \\end{array}\n$$",
470
+ "text_format": "latex",
471
+ "bbox": [
472
+ 305,
473
+ 616,
474
+ 691,
475
+ 743
476
+ ],
477
+ "page_idx": 3
478
+ },
479
+ {
480
+ "type": "text",
481
+ "text": "126 Nesterov’s Accelerated Gradient With $\\nabla$ or $\\nabla ^ { 2 }$ , first-order gradient algorithms or second-order \n127 Newton–Raphson method are commonly applied in MLE to maxmise $\\ln { \\cal L }$ . In particular, Nesterov’s \n128 Accelerated Gradient (NAG) is a practical solution for homomorphic MLR without frequent inversion \n129 operations. It seems plausible that the NAG method is probably the best choice for privacy-preserving \n130 model training. ",
482
+ "bbox": [
483
+ 140,
484
+ 756,
485
+ 825,
486
+ 827
487
+ ],
488
+ "page_idx": 3
489
+ },
490
+ {
491
+ "type": "text",
492
+ "text": "3.2 Chiang’s Quadratic Gradient ",
493
+ "text_level": 1,
494
+ "bbox": [
495
+ 165,
496
+ 843,
497
+ 418,
498
+ 859
499
+ ],
500
+ "page_idx": 3
501
+ },
502
+ {
503
+ "type": "text",
504
+ "text": "132 Chiang's Quadratic Gradient (CQG) [15, 16, 9] is a faster, promising gradient variant that can \n133 combine the first-order gradient descent/ascent algorithms and the second-order Newton–Raphson \n134 method, accelerating the raw Newton–Raphson method with various gradient algorithms and probably ",
505
+ "bbox": [
506
+ 142,
507
+ 868,
508
+ 825,
509
+ 911
510
+ ],
511
+ "page_idx": 3
512
+ },
513
+ {
514
+ "type": "text",
515
+ "text": "135 helpful to build super-quadratic algorithms. For a function $F _ { _ - } ( x )$ with its gradient $g$ and Hessian matrix 136 $H$ , to build CQG, we first construct a diagonal matrix $\\bar { B }$ from the Hessian $H$ itself: ",
516
+ "bbox": [
517
+ 140,
518
+ 90,
519
+ 825,
520
+ 121
521
+ ],
522
+ "page_idx": 4
523
+ },
524
+ {
525
+ "type": "equation",
526
+ "img_path": "images/0e03d73de11bd603002ff1a39544ecbbf40e0331b3026bfe9e2bd865818a5d0a.jpg",
527
+ "text": "$$\n\\bar { B } = \\left[ \\begin{array} { c c c c c } { \\frac { 1 } { \\varepsilon + \\sum _ { i = 0 } ^ { d } \\vert \\bar { h } _ { 0 i } \\vert } } & { 0 } & { \\dots } & { 0 } \\\\ { 0 } & { \\frac { 1 } { \\varepsilon + \\sum _ { i = 0 } ^ { d } \\vert \\bar { h } _ { 1 i } \\vert } } & { \\dots } & { 0 } \\\\ { \\vdots } & { \\vdots } & { \\ddots } & { \\vdots } \\\\ { 0 } & { 0 } & { \\dots } & { \\frac { 1 } { \\varepsilon + \\sum _ { i = 0 } ^ { d } \\vert \\bar { h } _ { d i } \\vert } } \\end{array} \\right] ,\n$$",
528
+ "text_format": "latex",
529
+ "bbox": [
530
+ 299,
531
+ 131,
532
+ 696,
533
+ 218
534
+ ],
535
+ "page_idx": 4
536
+ },
537
+ {
538
+ "type": "text",
539
+ "text": "where 137 $\\bar { h } _ { j i }$ is the elements of the matrix $H$ and $\\varepsilon$ is a small constant positive number. ",
540
+ "bbox": [
541
+ 145,
542
+ 222,
543
+ 723,
544
+ 238
545
+ ],
546
+ "page_idx": 4
547
+ },
548
+ {
549
+ "type": "text",
550
+ "text": "138 CQG for the function $F ( \\mathbf { x } )$ , defined as $G = \\bar { B } \\cdot g$ , has the same dimension as the raw gradient $g$ . To \n139 apply CQG in practice, we can use it in the same way as the first-order gradient algorithms, except \n140 that we need to replace the naive gradient with the quadratic gradient and adopt a new learning rate \n141 (usually by increasing 1 to the original learning rate). \n142 For efficiency in applying CQG, a good bound matrix should be attempted to obtain in order to \n143 replace the Hessian itself. Chiang has proposed the enhanced NAG method via CQG for MLR with a \n144 fixed Hessian [17, 7, 18] substitute built from ${ \\frac { 1 } { 2 } } X ^ { \\mathsf { \\tau } } X$ . ",
551
+ "bbox": [
552
+ 142,
553
+ 243,
554
+ 825,
555
+ 301
556
+ ],
557
+ "page_idx": 4
558
+ },
559
+ {
560
+ "type": "text",
561
+ "text": "",
562
+ "bbox": [
563
+ 142,
564
+ 306,
565
+ 825,
566
+ 351
567
+ ],
568
+ "page_idx": 4
569
+ },
570
+ {
571
+ "type": "text",
572
+ "text": "45 3.3 Approximating Softmax Function ",
573
+ "text_level": 1,
574
+ "bbox": [
575
+ 156,
576
+ 364,
577
+ 447,
578
+ 380
579
+ ],
580
+ "page_idx": 4
581
+ },
582
+ {
583
+ "type": "text",
584
+ "text": "146 It might be impractical to perfectly approximate Softmax function in the privacy-preserving domain \n147 due to its uncertainty. To address this issue, we employ the thought of transformation from mathemat \n148 ics: transforming one tough problem into another easier one. That is, instead of trying to approximate \n149 the Softmax function, we attempt to approximate the Sigmoid function in the encryption domain, \n150 which has been well-studied by several works using the least-square method. ",
585
+ "bbox": [
586
+ 140,
587
+ 390,
588
+ 825,
589
+ 460
590
+ ],
591
+ "page_idx": 4
592
+ },
593
+ {
594
+ "type": "text",
595
+ "text": "In line with standard practice of the log-likelihood loss function involving the Softmax function, we should try to maximize the new loss function ",
596
+ "bbox": [
597
+ 166,
598
+ 465,
599
+ 825,
600
+ 494
601
+ ],
602
+ "page_idx": 4
603
+ },
604
+ {
605
+ "type": "equation",
606
+ "img_path": "images/8e40c67bb9626e3380e4b0886f8b2f0fb2fa0190de4ed50a093d8699d8850f2c.jpg",
607
+ "text": "$$\nL _ { 1 } = \\prod _ { i = 1 } ^ { n } \\frac { 1 } { 1 + \\exp ( - x _ { i } \\cdot w _ { [ y _ { i } ] } ^ { \\mathsf { T } } ) } .\n$$",
608
+ "text_format": "latex",
609
+ "bbox": [
610
+ 392,
611
+ 498,
612
+ 604,
613
+ 540
614
+ ],
615
+ "page_idx": 4
616
+ },
617
+ {
618
+ "type": "text",
619
+ "text": "151 We can prove that $\\ln { \\cal L } _ { 1 }$ is concave and deduce that ${ \\scriptstyle { \\frac { 1 } { 4 } } } E \\otimes X ^ { \\tau } X$ can be used to build the CQG for \n152 $\\ln { \\cal L } _ { 1 }$ . However, the performance of this loss function $\\ln { \\cal L } _ { 1 }$ is not ideal, probably because for the \n153 individual example its gradient and Hessian contain no information about any other class weights not \n154 related to this example. ",
620
+ "bbox": [
621
+ 142,
622
+ 546,
623
+ 825,
624
+ 603
625
+ ],
626
+ "page_idx": 4
627
+ },
628
+ {
629
+ "type": "text",
630
+ "text": "Squared Likelihood Error After many attempts to finding a proper loss function, we develop a novel loss function that can have a competitive performance to the log-likelihood loss function, which we term Squared Likelihood Error (SLE): ",
631
+ "bbox": [
632
+ 173,
633
+ 617,
634
+ 825,
635
+ 660
636
+ ],
637
+ "page_idx": 4
638
+ },
639
+ {
640
+ "type": "equation",
641
+ "img_path": "images/e4686d839a0fa9a4060c4e9cf0fdb4b5ba6d51dad2eefc1d4eaaad9ddb9a2d24.jpg",
642
+ "text": "$$\n{ \\cal L } _ { 2 } = \\prod _ { i = 1 } ^ { n } \\prod _ { j = 0 } ^ { c - 1 } ( \\bar { y } _ { i } - { \\cal S } i g m o i d ( x _ { i } \\cdot w _ { [ y _ { i } ] } ^ { \\top } ) ^ { 2 } \\longmapsto \\ln { \\cal L } _ { 2 } = \\sum _ { i = 1 } ^ { n } \\sum _ { j = 0 } ^ { c - 1 } \\ln \\left| \\bar { y } _ { i } - { \\cal S } i g m o i d ( x _ { i } \\cdot w _ { [ y _ { i } ] } ^ { \\top } ) \\right| .\n$$",
643
+ "text_format": "latex",
644
+ "bbox": [
645
+ 192,
646
+ 664,
647
+ 803,
648
+ 709
649
+ ],
650
+ "page_idx": 4
651
+ },
652
+ {
653
+ "type": "text",
654
+ "text": "155 We can also prove that $\\ln { \\cal L } _ { 2 }$ is concave and that ${ \\scriptstyle { \\frac { 1 } { 4 } } } E \\otimes X ^ { \\tau } X$ can be used to build the CQG for $\\ln { \\cal L } _ { 2 }$ \n156 The loss function SLE might be related to Mean Squared Error (MSE): the MSE loss function sums \n157 all the squared errors while SLE calculates the cumulative product of all the squared likelihood errors. \n158 Combining together all the techniques above, we now have the enhanced NAG method with the SLE \n159 loss function for MLR training, described in detail in Algorithm 1. \n160 Performance Evaluation We test the convergence speed of the raw NAG method with log \n161 likelihood loss function (denoted as RawNAG), the NAG method with SLE loss function (denoted \n162 as SigmoidNAG), and the enhanced NAG method via CQG with SLE loss function (denoted as \n163 SigmoidNAGQG) on the three datasets described above: USPS, MNIST, and CIFAR10. Since two \n164 different types of loss functions are used in these three methods, the loss function directly measuring \n165 the performance of various methods will not be selected as the indicator. Instead, we select precision \n166 as the only indicator in the following Python experiments. Note that we use REGNET_X_400MF to in ",
655
+ "bbox": [
656
+ 142,
657
+ 722,
658
+ 825,
659
+ 765
660
+ ],
661
+ "page_idx": 4
662
+ },
663
+ {
664
+ "type": "text",
665
+ "text": "",
666
+ "bbox": [
667
+ 143,
668
+ 771,
669
+ 826,
670
+ 800
671
+ ],
672
+ "page_idx": 4
673
+ },
674
+ {
675
+ "type": "text",
676
+ "text": "",
677
+ "bbox": [
678
+ 140,
679
+ 814,
680
+ 825,
681
+ 912
682
+ ],
683
+ "page_idx": 4
684
+ },
685
+ {
686
+ "type": "text",
687
+ "text": "Input: training dataset $X \\in \\mathbb { R } ^ { n \\times ( 1 + d ) }$ ; one-hot encoding training label $Y \\in \\mathbb { R } ^ { n \\times c }$ ; and the number $\\kappa$ of iterations; ",
688
+ "bbox": [
689
+ 174,
690
+ 111,
691
+ 826,
692
+ 140
693
+ ],
694
+ "page_idx": 5
695
+ },
696
+ {
697
+ "type": "text",
698
+ "text": "Output: the parameter matrix $V \\in \\mathbb { R } ^ { c \\times ( 1 + d ) }$ of the MLR \n1: Set $\\bar { H } - { \\textstyle \\frac { 1 } { 4 } } X ^ { \\intercal } X$ $\\begin{array} { r l r } & { } & { \\triangleright \\bar { H } \\in \\mathbb { R } ^ { ( 1 + d ) \\times ( 1 + d ) } } \\\\ & { } & { \\triangleright V \\in \\mathbb { R } ^ { c \\times ( 1 + d ) } , W \\in \\mathbb { R } ^ { c \\times ( 1 + d ) } , \\bar { B } \\in \\mathbb { R } ^ { c \\times ( 1 + d ) } } \\end{array}$ \n2: Set $V \\mathbf { 0 }$ , $W \\mathbf { 0 }$ , $\\bar { B } { \\bf 0 }$ \n3: for $j : = 0$ to $d$ do \n4: $\\bar { B } [ 0 ] [ j ] \\varepsilon$ . $\\varepsilon$ is a small positive constant such as $1 e - 1 0$ \n5: for $i : = 0$ to $d$ do \n6: $\\bar { B } [ 0 ] [ j ] \\bar { B } [ 0 ] [ j ] + | \\bar { H } [ i ] [ j ] |$ \n7: end for \n8: for $i : = 1$ to $c - 1$ do \n9: $\\bar { B } [ i ] [ j ] \\bar { B } [ 0 ] [ j ]$ \n10: end for \n11: for $i : = 0$ to $c - 1$ do \n12: $\\bar { B } [ i ] [ j ] 1 . 0 / \\bar { B } [ i ] [ j ]$ \n13: end for \n14: end for \n15: Set $\\alpha _ { 0 } \\gets 0 . 0 1$ , $\\alpha _ { 1 } 0 . 5 \\times ( 1 + \\sqrt { 1 + 4 \\times \\alpha _ { 0 } ^ { 2 } } )$ \n16: for count $: = 1$ to $\\kappa$ do \n17: Set $Z X \\times V ^ { \\tau }$ $\\mathsf { D } Z \\in \\mathbb { R } ^ { n \\times c }$ and $V ^ { \\intercal }$ means the transpose of matrix V \n18: for $i : = 1$ to $n$ do . $Z$ is going to store the inputs to the Sigmoid function \n19: for $j : = 0$ to $d$ do \n20: $Z [ i ] [ j ] 1 / ( 1 + e ^ { - Z [ i ] [ j ] } )$ \n21: end for \n22: end for \n23: Set $\\pmb { g } ( Y - Z ) \\ d { \\tau } \\times X$ . g Rc×(1+d) \n24: Set $G 0$ \n25: for $i : = 0$ to $c - 1$ do \n26: for $j : = 0$ to $d$ do \n27: $\\mathsf { \\bar { \\mathbf { { G } } } } [ i ] [ j ] \\gets \\bar { B } [ i ] [ j ] \\times \\mathbf { \\mathbf { \\mathbf { \\mathbf { g } } } } [ i ] [ j ]$ \n28: end for \n29: end for \n30: $\\begin{array} { l } { { \\mathrm { S e t } \\eta ( 1 - \\alpha _ { 0 } ) / \\alpha _ { 1 } , \\gamma 1 / ( n \\times c o u n t ) } } \\\\ { { w _ { t e m p } W + ( 1 + \\gamma ) \\times G } } \\\\ { { W ( 1 - \\eta ) \\times w _ { t e m p } + \\eta \\times V } } \\\\ { { V w _ { t e m p } } } \\\\ { { \\alpha _ { 0 } \\alpha _ { 1 } , \\alpha _ { 1 } 0 . 5 \\times ( 1 + \\sqrt { 1 + 4 \\times \\alpha _ { 0 } ^ { 2 } } ) } } \\end{array}$ $\\triangleright n$ is the size of training data \n31: \n32: \n33: \n34: \n35: end for \n36: return W \n167 advance extract the features of USPS, MNIST, and CIFAR10, resulting in a new same-size dataset \n168 with 401 features of each example. Figure 1 shows that our enhanced methods all converge faster \n169 than other algorithms on the three datasets. ",
699
+ "bbox": [
700
+ 173,
701
+ 128,
702
+ 826,
703
+ 665
704
+ ],
705
+ "page_idx": 5
706
+ },
707
+ {
708
+ "type": "text",
709
+ "text": "",
710
+ "bbox": [
711
+ 147,
712
+ 690,
713
+ 825,
714
+ 733
715
+ ],
716
+ "page_idx": 5
717
+ },
718
+ {
719
+ "type": "text",
720
+ "text": "170 3.4 Double Volley Revolver ",
721
+ "text_level": 1,
722
+ "bbox": [
723
+ 147,
724
+ 752,
725
+ 375,
726
+ 767
727
+ ],
728
+ "page_idx": 5
729
+ },
730
+ {
731
+ "type": "text",
732
+ "text": "171 Unlike those efficient, complex encoding methods [3], Volley Revolver is a simple, flexible \n172 matrix-encoding method specialized for privacy-preserving machine-learning applications, whose \n173 basic idea in a simple version is to encrypt the transpose of the second matrix for two matrices to \n174 perform multiplication. Figure 2 describes a simple case for the algorithm adopted in this encoding \n175 method. \n176 The encoding method actually plays a significant role in implementing privacy-preserving CNN \n177 training. Just as Chiang mentioned in [4], we show that Volley Revolver can indeed be used to \n178 implement homomorphic CNN training. This simple encoding method can help to control and \n179 manage the data flow through ciphertexts. \n180 However, we don’t need to stick to encrypting the transpose of the second matrix. Instead, either of \n181 the two matrices is transposed would do the trick: we could also encrypt the transpose of the first \n182 matrix, and the corresponding multiplication algorithm due to this change is similar to the Algorithm \n183 2 from [4]. \n184 Also, if each of the two matrices are too large to be encrypted into a single ciphertext, we could also \n185 encrypt the two matrices into two teams $A$ and $B$ of multiple ciphertexts. In this case, we can see this \n186 encoding method as Double Volley Revolver, which has two loops: the outside loop deals with \n187 the calculations between ciphertexts from two teams while the inside loop literally calculates two \n188 sub-matrices encrypted by two ciphertexts $A _ { [ i ] }$ and $B _ { [ j ] }$ using the raw algorithm of Volley Revolver. ",
733
+ "bbox": [
734
+ 142,
735
+ 780,
736
+ 825,
737
+ 849
738
+ ],
739
+ "page_idx": 5
740
+ },
741
+ {
742
+ "type": "text",
743
+ "text": "",
744
+ "bbox": [
745
+ 142,
746
+ 854,
747
+ 825,
748
+ 911
749
+ ],
750
+ "page_idx": 5
751
+ },
752
+ {
753
+ "type": "image",
754
+ "img_path": "images/0fe4d2a0bee0fe6745d45aaacf25e661015c03bbbb0e73b9580001bfe7ac960d.jpg",
755
+ "image_caption": [
756
+ "Figure 1: Training and Testing precision results for raw NAG vs. NAG with SLE vs. The enhanced NAG with SLE "
757
+ ],
758
+ "image_footnote": [],
759
+ "bbox": [
760
+ 205,
761
+ 151,
762
+ 787,
763
+ 819
764
+ ],
765
+ "page_idx": 6
766
+ },
767
+ {
768
+ "type": "image",
769
+ "img_path": "images/b826681a550108370bd962cafafb3fd0a0e4d2c2a1a1bedb827e813e075433b0.jpg",
770
+ "image_caption": [
771
+ "Figure 2: The matrix multiplication algorithm of Volley Revolver for the $4 \\times 2$ matrix $A$ and the matrix $B$ of size $2 \\times 2$ "
772
+ ],
773
+ "image_footnote": [],
774
+ "bbox": [
775
+ 287,
776
+ 90,
777
+ 709,
778
+ 410
779
+ ],
780
+ "page_idx": 7
781
+ },
782
+ {
783
+ "type": "text",
784
+ "text": "",
785
+ "bbox": [
786
+ 142,
787
+ 488,
788
+ 825,
789
+ 545
790
+ ],
791
+ "page_idx": 7
792
+ },
793
+ {
794
+ "type": "text",
795
+ "text": "",
796
+ "bbox": [
797
+ 142,
798
+ 550,
799
+ 825,
800
+ 622
801
+ ],
802
+ "page_idx": 7
803
+ },
804
+ {
805
+ "type": "text",
806
+ "text": "189 4 Privacy-preserving CNN Training ",
807
+ "text_level": 1,
808
+ "bbox": [
809
+ 147,
810
+ 648,
811
+ 490,
812
+ 666
813
+ ],
814
+ "page_idx": 7
815
+ },
816
+ {
817
+ "type": "text",
818
+ "text": "4.1 Polynomial Approximation ",
819
+ "text_level": 1,
820
+ "bbox": [
821
+ 166,
822
+ 684,
823
+ 401,
824
+ 700
825
+ ],
826
+ "page_idx": 7
827
+ },
828
+ {
829
+ "type": "text",
830
+ "text": "191 Although Algorithm 1 enables us to avoid computing the Softmax function in the encryption domain, \n192 we still need to calculate the Sigmoid function using HE technique. This problem has been well \n193 studied by several works and we adopt a simple one [19], that is (1) we first use the least-square method \n194 to perfectly approximate the sigmoid function over the range $[ - 8 , + 8 ]$ , obtaining a polynomial $Z _ { 1 1 }$ \n195 of degree 11; and (2) we use a polynomial $Z _ { 3 }$ of degree 3 to approximate the Sigmoid by minimizing \n196 the cost function $F$ including the squared gradient difference: ",
831
+ "bbox": [
832
+ 140,
833
+ 713,
834
+ 826,
835
+ 797
836
+ ],
837
+ "page_idx": 7
838
+ },
839
+ {
840
+ "type": "equation",
841
+ "img_path": "images/f1f22b855679157bfdf7cf0b3957b38a0ff6b6be83c903c7922b184ff803efa4.jpg",
842
+ "text": "$$\nF = \\lambda _ { 0 } \\cdot \\int _ { - 8 } ^ { + 8 } ( Z _ { 1 1 } - Z _ { 3 } ) ^ { 2 } d x + \\lambda _ { 1 } \\cdot \\int _ { - 8 } ^ { + 8 } ( Z _ { 1 1 } ^ { ' } - Z _ { 3 } ^ { ' } ) ^ { 2 } d x ,\n$$",
843
+ "text_format": "latex",
844
+ "bbox": [
845
+ 303,
846
+ 811,
847
+ 692,
848
+ 848
849
+ ],
850
+ "page_idx": 7
851
+ },
852
+ {
853
+ "type": "text",
854
+ "text": "197 where $\\lambda _ { 0 }$ and $\\lambda _ { 1 }$ are two positive float numbers to control the shape of the polynomial to approximate. ",
855
+ "bbox": [
856
+ 150,
857
+ 862,
858
+ 823,
859
+ 877
860
+ ],
861
+ "page_idx": 7
862
+ },
863
+ {
864
+ "type": "text",
865
+ "text": "198 Setting $\\lambda _ { 0 } = 1 2 8$ and $\\lambda _ { 1 } = 1$ would result in the polynomial we used in our privacy-preserving CNN training:199 $Z _ { 3 } = 0 . 5 + 0 . 1 0 6 7 9 5 3 4 5 0 3 2 \\cdot x - 0 . 0 0 0 3 8 5 0 3 2 5 9 8 \\cdot x ^ { 3 }$ . ",
866
+ "bbox": [
867
+ 140,
868
+ 882,
869
+ 825,
870
+ 911
871
+ ],
872
+ "page_idx": 7
873
+ },
874
+ {
875
+ "type": "text",
876
+ "text": "Before the homomorphic CNN training starts, the client needs to encrypt the dataset $X$ , the data labels $\\bar { Y }$ , the matrix $\\vec { B }$ and the weight $W$ into ciphertexts $E n c ( X ) , E n c ( \\hat { Y } ) , E n c ( \\hat { B } )$ and $E n c ( W )$ , respectively, and upload them to the cloud. For simplicity in presentation, we can just regard the whole pipeline of homomorphic evaluation of Algorithm 1 as updating the weight ciphertext: $W = W \\dot { + } \\hat { B } \\odot ( \\bar { Y } - Z _ { 3 } ( X \\times \\hat { W } ^ { \\bar { \\mathsf { T } } } ) ) ^ { \\bar { \\mathsf { T } } } \\times X$ , regardless of the subtle control of the enhanced NAG method with the SLE loss function. ",
877
+ "bbox": [
878
+ 173,
879
+ 117,
880
+ 825,
881
+ 199
882
+ ],
883
+ "page_idx": 8
884
+ },
885
+ {
886
+ "type": "text",
887
+ "text": "Since Volley Revolver only needs one of the two matrices to be transposed ahead before encryption and $( \\bar { Y } - Z _ { 3 } ( X \\times \\bar { W } ^ { \\bar { \\mathsf { T } } } ) ) ^ { \\bar { \\mathsf { T } } } \\times X$ happened to suffice this situation between any matrix multiplication, we can complete the homomorphic evaluation of CQG for MLR. ",
888
+ "bbox": [
889
+ 174,
890
+ 207,
891
+ 825,
892
+ 250
893
+ ],
894
+ "page_idx": 8
895
+ },
896
+ {
897
+ "type": "text",
898
+ "text": "5 Experiments ",
899
+ "text_level": 1,
900
+ "bbox": [
901
+ 169,
902
+ 268,
903
+ 312,
904
+ 286
905
+ ],
906
+ "page_idx": 8
907
+ },
908
+ {
909
+ "type": "text",
910
+ "text": "The $\\mathrm { C } { + } { + }$ source code to implement the experiments in this section is openly available at: https://anonymous.4open.science/r/HE-CNNtraining-B355/ . ",
911
+ "bbox": [
912
+ 169,
913
+ 300,
914
+ 823,
915
+ 329
916
+ ],
917
+ "page_idx": 8
918
+ },
919
+ {
920
+ "type": "text",
921
+ "text": "Implementation We implement the enhanced NAG with the SLE loss function based on HE with the library HEAAN. All the experiments on the ciphertexts were conducted on a public cloud with 64 vCPUs and 192 GB RAM. ",
922
+ "bbox": [
923
+ 174,
924
+ 343,
925
+ 825,
926
+ 385
927
+ ],
928
+ "page_idx": 8
929
+ },
930
+ {
931
+ "type": "text",
932
+ "text": "We adopt the first 128 MNIST training images as the training data and the whole test dataset as the testing data. Both the training images and testing images have been processed in advance with the pre-trained model REGNET_X_400MF, resulting in a new dataset with each example of size 401. ",
933
+ "bbox": [
934
+ 171,
935
+ 392,
936
+ 823,
937
+ 434
938
+ ],
939
+ "page_idx": 8
940
+ },
941
+ {
942
+ "type": "text",
943
+ "text": "5.1 Parameters ",
944
+ "text_level": 1,
945
+ "bbox": [
946
+ 174,
947
+ 452,
948
+ 294,
949
+ 465
950
+ ],
951
+ "page_idx": 8
952
+ },
953
+ {
954
+ "type": "text",
955
+ "text": "The parameters of HEAAN we selected are: $l o g N = 1 6$ , $l o g Q = 9 9 0$ , $l o g p = 4 5$ , $s l o t s = 3 2 7 6 8$ , which ensure the security level $\\lambda = 1 2 8$ . Refer [6] for the details of these parameters. We didn’t use bootstrapping to refresh the weight ciphertexts and thus it can only perform 2 iterations of our algorithm. Each iteration takes $\\sim 1 1$ mins. The maximum runtime memory in this case is $\\sim 1 8$ GB. The 128 MNIST training images are encrypted into 2 ciphertexts. The client who own the private data has to upload these two ciphertexts, two ciphertexts encrypting the one-hot labels $\\bar { Y }$ , one ciphertext encrypting the $\\bar { B }$ and one ciphertext encrypting the weight $W$ to the cloud. The inticial weight matrix $W _ { 0 }$ we adopted is the zero matrix. The resulting MLR model after 2-iteration training has reached a pricision of $2 1 . 4 9 \\%$ and obtain the loss of −147206, which are consistent with the Python simulation experiment. ",
956
+ "bbox": [
957
+ 173,
958
+ 477,
959
+ 826,
960
+ 616
961
+ ],
962
+ "page_idx": 8
963
+ },
964
+ {
965
+ "type": "text",
966
+ "text": "6 Conclusion ",
967
+ "text_level": 1,
968
+ "bbox": [
969
+ 173,
970
+ 636,
971
+ 299,
972
+ 652
973
+ ],
974
+ "page_idx": 8
975
+ },
976
+ {
977
+ "type": "text",
978
+ "text": "In this work, we initiated to implement privacy-persevering CNN training based on mere HE techniques by presenting a faster HE-friendly algorithm. ",
979
+ "bbox": [
980
+ 161,
981
+ 667,
982
+ 825,
983
+ 696
984
+ ],
985
+ "page_idx": 8
986
+ },
987
+ {
988
+ "type": "text",
989
+ "text": "The HE operation bootstrapping could be adopted to refresh the weight ciphertexts. Python experiments imitating the privacy-preserving CNN training using $Z _ { 3 }$ as Sigmoid substitution showed that using a large amount of data such as 8,192 images to train the MLE model for hundreds of iterations would finally reach $9 5 \\%$ precision. The real experiments over ciphertexts conducted on a high-performance cloud with many vCPUs would take weeks to complete this test, if not months. ",
990
+ "bbox": [
991
+ 173,
992
+ 702,
993
+ 825,
994
+ 771
995
+ ],
996
+ "page_idx": 8
997
+ },
998
+ {
999
+ "type": "text",
1000
+ "text": "References ",
1001
+ "text_level": 1,
1002
+ "bbox": [
1003
+ 161,
1004
+ 792,
1005
+ 266,
1006
+ 808
1007
+ ],
1008
+ "page_idx": 8
1009
+ },
1010
+ {
1011
+ "type": "text",
1012
+ "text": "[1] Ran Gilad-Bachrach, Nathan Dowlin, Kim Laine, Kristin Lauter, Michael Naehrig, and John Wernsing. Cryptonets: Applying neural networks to encrypted data with high throughput and accuracy. In International conference on machine learning, pages 201–210. PMLR, 2016. ",
1013
+ "bbox": [
1014
+ 179,
1015
+ 816,
1016
+ 823,
1017
+ 858
1018
+ ],
1019
+ "page_idx": 8
1020
+ },
1021
+ {
1022
+ "type": "text",
1023
+ "text": "[2] Hervé Chabanne, Amaury De Wargny, Jonathan Milgram, Constance Morel, and Emmanuel Prouff. Privacy-preserving classification on deep neural network. Cryptology ePrint Archive, 2017. ",
1024
+ "bbox": [
1025
+ 173,
1026
+ 868,
1027
+ 823,
1028
+ 911
1029
+ ],
1030
+ "page_idx": 8
1031
+ },
1032
+ {
1033
+ "type": "text",
1034
+ "text": "[3] Xiaoqian Jiang, Miran Kim, Kristin Lauter, and Yongsoo Song. Secure outsourced matrix computation and application to neural networks. In Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security, pages 1209–1222, 2018. [4] John Chiang. A novel matrix-encoding method for privacy-preserving neural networks (inference). arXiv preprint arXiv:2201.12577, 2022. [5] Florian Bourse, Michele Minelli, Matthias Minihold, and Pascal Paillier. Fast homomorphic evaluation of deep discretized neural networks. In Advances in Cryptology–CRYPTO 2018: 38th Annual International Cryptology Conference, Santa Barbara, CA, USA, August 19–23, 2018, Proceedings, Part III 38, pages 483–512. Springer, 2018. [6] Andrey Kim, Yongsoo Song, Miran Kim, Keewoo Lee, and Jung Hee Cheon. Logistic regression model training based on the approximate homomorphic encryption. BMC medical genomics, 11(4):83, 2018. [7] Charlotte Bonte and Frederik Vercauteren. Privacy-preserving logistic regression training. BMC medical genomics, 11(4):86, 2018. [8] Miran Kim, Yongsoo Song, Shuang Wang, Yuhou Xia, and Xiaoqian Jiang. Secure logistic regression based on homomorphic encryption: Design and evaluation. JMIR medical informatics, 6(2):e19, 2018. [9] John Chiang. Privacy-preserving logistic regression training with a faster gradient variant. arXiv preprint arXiv:2201.10838, 2022. [10] Craig Gentry. Fully homomorphic encryption using ideal lattices. In Proceedings of the forty-first annual ACM symposium on Theory of computing, pages 169–178, 2009. [11] Zvika Brakerski, Craig Gentry, and Vinod Vaikuntanathan. (leveled) fully homomorphic encryption without bootstrapping. ACM Transactions on Computation Theory (TOCT), 6(3):1– 36, 2014. [12] N.P. Smart and F. Vercauteren. Fully homomorphic simd operations. Cryptology ePrint Archive, Report 2011/133, 2011. https://ia.cr/2011/133. [13] Jung Hee Cheon, Andrey Kim, Miran Kim, and Yongsoo Song. Homomorphic encryption for arithmetic of approximate numbers. In International Conference on the Theory and Application of Cryptology and Information Security, pages 409–437. Springer, 2017. [14] Kyoohyung Han, Seungwan Hong, Jung Hee Cheon, and Daejun Park. Logistic regression on homomorphic encrypted data at scale. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 9466–9471, 2019. \n7 [15] John Chiang. Multinomial logistic regression algorithms via quadratic gradient, 2023. \n78 [16] John Chiang. Quadratic gradient: Uniting gradient algorithm and newton method as one. arXiv preprint arXiv:2209.03282, 2022. [17] Dankmar Böhning and Bruce G Lindsay. Monotonicity of quadratic-approximation algorithms. Annals of the Institute of Statistical Mathematics, 40(4):641–663, 1988. [18] Dankmar Böhning. Multinomial logistic regression algorithm. Annals of the institute of Statistical Mathematics, 44(1):197–200, 1992. \n84 [19] John Chiang. On polynomial approximation of activation function. arXiv preprint arXiv:2202.00004, 2022. ",
1035
+ "bbox": [
1036
+ 153,
1037
+ 79,
1038
+ 830,
1039
+ 821
1040
+ ],
1041
+ "page_idx": 9
1042
+ }
1043
+ ]
parse/dev/c5Inzw6giM/c5Inzw6giM_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/c5Inzw6giM/c5Inzw6giM_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/hQwb-lbM6EL/hQwb-lbM6EL_content_list.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/nJJjv0JDJju/nJJjv0JDJju.md ADDED
@@ -0,0 +1,383 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Improving Diffusion Models for Inverse Problems using Manifold Constraints
2
+
3
+ # Hyungjin Chung∗,1
4
+
5
+ Byeongsu $\mathbf { S i m ^ { * , 2 } }$
6
+
7
+ Dohoon Ryu1
8
+
9
+ Jong Chul Ye3,1,2
10
+
11
+ 1 Dept. of Bio and Brain Engineering 2 Dept. of Mathematical Sciences 3Kim Jaechul Graduate School of AI ∗Equal contribution
12
+
13
+ Korea Advanced Institute of Science and Technology (KAIST) {hj.chung, byeongsu.s, dh.ryu, jong.ye}@kaist.ac.kr
14
+
15
+ # Abstract
16
+
17
+ Recently, diffusion models have been used to solve various inverse problems in an unsupervised manner with appropriate modifications to the sampling process. However, the current solvers, which recursively apply a reverse diffusion step followed by a projection-based measurement consistency step, often produce suboptimal results. By studying the generative sampling path, here we show that current solvers throw the sample path off the data manifold, and hence the error accumulates. To address this, we propose an additional correction term inspired by the manifold constraint, which can be used synergistically with the previous solvers to make the iterations close to the manifold. The proposed manifold constraint is straightforward to implement within a few lines of code, yet boosts the performance by a surprisingly large margin. With extensive experiments, we show that our method is superior to the previous methods both theoretically and empirically, producing promising results in many applications such as image inpainting, colorization, and sparse-view computed tomography. Code available here
18
+
19
+ # 1 Introduction
20
+
21
+ Diffusion models have shown impressive performance both as generative models themselves [41, 13], and also as unsupervised inverse problem solvers [41, 8, 9, 25] that do not require problem-specific training. Specifically, given a pre-trained unconditional score function (i.e. denoiser), solving the reverse stochastic differential equation (SDE) numerically would amount to sampling from the data generating distribution [41]. For many different inverse problems (e.g. super-resolution [8, 9], inpainting [41, 9], compressed-sensing MRI (CS-MRI) [40, 9], sparse view CT (SV-CT) [40], etc.), it was shown that simple incorporation of the measurement process produces satisfactory conditional samples, even when the model was not trained for the specific problem.
22
+
23
+ Nevertheless, for certain problems (e.g. inpainting), currently used algorithms often produce unsatisfactory results when implemented naively (e.g. boundary artifacts, as shown in Fig. 1 (b)). The authors in [32] showed that in order to produce high quality reconstructions, one needs to iterate back and forth between the noising and the denoising step at least $> 1 0$ times per iteration. These iterations are computationally demanding and should be avoided, considering that diffusion models are slow to sample from even without such iterations. On the other hand, a classic result of Tweedie’s formula [37, 42] shows that one can perform Bayes optimal denoising in one step, once we know the gradient of the log density. Extending such result, it was recently shown that one can indeed perform a single-step denoising with learned score functions for denoising problems from the general exponential family [28].
24
+
25
+ ![](images/d46a0a72e1f55b9ccd673c15a2514b6f8b732b934f8b5da5716869d6f9367d28.jpg)
26
+ Figure 1: Visual schematic of the MCG correction step. (a) $\textcircled{1}$ Unconditional reverse diffusion generates $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ ; $\textcircled { 2 } Q _ { i }$ maps the noisy $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ to generate $\scriptstyle { \hat { \mathbf { x } } } _ { 0 }$ ; $\textcircled{3}$ Manifold Constrained Gradient (MCG) $\begin{array} { r l } { \frac { \partial } { \partial { \bf x } _ { i } } \| { \bf W } ( { \bf y } - { \bf H } \hat { \bf x } _ { 0 } ) \| _ { 2 } ^ { 2 } } \end{array}$ is applied to fix the iteration on manifold; $\textcircled{4}$ Takes the orthogonal complement; $\textcircled{5}$ Samples from $p ( \pmb { y } _ { i } | \pmb { y } )$ , then combines $\pmb { A x } _ { i - 1 } ^ { \prime }$ and $\mathbf { \nabla } _ { \mathbf { \boldsymbol { y } } _ { i } }$ . (b) Representative results of inpainting, compared with score-SDE [41]. Reconstructions with score-SDE produce incoherent results, while our method produces high fidelity solutions.
27
+
28
+ In this work, we leverage the denoising result through Tweedie’s formula and show that such denoised samples can be the key to significantly improving the performance of reconstruction using diffusion models across arbitrary linear inverse problems, despite the simplicity in the implementation. Moreover, we theoretically prove that if the score function estimation is globally optimal, the correction term from the manifold constraint enforces the sample path to stay on the plane tangent to the data manifold1, so by combining with the reverse diffusion step, the solution becomes more stable and accurate.
29
+
30
+ # 2 Related Works
31
+
32
+ # 2.1 Diffusion Models
33
+
34
+ Continuous Form For a continuous diffusion process $\pmb { x } ( t ) \in \mathbb { R } ^ { n } , t \in [ 0 , 1 ]$ , we set $x ( 0 ) \sim$ $p _ { 0 } ( { \pmb x } ) = p _ { d a t a }$ , where $p _ { d a t a }$ represents the data distribution of interest, and $\pmb { x } ( \bar { 1 } ) \sim p _ { 1 } ( \pmb { x } )$ , with $p _ { 1 } ( { \pmb x } )$ approximating spherical Gaussian distribution, containing no information of data. Here, the forward noising process is defined with the following Itˆo stochastic differential equation (SDE) [41]:
35
+
36
+ $$
37
+ \begin{array} { r } { d { \pmb x } = \bar { \pmb f } ( { \pmb x } , t ) d t + \bar { \pmb g } ( t ) d { \pmb w } , } \end{array}
38
+ $$
39
+
40
+ with $\bar { \pmb f } : \mathbb { R } ^ { d } \mapsto \mathbb { R } ^ { d }$ defining the linear drift function, $\bar { g } ( t ) : \mathbb { R } \mapsto \mathbb { R }$ defining a scalar diffusion coefficient, and $\pmb { w } \in \mathbb { R } ^ { n }$ denoting the standard $n -$ dimensional Wiener process. The forward SDE in (1) is coupled with the following reverse SDE by the Anderson’s theorem [1, 41]:
41
+
42
+ $$
43
+ \begin{array} { r } { d \pmb { x } = [ \pmb { \bar { f } } ( \pmb { x } , t ) - \bar { g } ( t ) ^ { 2 } \nabla _ { \pmb { x } } \log p _ { t } ( \pmb { x } ) ] d t + \bar { g } ( t ) d \bar { w } , } \end{array}
44
+ $$
45
+
46
+ with $d t$ denoting the infinitesimal negative time step, and $\bar { \mathbf { \Gamma } } _ { \bar { \mathbf { \Gamma } } } ^ { \bar { \mathbf { \Gamma } } } \bar { \mathbf { \Gamma } } _ { \bar { \mathbf { \Gamma } } } ^ { \bar { \mathbf { \Gamma } } }$ defining the standard Wiener process running backward in time. Note that the reverse SDE defines the generative process through the score function $\nabla _ { \pmb { x } } \log \ p _ { t } ( \pmb { x } )$ , which in practice, is typically replaced with $\nabla _ { \pmb { x } } \log p _ { 0 t } ( \pmb { x } ( t ) | \pmb { x } ( 0 ) )$ to minimize the following denoising score-matching objective
47
+
48
+ $$
49
+ \operatorname* { m i n } _ { \theta } \mathbb { E } _ { t \sim U ( \varepsilon , 1 ) , x ( 0 ) \sim p _ { 0 } ( x ) , x ( t ) \sim p _ { 0 t } ( x ( t ) | x ( 0 ) ) } \left[ \| s _ { \theta } ( x ( t ) , t ) - \nabla _ { x _ { t } } \log p _ { 0 t } ( x ( t ) | x ( 0 ) ) \| _ { 2 } ^ { 2 } \right] .
50
+ $$
51
+
52
+ Once the parameter $\theta ^ { * }$ for the score function is estimated, one can replace the score function in (2) with $s _ { \theta ^ { * } } ( \bar { { \boldsymbol { x } } } ( t ) , t )$ to solve the reverse SDE [41].
53
+
54
+ Discrete Form Due to the linearity of $\bar { \pmb f }$ and $\bar { g }$ , the forward diffusion step can be implemented with a simple reparameterization trick [29]. Namely, the general form of the forward diffusion is
55
+
56
+ $$
57
+ \begin{array} { r } { \pmb { x } _ { i } = a _ { i } \pmb { x } _ { 0 } + b _ { i } \pmb { z } , \quad \pmb { z } \sim \mathcal { N } ( 0 , \pmb { I } ) , } \end{array}
58
+ $$
59
+
60
+ where we have replaced the continuous index $t \in [ 0 , 1 ]$ with the discrete index $i \in \mathbb N$ . On the other hand, the discrete reverse diffusion step can in general be represented as
61
+
62
+ $$
63
+ \begin{array} { r } { \pmb { x } _ { i - 1 } = \pmb { f } ( \pmb { x } _ { i } , \pmb { s } _ { \theta ^ { * } } ) + g ( \pmb { x } _ { i } ) \pmb { z } , \quad \pmb { z } \sim \mathcal { N } ( 0 , \pmb { I } ) , } \end{array}
64
+ $$
65
+
66
+ where we have replaced the ground truth score function with the trained one. We detail the choice of $a _ { i } , b _ { i } , f , g$ in Appendix. B.
67
+
68
+ # 2.2 Conditional Generative models for Inverse problems
69
+
70
+ The main problem of our interest in this paper is the inverse problem, retrieving the unknown $\pmb { x } \in \mathbb { R } ^ { n }$ from a measurement $\textbf { { y } }$ :
71
+
72
+ $$
73
+ \pmb { y } = \pmb { H } \pmb { x } + \epsilon , \pmb { y } \in \mathbb { R } ^ { m } , \pmb { H } \in \mathbb { R } ^ { m \times n } ,
74
+ $$
75
+
76
+ where $\epsilon \in \mathbb { R } ^ { m }$ is the noise in the measurement. Accordingly, for the case of the inverse problems, our goal is to generate samples from a conditional distribution with respect to the measurement $\textbf { { y } }$ , i.e. $p ( { \pmb x } | { \pmb y } )$ . Accordingly, the score function $\nabla _ { \pmb { x } } \log p _ { t } ( \pmb { x } )$ in (2) should be replaced by the conditional score $\nabla _ { \pmb { x } } \log p _ { t } ( \pmb { x } | \pmb { y } )$ . Unfortunately, this strictly restricts the generalization capability of the neural network since the conditional score should be retrained whenever the conditions change. To address this, recent conditional diffusion models [22, 41, 8, 9] utilize the unconditional score function $\nabla _ { \pmb { x } } \log p _ { t } ( \pmb { x } )$ but rely on a projection-based measurement constraint to impose the conditions. Specifically, one can apply the following:
77
+
78
+ $$
79
+ \begin{array} { r l } & { \pmb { x } _ { i - 1 } ^ { \prime } = \pmb { f } ( \pmb { x } _ { i } , s _ { \theta } ) + g ( \pmb { x } _ { i } ) \pmb { z } , \quad \pmb { z } \sim \mathcal { N } ( 0 , \pmb { I } ) , } \\ & { \pmb { x } _ { i - 1 } = \pmb { A } \pmb { x } _ { i - 1 } ^ { \prime } + \pmb { b } _ { i } , } \end{array}
80
+ $$
81
+
82
+ where $A , b _ { i }$ are functions of $H , y$ , and $\scriptstyle { \mathbf { { \vec { x } } } } _ { 0 }$ . Note that (7) is identical to the unconditional reverse diffusion step in (5), whereas (8) effectively imposes the condition. It was shown in [9] that any general contraction mapping (e.g. projection onto convex sets, gradient step) may be utilized as (8) to impose the constraint.
83
+
84
+ Another recent work [25] advancing [26] establishes the state-of-the-art (SOTA) in solving noisy inverse problems with unconditional diffusion models, by running the conditional reverse diffusion process in the spectral domain achieved by performing singular value decomposition (SVD), and leveraging approximate gradient of the log likelihood term in the spectral space. The authors show that feasible solutions can be obtained with as small as 20 diffusion steps.
85
+
86
+ Prior to the development of diffusion models, Plug-and-Play $( \mathrm { P n P } )$ models [47, 53, 44] were used in a similar fashion by utilizing a general-purpose unconditional denoiser in the place of proximal mappings in model-based iterative reconstruction methods [5, 3]. Similarly, outside the context of diffusion models, iterative denoising followed by projection-based data consistency was proposed in [44]. In such view, diffusion models can be understood as generative variant of PnPs trained with multiple scales of noise.
87
+
88
+ GAN-based solvers are also widly explored [4, 10, 20], where the pre-trained generators are tuned at the test time by optimizing over the latent, the parameters, or jointly.
89
+
90
+ # 2.3 Tweedie’s formula for denoising
91
+
92
+ In the case of Gaussian noise, a classic result of Tweedie’s formula [37] tells us that one can achieve the denoised result by computing the posterior expectation:
93
+
94
+ $$
95
+ \begin{array} { r } { \mathbb { E } [ { \pmb x } | { \tilde { \pmb x } } ] = \tilde { \pmb x } + \sigma ^ { 2 } \nabla _ { \tilde { \pmb x } } \log p ( \tilde { \pmb x } ) , } \end{array}
96
+ $$
97
+
98
+ where the noise is modeled by $\tilde { \pmb { x } } \sim \mathcal { N } ( \pmb { x } , \sigma ^ { 2 } I )$ . If we consider a diffusion model in which the forward step is modeled as $\pmb { x } _ { i } \sim \mathcal { N } ( a _ { i } \pmb { x } _ { 0 } , b _ { i } ^ { 2 } I )$ (discrete form), the Tweedie’s formula can be rewritten as:
99
+
100
+ $$
101
+ \begin{array} { r } { \mathbb { E } [ \pmb { x } _ { 0 } | \pmb { x } _ { i } ] = ( \pmb { x } _ { i } + b _ { i } ^ { 2 } \nabla _ { \pmb { x } _ { i } } \log p ( \pmb { x } _ { i } ) ) / a _ { i } . } \end{array}
102
+ $$
103
+
104
+ Tweedie’s formula is in fact not only relevant to Gaussian denoising in the Bayesian framework, but have also been extended to be in close relation with kernel regression [34]. Moreover, it was shown that it can be applied to arbitrary exponential noise distributions beyond Gaussian [14, 28]. In the following, we use this key property to develop our algorithm.
105
+
106
+ # 3 Conditional Diffusion using Manifold Constraints
107
+
108
+ Although our original motivation of using the measurement constraint step in (8) was to utilize the unconditionally trained score function in the reverse diffusion step in (7), there is room for imposing additional constraints while still using the unconditionally trained score function.
109
+
110
+ Specifically, the Bayes rule $p ( { \pmb x } | { \pmb y } ) = p ( { \pmb y } | { \pmb x } ) p ( { \pmb x } ) / p ( { \pmb y } )$ leads to
111
+
112
+ $$
113
+ \nabla _ { \pmb { x } } \log p ( \pmb { x } | \pmb { y } ) = \nabla _ { \pmb { x } } \log p ( \pmb { x } ) + \nabla _ { \pmb { x } } \log p ( \pmb { y } | \pmb { x } ) .
114
+ $$
115
+
116
+ Hence, the score function in the reverse SDE in (7) can be replaced by (11), leading to
117
+
118
+ $$
119
+ x _ { i - 1 } ^ { \prime } = f ( x _ { i } , s _ { \theta } ) - \alpha \frac { \partial } { \partial x _ { i } } \| W ( y - H x _ { i } ) \| _ { 2 } ^ { 2 } + g ( x _ { i } ) z , \quad z \sim \mathcal { N } ( 0 , I )
120
+ $$
121
+
122
+ where $\alpha$ and $W$ depend on the noise covariance, if the noise $\epsilon$ in (6) is Gaussian.
123
+
124
+ Now, one of the important contributions of this paper is to reveal that the Bayes optimal denoising step in (10) from the Tweedie’s formula leads to a preferred condition both empirically and theoretically. Specifically, we define the set constraint for $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ , called the manifold constrained gradient (MCG), so that the gradient of the measurement term stays on the manifold (see Theorem 1):
125
+
126
+ $$
127
+ \pmb { x } \in \mathcal { X } _ { i } , \quad \mathrm { w h e r e } \quad \mathcal { X } _ { i } = \{ \pmb { x } \in \mathbb { R } ^ { n } | \pmb { x } = ( \pmb { x } + b _ { i } ^ { 2 } \pmb { s } _ { \theta } ( \pmb { x } , i ) ) / a _ { i } \}
128
+ $$
129
+
130
+ To deal with the potential deviation from the measurement consistency, we again impose the data consistency step (8). Putting them together, the discrete reverse diffusion under the additional manifold constraint and the data consistency can be represented by
131
+
132
+ $$
133
+ \begin{array} { l } { { \displaystyle x _ { i - 1 } ^ { \prime } = f ( x _ { i } , s _ { \theta } ) - \alpha \frac { \partial } { \partial x _ { i } } \| W ( y - H \hat { x } _ { 0 } ( x _ { i } ) ) \| _ { 2 } ^ { 2 } + g ( x _ { i } ) z , \quad z \sim \mathcal { N } ( 0 , I ) , } } \\ { { \displaystyle x _ { i - 1 } = A x _ { i - 1 } ^ { \prime } + b . } } \end{array}
134
+ $$
135
+
136
+ We illustrate our scheme visually in Fig. 1 (a), specifically for the task of image inpainting. The additional step leads to a dramatic performance boost, as can be seen in Fig. 1 (b). Note that while the mapping (10) does not rely on the measurement, our gradient term in (14) incorporates the information of $\textbf { { y } }$ so that the gradient of the measurement terms stays on the manifold. In the following, we study the theoretical properties of the method. Further algorithmic details and adaptations to each problem that we tackle are presented in Section C.
137
+
138
+ We note that the authors of [19] proposed a similar gradient method for the application of temporal imputation and super-resolution. When combining (14) with (15), one can arrive at a similar gradient method proposed in [19], and hence our method can be seen as a generalization to arbitrary linear inverse problems. Furthermore, there are vast literature in the context of $\mathrm { P n P }$ models that utilize pretrained denoisers together with gradient of the log-likelihood to solve inverse problems [30, 48, 11]. Among them, [30] is especially relevant to this work since their method relies on modified Langevin diffusion, together with Tweedie’s denoising and projections to the measurement subspace.
139
+
140
+ # 4 Geometry of Diffusion Models and Manifold Constrained Gradient
141
+
142
+ In this section, we theoretically support the effectiveness of the proposed algorithm by showing the problematic behavior of the earlier algorithm and how the proposed algorithm resolves the problem. We defer all proofs in the supplementary section. To begin with, we borrow a geometrical viewpoint of the data manifold.
143
+
144
+ Notation For a scalar $a$ , points $\mathbf { \nabla } _ { \mathbf { x } , \mathbf { y } }$ and a set $A$ , we use the following notations. $a A : = \{ a x : x \in$ $A \}$ ; $d ( \pmb { x } , A ) : = \operatorname* { i n f } _ { \pmb { y } \in A } \widetilde { | } | \pmb { x } - \pmb { y } | | _ { 2 }$ ; $B _ { r } ( A ) : = \{ { \pmb x } : d ( { \pmb x } , A ) < r \}$ ; $T _ { x } { \mathcal { M } }$ : the tangent space to a manifold $\mathcal { M }$ at $_ { \textbf { \em x } }$ ; $J _ { f }$ : the Jacobian matrix of a vector valued function $f$ . We define $p _ { 0 } = p _ { d a t a }$ .
145
+
146
+ To develop the theory, we need an assumption on the data distribution.
147
+
148
+ Assumption 1 (Strong manifold assumption: linear structure). Suppose $\mathcal { M } \subset \mathbb { R } ^ { n }$ is the set of all data points, here we call the data manifold. Then, the manifold coincides with the tangent space with dimension $l \ll n$ .
149
+
150
+ $$
151
+ \mathcal { M } \cap B _ { R } ( { \pmb x } _ { 0 } ) = T _ { { \pmb x } _ { 0 } } \mathcal { M } \cap B _ { R } ( { \pmb x } _ { 0 } ) a n d T _ { { \pmb x } _ { 0 } } \mathcal { M } \cong \mathbb { R } ^ { l } .
152
+ $$
153
+
154
+ Moreover, the data distribution $p _ { 0 }$ is the uniform distribution on the data manifold $\mathcal { M }$
155
+
156
+ ![](images/bf68c5be2851b2c07848707846530a6e49eab176c2c8a7727e05e085b684c4c5.jpg)
157
+ (a) Geometry of diffusion model
158
+
159
+ ![](images/f9ce18aca0d47ae1fdfd7b499db3a160ec5a8e7cab4bc942abbb1f213b11dd58.jpg)
160
+ (b) MCG correction
161
+ Figure 2: In both (a) and (b), the central manifolds represent the data manifold $\mathcal { M }$ , encircled by manifolds of noisy data $\mathcal { M } _ { i }$ . The concentration on the manifold of noisy data and the distance from the clean data manifold are prescribed by Proposition 1. In (a), the backward (resp. forward) step depicted by blue (resp. red) arrows can be considered as transitions from $\mathcal { M } _ { i }$ to $\mathcal { M } _ { i - 1 }$ (resp. $\mathcal { M } _ { i - 1 }$ to $\mathcal { M } _ { i }$ ). In (b), arrows refer to the directions of conventional projection onto convex sets (POCS) step (green arrow) and MCG step (red arrow) which can be predicted by Theorem 1.
162
+
163
+ We need to recall that the conventional manifold assumption is about the intrinsic geometry of data points having a low dimensional nature. However, we assume more in this work: the manifold is locally linear. Although this stronger assumption might narrow the practice of the theory, the geometric approach may provide new insights on diffusion models. Under this assumption, the following proposition shows how the data perturbed by noise lies in the ambient space, illustrated pictorially in Fig. 2a.
164
+
165
+ Proposition 1 (Concentration of noisy data). Consider the distribution of noisy data $p _ { i } ( { \pmb x } _ { i } ) =$ $\begin{array} { r } { \int p ( \mathbf { \bar { x } } _ { i } | \mathbf { { x } } ) p _ { 0 } ( \mathbf { { x } } ) d \mathbf { { x } } , p ( \mathbf { { x } } _ { i } | \mathbf { { x } } ) \sim \mathcal { N } ( a _ { i } x , b _ { i } ^ { 2 } I ) } \end{array}$ . Then $p _ { i } ( { \pmb x } _ { i } )$ is concentrated on $( n - 1 )$ -dim manifold $\mathcal { M } _ { i } : = \{ \pmb { y } \in \mathbb { R } ^ { n } : d ( \pmb { y } , a _ { i } \mathcal { M } ) = r _ { i } : = b _ { i } \sqrt { n - l } \}$ . Rigorously, $p _ { i } ( B _ { \epsilon r _ { i } } ( \mathcal { M } _ { i } ) ) > 1 - \delta$ , for some small $\epsilon , \delta > 0$ .
166
+
167
+ Remark 1 (Geometric interpretation of the diffusion process). Considering Proposition $I$ , the manifolds of noisy data can be interpreted as interpolating manifolds between the two: the hypersphere, where pure noise $\mathcal { N } ( a _ { \infty } x _ { 0 } , b _ { \infty } ^ { 2 } )$ is concentrated, and the clean data manifold. In this regard, the diffusion steps are mere transitions from one manifold to another and the diffusion process is a transport from the data manifold to the hypersphere through interpolating manifolds. See Fig. 2a.
168
+
169
+ Remark 2. We can infer from the proposition that the score functions are trained only with the data points concentrated on the noisy data manifolds. Therefore, inaccurate inference might be caused by application of a score function on points away from the noisy data manifold.
170
+
171
+ Proposition 2 (score function). Suppose sθ is the minimizer of the denoising score matching loss in (3). Let $Q _ { i }$ be the function that maps $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ to $\scriptstyle { \hat { \mathbf { x } } } _ { 0 }$ for each $i$ ,
172
+
173
+ $$
174
+ Q _ { i } : \mathbb { R } ^ { d } \mathbb { R } ^ { d } , \mathbf { x } _ { i } \mapsto \hat { \pmb x } _ { 0 } : = \frac { 1 } { a _ { i } } ( \mathbf { x } _ { i } + b _ { i } ^ { 2 } s _ { \theta } ( \mathbf { x } _ { i } , i ) ) .
175
+ $$
176
+
177
+ Then, $Q _ { i } ( \pmb { x } _ { i } ) \in \mathcal { M }$ and $\pmb { J } _ { Q _ { i } } ^ { 2 } = \pmb { J } _ { Q _ { i } } = \pmb { J } _ { Q _ { i } } ^ { T } : \mathbb { R } ^ { d } T _ { Q _ { i } ( \pmb { x } _ { i } ) } \mathcal { M }$ . Intuitively, $Q _ { i }$ is locally an orthogonal projection onto $\bar { \mathcal { M } }$ .
178
+
179
+ According to the proposition, the score function only concerns the normal direction of the data manifold. In other words, the score function cannot discriminate two data points whose difference is tangent to the manifold. In solving inverse problems, however, we desire to discriminate data points to reconstruct the original signal, and the discrimination is achievable by measurement fidelity. In order to achieve the original signal, the measurement plays a role in correcting the tangent component near the data manifold. Furthermore, with regard to remark 2, diffusion model-based inverse problem solvers should follow the tangent component. The following theorem shows how existing algorithms and the proposed method are different in this regard.
180
+
181
+ ![](images/5a086fbd9fa419eab1750b9d248b44e7ab45bab79112f3f5df966a9519cf7215.jpg)
182
+ Figure 3: Inpainting results on FFHQ (1st, 2nd row) and ImageNet (3rd, 4th row). (a) Measurement, (b) Ground truth, (c) IAGAN [20] for FFHQ, LaMa [43] for ImageNet, (d) DDRM [25], (e) ScoreSDE [41], (f) RePAINT [32], (g) MCG (Ours). Out of $2 5 6 \times 2 5 6$ image, the 1st and the 3rd row is masked with size $1 2 8 \times 1 2 8$ box. $92 \%$ of pixels (all RGB channels) from the images in the 2nd and 4th row are blocked.
183
+
184
+ Theorem 1 (Manifold constrained gradient). A correction by the manifold constrained gradient does not leave the data manifold. Formally,
185
+
186
+ $$
187
+ \frac { \partial } { \partial x _ { i } } \| { \cal W } ( y - H \hat { x } _ { 0 } ) \| _ { 2 } ^ { 2 } = - 2 { \cal J } _ { Q _ { i } } ^ { T } H ^ { T } { \cal W } ^ { T } { \cal W } ( y - H \hat { x } _ { 0 } ) \in T _ { \hat { x } _ { 0 } } { \mathcal { M } } ,
188
+ $$
189
+
190
+ the gradient is the projection of the data fidelity term onto $T _ { \hat { \pmb { x } } _ { 0 } } \mathcal { M }$ ,
191
+
192
+ This theorem suggests that in diffusion models, the naive measurement fidelity step (without considering the data manifold) pushes the inference path out of the manifolds and might lead to inaccurate reconstruction. (To see this pictorially, see section. D, and Fig. 7.) On the other hand, our correction term from the manifold constraint guides the diffusion to lie on the data manifold, leading to better reconstruction. Such geometric views are illustrated in Fig. 2b.
193
+
194
+ Remark 3. One may concern that the suboptimality of the denoising score matching loss optimization may lead to inaccurate inference of the MCG steps. In practice, however, most of the error in denoising score matching is concentrated on $t \sim 1 / 9 I$ , and in such region, the Tweedie’s inference cannot make meaningful images. That is, the score function cannot detect the data manifold. Nonetheless, in this regime, the magnitudes of the MCGs are small when the denoising score is inaccurate, and hence the matters arising from suboptimality is minimal. As $t 0$ , the estimation becomes exact, and subsequently leads to accurate implementation of the MCG.
195
+
196
+ # 5 Experiments
197
+
198
+ For all tasks, we aim to verify the superiority of our method against other diffusion model-based approaches, and also against strong supervised learning-based baselines. Further details can be found in Section. F.
199
+
200
+ Datasets and Implementation For inpainting, we use FFHQ $2 5 6 \times 2 5 6$ [24], and ImageNet $2 5 6 \times 2 5 6$ [12] to validate our method. We utilize pre-trained models from the open sourced repository based on the implementation of ADM (VP-SDE) [13]. We validate the performance on 1000 held-out validation set images for both FFHQ and ImageNet dataset. For the colorization task, we use FFHQ $2 5 6 \times 2 5 6$ , and LSUN-bedroom $2 5 6 \times 2 5 6$ [51]. We use pre-trained score functions from score-SDE [41] based on VE-SDE. We use 300 validation images for testing the performance with respect to the LSUN-bedroom dataset. For experiments with CT, we train our model based on ncsnpp as a VE-SDE from score-SDE [41], on the 2016 American Association of Physicists in Medicine (AAPM) grand challenge dataset, and we process the data as in [23]. Specifically, the dataset contains 3839 training images resized to $2 5 6 \times 2 5 6$ resolution. We simulate the CT measurement process with parallel beam geometry with evenly-spaced 180 degrees. Evaluation is performed on 421 held-out validation images from the AAPM challenge.
201
+
202
+ Table 1: Quantitative evaluation (FID, LPIPS) of inpainting task on FFHQ and ImageNet. ∗: Reimplemented with our score function. MCG, Score-SDE, RePAINT, and DDRM all share the same score function and differ only in the inference method. Bold: Best, under: second best.
203
+
204
+ <table><tr><td></td><td colspan="8">FFHQ(256×256)</td><td colspan="5">ImageNet (256 × 256)</td></tr><tr><td></td><td colspan="2">Box</td><td colspan="2">Random</td><td colspan="2">Extreme</td><td colspan="2">Wide masks</td><td colspan="2">Box</td><td colspan="2">Random</td><td colspan="2">Wide masks</td></tr><tr><td>Method</td><td></td><td>FID↓LPIPS ←</td><td>FID↓LPIPS</td><td>√</td><td></td><td>FID↓LPIPS ↓</td><td>FID↓LPIPS↓</td><td></td><td>FID↓LPIPS</td><td>↓</td><td>FID↓LPIPS</td><td>←</td><td>FID↓LPIPS</td><td></td></tr><tr><td>MCG (ours)</td><td>23.7</td><td>0.089</td><td>21.4</td><td>0.186</td><td>30.6</td><td>0.366</td><td>22.1</td><td>0.099</td><td>25.4</td><td>0.157</td><td>34.8</td><td>0.308</td><td>21.9</td><td>0.148</td></tr><tr><td>Score-SDE [41] 30.3</td><td></td><td>0.135</td><td>109.3 0.674</td><td></td><td>48.6</td><td>0.488</td><td>29.8</td><td>0.132</td><td>43.5</td><td>0.199</td><td>143.5 0.758</td><td></td><td>25.9</td><td>0.150</td></tr><tr><td>RePAINT*[32]</td><td>25.7</td><td>0.093</td><td>38.1</td><td>0.240</td><td>35.9</td><td>0.398</td><td>24.2</td><td>0.108</td><td>26.1</td><td>0.156</td><td>59.3</td><td>0.387</td><td>37.0</td><td>0.205</td></tr><tr><td>DDRM [25]</td><td>28.4</td><td>0.109</td><td>111.6 0.774</td><td></td><td>48.1</td><td>0.532</td><td>27.5</td><td>0.113</td><td>88.8</td><td>0.386</td><td>99.6</td><td>0.767</td><td>80.6</td><td>0.398</td></tr><tr><td>LaMa [43]</td><td>27.7</td><td>0.086</td><td>188.7 0.648</td><td></td><td>61.7</td><td>0.492</td><td>23.2</td><td>0.096</td><td>26.8</td><td>0.139</td><td>134.1</td><td>0.567</td><td>20.4</td><td>0.140</td></tr><tr><td>AOT-GAN [52]</td><td>29.2</td><td>0.108</td><td>97.2</td><td>0.514</td><td>69.5</td><td>0.452</td><td>28.3</td><td>0.106</td><td>35.3</td><td>0.163</td><td>119.6 0.583</td><td></td><td>29.8</td><td>0.161</td></tr><tr><td>ICT[49]</td><td>27.3</td><td>0.103</td><td>91.3</td><td>0.445</td><td>56.7</td><td>0.425</td><td>26.9</td><td>0.104</td><td>31.9</td><td>0.148</td><td>131.4 0.584</td><td></td><td>25.4</td><td>0.148</td></tr><tr><td>DSI [35]</td><td>27.9</td><td>0.096</td><td>126.4 0.601</td><td></td><td>77.5</td><td>0.463</td><td>28.3</td><td>0.102</td><td>34.5</td><td>0.155</td><td>132.9 0.549</td><td></td><td>24.3</td><td>0.154</td></tr><tr><td>IAGAN [20]</td><td>26.3</td><td>0.098</td><td>41.5</td><td>0.279</td><td>56.1</td><td>0.417</td><td>23.8</td><td>0.110</td><td>1</td><td>1</td><td>-</td><td>-</td><td>-</td><td>-</td></tr></table>
205
+
206
+ Inpainting Score-SDE [41], REPAINT [32], DDRM [25] were chosen as baseline diffusion models to compare against the proposed method. For a fair comparison, we use the same score function for all methods including MCG, and only differentiate the inference method that is used. Another class of generative models: GAN-based inverse problem solver, IAGAN [20] is considered as a comparison method for FFHQ specifically. We also include comparisons against supervised learning based base
207
+
208
+ <table><tr><td>Data</td><td colspan="2">FFHQ(256×256) LSUN(256×256)</td></tr><tr><td>Method</td><td>SSIM↑ LPIPS↓</td><td>SSIM↓ LPIPS↓</td></tr><tr><td>MCG (ours)</td><td>0.951 0.146</td><td>0.959 0.160</td></tr><tr><td>Score-SDE [41]</td><td>0.936 0.180</td><td>0.945 0.199</td></tr><tr><td>DDRM[25]</td><td>0.948 0.154</td><td>0.957 0.182</td></tr><tr><td>cINN[2]</td><td>0.952 0.166 0.935</td><td>0.952 0.180</td></tr><tr><td>pix2pix [21]</td><td>0.184</td><td>0.947 0.174</td></tr></table>
209
+
210
+ Table 2: Quantitative evaluation (SSIM, LPIPS) of colorization task. Bold: best, under: second best.
211
+
212
+ lines: LaMa [43], AOT-GAN [52], ICT [49], and DSI [35]. We use various forms of inpainting masks: box $1 2 8 \times 1 2 8$ sized square region is missing2), extreme (only the box region is existent), random $( 9 0 - 9 5 \%$ of pixels are missing), and LaMa-wide. Quantitative evaluation is performed with two metrics - Frechet Inception Distance (FID)-1k [17], and Learned Perceptual Image Patch Similarity (LPIPS) [54].
213
+
214
+ Our method outperforms the diffusion model baselines [41, 32, 25] by a large margin. Moreover, our method is also competitive with, or even better than the best-in-class fully supervised methods, as can be seen in Table 1. In Fig. 3, we depict representative results that show the superiority of the method, where we see in both the box-type and random dropping that MCG performs very well on all experiments.
215
+
216
+ Table 3: Quantitative evaluation (PSNR, SSIM) of CT reconstruction task. Bold: best.
217
+
218
+ <table><tr><td></td><td colspan="2">AAPM(256×256)</td></tr><tr><td>Views</td><td>18</td><td>30</td></tr><tr><td>Method</td><td>PSNR 个 SSIM↑</td><td>PSNR 个 SSIM↑</td></tr><tr><td>MCG (ours)</td><td>33.57 0.956</td><td>36.09 0.971</td></tr><tr><td>Score-CT[40]</td><td>29.85 0.897</td><td>31.97</td><td>0.913</td></tr><tr><td>SIN-4c-PRN[50]</td><td>26.96</td><td>0.850 30.23</td><td>0.917</td></tr><tr><td>cGAN [15]</td><td>24.38</td><td>0.823 27.45 23.92</td><td>0.927</td></tr><tr><td>FISTA-TV [3]</td><td>21.57</td><td>0.791</td><td>0.861</td></tr></table>
219
+
220
+ Colorization We choose score-SDE [41], and DDRM [25] as diffusion-model based compar
221
+
222
+ ison methods, and also compare against cINN [2], and pix2pix [21]. Two metrics were used for evaluation: structural similarity index (SSIM), and LPIPS. Consistent with the findings from inpainting, we achieve much improved performance than score-SDE, and also is favorable against state-of-the-art (SOTA) superivsed learning based methods. In Table 2, we see that the proposed method outperforms all other methods in terms of both PSNR/LPIPS in LSUN-bedroom, and also achieves strong performance in the colorization of FFHQ dataset.
223
+
224
+ ![](images/45291f0ff87059d30bbd75ebf14b3847922cf66508d4a7339710a26c29cf9b55.jpg)
225
+ Figure 4: Colorization results on FFHQ / LSUN-bedroom, Sparse view CT reconstruction results on AAPM.
226
+
227
+ CT reconstruction To the best of our knowledge, [40] is the only method that tackles CT reconstruction directly with diffusion models. We compare our method against [40], which we refer to as score-CT henceforth. We also compare with the best-in-class supervised learning methods, cGAN [15] and SIN- $\scriptscriptstyle \cdot 4 \mathrm { c }$ -PRN [50]. As a compressed sensing baseline, FISTA-TV [3] was included, along with the analytical reconstruction method, FBP. We use two standard metrics - peak-signalto-noise-ratio (PSNR), and SSIM for quantitative evaluation. From Table 3, we see that the newly proposed MCG method outperforms the previous score-CT [40] by a large margin. We can observe the superiority of MCG over other methods more clearly in Fig. 4, where MCG reconstructs the measurement with high fidelity and detail. All other methods including the fully supervised baselines fall behind the proposed method.
228
+
229
+ Ablation studies We perform three ablation studies: 1) As both the MCG term and the projection term contain information about the measurement $\textbf { { y } }$ , we observe the contribution of each term to the fixed solution. To further clarify the efficacy of the gradient step combined with Tweedie’s denoising, we also consider the case where the gradient of the log likelihood is computed not in the noiseless regime, but in the noise level matching the current iteration. Specifically, we define $\pmb { x } _ { i - 1 } ^ { \prime } : = \pmb { f } ( \pmb { x } _ { i } , \pmb { s } _ { \theta } ) + g ( \pmb { x } _ { i } ) z$ , $\ z \sim$ $\bar { \mathcal { N } } ( 0 , \pmb { I } )$ , ${ \pmb y } _ { i - 1 } \sim p ( { \pmb y } _ { i - 1 } | { \pmb y } _ { 0 } )$ , and implement the gradient step as $\nabla _ { \pmb { x } _ { i } } \| \pmb { y } _ { i - 1 } - \pmb { H } \pmb { x } _ { i - 1 } ^ { \prime } \| _ { 2 } ^ { 2 }$ . 2) As the performance of diffusion models depend heavily on the number of NFEs, we observe the trade-off of each diffusion model when varying the NFE from 20 to 1000. Moreover, for completeness, we measure the runtime of each algorithms including the non-diffusion based methods in wall-clock time computed with a commodity GPU in Table. 4. 3) Setting $\alpha = 0 . 0$ reduces our method to [9]. We show the difference in the performance by varying the values of $\alpha$ .
230
+
231
+ Table 4: Runtime for each algorithm in Wall-clock time: Computed with a single GTX 1080Ti GPU.
232
+
233
+ <table><tr><td rowspan=1 colspan=1>Method Wall-clock time [s]</td></tr><tr><td rowspan=1 colspan=1>Score-SDE [41] 38.68RePAINT[32] 247.6</td></tr><tr><td rowspan=1 colspan=1>DDRM[25] 2.117</td></tr><tr><td rowspan=1 colspan=1>LaMa [43] 0.629</td></tr><tr><td rowspan=1 colspan=1>AOT-GAN [52] 0.082</td></tr><tr><td rowspan=1 colspan=1>ICT[49] 144.6</td></tr><tr><td rowspan=1 colspan=1>DSI[35] 36.64</td></tr><tr><td rowspan=1 colspan=1>IAGAN [20] 518.47</td></tr><tr><td rowspan=1 colspan=1>Ours 81.59</td></tr></table>
234
+
235
+ First, we see in Table. 5 that using only the MCG step leads to improved performance in terms of LPIPS, but introduces error in the measurement consistency (measured with MSE). Combining both the projection and MCG leads to perfect data consistency along with further improved
236
+
237
+ Table 5: LPIPS & Measurement consistency (MC) vs. method
238
+
239
+ <table><tr><td>Method</td><td colspan="2">LPIPS(↓) MSE(MC)</td></tr><tr><td>Proj.</td><td>0.138</td><td>0</td></tr><tr><td>Vllyi-1-Hx-1ll2</td><td>0.271</td><td>12.99</td></tr><tr><td>Vaillyi-1-Hx-ill2+Proj.</td><td>0.128</td><td>0</td></tr><tr><td>Vally-Hxoll2</td><td>0.124</td><td>10.7</td></tr><tr><td>Vxlly-Hxoll2+Proj. (Ours)</td><td>0.089</td><td>0</td></tr></table>
240
+
241
+ ![](images/26cbce0829991aad732a94cd964c769ac48b1a4b49d87a1588498477a727615f.jpg)
242
+ Figure 5: Ablation studies performed with box inpainting task on FFHQ $2 5 6 \times 2 5 6$ data.
243
+
244
+ reconstruction. When considering gradient steps without Tweedie’s denoising (i.e. keeping the noise level at the $i ^ { \mathrm { { t h } } }$ step), the performance heavily degrades, especially when implemented without the projection steps. Here, we see that the proposed denoising step to utilize $\scriptstyle { \hat { \mathbf { x } } } _ { 0 }$ is indeed the key to the superior performance.
245
+
246
+ Second, looking at Fig. 5a, we immediately see that the graph of MCG stays in the lowest (best) LPIPS regime across all NFEs by a large margin, except for when the NFE drops below 100. Here, DDRM [25] takes over the 1st place - allegedly due to the DDIM sampling strategy they take. The performance of RePAINT deteriorates rapidly as we decrease NFE. Furthermore, we observe that the LPIPS of score-SDE [41] actually increases (i.e. worsen), as we increase the number of NFEs from a few hundred to one thousand. This suggests that the inference process that score-SDE takes (i.e. projection only) is inherently flawed, and cannot be corrected by taking small enough steps. In Table. 4, we list the runtime of all the methods that were used for comparison in the task of inpainting. Note that the proposed method takes longer for compute than score-SDE albeit having the same NFE. The gap is due to the backpropagation steps that are required for the MCG step, where the gap can be potentially ameliorated by switching to JAX [6] implementation from the current PyTorch implementation.
247
+
248
+ Lastly, we observe the difference in the performance as we vary the values of $\alpha$ . Implementation-wise, we find that we yield superior results when normalizing the squared norm with the norm of itself (e.g. $\alpha = \alpha ^ { \prime } / \lVert \dot { \mathbf { W } } ( \pmb { y } - \hat { \pmb { H } } \hat { \pmb { x } } _ { 0 } ) \rVert$ , where $\alpha ^ { \prime }$ is some constant). In order to avoid cluttered notation, we instead experiment with changing the values of $\alpha ^ { \prime }$ in Fig. 5b. Inspecting Fig. 5b, we see that $\alpha$ values within the range [0.1, 1.0] produce satisfactory results. $\alpha$ values that are too low do not fully enjoy the advantages of MCG and collapses to the projection-only method, while using too high values of $\alpha$ results in exploding gradients, and the reconstruction saturates.
249
+
250
+ Properties of our method Our proposed method is fully unsupervised and is not trained on solving a specific inverse problem. For example, our box masks and random masks have very different forms of erasing the pixel values. Nevertheless, our method generalizes perfectly well to such different measurement conditions, while other methods have a large performance gap between the different mask shapes. We further note two appealing properties of our method as an inverse problem solver: 1) the ability to generate multiple solutions given a condition, and 2) the ability to maintain perfect measurement consistency. The former ability often lacks in supervised learningbased methods [43, 50], and the latter is often not satisfied for some unsupervised GAN-based solutions [10, 4].
251
+
252
+ # 6 Conclusion
253
+
254
+ In this work, we proposed a general framework that can greatly enhance the performance of the diffusion model-based solvers for solving inverse problems. We showed several promising applications - inpainting, colorization, sparse view CT reconstruction, and showed that our method can outperform the current state-of-the-art methods. We analyzed our method theoretically and show that
255
+
256
+ MCG prevents the data generation process from falling off the manifold, thereby reducing the errors that might accumulate at every step. Further, we showed that MCG controls the direction tangent to the data manifold, whereas the score function controls the direction that is normal, such that the two components complement each other.
257
+
258
+ Limitations and Broader Impact The proposed method is inherently stochastic since the diffusion model is the main workhorse of the algorithm. When the dimension $m$ is pushed to low values, at times, our method fails to produce high quality reconstructions, albeit being better than the other methods overall. For extreme cases of inpainting (e.g. Half masks) with the ImageNet model, we often observe artifacts in our reconstruction (e.g. generating perfectly symmetric images), which we discuss in further detail in Sec. E. We note that our method is slow to sample from, inheriting the existing limitations of diffusion models. This would likely benefit from leveraging recent solvers aimed at accelerating the inference speed of diffusion models. In line with the arguments of other generative model-based inverse problem solvers, our method is a solver that relies heavily on the underlying diffusion model, and can thus potentially create malicious content such as deepfakes. Further, the reconstructions could intensify the social bias that is already existent in the training dataset.
259
+
260
+ # Acknowledgments and Disclosure of Funding
261
+
262
+ This research was supported by Field-oriented Technology Development Project for Customs Administration through National Research Foundation of Korea(NRF) funded by the Ministry of Science & ICT and Korea Customs Service (NRF-2021M3I1A1097938, NRF-2021M3I1A1097910), by the Korea Health Technology R&D Project through the Korea Health Industry Development Institute (KHIDI), which is funded by the Ministry of Health & Welfare, Republic of Korea (grant number: HU21C0222), and by the KAIST Key Research Institute (Interdisciplinary Research Group) Project.
263
+
264
+ # References
265
+
266
+ [1] Brian DO Anderson. Reverse-time diffusion equation models. Stochastic Processes and their Applications, 12(3):313–326, 1982.
267
+ [2] Lynton Ardizzone, Carsten Lüth, Jakob Kruse, Carsten Rother, and Ullrich Köthe. Guided image generation with conditional invertible neural networks. arXiv preprint arXiv:1907.02392, 2019.
268
+ [3] Amir Beck and Marc Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM journal on imaging sciences, 2(1):183–202, 2009.
269
+ [4] Ashish Bora, Ajil Jalal, Eric Price, and Alexandros G Dimakis. Compressed sensing using generative models. In International Conference on Machine Learning, pages 537–546. PMLR, 2017.
270
+ [5] Stephen Boyd, Neal Parikh, Eric Chu, Borja Peleato, Jonathan Eckstein, et al. Distributed optimization and statistical learning via the alternating direction method of multipliers. Foundations and Trends® in Machine learning, 3(1):1–122, 2011.
271
+ [6] James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao Zhang. JAX: composable transformations of Python+NumPy programs, 2018.
272
+ [7] Thorsten M Buzug. Computed tomography. In Springer handbook of medical technology, pages 311–342. Springer, 2011.
273
+ [8] Jooyoung Choi, Sungwon Kim, Yonghyun Jeong, Youngjune Gwon, and Sungroh Yoon. ILVR: Conditioning method for denoising diffusion probabilistic models. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), 2021.
274
+ [9] Hyungjin Chung, Byeongsu Sim, and Jong Chul Ye. Come-Closer-Diffuse-Faster: Accelerating Conditional Diffusion Models for Inverse Problems through Stochastic Contraction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2022.
275
+
276
+ [10] Giannis Daras, Joseph Dean, Ajil Jalal, and Alexandros G Dimakis. Intermediate layer optimization for inverse problems using deep generative models. In International Conference on Machine Learning, 2021.
277
+
278
+ [11] Valentin De Bortoli, Alain Durmus, Marcelo Pereyra, and Ana Fernandez Vidal. Maximum likelihood estimation of regularization parameters in high-dimensional inverse problems: an empirical bayesian approach. part ii: Theoretical analysis. SIAM Journal on Imaging Sciences, 13(4):1990–2028, 2020.
279
+
280
+ [12] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A largescale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009.
281
+
282
+ [13] Prafulla Dhariwal and Alexander Quinn Nichol. Diffusion models beat GANs on image synthesis. In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, 2021.
283
+
284
+ [14] Bradley Efron. Tweedie’s formula and selection bias. Journal of the American Statistical Association, 106(496):1602–1614, 2011.
285
+
286
+ [15] Muhammad Usman Ghani and W Clem Karl. Deep learning-based sinogram completion for low-dose ct. In 2018 IEEE 13th Image, Video, and Multidimensional Signal Processing Workshop (IVMSP), pages 1–5. IEEE, 2018.
287
+
288
+ [16] Richard Gordon, Robert Bender, and Gabor T Herman. Algebraic reconstruction techniques (art) for three-dimensional electron microscopy and x-ray photography. Journal of theoretical Biology, 29(3):471–481, 1970.
289
+
290
+ [17] Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In I. Guyon, U. Von Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017.
291
+
292
+ [18] Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems, volume 33, pages 6840–6851, 2020.
293
+
294
+ [19] Jonathan Ho, Tim Salimans, Alexey Gritsenko, William Chan, Mohammad Norouzi, and David J Fleet. Video diffusion models. arXiv preprint arXiv:2204.03458, 2022.
295
+
296
+ [20] Shady Abu Hussein, Tom Tirer, and Raja Giryes. Image-adaptive gan based reconstruction. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 3121–3129, 2020.
297
+
298
+ [21] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1125–1134, 2017.
299
+
300
+ [22] Zahra Kadkhodaie and Eero Simoncelli. Stochastic solutions for linear inverse problems using the prior implicit in a denoiser. In Advances in Neural Information Processing Systems, volume 34, pages 13242–13254. Curran Associates, Inc., 2021.
301
+
302
+ [23] Eunhee Kang, Junhong Min, and Jong Chul Ye. A deep convolutional neural network using directional wavelets for low-dose $\mathbf { X }$ -ray ct reconstruction. Medical physics, 44(10):e360–e375, 2017.
303
+
304
+ [24] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 4401–4410, 2019.
305
+
306
+ [25] Bahjat Kawar, Michael Elad, Stefano Ermon, and Jiaming Song. Denoising diffusion restoration models. In ICLR Workshop on Deep Generative Models for Highly Structured Data, 2022.
307
+
308
+ [26] Bahjat Kawar, Gregory Vaksman, and Michael Elad. Snips: Solving noisy inverse problems stochastically. Advances in Neural Information Processing Systems, 34:21757–21769, 2021.
309
+
310
+ [27] Daniil Kazantsev, Edoardo Pasca, Martin J Turner, and Philip J Withers. Ccpi-regularisation toolkit for computed tomographic image reconstruction with proximal splitting algorithms. SoftwareX, 9:317–323, 2019.
311
+ [28] Kwanyoung Kim and Jong Chul Ye. Noise2score: Tweedie’s approach to self-supervised image denoising without clean images. In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, 2021.
312
+ [29] Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In 2nd International Conference on Learning Representations, ICLR, 2014.
313
+ [30] Rémi Laumont, Valentin De Bortoli, Andrés Almansa, Julie Delon, Alain Durmus, and Marcelo Pereyra. Bayesian imaging using plug & play priors: when langevin meets tweedie. SIAM Journal on Imaging Sciences, 15(2):701–737, 2022.
314
+ [31] Beatrice Laurent and Pascal Massart. Adaptive estimation of a quadratic functional by model selection. Annals of Statistics, pages 1302–1338, 2000.
315
+ [32] Andreas Lugmayr, Martin Danelljan, Andres Romero, Fisher Yu, Radu Timofte, and Luc Van Gool. RePaint: Inpainting using Denoising Diffusion Probabilistic Models. arXiv preprint arXiv:2201.09865, 2022.
316
+ [33] Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. In Proceedings of the IEEE international conference on computer vision, pages 2794–2802, 2017.
317
+ [34] Frank Ong, Peyman Milanfar, and Pascal Getreuer. Local kernels that approximate bayesian regularization and proximal operators. IEEE Transactions on Image Processing, 28(6):3007– 3019, 2019.
318
+ [35] Jialun Peng, Dong Liu, Songcen Xu, and Houqiang Li. Generating diverse structure for image inpainting with hierarchical VQ-VAE. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10775–10784, 2021.
319
+ [36] Ali Razavi, Aaron Van den Oord, and Oriol Vinyals. Generating diverse high-fidelity images with vq-vae-2. Advances in neural information processing systems, 32, 2019.
320
+ [37] Herbert E Robbins. An empirical bayes approach to statistics. In Breakthroughs in statistics, pages 388–394. Springer, 1992.
321
+ [38] Simo Särkkä and Arno Solin. Applied stochastic differential equations, volume 10. Cambridge University Press, 2019.
322
+ [39] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In 3rd International Conference on Learning Representations, ICLR, 2015.
323
+ [40] Yang Song, Liyue Shen, Lei Xing, and Stefano Ermon. Solving inverse problems in medical imaging with score-based generative models. In International Conference on Learning Representations, 2022.
324
+ [41] Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. In 9th International Conference on Learning Representations, ICLR, 2021.
325
+ [42] Charles M Stein. Estimation of the mean of a multivariate normal distribution. The annals of Statistics, pages 1135–1151, 1981.
326
+ [43] Roman Suvorov, Elizaveta Logacheva, Anton Mashikhin, Anastasia Remizova, Arsenii Ashukha, Aleksei Silvestrov, Naejin Kong, Harshith Goka, Kiwoong Park, and Victor Lempitsky. Resolution-robust large mask inpainting with fourier convolutions. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 2149–2159, 2022.
327
+ [44] Tom Tirer and Raja Giryes. Image restoration by iterative denoising and backward projections. IEEE Transactions on Image Processing, 28(3):1220–1234, 2018.
328
+
329
+ [45] Github PK Tool, Nov Sun Mon Tue Wed Thu, and Fri Sat. dkazanc/tomobar.
330
+
331
+ [46] Aaron Van Den Oord, Oriol Vinyals, et al. Neural discrete representation learning. Advances in neural information processing systems, 30, 2017.
332
+
333
+ [47] Singanallur V Venkatakrishnan, Charles A Bouman, and Brendt Wohlberg. Plug-and-play priors for model based reconstruction. In 2013 IEEE Global Conference on Signal and Information Processing, pages 945–948. IEEE, 2013.
334
+
335
+ [48] Ana Fernandez Vidal, Valentin De Bortoli, Marcelo Pereyra, and Alain Durmus. Maximum likelihood estimation of regularization parameters in high-dimensional inverse problems: An empirical bayesian approach part i: Methodology and experiments. SIAM Journal on Imaging Sciences, 13(4):1945–1989, 2020.
336
+
337
+ [49] Ziyu Wan, Jingbo Zhang, Dongdong Chen, and Jing Liao. High-fidelity pluralistic image completion with transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 4692–4701, 2021.
338
+
339
+ [50] Haoyu Wei, Florian Schiffers, Tobias Würfl, Daming Shen, Daniel Kim, Aggelos K Katsaggelos, and Oliver Cossairt. 2-step sparse-view ct reconstruction with a domain-specific perceptual network. arXiv preprint arXiv:2012.04743, 2020.
340
+
341
+ [51] Fisher Yu, Ari Seff, Yinda Zhang, Shuran Song, Thomas Funkhouser, and Jianxiong Xiao. Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015.
342
+
343
+ [52] Yanhong Zeng, Jianlong Fu, Hongyang Chao, and Baining Guo. Aggregated contextual transformations for high-resolution image inpainting. IEEE Transactions on Visualization and Computer Graphics, 2022.
344
+
345
+ [53] Kai Zhang, Wangmeng Zuo, Shuhang Gu, and Lei Zhang. Learning deep cnn denoiser prior for image restoration. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3929–3938, 2017.
346
+
347
+ [54] Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 586–595, 2018.
348
+
349
+ [55] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE international conference on computer vision, pages 2223–2232, 2017.
350
+
351
+ # Checklist
352
+
353
+ 1. For all authors...
354
+
355
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
356
+ (b) Did you describe the limitations of your work? [Yes] We discuss the limitations in (6).
357
+ (c) Did you discuss any potential negative societal impacts of your work? [Yes] We discuss potential negative impacts in (6).
358
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
359
+
360
+ 2. If you are including theoretical results...
361
+
362
+ (a) Did you state the full set of assumptions of all theoretical results? [Yes] (b) Did you include complete proofs of all theoretical results? [Yes] We provide all proofs of results in supplementary material.
363
+
364
+ 3. If you ran experiments...
365
+
366
+ (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] We include all code for our experiments in the supplementary material. We will release the code once the paper is published.
367
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
368
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] Due to our limited resources we do not have time to run multiple sets of experiments.
369
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes]
370
+
371
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
372
+
373
+ (a) If your work uses existing assets, did you cite the creators? [Yes] We have cited the original works that released the datasets.
374
+ (b) Did you mention the license of the assets? [No] Licenses are standard and can be found online.
375
+ (c) Did you include any new assets either in the supplemental material or as a URL? [Yes] We include our implementation as the supplementary material. We will release the code upon publication.
376
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [No] All datasets used in our work are publicly available.
377
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
378
+
379
+ 5. If you used crowdsourcing or conducted research with human subjects...
380
+
381
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
382
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
383
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
parse/dev/nJJjv0JDJju/nJJjv0JDJju_content_list.json ADDED
@@ -0,0 +1,1782 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "type": "text",
4
+ "text": "Improving Diffusion Models for Inverse Problems using Manifold Constraints ",
5
+ "text_level": 1,
6
+ "bbox": [
7
+ 197,
8
+ 122,
9
+ 800,
10
+ 172
11
+ ],
12
+ "page_idx": 0
13
+ },
14
+ {
15
+ "type": "text",
16
+ "text": "Hyungjin Chung∗,1 ",
17
+ "text_level": 1,
18
+ "bbox": [
19
+ 209,
20
+ 224,
21
+ 344,
22
+ 241
23
+ ],
24
+ "page_idx": 0
25
+ },
26
+ {
27
+ "type": "text",
28
+ "text": "Byeongsu $\\mathbf { S i m ^ { * , 2 } }$ ",
29
+ "bbox": [
30
+ 379,
31
+ 226,
32
+ 498,
33
+ 241
34
+ ],
35
+ "page_idx": 0
36
+ },
37
+ {
38
+ "type": "text",
39
+ "text": "Dohoon Ryu1 ",
40
+ "bbox": [
41
+ 532,
42
+ 226,
43
+ 629,
44
+ 241
45
+ ],
46
+ "page_idx": 0
47
+ },
48
+ {
49
+ "type": "text",
50
+ "text": "Jong Chul Ye3,1,2 ",
51
+ "bbox": [
52
+ 663,
53
+ 224,
54
+ 787,
55
+ 241
56
+ ],
57
+ "page_idx": 0
58
+ },
59
+ {
60
+ "type": "text",
61
+ "text": "1 Dept. of Bio and Brain Engineering 2 Dept. of Mathematical Sciences 3Kim Jaechul Graduate School of AI ∗Equal contribution ",
62
+ "bbox": [
63
+ 377,
64
+ 241,
65
+ 622,
66
+ 296
67
+ ],
68
+ "page_idx": 0
69
+ },
70
+ {
71
+ "type": "text",
72
+ "text": "Korea Advanced Institute of Science and Technology (KAIST) {hj.chung, byeongsu.s, dh.ryu, jong.ye}@kaist.ac.kr ",
73
+ "bbox": [
74
+ 251,
75
+ 297,
76
+ 746,
77
+ 325
78
+ ],
79
+ "page_idx": 0
80
+ },
81
+ {
82
+ "type": "text",
83
+ "text": "Abstract ",
84
+ "text_level": 1,
85
+ "bbox": [
86
+ 462,
87
+ 361,
88
+ 535,
89
+ 377
90
+ ],
91
+ "page_idx": 0
92
+ },
93
+ {
94
+ "type": "text",
95
+ "text": "Recently, diffusion models have been used to solve various inverse problems in an unsupervised manner with appropriate modifications to the sampling process. However, the current solvers, which recursively apply a reverse diffusion step followed by a projection-based measurement consistency step, often produce suboptimal results. By studying the generative sampling path, here we show that current solvers throw the sample path off the data manifold, and hence the error accumulates. To address this, we propose an additional correction term inspired by the manifold constraint, which can be used synergistically with the previous solvers to make the iterations close to the manifold. The proposed manifold constraint is straightforward to implement within a few lines of code, yet boosts the performance by a surprisingly large margin. With extensive experiments, we show that our method is superior to the previous methods both theoretically and empirically, producing promising results in many applications such as image inpainting, colorization, and sparse-view computed tomography. Code available here ",
96
+ "bbox": [
97
+ 233,
98
+ 395,
99
+ 766,
100
+ 602
101
+ ],
102
+ "page_idx": 0
103
+ },
104
+ {
105
+ "type": "text",
106
+ "text": "1 Introduction ",
107
+ "text_level": 1,
108
+ "bbox": [
109
+ 174,
110
+ 635,
111
+ 310,
112
+ 651
113
+ ],
114
+ "page_idx": 0
115
+ },
116
+ {
117
+ "type": "text",
118
+ "text": "Diffusion models have shown impressive performance both as generative models themselves [41, 13], and also as unsupervised inverse problem solvers [41, 8, 9, 25] that do not require problem-specific training. Specifically, given a pre-trained unconditional score function (i.e. denoiser), solving the reverse stochastic differential equation (SDE) numerically would amount to sampling from the data generating distribution [41]. For many different inverse problems (e.g. super-resolution [8, 9], inpainting [41, 9], compressed-sensing MRI (CS-MRI) [40, 9], sparse view CT (SV-CT) [40], etc.), it was shown that simple incorporation of the measurement process produces satisfactory conditional samples, even when the model was not trained for the specific problem. ",
119
+ "bbox": [
120
+ 174,
121
+ 669,
122
+ 825,
123
+ 780
124
+ ],
125
+ "page_idx": 0
126
+ },
127
+ {
128
+ "type": "text",
129
+ "text": "Nevertheless, for certain problems (e.g. inpainting), currently used algorithms often produce unsatisfactory results when implemented naively (e.g. boundary artifacts, as shown in Fig. 1 (b)). The authors in [32] showed that in order to produce high quality reconstructions, one needs to iterate back and forth between the noising and the denoising step at least $> 1 0$ times per iteration. These iterations are computationally demanding and should be avoided, considering that diffusion models are slow to sample from even without such iterations. On the other hand, a classic result of Tweedie’s formula [37, 42] shows that one can perform Bayes optimal denoising in one step, once we know the gradient of the log density. Extending such result, it was recently shown that one can indeed perform a single-step denoising with learned score functions for denoising problems from the general exponential family [28]. ",
130
+ "bbox": [
131
+ 174,
132
+ 786,
133
+ 825,
134
+ 897
135
+ ],
136
+ "page_idx": 0
137
+ },
138
+ {
139
+ "type": "image",
140
+ "img_path": "images/d46a0a72e1f55b9ccd673c15a2514b6f8b732b934f8b5da5716869d6f9367d28.jpg",
141
+ "image_caption": [
142
+ "Figure 1: Visual schematic of the MCG correction step. (a) $\\textcircled{1}$ Unconditional reverse diffusion generates $\\mathbf { \\Delta } _ { \\mathbf { \\mathcal { X } } _ { i } }$ ; $\\textcircled { 2 } Q _ { i }$ maps the noisy $\\mathbf { \\Delta } _ { \\mathbf { \\mathcal { X } } _ { i } }$ to generate $\\scriptstyle { \\hat { \\mathbf { x } } } _ { 0 }$ ; $\\textcircled{3}$ Manifold Constrained Gradient (MCG) $\\begin{array} { r l } { \\frac { \\partial } { \\partial { \\bf x } _ { i } } \\| { \\bf W } ( { \\bf y } - { \\bf H } \\hat { \\bf x } _ { 0 } ) \\| _ { 2 } ^ { 2 } } \\end{array}$ is applied to fix the iteration on manifold; $\\textcircled{4}$ Takes the orthogonal complement; $\\textcircled{5}$ Samples from $p ( \\pmb { y } _ { i } | \\pmb { y } )$ , then combines $\\pmb { A x } _ { i - 1 } ^ { \\prime }$ and $\\mathbf { \\nabla } _ { \\mathbf { \\boldsymbol { y } } _ { i } }$ . (b) Representative results of inpainting, compared with score-SDE [41]. Reconstructions with score-SDE produce incoherent results, while our method produces high fidelity solutions. "
143
+ ],
144
+ "image_footnote": [],
145
+ "bbox": [
146
+ 186,
147
+ 102,
148
+ 823,
149
+ 222
150
+ ],
151
+ "page_idx": 1
152
+ },
153
+ {
154
+ "type": "text",
155
+ "text": "",
156
+ "bbox": [
157
+ 174,
158
+ 340,
159
+ 823,
160
+ 369
161
+ ],
162
+ "page_idx": 1
163
+ },
164
+ {
165
+ "type": "text",
166
+ "text": "In this work, we leverage the denoising result through Tweedie’s formula and show that such denoised samples can be the key to significantly improving the performance of reconstruction using diffusion models across arbitrary linear inverse problems, despite the simplicity in the implementation. Moreover, we theoretically prove that if the score function estimation is globally optimal, the correction term from the manifold constraint enforces the sample path to stay on the plane tangent to the data manifold1, so by combining with the reverse diffusion step, the solution becomes more stable and accurate. ",
167
+ "bbox": [
168
+ 173,
169
+ 375,
170
+ 825,
171
+ 473
172
+ ],
173
+ "page_idx": 1
174
+ },
175
+ {
176
+ "type": "text",
177
+ "text": "2 Related Works ",
178
+ "text_level": 1,
179
+ "bbox": [
180
+ 176,
181
+ 492,
182
+ 330,
183
+ 508
184
+ ],
185
+ "page_idx": 1
186
+ },
187
+ {
188
+ "type": "text",
189
+ "text": "2.1 Diffusion Models ",
190
+ "text_level": 1,
191
+ "bbox": [
192
+ 174,
193
+ 522,
194
+ 331,
195
+ 537
196
+ ],
197
+ "page_idx": 1
198
+ },
199
+ {
200
+ "type": "text",
201
+ "text": "Continuous Form For a continuous diffusion process $\\pmb { x } ( t ) \\in \\mathbb { R } ^ { n } , t \\in [ 0 , 1 ]$ , we set $x ( 0 ) \\sim$ $p _ { 0 } ( { \\pmb x } ) = p _ { d a t a }$ , where $p _ { d a t a }$ represents the data distribution of interest, and $\\pmb { x } ( \\bar { 1 } ) \\sim p _ { 1 } ( \\pmb { x } )$ , with $p _ { 1 } ( { \\pmb x } )$ approximating spherical Gaussian distribution, containing no information of data. Here, the forward noising process is defined with the following Itˆo stochastic differential equation (SDE) [41]: ",
202
+ "bbox": [
203
+ 173,
204
+ 547,
205
+ 825,
206
+ 604
207
+ ],
208
+ "page_idx": 1
209
+ },
210
+ {
211
+ "type": "equation",
212
+ "img_path": "images/6f8f5f7b1a21da6d626a220dfd1dfdbad6f62c3f030aeddb4a51b080e95e8760.jpg",
213
+ "text": "$$\n\\begin{array} { r } { d { \\pmb x } = \\bar { \\pmb f } ( { \\pmb x } , t ) d t + \\bar { \\pmb g } ( t ) d { \\pmb w } , } \\end{array}\n$$",
214
+ "text_format": "latex",
215
+ "bbox": [
216
+ 408,
217
+ 608,
218
+ 588,
219
+ 627
220
+ ],
221
+ "page_idx": 1
222
+ },
223
+ {
224
+ "type": "text",
225
+ "text": "with $\\bar { \\pmb f } : \\mathbb { R } ^ { d } \\mapsto \\mathbb { R } ^ { d }$ defining the linear drift function, $\\bar { g } ( t ) : \\mathbb { R } \\mapsto \\mathbb { R }$ defining a scalar diffusion coefficient, and $\\pmb { w } \\in \\mathbb { R } ^ { n }$ denoting the standard $n -$ dimensional Wiener process. The forward SDE in (1) is coupled with the following reverse SDE by the Anderson’s theorem [1, 41]: ",
226
+ "bbox": [
227
+ 173,
228
+ 632,
229
+ 825,
230
+ 676
231
+ ],
232
+ "page_idx": 1
233
+ },
234
+ {
235
+ "type": "equation",
236
+ "img_path": "images/bc79864c6d627100236e11987d90368d7ded1137e227a489cb00aeed77c7ed29.jpg",
237
+ "text": "$$\n\\begin{array} { r } { d \\pmb { x } = [ \\pmb { \\bar { f } } ( \\pmb { x } , t ) - \\bar { g } ( t ) ^ { 2 } \\nabla _ { \\pmb { x } } \\log p _ { t } ( \\pmb { x } ) ] d t + \\bar { g } ( t ) d \\bar { w } , } \\end{array}\n$$",
238
+ "text_format": "latex",
239
+ "bbox": [
240
+ 333,
241
+ 680,
242
+ 663,
243
+ 699
244
+ ],
245
+ "page_idx": 1
246
+ },
247
+ {
248
+ "type": "text",
249
+ "text": "with $d t$ denoting the infinitesimal negative time step, and $\\bar { \\mathbf { \\Gamma } } _ { \\bar { \\mathbf { \\Gamma } } } ^ { \\bar { \\mathbf { \\Gamma } } } \\bar { \\mathbf { \\Gamma } } _ { \\bar { \\mathbf { \\Gamma } } } ^ { \\bar { \\mathbf { \\Gamma } } }$ defining the standard Wiener process running backward in time. Note that the reverse SDE defines the generative process through the score function $\\nabla _ { \\pmb { x } } \\log \\ p _ { t } ( \\pmb { x } )$ , which in practice, is typically replaced with $\\nabla _ { \\pmb { x } } \\log p _ { 0 t } ( \\pmb { x } ( t ) | \\pmb { x } ( 0 ) )$ to minimize the following denoising score-matching objective ",
250
+ "bbox": [
251
+ 174,
252
+ 704,
253
+ 825,
254
+ 761
255
+ ],
256
+ "page_idx": 1
257
+ },
258
+ {
259
+ "type": "equation",
260
+ "img_path": "images/f19ca9474be156ffa64bea5822c4b4ea929d2b23c4b9c3c915d5fb9d162d13b4.jpg",
261
+ "text": "$$\n\\operatorname* { m i n } _ { \\theta } \\mathbb { E } _ { t \\sim U ( \\varepsilon , 1 ) , x ( 0 ) \\sim p _ { 0 } ( x ) , x ( t ) \\sim p _ { 0 t } ( x ( t ) | x ( 0 ) ) } \\left[ \\| s _ { \\theta } ( x ( t ) , t ) - \\nabla _ { x _ { t } } \\log p _ { 0 t } ( x ( t ) | x ( 0 ) ) \\| _ { 2 } ^ { 2 } \\right] .\n$$",
262
+ "text_format": "latex",
263
+ "bbox": [
264
+ 199,
265
+ 765,
266
+ 777,
267
+ 785
268
+ ],
269
+ "page_idx": 1
270
+ },
271
+ {
272
+ "type": "text",
273
+ "text": "Once the parameter $\\theta ^ { * }$ for the score function is estimated, one can replace the score function in (2) with $s _ { \\theta ^ { * } } ( \\bar { { \\boldsymbol { x } } } ( t ) , t )$ to solve the reverse SDE [41]. ",
274
+ "bbox": [
275
+ 174,
276
+ 794,
277
+ 825,
278
+ 823
279
+ ],
280
+ "page_idx": 1
281
+ },
282
+ {
283
+ "type": "text",
284
+ "text": "Discrete Form Due to the linearity of $\\bar { \\pmb f }$ and $\\bar { g }$ , the forward diffusion step can be implemented with a simple reparameterization trick [29]. Namely, the general form of the forward diffusion is ",
285
+ "bbox": [
286
+ 174,
287
+ 835,
288
+ 825,
289
+ 866
290
+ ],
291
+ "page_idx": 1
292
+ },
293
+ {
294
+ "type": "equation",
295
+ "img_path": "images/8c34c0876fa12039f52f7c77970d4c9f8b75080795b310d7ae9c927f7181f2f2.jpg",
296
+ "text": "$$\n\\begin{array} { r } { \\pmb { x } _ { i } = a _ { i } \\pmb { x } _ { 0 } + b _ { i } \\pmb { z } , \\quad \\pmb { z } \\sim \\mathcal { N } ( 0 , \\pmb { I } ) , } \\end{array}\n$$",
297
+ "text_format": "latex",
298
+ "bbox": [
299
+ 383,
300
+ 871,
301
+ 614,
302
+ 887
303
+ ],
304
+ "page_idx": 1
305
+ },
306
+ {
307
+ "type": "text",
308
+ "text": "where we have replaced the continuous index $t \\in [ 0 , 1 ]$ with the discrete index $i \\in \\mathbb N$ . On the other hand, the discrete reverse diffusion step can in general be represented as ",
309
+ "bbox": [
310
+ 169,
311
+ 90,
312
+ 823,
313
+ 119
314
+ ],
315
+ "page_idx": 2
316
+ },
317
+ {
318
+ "type": "equation",
319
+ "img_path": "images/27cd8b387e46a3675a024baf83befaff71601e0683130eaa9b1b90b912e89df7.jpg",
320
+ "text": "$$\n\\begin{array} { r } { \\pmb { x } _ { i - 1 } = \\pmb { f } ( \\pmb { x } _ { i } , \\pmb { s } _ { \\theta ^ { * } } ) + g ( \\pmb { x } _ { i } ) \\pmb { z } , \\quad \\pmb { z } \\sim \\mathcal { N } ( 0 , \\pmb { I } ) , } \\end{array}\n$$",
321
+ "text_format": "latex",
322
+ "bbox": [
323
+ 343,
324
+ 126,
325
+ 653,
326
+ 143
327
+ ],
328
+ "page_idx": 2
329
+ },
330
+ {
331
+ "type": "text",
332
+ "text": "where we have replaced the ground truth score function with the trained one. We detail the choice of $a _ { i } , b _ { i } , f , g$ in Appendix. B. ",
333
+ "bbox": [
334
+ 173,
335
+ 150,
336
+ 826,
337
+ 179
338
+ ],
339
+ "page_idx": 2
340
+ },
341
+ {
342
+ "type": "text",
343
+ "text": "2.2 Conditional Generative models for Inverse problems ",
344
+ "text_level": 1,
345
+ "bbox": [
346
+ 173,
347
+ 194,
348
+ 576,
349
+ 209
350
+ ],
351
+ "page_idx": 2
352
+ },
353
+ {
354
+ "type": "text",
355
+ "text": "The main problem of our interest in this paper is the inverse problem, retrieving the unknown $\\pmb { x } \\in \\mathbb { R } ^ { n }$ from a measurement $\\textbf { { y } }$ : ",
356
+ "bbox": [
357
+ 174,
358
+ 219,
359
+ 823,
360
+ 248
361
+ ],
362
+ "page_idx": 2
363
+ },
364
+ {
365
+ "type": "equation",
366
+ "img_path": "images/b757cc7cf0bee8a9cced85b0c5e3297ef694a41d5ce499b6307ce96bf6680fe5.jpg",
367
+ "text": "$$\n\\pmb { y } = \\pmb { H } \\pmb { x } + \\epsilon , \\pmb { y } \\in \\mathbb { R } ^ { m } , \\pmb { H } \\in \\mathbb { R } ^ { m \\times n } ,\n$$",
368
+ "text_format": "latex",
369
+ "bbox": [
370
+ 366,
371
+ 253,
372
+ 629,
373
+ 272
374
+ ],
375
+ "page_idx": 2
376
+ },
377
+ {
378
+ "type": "text",
379
+ "text": "where $\\epsilon \\in \\mathbb { R } ^ { m }$ is the noise in the measurement. Accordingly, for the case of the inverse problems, our goal is to generate samples from a conditional distribution with respect to the measurement $\\textbf { { y } }$ , i.e. $p ( { \\pmb x } | { \\pmb y } )$ . Accordingly, the score function $\\nabla _ { \\pmb { x } } \\log p _ { t } ( \\pmb { x } )$ in (2) should be replaced by the conditional score $\\nabla _ { \\pmb { x } } \\log p _ { t } ( \\pmb { x } | \\pmb { y } )$ . Unfortunately, this strictly restricts the generalization capability of the neural network since the conditional score should be retrained whenever the conditions change. To address this, recent conditional diffusion models [22, 41, 8, 9] utilize the unconditional score function $\\nabla _ { \\pmb { x } } \\log p _ { t } ( \\pmb { x } )$ but rely on a projection-based measurement constraint to impose the conditions. Specifically, one can apply the following: ",
380
+ "bbox": [
381
+ 173,
382
+ 277,
383
+ 826,
384
+ 390
385
+ ],
386
+ "page_idx": 2
387
+ },
388
+ {
389
+ "type": "equation",
390
+ "img_path": "images/12ad267466de6bc481a1a60aff09edce9eb747a5eb9bd847a7136bfcdacccded.jpg",
391
+ "text": "$$\n\\begin{array} { r l } & { \\pmb { x } _ { i - 1 } ^ { \\prime } = \\pmb { f } ( \\pmb { x } _ { i } , s _ { \\theta } ) + g ( \\pmb { x } _ { i } ) \\pmb { z } , \\quad \\pmb { z } \\sim \\mathcal { N } ( 0 , \\pmb { I } ) , } \\\\ & { \\pmb { x } _ { i - 1 } = \\pmb { A } \\pmb { x } _ { i - 1 } ^ { \\prime } + \\pmb { b } _ { i } , } \\end{array}\n$$",
392
+ "text_format": "latex",
393
+ "bbox": [
394
+ 346,
395
+ 393,
396
+ 650,
397
+ 435
398
+ ],
399
+ "page_idx": 2
400
+ },
401
+ {
402
+ "type": "text",
403
+ "text": "where $A , b _ { i }$ are functions of $H , y$ , and $\\scriptstyle { \\mathbf { { \\vec { x } } } } _ { 0 }$ . Note that (7) is identical to the unconditional reverse diffusion step in (5), whereas (8) effectively imposes the condition. It was shown in [9] that any general contraction mapping (e.g. projection onto convex sets, gradient step) may be utilized as (8) to impose the constraint. ",
404
+ "bbox": [
405
+ 174,
406
+ 439,
407
+ 825,
408
+ 494
409
+ ],
410
+ "page_idx": 2
411
+ },
412
+ {
413
+ "type": "text",
414
+ "text": "Another recent work [25] advancing [26] establishes the state-of-the-art (SOTA) in solving noisy inverse problems with unconditional diffusion models, by running the conditional reverse diffusion process in the spectral domain achieved by performing singular value decomposition (SVD), and leveraging approximate gradient of the log likelihood term in the spectral space. The authors show that feasible solutions can be obtained with as small as 20 diffusion steps. ",
415
+ "bbox": [
416
+ 174,
417
+ 501,
418
+ 825,
419
+ 570
420
+ ],
421
+ "page_idx": 2
422
+ },
423
+ {
424
+ "type": "text",
425
+ "text": "Prior to the development of diffusion models, Plug-and-Play $( \\mathrm { P n P } )$ models [47, 53, 44] were used in a similar fashion by utilizing a general-purpose unconditional denoiser in the place of proximal mappings in model-based iterative reconstruction methods [5, 3]. Similarly, outside the context of diffusion models, iterative denoising followed by projection-based data consistency was proposed in [44]. In such view, diffusion models can be understood as generative variant of PnPs trained with multiple scales of noise. ",
426
+ "bbox": [
427
+ 173,
428
+ 575,
429
+ 825,
430
+ 661
431
+ ],
432
+ "page_idx": 2
433
+ },
434
+ {
435
+ "type": "text",
436
+ "text": "GAN-based solvers are also widly explored [4, 10, 20], where the pre-trained generators are tuned at the test time by optimizing over the latent, the parameters, or jointly. ",
437
+ "bbox": [
438
+ 173,
439
+ 665,
440
+ 825,
441
+ 695
442
+ ],
443
+ "page_idx": 2
444
+ },
445
+ {
446
+ "type": "text",
447
+ "text": "2.3 Tweedie’s formula for denoising ",
448
+ "text_level": 1,
449
+ "bbox": [
450
+ 174,
451
+ 710,
452
+ 436,
453
+ 726
454
+ ],
455
+ "page_idx": 2
456
+ },
457
+ {
458
+ "type": "text",
459
+ "text": "In the case of Gaussian noise, a classic result of Tweedie’s formula [37] tells us that one can achieve the denoised result by computing the posterior expectation: ",
460
+ "bbox": [
461
+ 173,
462
+ 736,
463
+ 823,
464
+ 765
465
+ ],
466
+ "page_idx": 2
467
+ },
468
+ {
469
+ "type": "equation",
470
+ "img_path": "images/5def132ebb579dc4e6171a9ee2d8f5985ba2db0f77d00e148677652dd3534175.jpg",
471
+ "text": "$$\n\\begin{array} { r } { \\mathbb { E } [ { \\pmb x } | { \\tilde { \\pmb x } } ] = \\tilde { \\pmb x } + \\sigma ^ { 2 } \\nabla _ { \\tilde { \\pmb x } } \\log p ( \\tilde { \\pmb x } ) , } \\end{array}\n$$",
472
+ "text_format": "latex",
473
+ "bbox": [
474
+ 395,
475
+ 770,
476
+ 599,
477
+ 789
478
+ ],
479
+ "page_idx": 2
480
+ },
481
+ {
482
+ "type": "text",
483
+ "text": "where the noise is modeled by $\\tilde { \\pmb { x } } \\sim \\mathcal { N } ( \\pmb { x } , \\sigma ^ { 2 } I )$ . If we consider a diffusion model in which the forward step is modeled as $\\pmb { x } _ { i } \\sim \\mathcal { N } ( a _ { i } \\pmb { x } _ { 0 } , b _ { i } ^ { 2 } I )$ (discrete form), the Tweedie’s formula can be rewritten as: ",
484
+ "bbox": [
485
+ 174,
486
+ 794,
487
+ 828,
488
+ 824
489
+ ],
490
+ "page_idx": 2
491
+ },
492
+ {
493
+ "type": "equation",
494
+ "img_path": "images/1ce95bc9c1bd39fac35c5990afde865840f0aae407aae7ea3f751e55c35fe4d5.jpg",
495
+ "text": "$$\n\\begin{array} { r } { \\mathbb { E } [ \\pmb { x } _ { 0 } | \\pmb { x } _ { i } ] = ( \\pmb { x } _ { i } + b _ { i } ^ { 2 } \\nabla _ { \\pmb { x } _ { i } } \\log p ( \\pmb { x } _ { i } ) ) / a _ { i } . } \\end{array}\n$$",
496
+ "text_format": "latex",
497
+ "bbox": [
498
+ 366,
499
+ 830,
500
+ 632,
501
+ 849
502
+ ],
503
+ "page_idx": 2
504
+ },
505
+ {
506
+ "type": "text",
507
+ "text": "Tweedie’s formula is in fact not only relevant to Gaussian denoising in the Bayesian framework, but have also been extended to be in close relation with kernel regression [34]. Moreover, it was shown that it can be applied to arbitrary exponential noise distributions beyond Gaussian [14, 28]. In the following, we use this key property to develop our algorithm. ",
508
+ "bbox": [
509
+ 174,
510
+ 854,
511
+ 825,
512
+ 911
513
+ ],
514
+ "page_idx": 2
515
+ },
516
+ {
517
+ "type": "text",
518
+ "text": "3 Conditional Diffusion using Manifold Constraints ",
519
+ "text_level": 1,
520
+ "bbox": [
521
+ 173,
522
+ 88,
523
+ 620,
524
+ 107
525
+ ],
526
+ "page_idx": 3
527
+ },
528
+ {
529
+ "type": "text",
530
+ "text": "Although our original motivation of using the measurement constraint step in (8) was to utilize the unconditionally trained score function in the reverse diffusion step in (7), there is room for imposing additional constraints while still using the unconditionally trained score function. ",
531
+ "bbox": [
532
+ 174,
533
+ 119,
534
+ 825,
535
+ 162
536
+ ],
537
+ "page_idx": 3
538
+ },
539
+ {
540
+ "type": "text",
541
+ "text": "Specifically, the Bayes rule $p ( { \\pmb x } | { \\pmb y } ) = p ( { \\pmb y } | { \\pmb x } ) p ( { \\pmb x } ) / p ( { \\pmb y } )$ leads to ",
542
+ "bbox": [
543
+ 169,
544
+ 167,
545
+ 596,
546
+ 184
547
+ ],
548
+ "page_idx": 3
549
+ },
550
+ {
551
+ "type": "equation",
552
+ "img_path": "images/9585ee8c7877a183af1d29e5417257b60540b4dc676f432b2dd3293235ae1506.jpg",
553
+ "text": "$$\n\\nabla _ { \\pmb { x } } \\log p ( \\pmb { x } | \\pmb { y } ) = \\nabla _ { \\pmb { x } } \\log p ( \\pmb { x } ) + \\nabla _ { \\pmb { x } } \\log p ( \\pmb { y } | \\pmb { x } ) .\n$$",
554
+ "text_format": "latex",
555
+ "bbox": [
556
+ 338,
557
+ 188,
558
+ 660,
559
+ 205
560
+ ],
561
+ "page_idx": 3
562
+ },
563
+ {
564
+ "type": "text",
565
+ "text": "Hence, the score function in the reverse SDE in (7) can be replaced by (11), leading to ",
566
+ "bbox": [
567
+ 168,
568
+ 209,
569
+ 740,
570
+ 226
571
+ ],
572
+ "page_idx": 3
573
+ },
574
+ {
575
+ "type": "equation",
576
+ "img_path": "images/28bf08b3da169e38380ef93e2f5c21bc98995e228a722beccf72688efb423d8b.jpg",
577
+ "text": "$$\nx _ { i - 1 } ^ { \\prime } = f ( x _ { i } , s _ { \\theta } ) - \\alpha \\frac { \\partial } { \\partial x _ { i } } \\| W ( y - H x _ { i } ) \\| _ { 2 } ^ { 2 } + g ( x _ { i } ) z , \\quad z \\sim \\mathcal { N } ( 0 , I )\n$$",
578
+ "text_format": "latex",
579
+ "bbox": [
580
+ 258,
581
+ 229,
582
+ 740,
583
+ 262
584
+ ],
585
+ "page_idx": 3
586
+ },
587
+ {
588
+ "type": "text",
589
+ "text": "where $\\alpha$ and $W$ depend on the noise covariance, if the noise $\\epsilon$ in (6) is Gaussian. ",
590
+ "bbox": [
591
+ 173,
592
+ 266,
593
+ 705,
594
+ 281
595
+ ],
596
+ "page_idx": 3
597
+ },
598
+ {
599
+ "type": "text",
600
+ "text": "Now, one of the important contributions of this paper is to reveal that the Bayes optimal denoising step in (10) from the Tweedie’s formula leads to a preferred condition both empirically and theoretically. Specifically, we define the set constraint for $\\mathbf { \\Delta } _ { \\mathbf { \\mathcal { X } } _ { i } }$ , called the manifold constrained gradient (MCG), so that the gradient of the measurement term stays on the manifold (see Theorem 1): ",
601
+ "bbox": [
602
+ 173,
603
+ 286,
604
+ 825,
605
+ 343
606
+ ],
607
+ "page_idx": 3
608
+ },
609
+ {
610
+ "type": "equation",
611
+ "img_path": "images/5c575c045a7857adbeef443d2efbc5a07f48ecfadc6d4dbaef6a6bfefd3f7cc6.jpg",
612
+ "text": "$$\n\\pmb { x } \\in \\mathcal { X } _ { i } , \\quad \\mathrm { w h e r e } \\quad \\mathcal { X } _ { i } = \\{ \\pmb { x } \\in \\mathbb { R } ^ { n } | \\pmb { x } = ( \\pmb { x } + b _ { i } ^ { 2 } \\pmb { s } _ { \\theta } ( \\pmb { x } , i ) ) / a _ { i } \\}\n$$",
613
+ "text_format": "latex",
614
+ "bbox": [
615
+ 292,
616
+ 347,
617
+ 705,
618
+ 366
619
+ ],
620
+ "page_idx": 3
621
+ },
622
+ {
623
+ "type": "text",
624
+ "text": "To deal with the potential deviation from the measurement consistency, we again impose the data consistency step (8). Putting them together, the discrete reverse diffusion under the additional manifold constraint and the data consistency can be represented by ",
625
+ "bbox": [
626
+ 176,
627
+ 369,
628
+ 825,
629
+ 412
630
+ ],
631
+ "page_idx": 3
632
+ },
633
+ {
634
+ "type": "equation",
635
+ "img_path": "images/b7b057ecb4a7ae5df6bea6dc5405200fbb2881cc0ec052b16d859f18fafc83ba.jpg",
636
+ "text": "$$\n\\begin{array} { l } { { \\displaystyle x _ { i - 1 } ^ { \\prime } = f ( x _ { i } , s _ { \\theta } ) - \\alpha \\frac { \\partial } { \\partial x _ { i } } \\| W ( y - H \\hat { x } _ { 0 } ( x _ { i } ) ) \\| _ { 2 } ^ { 2 } + g ( x _ { i } ) z , \\quad z \\sim \\mathcal { N } ( 0 , I ) , } } \\\\ { { \\displaystyle x _ { i - 1 } = A x _ { i - 1 } ^ { \\prime } + b . } } \\end{array}\n$$",
637
+ "text_format": "latex",
638
+ "bbox": [
639
+ 240,
640
+ 416,
641
+ 756,
642
+ 470
643
+ ],
644
+ "page_idx": 3
645
+ },
646
+ {
647
+ "type": "text",
648
+ "text": "We illustrate our scheme visually in Fig. 1 (a), specifically for the task of image inpainting. The additional step leads to a dramatic performance boost, as can be seen in Fig. 1 (b). Note that while the mapping (10) does not rely on the measurement, our gradient term in (14) incorporates the information of $\\textbf { { y } }$ so that the gradient of the measurement terms stays on the manifold. In the following, we study the theoretical properties of the method. Further algorithmic details and adaptations to each problem that we tackle are presented in Section C. ",
649
+ "bbox": [
650
+ 173,
651
+ 472,
652
+ 825,
653
+ 556
654
+ ],
655
+ "page_idx": 3
656
+ },
657
+ {
658
+ "type": "text",
659
+ "text": "We note that the authors of [19] proposed a similar gradient method for the application of temporal imputation and super-resolution. When combining (14) with (15), one can arrive at a similar gradient method proposed in [19], and hence our method can be seen as a generalization to arbitrary linear inverse problems. Furthermore, there are vast literature in the context of $\\mathrm { P n P }$ models that utilize pretrained denoisers together with gradient of the log-likelihood to solve inverse problems [30, 48, 11]. Among them, [30] is especially relevant to this work since their method relies on modified Langevin diffusion, together with Tweedie’s denoising and projections to the measurement subspace. ",
660
+ "bbox": [
661
+ 173,
662
+ 561,
663
+ 826,
664
+ 660
665
+ ],
666
+ "page_idx": 3
667
+ },
668
+ {
669
+ "type": "text",
670
+ "text": "4 Geometry of Diffusion Models and Manifold Constrained Gradient ",
671
+ "text_level": 1,
672
+ "bbox": [
673
+ 174,
674
+ 678,
675
+ 766,
676
+ 695
677
+ ],
678
+ "page_idx": 3
679
+ },
680
+ {
681
+ "type": "text",
682
+ "text": "In this section, we theoretically support the effectiveness of the proposed algorithm by showing the problematic behavior of the earlier algorithm and how the proposed algorithm resolves the problem. We defer all proofs in the supplementary section. To begin with, we borrow a geometrical viewpoint of the data manifold. ",
683
+ "bbox": [
684
+ 173,
685
+ 708,
686
+ 825,
687
+ 765
688
+ ],
689
+ "page_idx": 3
690
+ },
691
+ {
692
+ "type": "text",
693
+ "text": "Notation For a scalar $a$ , points $\\mathbf { \\nabla } _ { \\mathbf { x } , \\mathbf { y } }$ and a set $A$ , we use the following notations. $a A : = \\{ a x : x \\in$ $A \\}$ ; $d ( \\pmb { x } , A ) : = \\operatorname* { i n f } _ { \\pmb { y } \\in A } \\widetilde { | } | \\pmb { x } - \\pmb { y } | | _ { 2 }$ ; $B _ { r } ( A ) : = \\{ { \\pmb x } : d ( { \\pmb x } , A ) < r \\}$ ; $T _ { x } { \\mathcal { M } }$ : the tangent space to a manifold $\\mathcal { M }$ at $_ { \\textbf { \\em x } }$ ; $J _ { f }$ : the Jacobian matrix of a vector valued function $f$ . We define $p _ { 0 } = p _ { d a t a }$ . ",
694
+ "bbox": [
695
+ 173,
696
+ 771,
697
+ 825,
698
+ 814
699
+ ],
700
+ "page_idx": 3
701
+ },
702
+ {
703
+ "type": "text",
704
+ "text": "To develop the theory, we need an assumption on the data distribution. ",
705
+ "bbox": [
706
+ 174,
707
+ 819,
708
+ 633,
709
+ 834
710
+ ],
711
+ "page_idx": 3
712
+ },
713
+ {
714
+ "type": "text",
715
+ "text": "Assumption 1 (Strong manifold assumption: linear structure). Suppose $\\mathcal { M } \\subset \\mathbb { R } ^ { n }$ is the set of all data points, here we call the data manifold. Then, the manifold coincides with the tangent space with dimension $l \\ll n$ . ",
716
+ "bbox": [
717
+ 174,
718
+ 838,
719
+ 823,
720
+ 878
721
+ ],
722
+ "page_idx": 3
723
+ },
724
+ {
725
+ "type": "equation",
726
+ "img_path": "images/85ab0616e603f6a98fb96e1bae7946f7319d4ff18d724b555c69554c27d24f59.jpg",
727
+ "text": "$$\n\\mathcal { M } \\cap B _ { R } ( { \\pmb x } _ { 0 } ) = T _ { { \\pmb x } _ { 0 } } \\mathcal { M } \\cap B _ { R } ( { \\pmb x } _ { 0 } ) a n d T _ { { \\pmb x } _ { 0 } } \\mathcal { M } \\cong \\mathbb { R } ^ { l } .\n$$",
728
+ "text_format": "latex",
729
+ "bbox": [
730
+ 325,
731
+ 877,
732
+ 671,
733
+ 895
734
+ ],
735
+ "page_idx": 3
736
+ },
737
+ {
738
+ "type": "text",
739
+ "text": "Moreover, the data distribution $p _ { 0 }$ is the uniform distribution on the data manifold $\\mathcal { M }$ ",
740
+ "bbox": [
741
+ 173,
742
+ 897,
743
+ 736,
744
+ 912
745
+ ],
746
+ "page_idx": 3
747
+ },
748
+ {
749
+ "type": "image",
750
+ "img_path": "images/bf68c5be2851b2c07848707846530a6e49eab176c2c8a7727e05e085b684c4c5.jpg",
751
+ "image_caption": [
752
+ "(a) Geometry of diffusion model "
753
+ ],
754
+ "image_footnote": [],
755
+ "bbox": [
756
+ 176,
757
+ 92,
758
+ 431,
759
+ 287
760
+ ],
761
+ "page_idx": 4
762
+ },
763
+ {
764
+ "type": "image",
765
+ "img_path": "images/f9ce18aca0d47ae1fdfd7b499db3a160ec5a8e7cab4bc942abbb1f213b11dd58.jpg",
766
+ "image_caption": [
767
+ "(b) MCG correction ",
768
+ "Figure 2: In both (a) and (b), the central manifolds represent the data manifold $\\mathcal { M }$ , encircled by manifolds of noisy data $\\mathcal { M } _ { i }$ . The concentration on the manifold of noisy data and the distance from the clean data manifold are prescribed by Proposition 1. In (a), the backward (resp. forward) step depicted by blue (resp. red) arrows can be considered as transitions from $\\mathcal { M } _ { i }$ to $\\mathcal { M } _ { i - 1 }$ (resp. $\\mathcal { M } _ { i - 1 }$ to $\\mathcal { M } _ { i }$ ). In (b), arrows refer to the directions of conventional projection onto convex sets (POCS) step (green arrow) and MCG step (red arrow) which can be predicted by Theorem 1. "
769
+ ],
770
+ "image_footnote": [],
771
+ "bbox": [
772
+ 498,
773
+ 127,
774
+ 818,
775
+ 290
776
+ ],
777
+ "page_idx": 4
778
+ },
779
+ {
780
+ "type": "text",
781
+ "text": "We need to recall that the conventional manifold assumption is about the intrinsic geometry of data points having a low dimensional nature. However, we assume more in this work: the manifold is locally linear. Although this stronger assumption might narrow the practice of the theory, the geometric approach may provide new insights on diffusion models. Under this assumption, the following proposition shows how the data perturbed by noise lies in the ambient space, illustrated pictorially in Fig. 2a. ",
782
+ "bbox": [
783
+ 173,
784
+ 422,
785
+ 825,
786
+ 507
787
+ ],
788
+ "page_idx": 4
789
+ },
790
+ {
791
+ "type": "text",
792
+ "text": "Proposition 1 (Concentration of noisy data). Consider the distribution of noisy data $p _ { i } ( { \\pmb x } _ { i } ) =$ $\\begin{array} { r } { \\int p ( \\mathbf { \\bar { x } } _ { i } | \\mathbf { { x } } ) p _ { 0 } ( \\mathbf { { x } } ) d \\mathbf { { x } } , p ( \\mathbf { { x } } _ { i } | \\mathbf { { x } } ) \\sim \\mathcal { N } ( a _ { i } x , b _ { i } ^ { 2 } I ) } \\end{array}$ . Then $p _ { i } ( { \\pmb x } _ { i } )$ is concentrated on $( n - 1 )$ -dim manifold $\\mathcal { M } _ { i } : = \\{ \\pmb { y } \\in \\mathbb { R } ^ { n } : d ( \\pmb { y } , a _ { i } \\mathcal { M } ) = r _ { i } : = b _ { i } \\sqrt { n - l } \\}$ . Rigorously, $p _ { i } ( B _ { \\epsilon r _ { i } } ( \\mathcal { M } _ { i } ) ) > 1 - \\delta$ , for some small $\\epsilon , \\delta > 0$ . ",
793
+ "bbox": [
794
+ 174,
795
+ 510,
796
+ 825,
797
+ 569
798
+ ],
799
+ "page_idx": 4
800
+ },
801
+ {
802
+ "type": "text",
803
+ "text": "Remark 1 (Geometric interpretation of the diffusion process). Considering Proposition $I$ , the manifolds of noisy data can be interpreted as interpolating manifolds between the two: the hypersphere, where pure noise $\\mathcal { N } ( a _ { \\infty } x _ { 0 } , b _ { \\infty } ^ { 2 } )$ is concentrated, and the clean data manifold. In this regard, the diffusion steps are mere transitions from one manifold to another and the diffusion process is a transport from the data manifold to the hypersphere through interpolating manifolds. See Fig. 2a. ",
804
+ "bbox": [
805
+ 173,
806
+ 571,
807
+ 825,
808
+ 642
809
+ ],
810
+ "page_idx": 4
811
+ },
812
+ {
813
+ "type": "text",
814
+ "text": "Remark 2. We can infer from the proposition that the score functions are trained only with the data points concentrated on the noisy data manifolds. Therefore, inaccurate inference might be caused by application of a score function on points away from the noisy data manifold. ",
815
+ "bbox": [
816
+ 173,
817
+ 643,
818
+ 825,
819
+ 686
820
+ ],
821
+ "page_idx": 4
822
+ },
823
+ {
824
+ "type": "text",
825
+ "text": "Proposition 2 (score function). Suppose sθ is the minimizer of the denoising score matching loss in (3). Let $Q _ { i }$ be the function that maps $\\mathbf { \\Delta } _ { \\mathbf { \\mathcal { X } } _ { i } }$ to $\\scriptstyle { \\hat { \\mathbf { x } } } _ { 0 }$ for each $i$ , ",
826
+ "bbox": [
827
+ 171,
828
+ 693,
829
+ 823,
830
+ 722
831
+ ],
832
+ "page_idx": 4
833
+ },
834
+ {
835
+ "type": "equation",
836
+ "img_path": "images/5b2784040dd838dcabe0907347a065771b3fa16a6b4fd6b3ca6ab6f23de4687d.jpg",
837
+ "text": "$$\nQ _ { i } : \\mathbb { R } ^ { d } \\mathbb { R } ^ { d } , \\mathbf { x } _ { i } \\mapsto \\hat { \\pmb x } _ { 0 } : = \\frac { 1 } { a _ { i } } ( \\mathbf { x } _ { i } + b _ { i } ^ { 2 } s _ { \\theta } ( \\mathbf { x } _ { i } , i ) ) .\n$$",
838
+ "text_format": "latex",
839
+ "bbox": [
840
+ 330,
841
+ 724,
842
+ 665,
843
+ 756
844
+ ],
845
+ "page_idx": 4
846
+ },
847
+ {
848
+ "type": "text",
849
+ "text": "Then, $Q _ { i } ( \\pmb { x } _ { i } ) \\in \\mathcal { M }$ and $\\pmb { J } _ { Q _ { i } } ^ { 2 } = \\pmb { J } _ { Q _ { i } } = \\pmb { J } _ { Q _ { i } } ^ { T } : \\mathbb { R } ^ { d } T _ { Q _ { i } ( \\pmb { x } _ { i } ) } \\mathcal { M }$ . Intuitively, $Q _ { i }$ is locally an orthogonal projection onto $\\bar { \\mathcal { M } }$ . ",
850
+ "bbox": [
851
+ 173,
852
+ 760,
853
+ 821,
854
+ 791
855
+ ],
856
+ "page_idx": 4
857
+ },
858
+ {
859
+ "type": "text",
860
+ "text": "According to the proposition, the score function only concerns the normal direction of the data manifold. In other words, the score function cannot discriminate two data points whose difference is tangent to the manifold. In solving inverse problems, however, we desire to discriminate data points to reconstruct the original signal, and the discrimination is achievable by measurement fidelity. In order to achieve the original signal, the measurement plays a role in correcting the tangent component near the data manifold. Furthermore, with regard to remark 2, diffusion model-based inverse problem solvers should follow the tangent component. The following theorem shows how existing algorithms and the proposed method are different in this regard. ",
861
+ "bbox": [
862
+ 173,
863
+ 799,
864
+ 825,
865
+ 912
866
+ ],
867
+ "page_idx": 4
868
+ },
869
+ {
870
+ "type": "image",
871
+ "img_path": "images/5a086fbd9fa419eab1750b9d248b44e7ab45bab79112f3f5df966a9519cf7215.jpg",
872
+ "image_caption": [
873
+ "Figure 3: Inpainting results on FFHQ (1st, 2nd row) and ImageNet (3rd, 4th row). (a) Measurement, (b) Ground truth, (c) IAGAN [20] for FFHQ, LaMa [43] for ImageNet, (d) DDRM [25], (e) ScoreSDE [41], (f) RePAINT [32], (g) MCG (Ours). Out of $2 5 6 \\times 2 5 6$ image, the 1st and the 3rd row is masked with size $1 2 8 \\times 1 2 8$ box. $92 \\%$ of pixels (all RGB channels) from the images in the 2nd and 4th row are blocked. "
874
+ ],
875
+ "image_footnote": [],
876
+ "bbox": [
877
+ 210,
878
+ 87,
879
+ 790,
880
+ 356
881
+ ],
882
+ "page_idx": 5
883
+ },
884
+ {
885
+ "type": "text",
886
+ "text": "Theorem 1 (Manifold constrained gradient). A correction by the manifold constrained gradient does not leave the data manifold. Formally, ",
887
+ "bbox": [
888
+ 173,
889
+ 458,
890
+ 823,
891
+ 487
892
+ ],
893
+ "page_idx": 5
894
+ },
895
+ {
896
+ "type": "equation",
897
+ "img_path": "images/228deff095f0085e4bc34a36a6dd9a0fc55fadb61c5e8f0db1ca28cd0eb68c9c.jpg",
898
+ "text": "$$\n\\frac { \\partial } { \\partial x _ { i } } \\| { \\cal W } ( y - H \\hat { x } _ { 0 } ) \\| _ { 2 } ^ { 2 } = - 2 { \\cal J } _ { Q _ { i } } ^ { T } H ^ { T } { \\cal W } ^ { T } { \\cal W } ( y - H \\hat { x } _ { 0 } ) \\in T _ { \\hat { x } _ { 0 } } { \\mathcal { M } } ,\n$$",
899
+ "text_format": "latex",
900
+ "bbox": [
901
+ 272,
902
+ 494,
903
+ 723,
904
+ 527
905
+ ],
906
+ "page_idx": 5
907
+ },
908
+ {
909
+ "type": "text",
910
+ "text": "the gradient is the projection of the data fidelity term onto $T _ { \\hat { \\pmb { x } } _ { 0 } } \\mathcal { M }$ , ",
911
+ "bbox": [
912
+ 174,
913
+ 534,
914
+ 606,
915
+ 549
916
+ ],
917
+ "page_idx": 5
918
+ },
919
+ {
920
+ "type": "text",
921
+ "text": "This theorem suggests that in diffusion models, the naive measurement fidelity step (without considering the data manifold) pushes the inference path out of the manifolds and might lead to inaccurate reconstruction. (To see this pictorially, see section. D, and Fig. 7.) On the other hand, our correction term from the manifold constraint guides the diffusion to lie on the data manifold, leading to better reconstruction. Such geometric views are illustrated in Fig. 2b. ",
922
+ "bbox": [
923
+ 174,
924
+ 559,
925
+ 825,
926
+ 630
927
+ ],
928
+ "page_idx": 5
929
+ },
930
+ {
931
+ "type": "text",
932
+ "text": "Remark 3. One may concern that the suboptimality of the denoising score matching loss optimization may lead to inaccurate inference of the MCG steps. In practice, however, most of the error in denoising score matching is concentrated on $t \\sim 1 / 9 I$ , and in such region, the Tweedie’s inference cannot make meaningful images. That is, the score function cannot detect the data manifold. Nonetheless, in this regime, the magnitudes of the MCGs are small when the denoising score is inaccurate, and hence the matters arising from suboptimality is minimal. As $t 0$ , the estimation becomes exact, and subsequently leads to accurate implementation of the MCG. ",
933
+ "bbox": [
934
+ 174,
935
+ 633,
936
+ 825,
937
+ 732
938
+ ],
939
+ "page_idx": 5
940
+ },
941
+ {
942
+ "type": "text",
943
+ "text": "5 Experiments ",
944
+ "text_level": 1,
945
+ "bbox": [
946
+ 174,
947
+ 751,
948
+ 312,
949
+ 770
950
+ ],
951
+ "page_idx": 5
952
+ },
953
+ {
954
+ "type": "text",
955
+ "text": "For all tasks, we aim to verify the superiority of our method against other diffusion model-based approaches, and also against strong supervised learning-based baselines. Further details can be found in Section. F. ",
956
+ "bbox": [
957
+ 174,
958
+ 784,
959
+ 825,
960
+ 825
961
+ ],
962
+ "page_idx": 5
963
+ },
964
+ {
965
+ "type": "text",
966
+ "text": "Datasets and Implementation For inpainting, we use FFHQ $2 5 6 \\times 2 5 6$ [24], and ImageNet $2 5 6 \\times 2 5 6$ [12] to validate our method. We utilize pre-trained models from the open sourced repository based on the implementation of ADM (VP-SDE) [13]. We validate the performance on 1000 held-out validation set images for both FFHQ and ImageNet dataset. For the colorization task, we use FFHQ $2 5 6 \\times 2 5 6$ , and LSUN-bedroom $2 5 6 \\times 2 5 6$ [51]. We use pre-trained score functions from score-SDE [41] based on VE-SDE. We use 300 validation images for testing the performance with respect to the LSUN-bedroom dataset. For experiments with CT, we train our model based on ncsnpp as a VE-SDE from score-SDE [41], on the 2016 American Association of Physicists in Medicine (AAPM) grand challenge dataset, and we process the data as in [23]. Specifically, the dataset contains 3839 training images resized to $2 5 6 \\times 2 5 6$ resolution. We simulate the CT measurement process with parallel beam geometry with evenly-spaced 180 degrees. Evaluation is performed on 421 held-out validation images from the AAPM challenge. ",
967
+ "bbox": [
968
+ 174,
969
+ 842,
970
+ 825,
971
+ 911
972
+ ],
973
+ "page_idx": 5
974
+ },
975
+ {
976
+ "type": "table",
977
+ "img_path": "images/d5a2e946512c3ad829216df977f59b7bfca465119e1b7d3fb228668023d50e1f.jpg",
978
+ "table_caption": [
979
+ "Table 1: Quantitative evaluation (FID, LPIPS) of inpainting task on FFHQ and ImageNet. ∗: Reimplemented with our score function. MCG, Score-SDE, RePAINT, and DDRM all share the same score function and differ only in the inference method. Bold: Best, under: second best. "
980
+ ],
981
+ "table_footnote": [],
982
+ "table_body": "<table><tr><td></td><td colspan=\"8\">FFHQ(256×256)</td><td colspan=\"5\">ImageNet (256 × 256)</td></tr><tr><td></td><td colspan=\"2\">Box</td><td colspan=\"2\">Random</td><td colspan=\"2\">Extreme</td><td colspan=\"2\">Wide masks</td><td colspan=\"2\">Box</td><td colspan=\"2\">Random</td><td colspan=\"2\">Wide masks</td></tr><tr><td>Method</td><td></td><td>FID↓LPIPS ←</td><td>FID↓LPIPS</td><td>√</td><td></td><td>FID↓LPIPS ↓</td><td>FID↓LPIPS↓</td><td></td><td>FID↓LPIPS</td><td>↓</td><td>FID↓LPIPS</td><td>←</td><td>FID↓LPIPS</td><td></td></tr><tr><td>MCG (ours)</td><td>23.7</td><td>0.089</td><td>21.4</td><td>0.186</td><td>30.6</td><td>0.366</td><td>22.1</td><td>0.099</td><td>25.4</td><td>0.157</td><td>34.8</td><td>0.308</td><td>21.9</td><td>0.148</td></tr><tr><td>Score-SDE [41] 30.3</td><td></td><td>0.135</td><td>109.3 0.674</td><td></td><td>48.6</td><td>0.488</td><td>29.8</td><td>0.132</td><td>43.5</td><td>0.199</td><td>143.5 0.758</td><td></td><td>25.9</td><td>0.150</td></tr><tr><td>RePAINT*[32]</td><td>25.7</td><td>0.093</td><td>38.1</td><td>0.240</td><td>35.9</td><td>0.398</td><td>24.2</td><td>0.108</td><td>26.1</td><td>0.156</td><td>59.3</td><td>0.387</td><td>37.0</td><td>0.205</td></tr><tr><td>DDRM [25]</td><td>28.4</td><td>0.109</td><td>111.6 0.774</td><td></td><td>48.1</td><td>0.532</td><td>27.5</td><td>0.113</td><td>88.8</td><td>0.386</td><td>99.6</td><td>0.767</td><td>80.6</td><td>0.398</td></tr><tr><td>LaMa [43]</td><td>27.7</td><td>0.086</td><td>188.7 0.648</td><td></td><td>61.7</td><td>0.492</td><td>23.2</td><td>0.096</td><td>26.8</td><td>0.139</td><td>134.1</td><td>0.567</td><td>20.4</td><td>0.140</td></tr><tr><td>AOT-GAN [52]</td><td>29.2</td><td>0.108</td><td>97.2</td><td>0.514</td><td>69.5</td><td>0.452</td><td>28.3</td><td>0.106</td><td>35.3</td><td>0.163</td><td>119.6 0.583</td><td></td><td>29.8</td><td>0.161</td></tr><tr><td>ICT[49]</td><td>27.3</td><td>0.103</td><td>91.3</td><td>0.445</td><td>56.7</td><td>0.425</td><td>26.9</td><td>0.104</td><td>31.9</td><td>0.148</td><td>131.4 0.584</td><td></td><td>25.4</td><td>0.148</td></tr><tr><td>DSI [35]</td><td>27.9</td><td>0.096</td><td>126.4 0.601</td><td></td><td>77.5</td><td>0.463</td><td>28.3</td><td>0.102</td><td>34.5</td><td>0.155</td><td>132.9 0.549</td><td></td><td>24.3</td><td>0.154</td></tr><tr><td>IAGAN [20]</td><td>26.3</td><td>0.098</td><td>41.5</td><td>0.279</td><td>56.1</td><td>0.417</td><td>23.8</td><td>0.110</td><td>1</td><td>1</td><td>-</td><td>-</td><td>-</td><td>-</td></tr></table>",
983
+ "bbox": [
984
+ 173,
985
+ 88,
986
+ 821,
987
+ 237
988
+ ],
989
+ "page_idx": 6
990
+ },
991
+ {
992
+ "type": "text",
993
+ "text": "",
994
+ "bbox": [
995
+ 173,
996
+ 316,
997
+ 826,
998
+ 414
999
+ ],
1000
+ "page_idx": 6
1001
+ },
1002
+ {
1003
+ "type": "text",
1004
+ "text": "Inpainting Score-SDE [41], REPAINT [32], DDRM [25] were chosen as baseline diffusion models to compare against the proposed method. For a fair comparison, we use the same score function for all methods including MCG, and only differentiate the inference method that is used. Another class of generative models: GAN-based inverse problem solver, IAGAN [20] is considered as a comparison method for FFHQ specifically. We also include comparisons against supervised learning based base",
1005
+ "bbox": [
1006
+ 174,
1007
+ 431,
1008
+ 485,
1009
+ 582
1010
+ ],
1011
+ "page_idx": 6
1012
+ },
1013
+ {
1014
+ "type": "table",
1015
+ "img_path": "images/f69a0f6d0176b53acfead06f46f08b2cece44b8c209162b9f252a86050f3aad3.jpg",
1016
+ "table_caption": [],
1017
+ "table_footnote": [
1018
+ "Table 2: Quantitative evaluation (SSIM, LPIPS) of colorization task. Bold: best, under: second best. "
1019
+ ],
1020
+ "table_body": "<table><tr><td>Data</td><td colspan=\"2\">FFHQ(256×256) LSUN(256×256)</td></tr><tr><td>Method</td><td>SSIM↑ LPIPS↓</td><td>SSIM↓ LPIPS↓</td></tr><tr><td>MCG (ours)</td><td>0.951 0.146</td><td>0.959 0.160</td></tr><tr><td>Score-SDE [41]</td><td>0.936 0.180</td><td>0.945 0.199</td></tr><tr><td>DDRM[25]</td><td>0.948 0.154</td><td>0.957 0.182</td></tr><tr><td>cINN[2]</td><td>0.952 0.166 0.935</td><td>0.952 0.180</td></tr><tr><td>pix2pix [21]</td><td>0.184</td><td>0.947 0.174</td></tr></table>",
1021
+ "bbox": [
1022
+ 527,
1023
+ 448,
1024
+ 787,
1025
+ 539
1026
+ ],
1027
+ "page_idx": 6
1028
+ },
1029
+ {
1030
+ "type": "text",
1031
+ "text": "lines: LaMa [43], AOT-GAN [52], ICT [49], and DSI [35]. We use various forms of inpainting masks: box $1 2 8 \\times 1 2 8$ sized square region is missing2), extreme (only the box region is existent), random $( 9 0 - 9 5 \\%$ of pixels are missing), and LaMa-wide. Quantitative evaluation is performed with two metrics - Frechet Inception Distance (FID)-1k [17], and Learned Perceptual Image Patch Similarity (LPIPS) [54]. ",
1032
+ "bbox": [
1033
+ 173,
1034
+ 583,
1035
+ 825,
1036
+ 651
1037
+ ],
1038
+ "page_idx": 6
1039
+ },
1040
+ {
1041
+ "type": "text",
1042
+ "text": "Our method outperforms the diffusion model baselines [41, 32, 25] by a large margin. Moreover, our method is also competitive with, or even better than the best-in-class fully supervised methods, as can be seen in Table 1. In Fig. 3, we depict representative results that show the superiority of the method, where we see in both the box-type and random dropping that MCG performs very well on all experiments. ",
1043
+ "bbox": [
1044
+ 174,
1045
+ 659,
1046
+ 485,
1047
+ 782
1048
+ ],
1049
+ "page_idx": 6
1050
+ },
1051
+ {
1052
+ "type": "table",
1053
+ "img_path": "images/680cc33eead3b4ac9be4815911877feb13127e0bf636332d0060f1d040d2f892.jpg",
1054
+ "table_caption": [
1055
+ "Table 3: Quantitative evaluation (PSNR, SSIM) of CT reconstruction task. Bold: best. "
1056
+ ],
1057
+ "table_footnote": [],
1058
+ "table_body": "<table><tr><td></td><td colspan=\"2\">AAPM(256×256)</td></tr><tr><td>Views</td><td>18</td><td>30</td></tr><tr><td>Method</td><td>PSNR 个 SSIM↑</td><td>PSNR 个 SSIM↑</td></tr><tr><td>MCG (ours)</td><td>33.57 0.956</td><td>36.09 0.971</td></tr><tr><td>Score-CT[40]</td><td>29.85 0.897</td><td>31.97</td><td>0.913</td></tr><tr><td>SIN-4c-PRN[50]</td><td>26.96</td><td>0.850 30.23</td><td>0.917</td></tr><tr><td>cGAN [15]</td><td>24.38</td><td>0.823 27.45 23.92</td><td>0.927</td></tr><tr><td>FISTA-TV [3]</td><td>21.57</td><td>0.791</td><td>0.861</td></tr></table>",
1059
+ "bbox": [
1060
+ 527,
1061
+ 674,
1062
+ 787,
1063
+ 781
1064
+ ],
1065
+ "page_idx": 6
1066
+ },
1067
+ {
1068
+ "type": "text",
1069
+ "text": "Colorization We choose score-SDE [41], and DDRM [25] as diffusion-model based compar",
1070
+ "bbox": [
1071
+ 174,
1072
+ 800,
1073
+ 485,
1074
+ 827
1075
+ ],
1076
+ "page_idx": 6
1077
+ },
1078
+ {
1079
+ "type": "text",
1080
+ "text": "ison methods, and also compare against cINN [2], and pix2pix [21]. Two metrics were used for evaluation: structural similarity index (SSIM), and LPIPS. Consistent with the findings from inpainting, we achieve much improved performance than score-SDE, and also is favorable against state-of-the-art (SOTA) superivsed learning based methods. In Table 2, we see that the proposed method outperforms all other methods in terms of both PSNR/LPIPS in LSUN-bedroom, and also achieves strong performance in the colorization of FFHQ dataset. ",
1081
+ "bbox": [
1082
+ 174,
1083
+ 828,
1084
+ 825,
1085
+ 883
1086
+ ],
1087
+ "page_idx": 6
1088
+ },
1089
+ {
1090
+ "type": "image",
1091
+ "img_path": "images/45291f0ff87059d30bbd75ebf14b3847922cf66508d4a7339710a26c29cf9b55.jpg",
1092
+ "image_caption": [
1093
+ "Figure 4: Colorization results on FFHQ / LSUN-bedroom, Sparse view CT reconstruction results on AAPM. "
1094
+ ],
1095
+ "image_footnote": [],
1096
+ "bbox": [
1097
+ 178,
1098
+ 88,
1099
+ 816,
1100
+ 306
1101
+ ],
1102
+ "page_idx": 7
1103
+ },
1104
+ {
1105
+ "type": "text",
1106
+ "text": "",
1107
+ "bbox": [
1108
+ 176,
1109
+ 369,
1110
+ 821,
1111
+ 398
1112
+ ],
1113
+ "page_idx": 7
1114
+ },
1115
+ {
1116
+ "type": "text",
1117
+ "text": "CT reconstruction To the best of our knowledge, [40] is the only method that tackles CT reconstruction directly with diffusion models. We compare our method against [40], which we refer to as score-CT henceforth. We also compare with the best-in-class supervised learning methods, cGAN [15] and SIN- $\\scriptscriptstyle \\cdot 4 \\mathrm { c }$ -PRN [50]. As a compressed sensing baseline, FISTA-TV [3] was included, along with the analytical reconstruction method, FBP. We use two standard metrics - peak-signalto-noise-ratio (PSNR), and SSIM for quantitative evaluation. From Table 3, we see that the newly proposed MCG method outperforms the previous score-CT [40] by a large margin. We can observe the superiority of MCG over other methods more clearly in Fig. 4, where MCG reconstructs the measurement with high fidelity and detail. All other methods including the fully supervised baselines fall behind the proposed method. ",
1118
+ "bbox": [
1119
+ 174,
1120
+ 416,
1121
+ 826,
1122
+ 554
1123
+ ],
1124
+ "page_idx": 7
1125
+ },
1126
+ {
1127
+ "type": "text",
1128
+ "text": "Ablation studies We perform three ablation studies: 1) As both the MCG term and the projection term contain information about the measurement $\\textbf { { y } }$ , we observe the contribution of each term to the fixed solution. To further clarify the efficacy of the gradient step combined with Tweedie’s denoising, we also consider the case where the gradient of the log likelihood is computed not in the noiseless regime, but in the noise level matching the current iteration. Specifically, we define $\\pmb { x } _ { i - 1 } ^ { \\prime } : = \\pmb { f } ( \\pmb { x } _ { i } , \\pmb { s } _ { \\theta } ) + g ( \\pmb { x } _ { i } ) z$ , $\\ z \\sim$ $\\bar { \\mathcal { N } } ( 0 , \\pmb { I } )$ , ${ \\pmb y } _ { i - 1 } \\sim p ( { \\pmb y } _ { i - 1 } | { \\pmb y } _ { 0 } )$ , and implement the gradient step as $\\nabla _ { \\pmb { x } _ { i } } \\| \\pmb { y } _ { i - 1 } - \\pmb { H } \\pmb { x } _ { i - 1 } ^ { \\prime } \\| _ { 2 } ^ { 2 }$ . 2) As the performance of diffusion models depend heavily on the number of NFEs, we observe the trade-off of each diffusion model when varying the NFE from 20 to 1000. Moreover, for completeness, we measure the runtime of each algorithms including the non-diffusion based methods in wall-clock time computed with a commodity GPU in Table. 4. 3) Setting $\\alpha = 0 . 0$ reduces our method to [9]. We show the difference in the performance by varying the values of $\\alpha$ . ",
1129
+ "bbox": [
1130
+ 174,
1131
+ 571,
1132
+ 550,
1133
+ 780
1134
+ ],
1135
+ "page_idx": 7
1136
+ },
1137
+ {
1138
+ "type": "table",
1139
+ "img_path": "images/fee719d3e2f6c74c7584341d1b3d60653f2aa1a2a0e83d36b3b1ef23716da482.jpg",
1140
+ "table_caption": [
1141
+ "Table 4: Runtime for each algorithm in Wall-clock time: Computed with a single GTX 1080Ti GPU. "
1142
+ ],
1143
+ "table_footnote": [],
1144
+ "table_body": "<table><tr><td rowspan=1 colspan=1>Method Wall-clock time [s]</td></tr><tr><td rowspan=1 colspan=1>Score-SDE [41] 38.68RePAINT[32] 247.6</td></tr><tr><td rowspan=1 colspan=1>DDRM[25] 2.117</td></tr><tr><td rowspan=1 colspan=1>LaMa [43] 0.629</td></tr><tr><td rowspan=1 colspan=1>AOT-GAN [52] 0.082</td></tr><tr><td rowspan=1 colspan=1>ICT[49] 144.6</td></tr><tr><td rowspan=1 colspan=1>DSI[35] 36.64</td></tr><tr><td rowspan=1 colspan=1>IAGAN [20] 518.47</td></tr><tr><td rowspan=1 colspan=1>Ours 81.59</td></tr></table>",
1145
+ "bbox": [
1146
+ 591,
1147
+ 588,
1148
+ 787,
1149
+ 715
1150
+ ],
1151
+ "page_idx": 7
1152
+ },
1153
+ {
1154
+ "type": "text",
1155
+ "text": "",
1156
+ "bbox": [
1157
+ 174,
1158
+ 780,
1159
+ 826,
1160
+ 821
1161
+ ],
1162
+ "page_idx": 7
1163
+ },
1164
+ {
1165
+ "type": "text",
1166
+ "text": "First, we see in Table. 5 that using only the MCG step leads to improved performance in terms of LPIPS, but introduces error in the measurement consistency (measured with MSE). Combining both the projection and MCG leads to perfect data consistency along with further improved ",
1167
+ "bbox": [
1168
+ 174,
1169
+ 828,
1170
+ 485,
1171
+ 911
1172
+ ],
1173
+ "page_idx": 7
1174
+ },
1175
+ {
1176
+ "type": "table",
1177
+ "img_path": "images/71d304e7c799b5aa3a97c5d0afe4c59800726fe65a61faa6a852eb265e2df6c3.jpg",
1178
+ "table_caption": [
1179
+ "Table 5: LPIPS & Measurement consistency (MC) vs. method "
1180
+ ],
1181
+ "table_footnote": [],
1182
+ "table_body": "<table><tr><td>Method</td><td colspan=\"2\">LPIPS(↓) MSE(MC)</td></tr><tr><td>Proj.</td><td>0.138</td><td>0</td></tr><tr><td>Vllyi-1-Hx-1ll2</td><td>0.271</td><td>12.99</td></tr><tr><td>Vaillyi-1-Hx-ill2+Proj.</td><td>0.128</td><td>0</td></tr><tr><td>Vally-Hxoll2</td><td>0.124</td><td>10.7</td></tr><tr><td>Vxlly-Hxoll2+Proj. (Ours)</td><td>0.089</td><td>0</td></tr></table>",
1183
+ "bbox": [
1184
+ 527,
1185
+ 819,
1186
+ 787,
1187
+ 892
1188
+ ],
1189
+ "page_idx": 7
1190
+ },
1191
+ {
1192
+ "type": "image",
1193
+ "img_path": "images/26cbce0829991aad732a94cd964c769ac48b1a4b49d87a1588498477a727615f.jpg",
1194
+ "image_caption": [
1195
+ "Figure 5: Ablation studies performed with box inpainting task on FFHQ $2 5 6 \\times 2 5 6$ data. "
1196
+ ],
1197
+ "image_footnote": [],
1198
+ "bbox": [
1199
+ 176,
1200
+ 108,
1201
+ 797,
1202
+ 277
1203
+ ],
1204
+ "page_idx": 8
1205
+ },
1206
+ {
1207
+ "type": "text",
1208
+ "text": "reconstruction. When considering gradient steps without Tweedie’s denoising (i.e. keeping the noise level at the $i ^ { \\mathrm { { t h } } }$ step), the performance heavily degrades, especially when implemented without the projection steps. Here, we see that the proposed denoising step to utilize $\\scriptstyle { \\hat { \\mathbf { x } } } _ { 0 }$ is indeed the key to the superior performance. ",
1209
+ "bbox": [
1210
+ 174,
1211
+ 327,
1212
+ 825,
1213
+ 383
1214
+ ],
1215
+ "page_idx": 8
1216
+ },
1217
+ {
1218
+ "type": "text",
1219
+ "text": "Second, looking at Fig. 5a, we immediately see that the graph of MCG stays in the lowest (best) LPIPS regime across all NFEs by a large margin, except for when the NFE drops below 100. Here, DDRM [25] takes over the 1st place - allegedly due to the DDIM sampling strategy they take. The performance of RePAINT deteriorates rapidly as we decrease NFE. Furthermore, we observe that the LPIPS of score-SDE [41] actually increases (i.e. worsen), as we increase the number of NFEs from a few hundred to one thousand. This suggests that the inference process that score-SDE takes (i.e. projection only) is inherently flawed, and cannot be corrected by taking small enough steps. In Table. 4, we list the runtime of all the methods that were used for comparison in the task of inpainting. Note that the proposed method takes longer for compute than score-SDE albeit having the same NFE. The gap is due to the backpropagation steps that are required for the MCG step, where the gap can be potentially ameliorated by switching to JAX [6] implementation from the current PyTorch implementation. ",
1220
+ "bbox": [
1221
+ 174,
1222
+ 390,
1223
+ 825,
1224
+ 555
1225
+ ],
1226
+ "page_idx": 8
1227
+ },
1228
+ {
1229
+ "type": "text",
1230
+ "text": "Lastly, we observe the difference in the performance as we vary the values of $\\alpha$ . Implementation-wise, we find that we yield superior results when normalizing the squared norm with the norm of itself (e.g. $\\alpha = \\alpha ^ { \\prime } / \\lVert \\dot { \\mathbf { W } } ( \\pmb { y } - \\hat { \\pmb { H } } \\hat { \\pmb { x } } _ { 0 } ) \\rVert$ , where $\\alpha ^ { \\prime }$ is some constant). In order to avoid cluttered notation, we instead experiment with changing the values of $\\alpha ^ { \\prime }$ in Fig. 5b. Inspecting Fig. 5b, we see that $\\alpha$ values within the range [0.1, 1.0] produce satisfactory results. $\\alpha$ values that are too low do not fully enjoy the advantages of MCG and collapses to the projection-only method, while using too high values of $\\alpha$ results in exploding gradients, and the reconstruction saturates. ",
1231
+ "bbox": [
1232
+ 174,
1233
+ 563,
1234
+ 825,
1235
+ 659
1236
+ ],
1237
+ "page_idx": 8
1238
+ },
1239
+ {
1240
+ "type": "text",
1241
+ "text": "Properties of our method Our proposed method is fully unsupervised and is not trained on solving a specific inverse problem. For example, our box masks and random masks have very different forms of erasing the pixel values. Nevertheless, our method generalizes perfectly well to such different measurement conditions, while other methods have a large performance gap between the different mask shapes. We further note two appealing properties of our method as an inverse problem solver: 1) the ability to generate multiple solutions given a condition, and 2) the ability to maintain perfect measurement consistency. The former ability often lacks in supervised learningbased methods [43, 50], and the latter is often not satisfied for some unsupervised GAN-based solutions [10, 4]. ",
1242
+ "bbox": [
1243
+ 174,
1244
+ 676,
1245
+ 825,
1246
+ 801
1247
+ ],
1248
+ "page_idx": 8
1249
+ },
1250
+ {
1251
+ "type": "text",
1252
+ "text": "6 Conclusion ",
1253
+ "text_level": 1,
1254
+ "bbox": [
1255
+ 174,
1256
+ 823,
1257
+ 299,
1258
+ 840
1259
+ ],
1260
+ "page_idx": 8
1261
+ },
1262
+ {
1263
+ "type": "text",
1264
+ "text": "In this work, we proposed a general framework that can greatly enhance the performance of the diffusion model-based solvers for solving inverse problems. We showed several promising applications - inpainting, colorization, sparse view CT reconstruction, and showed that our method can outperform the current state-of-the-art methods. We analyzed our method theoretically and show that ",
1265
+ "bbox": [
1266
+ 176,
1267
+ 856,
1268
+ 825,
1269
+ 911
1270
+ ],
1271
+ "page_idx": 8
1272
+ },
1273
+ {
1274
+ "type": "text",
1275
+ "text": "MCG prevents the data generation process from falling off the manifold, thereby reducing the errors that might accumulate at every step. Further, we showed that MCG controls the direction tangent to the data manifold, whereas the score function controls the direction that is normal, such that the two components complement each other. ",
1276
+ "bbox": [
1277
+ 174,
1278
+ 92,
1279
+ 825,
1280
+ 147
1281
+ ],
1282
+ "page_idx": 9
1283
+ },
1284
+ {
1285
+ "type": "text",
1286
+ "text": "Limitations and Broader Impact The proposed method is inherently stochastic since the diffusion model is the main workhorse of the algorithm. When the dimension $m$ is pushed to low values, at times, our method fails to produce high quality reconstructions, albeit being better than the other methods overall. For extreme cases of inpainting (e.g. Half masks) with the ImageNet model, we often observe artifacts in our reconstruction (e.g. generating perfectly symmetric images), which we discuss in further detail in Sec. E. We note that our method is slow to sample from, inheriting the existing limitations of diffusion models. This would likely benefit from leveraging recent solvers aimed at accelerating the inference speed of diffusion models. In line with the arguments of other generative model-based inverse problem solvers, our method is a solver that relies heavily on the underlying diffusion model, and can thus potentially create malicious content such as deepfakes. Further, the reconstructions could intensify the social bias that is already existent in the training dataset. ",
1287
+ "bbox": [
1288
+ 174,
1289
+ 161,
1290
+ 825,
1291
+ 327
1292
+ ],
1293
+ "page_idx": 9
1294
+ },
1295
+ {
1296
+ "type": "text",
1297
+ "text": "Acknowledgments and Disclosure of Funding ",
1298
+ "text_level": 1,
1299
+ "bbox": [
1300
+ 174,
1301
+ 345,
1302
+ 553,
1303
+ 363
1304
+ ],
1305
+ "page_idx": 9
1306
+ },
1307
+ {
1308
+ "type": "text",
1309
+ "text": "This research was supported by Field-oriented Technology Development Project for Customs Administration through National Research Foundation of Korea(NRF) funded by the Ministry of Science & ICT and Korea Customs Service (NRF-2021M3I1A1097938, NRF-2021M3I1A1097910), by the Korea Health Technology R&D Project through the Korea Health Industry Development Institute (KHIDI), which is funded by the Ministry of Health & Welfare, Republic of Korea (grant number: HU21C0222), and by the KAIST Key Research Institute (Interdisciplinary Research Group) Project. ",
1310
+ "bbox": [
1311
+ 174,
1312
+ 377,
1313
+ 826,
1314
+ 460
1315
+ ],
1316
+ "page_idx": 9
1317
+ },
1318
+ {
1319
+ "type": "text",
1320
+ "text": "References ",
1321
+ "text_level": 1,
1322
+ "bbox": [
1323
+ 174,
1324
+ 479,
1325
+ 266,
1326
+ 496
1327
+ ],
1328
+ "page_idx": 9
1329
+ },
1330
+ {
1331
+ "type": "text",
1332
+ "text": "[1] Brian DO Anderson. Reverse-time diffusion equation models. Stochastic Processes and their Applications, 12(3):313–326, 1982. \n[2] Lynton Ardizzone, Carsten Lüth, Jakob Kruse, Carsten Rother, and Ullrich Köthe. Guided image generation with conditional invertible neural networks. arXiv preprint arXiv:1907.02392, 2019. \n[3] Amir Beck and Marc Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM journal on imaging sciences, 2(1):183–202, 2009. \n[4] Ashish Bora, Ajil Jalal, Eric Price, and Alexandros G Dimakis. Compressed sensing using generative models. In International Conference on Machine Learning, pages 537–546. PMLR, 2017. \n[5] Stephen Boyd, Neal Parikh, Eric Chu, Borja Peleato, Jonathan Eckstein, et al. Distributed optimization and statistical learning via the alternating direction method of multipliers. Foundations and Trends® in Machine learning, 3(1):1–122, 2011. \n[6] James Bradbury, Roy Frostig, Peter Hawkins, Matthew James Johnson, Chris Leary, Dougal Maclaurin, George Necula, Adam Paszke, Jake VanderPlas, Skye Wanderman-Milne, and Qiao Zhang. JAX: composable transformations of Python+NumPy programs, 2018. \n[7] Thorsten M Buzug. Computed tomography. In Springer handbook of medical technology, pages 311–342. Springer, 2011. \n[8] Jooyoung Choi, Sungwon Kim, Yonghyun Jeong, Youngjune Gwon, and Sungroh Yoon. ILVR: Conditioning method for denoising diffusion probabilistic models. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), 2021. \n[9] Hyungjin Chung, Byeongsu Sim, and Jong Chul Ye. Come-Closer-Diffuse-Faster: Accelerating Conditional Diffusion Models for Inverse Problems through Stochastic Contraction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2022. ",
1333
+ "bbox": [
1334
+ 178,
1335
+ 502,
1336
+ 828,
1337
+ 912
1338
+ ],
1339
+ "page_idx": 9
1340
+ },
1341
+ {
1342
+ "type": "text",
1343
+ "text": "[10] Giannis Daras, Joseph Dean, Ajil Jalal, and Alexandros G Dimakis. Intermediate layer optimization for inverse problems using deep generative models. In International Conference on Machine Learning, 2021. ",
1344
+ "bbox": [
1345
+ 171,
1346
+ 90,
1347
+ 823,
1348
+ 133
1349
+ ],
1350
+ "page_idx": 10
1351
+ },
1352
+ {
1353
+ "type": "text",
1354
+ "text": "[11] Valentin De Bortoli, Alain Durmus, Marcelo Pereyra, and Ana Fernandez Vidal. Maximum likelihood estimation of regularization parameters in high-dimensional inverse problems: an empirical bayesian approach. part ii: Theoretical analysis. SIAM Journal on Imaging Sciences, 13(4):1990–2028, 2020. ",
1355
+ "bbox": [
1356
+ 173,
1357
+ 142,
1358
+ 825,
1359
+ 198
1360
+ ],
1361
+ "page_idx": 10
1362
+ },
1363
+ {
1364
+ "type": "text",
1365
+ "text": "[12] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A largescale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009. ",
1366
+ "bbox": [
1367
+ 173,
1368
+ 207,
1369
+ 823,
1370
+ 250
1371
+ ],
1372
+ "page_idx": 10
1373
+ },
1374
+ {
1375
+ "type": "text",
1376
+ "text": "[13] Prafulla Dhariwal and Alexander Quinn Nichol. Diffusion models beat GANs on image synthesis. In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, 2021. ",
1377
+ "bbox": [
1378
+ 173,
1379
+ 258,
1380
+ 823,
1381
+ 301
1382
+ ],
1383
+ "page_idx": 10
1384
+ },
1385
+ {
1386
+ "type": "text",
1387
+ "text": "[14] Bradley Efron. Tweedie’s formula and selection bias. Journal of the American Statistical Association, 106(496):1602–1614, 2011. ",
1388
+ "bbox": [
1389
+ 173,
1390
+ 309,
1391
+ 823,
1392
+ 338
1393
+ ],
1394
+ "page_idx": 10
1395
+ },
1396
+ {
1397
+ "type": "text",
1398
+ "text": "[15] Muhammad Usman Ghani and W Clem Karl. Deep learning-based sinogram completion for low-dose ct. In 2018 IEEE 13th Image, Video, and Multidimensional Signal Processing Workshop (IVMSP), pages 1–5. IEEE, 2018. ",
1399
+ "bbox": [
1400
+ 171,
1401
+ 347,
1402
+ 823,
1403
+ 390
1404
+ ],
1405
+ "page_idx": 10
1406
+ },
1407
+ {
1408
+ "type": "text",
1409
+ "text": "[16] Richard Gordon, Robert Bender, and Gabor T Herman. Algebraic reconstruction techniques (art) for three-dimensional electron microscopy and x-ray photography. Journal of theoretical Biology, 29(3):471–481, 1970. ",
1410
+ "bbox": [
1411
+ 173,
1412
+ 398,
1413
+ 823,
1414
+ 440
1415
+ ],
1416
+ "page_idx": 10
1417
+ },
1418
+ {
1419
+ "type": "text",
1420
+ "text": "[17] Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In I. Guyon, U. Von Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. ",
1421
+ "bbox": [
1422
+ 174,
1423
+ 449,
1424
+ 826,
1425
+ 506
1426
+ ],
1427
+ "page_idx": 10
1428
+ },
1429
+ {
1430
+ "type": "text",
1431
+ "text": "[18] Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems, volume 33, pages 6840–6851, 2020. ",
1432
+ "bbox": [
1433
+ 171,
1434
+ 513,
1435
+ 825,
1436
+ 545
1437
+ ],
1438
+ "page_idx": 10
1439
+ },
1440
+ {
1441
+ "type": "text",
1442
+ "text": "[19] Jonathan Ho, Tim Salimans, Alexey Gritsenko, William Chan, Mohammad Norouzi, and David J Fleet. Video diffusion models. arXiv preprint arXiv:2204.03458, 2022. ",
1443
+ "bbox": [
1444
+ 171,
1445
+ 551,
1446
+ 823,
1447
+ 582
1448
+ ],
1449
+ "page_idx": 10
1450
+ },
1451
+ {
1452
+ "type": "text",
1453
+ "text": "[20] Shady Abu Hussein, Tom Tirer, and Raja Giryes. Image-adaptive gan based reconstruction. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 3121–3129, 2020. ",
1454
+ "bbox": [
1455
+ 173,
1456
+ 588,
1457
+ 825,
1458
+ 631
1459
+ ],
1460
+ "page_idx": 10
1461
+ },
1462
+ {
1463
+ "type": "text",
1464
+ "text": "[21] Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1125–1134, 2017. ",
1465
+ "bbox": [
1466
+ 173,
1467
+ 640,
1468
+ 825,
1469
+ 684
1470
+ ],
1471
+ "page_idx": 10
1472
+ },
1473
+ {
1474
+ "type": "text",
1475
+ "text": "[22] Zahra Kadkhodaie and Eero Simoncelli. Stochastic solutions for linear inverse problems using the prior implicit in a denoiser. In Advances in Neural Information Processing Systems, volume 34, pages 13242–13254. Curran Associates, Inc., 2021. ",
1476
+ "bbox": [
1477
+ 173,
1478
+ 690,
1479
+ 825,
1480
+ 734
1481
+ ],
1482
+ "page_idx": 10
1483
+ },
1484
+ {
1485
+ "type": "text",
1486
+ "text": "[23] Eunhee Kang, Junhong Min, and Jong Chul Ye. A deep convolutional neural network using directional wavelets for low-dose $\\mathbf { X }$ -ray ct reconstruction. Medical physics, 44(10):e360–e375, 2017. ",
1487
+ "bbox": [
1488
+ 171,
1489
+ 742,
1490
+ 823,
1491
+ 785
1492
+ ],
1493
+ "page_idx": 10
1494
+ },
1495
+ {
1496
+ "type": "text",
1497
+ "text": "[24] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 4401–4410, 2019. ",
1498
+ "bbox": [
1499
+ 173,
1500
+ 794,
1501
+ 823,
1502
+ 837
1503
+ ],
1504
+ "page_idx": 10
1505
+ },
1506
+ {
1507
+ "type": "text",
1508
+ "text": "[25] Bahjat Kawar, Michael Elad, Stefano Ermon, and Jiaming Song. Denoising diffusion restoration models. In ICLR Workshop on Deep Generative Models for Highly Structured Data, 2022. ",
1509
+ "bbox": [
1510
+ 173,
1511
+ 844,
1512
+ 823,
1513
+ 875
1514
+ ],
1515
+ "page_idx": 10
1516
+ },
1517
+ {
1518
+ "type": "text",
1519
+ "text": "[26] Bahjat Kawar, Gregory Vaksman, and Michael Elad. Snips: Solving noisy inverse problems stochastically. Advances in Neural Information Processing Systems, 34:21757–21769, 2021. ",
1520
+ "bbox": [
1521
+ 171,
1522
+ 882,
1523
+ 825,
1524
+ 911
1525
+ ],
1526
+ "page_idx": 10
1527
+ },
1528
+ {
1529
+ "type": "text",
1530
+ "text": "[27] Daniil Kazantsev, Edoardo Pasca, Martin J Turner, and Philip J Withers. Ccpi-regularisation toolkit for computed tomographic image reconstruction with proximal splitting algorithms. SoftwareX, 9:317–323, 2019. \n[28] Kwanyoung Kim and Jong Chul Ye. Noise2score: Tweedie’s approach to self-supervised image denoising without clean images. In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, 2021. \n[29] Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In 2nd International Conference on Learning Representations, ICLR, 2014. \n[30] Rémi Laumont, Valentin De Bortoli, Andrés Almansa, Julie Delon, Alain Durmus, and Marcelo Pereyra. Bayesian imaging using plug & play priors: when langevin meets tweedie. SIAM Journal on Imaging Sciences, 15(2):701–737, 2022. \n[31] Beatrice Laurent and Pascal Massart. Adaptive estimation of a quadratic functional by model selection. Annals of Statistics, pages 1302–1338, 2000. \n[32] Andreas Lugmayr, Martin Danelljan, Andres Romero, Fisher Yu, Radu Timofte, and Luc Van Gool. RePaint: Inpainting using Denoising Diffusion Probabilistic Models. arXiv preprint arXiv:2201.09865, 2022. \n[33] Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. In Proceedings of the IEEE international conference on computer vision, pages 2794–2802, 2017. \n[34] Frank Ong, Peyman Milanfar, and Pascal Getreuer. Local kernels that approximate bayesian regularization and proximal operators. IEEE Transactions on Image Processing, 28(6):3007– 3019, 2019. \n[35] Jialun Peng, Dong Liu, Songcen Xu, and Houqiang Li. Generating diverse structure for image inpainting with hierarchical VQ-VAE. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10775–10784, 2021. \n[36] Ali Razavi, Aaron Van den Oord, and Oriol Vinyals. Generating diverse high-fidelity images with vq-vae-2. Advances in neural information processing systems, 32, 2019. \n[37] Herbert E Robbins. An empirical bayes approach to statistics. In Breakthroughs in statistics, pages 388–394. Springer, 1992. \n[38] Simo Särkkä and Arno Solin. Applied stochastic differential equations, volume 10. Cambridge University Press, 2019. \n[39] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. In 3rd International Conference on Learning Representations, ICLR, 2015. \n[40] Yang Song, Liyue Shen, Lei Xing, and Stefano Ermon. Solving inverse problems in medical imaging with score-based generative models. In International Conference on Learning Representations, 2022. \n[41] Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. In 9th International Conference on Learning Representations, ICLR, 2021. \n[42] Charles M Stein. Estimation of the mean of a multivariate normal distribution. The annals of Statistics, pages 1135–1151, 1981. \n[43] Roman Suvorov, Elizaveta Logacheva, Anton Mashikhin, Anastasia Remizova, Arsenii Ashukha, Aleksei Silvestrov, Naejin Kong, Harshith Goka, Kiwoong Park, and Victor Lempitsky. Resolution-robust large mask inpainting with fourier convolutions. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 2149–2159, 2022. \n[44] Tom Tirer and Raja Giryes. Image restoration by iterative denoising and backward projections. IEEE Transactions on Image Processing, 28(3):1220–1234, 2018. ",
1531
+ "bbox": [
1532
+ 169,
1533
+ 65,
1534
+ 828,
1535
+ 916
1536
+ ],
1537
+ "page_idx": 11
1538
+ },
1539
+ {
1540
+ "type": "text",
1541
+ "text": "[45] Github PK Tool, Nov Sun Mon Tue Wed Thu, and Fri Sat. dkazanc/tomobar. ",
1542
+ "bbox": [
1543
+ 173,
1544
+ 90,
1545
+ 712,
1546
+ 106
1547
+ ],
1548
+ "page_idx": 12
1549
+ },
1550
+ {
1551
+ "type": "text",
1552
+ "text": "[46] Aaron Van Den Oord, Oriol Vinyals, et al. Neural discrete representation learning. Advances in neural information processing systems, 30, 2017. ",
1553
+ "bbox": [
1554
+ 171,
1555
+ 114,
1556
+ 823,
1557
+ 143
1558
+ ],
1559
+ "page_idx": 12
1560
+ },
1561
+ {
1562
+ "type": "text",
1563
+ "text": "[47] Singanallur V Venkatakrishnan, Charles A Bouman, and Brendt Wohlberg. Plug-and-play priors for model based reconstruction. In 2013 IEEE Global Conference on Signal and Information Processing, pages 945–948. IEEE, 2013. ",
1564
+ "bbox": [
1565
+ 174,
1566
+ 152,
1567
+ 823,
1568
+ 195
1569
+ ],
1570
+ "page_idx": 12
1571
+ },
1572
+ {
1573
+ "type": "text",
1574
+ "text": "[48] Ana Fernandez Vidal, Valentin De Bortoli, Marcelo Pereyra, and Alain Durmus. Maximum likelihood estimation of regularization parameters in high-dimensional inverse problems: An empirical bayesian approach part i: Methodology and experiments. SIAM Journal on Imaging Sciences, 13(4):1945–1989, 2020. ",
1575
+ "bbox": [
1576
+ 174,
1577
+ 204,
1578
+ 821,
1579
+ 260
1580
+ ],
1581
+ "page_idx": 12
1582
+ },
1583
+ {
1584
+ "type": "text",
1585
+ "text": "[49] Ziyu Wan, Jingbo Zhang, Dongdong Chen, and Jing Liao. High-fidelity pluralistic image completion with transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 4692–4701, 2021. ",
1586
+ "bbox": [
1587
+ 173,
1588
+ 268,
1589
+ 823,
1590
+ 311
1591
+ ],
1592
+ "page_idx": 12
1593
+ },
1594
+ {
1595
+ "type": "text",
1596
+ "text": "[50] Haoyu Wei, Florian Schiffers, Tobias Würfl, Daming Shen, Daniel Kim, Aggelos K Katsaggelos, and Oliver Cossairt. 2-step sparse-view ct reconstruction with a domain-specific perceptual network. arXiv preprint arXiv:2012.04743, 2020. ",
1597
+ "bbox": [
1598
+ 171,
1599
+ 319,
1600
+ 823,
1601
+ 363
1602
+ ],
1603
+ "page_idx": 12
1604
+ },
1605
+ {
1606
+ "type": "text",
1607
+ "text": "[51] Fisher Yu, Ari Seff, Yinda Zhang, Shuran Song, Thomas Funkhouser, and Jianxiong Xiao. Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365, 2015. ",
1608
+ "bbox": [
1609
+ 171,
1610
+ 371,
1611
+ 823,
1612
+ 414
1613
+ ],
1614
+ "page_idx": 12
1615
+ },
1616
+ {
1617
+ "type": "text",
1618
+ "text": "[52] Yanhong Zeng, Jianlong Fu, Hongyang Chao, and Baining Guo. Aggregated contextual transformations for high-resolution image inpainting. IEEE Transactions on Visualization and Computer Graphics, 2022. ",
1619
+ "bbox": [
1620
+ 171,
1621
+ 422,
1622
+ 823,
1623
+ 465
1624
+ ],
1625
+ "page_idx": 12
1626
+ },
1627
+ {
1628
+ "type": "text",
1629
+ "text": "[53] Kai Zhang, Wangmeng Zuo, Shuhang Gu, and Lei Zhang. Learning deep cnn denoiser prior for image restoration. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 3929–3938, 2017. ",
1630
+ "bbox": [
1631
+ 173,
1632
+ 474,
1633
+ 823,
1634
+ 517
1635
+ ],
1636
+ "page_idx": 12
1637
+ },
1638
+ {
1639
+ "type": "text",
1640
+ "text": "[54] Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 586–595, 2018. ",
1641
+ "bbox": [
1642
+ 173,
1643
+ 526,
1644
+ 823,
1645
+ 569
1646
+ ],
1647
+ "page_idx": 12
1648
+ },
1649
+ {
1650
+ "type": "text",
1651
+ "text": "[55] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the IEEE international conference on computer vision, pages 2223–2232, 2017. ",
1652
+ "bbox": [
1653
+ 173,
1654
+ 577,
1655
+ 821,
1656
+ 621
1657
+ ],
1658
+ "page_idx": 12
1659
+ },
1660
+ {
1661
+ "type": "text",
1662
+ "text": "Checklist ",
1663
+ "text_level": 1,
1664
+ "bbox": [
1665
+ 174,
1666
+ 89,
1667
+ 254,
1668
+ 106
1669
+ ],
1670
+ "page_idx": 13
1671
+ },
1672
+ {
1673
+ "type": "text",
1674
+ "text": "1. For all authors... ",
1675
+ "bbox": [
1676
+ 214,
1677
+ 116,
1678
+ 339,
1679
+ 130
1680
+ ],
1681
+ "page_idx": 13
1682
+ },
1683
+ {
1684
+ "type": "text",
1685
+ "text": "(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] \n(b) Did you describe the limitations of your work? [Yes] We discuss the limitations in (6). \n(c) Did you discuss any potential negative societal impacts of your work? [Yes] We discuss potential negative impacts in (6). \n(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] ",
1686
+ "bbox": [
1687
+ 238,
1688
+ 135,
1689
+ 825,
1690
+ 239
1691
+ ],
1692
+ "page_idx": 13
1693
+ },
1694
+ {
1695
+ "type": "text",
1696
+ "text": "2. If you are including theoretical results... ",
1697
+ "bbox": [
1698
+ 214,
1699
+ 243,
1700
+ 493,
1701
+ 258
1702
+ ],
1703
+ "page_idx": 13
1704
+ },
1705
+ {
1706
+ "type": "text",
1707
+ "text": "(a) Did you state the full set of assumptions of all theoretical results? [Yes] (b) Did you include complete proofs of all theoretical results? [Yes] We provide all proofs of results in supplementary material. ",
1708
+ "bbox": [
1709
+ 238,
1710
+ 262,
1711
+ 825,
1712
+ 308
1713
+ ],
1714
+ "page_idx": 13
1715
+ },
1716
+ {
1717
+ "type": "text",
1718
+ "text": "3. If you ran experiments... ",
1719
+ "bbox": [
1720
+ 212,
1721
+ 311,
1722
+ 393,
1723
+ 325
1724
+ ],
1725
+ "page_idx": 13
1726
+ },
1727
+ {
1728
+ "type": "text",
1729
+ "text": "(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] We include all code for our experiments in the supplementary material. We will release the code once the paper is published. \n(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] \n(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] Due to our limited resources we do not have time to run multiple sets of experiments. \n(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] ",
1730
+ "bbox": [
1731
+ 238,
1732
+ 332,
1733
+ 825,
1734
+ 489
1735
+ ],
1736
+ "page_idx": 13
1737
+ },
1738
+ {
1739
+ "type": "text",
1740
+ "text": "4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... ",
1741
+ "bbox": [
1742
+ 215,
1743
+ 494,
1744
+ 823,
1745
+ 510
1746
+ ],
1747
+ "page_idx": 13
1748
+ },
1749
+ {
1750
+ "type": "text",
1751
+ "text": "(a) If your work uses existing assets, did you cite the creators? [Yes] We have cited the original works that released the datasets. \n(b) Did you mention the license of the assets? [No] Licenses are standard and can be found online. \n(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] We include our implementation as the supplementary material. We will release the code upon publication. \n(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [No] All datasets used in our work are publicly available. \n(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] ",
1752
+ "bbox": [
1753
+ 238,
1754
+ 513,
1755
+ 825,
1756
+ 675
1757
+ ],
1758
+ "page_idx": 13
1759
+ },
1760
+ {
1761
+ "type": "text",
1762
+ "text": "5. If you used crowdsourcing or conducted research with human subjects... ",
1763
+ "bbox": [
1764
+ 214,
1765
+ 680,
1766
+ 705,
1767
+ 695
1768
+ ],
1769
+ "page_idx": 13
1770
+ },
1771
+ {
1772
+ "type": "text",
1773
+ "text": "(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] \n(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] \n(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] ",
1774
+ "bbox": [
1775
+ 238,
1776
+ 699,
1777
+ 825,
1778
+ 787
1779
+ ],
1780
+ "page_idx": 13
1781
+ }
1782
+ ]
parse/dev/nJJjv0JDJju/nJJjv0JDJju_middle.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/nJJjv0JDJju/nJJjv0JDJju_model.json ADDED
The diff for this file is too large to render. See raw diff
 
parse/dev/peZSbfNnBp4/peZSbfNnBp4.md ADDED
@@ -0,0 +1,274 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Ensemble of Averages: Improving Model Selection and Boosting Performance in Domain Generalization
2
+
3
+ Devansh Arpit, Huan Wang, Yingbo Zhou, Caiming Xiong Salesforce Research, USA devansharpit@gmail.com
4
+
5
+ # Abstract
6
+
7
+ In Domain Generalization (DG) settings, models trained independently on a given set of training domains have notoriously chaotic performance on distribution shifted test domains, and stochasticity in optimization (e.g. seed) plays a big role. This makes deep learning models unreliable in real world settings. We first show that this chaotic behavior exists even along the training optimization trajectory of a single model, and propose a simple model averaging protocol that both significantly boosts domain generalization and diminishes the impact of stochasticity by improving the rank correlation between the in-domain validation accuracy and out-domain test accuracy, which is crucial for reliable early stopping. Taking advantage of our observation, we show that instead of ensembling unaveraged models (that is typical in practice), ensembling moving average models (EoA) from independent runs further boosts performance. We theoretically explain the boost in performance of ensembling and model averaging by adapting the well known Bias-Variance trade-off to the domain generalization setting. On the DomainBed benchmark, when using a pre-trained ResNet-50, this ensemble of averages achieves an average of $6 8 . 0 \%$ , beating vanilla ERM (w/o averaging/ensembling) by $\sim 4 \%$ , and when using a pre-trained RegNetY-16GF, achieves an average of $7 6 . 6 \%$ , beating vanilla ERM by $6 \%$ . Our code is available at https://github.com/salesforce/ ensemble-of-averages.
8
+
9
+ # 1 Introduction
10
+
11
+ Domain generalization (DG, [5]) aims at learning predictors that generalize well on data sampled from test distributions that are different from the training distribution. Currently, deep learning models have been shown to be poor at this form of generalization [10], and excel primarily in the IID setting [51].
12
+
13
+ While a number of algorithms have been proposed to mitigate this problem (cf [51] for a survey), [18] demonstrate that models trained using empirical risk minimization (ERM, [43]) along with proper model selection (i.e. early stopping using validation set), using a subset of data from all the training domains, largely match or even outperform the performance of most existing domain generalization algorithms. This suggests that model selection plays an important role in domain generalization. Despite its importance, there has not been much investigation into the reliability of model selection. As we demonstrate in Figure 1, the out-domain performance varies greatly along the optimization trajectory of a model during training, even though the in-domain performance does not. This instability therefore hurts the reliability of model selection, and can become a problem in realistic settings where test domain data is unavailable, because it causes the rank correlation between in-domain validation accuracy and out-domain test accuracy to be weak.
14
+
15
+ In this paper, we first investigate a simple protocol for model averaging that both boosts DG within the ERM framework, and mitigates performance instability of deep models on out-domain data, specifically with respect to in-domain validation data. This makes model selection more reliable. Next, taking advantage of our observation, we show that ensembling moving average models further boosts performance, making it a better choice for practical scenarios. Note that we do not claim that model averaging or ensembling can fully solve the problem of DG. The observation that model averaging can boost domain generalization performance is not new, and was exposed by SWAD [8], which inspired our work. Our contribution in this respect are as follows:
16
+
17
+ ![](images/abd1336925ba7100974c1258a065d55d6a86a913c9c29a0b5ebab23a2508f3a2.jpg)
18
+ Figure 1: Model averaging improves out-domain performance stability. Left: In-domain validation accuracy and out-domain test accuracy during training of models using ERM. Right: Same as left, except validation and test predictions are made using a simple moving average of the model being optimized, along its optimization path. Details: The plots are for the TerraIncognita dataset with domain L38 used as the test domain, and others as training/validation data, and ResNet-50. Solid lines denote accuracy, dashed lines denote training loss, and dash-dot lines denote best accuracy achieved during training and all runs (for reference). Each color denotes a different run with a different random seed and training/validation split. Gist: Model averaging reduces out-domain performance instability, and makes the test curves correlate better with the validation curves, making model selection using in-domain validation set more reliable during optimization. We see a similar pattern when using ensemble of models, with and without model averaging, in Figure 2.
19
+
20
+ 1. Hyperparameter-free:In contrast to SWAD, which introduces three additional hyper-parameters for its model averaging algorithm that need tuning, we show that the simple strategy of maintaining a simple moving average (SMA) of the model parameters throughout the optimization trajectory, starting near initialization (Appendix Figure 5), works just as well (when a pre-trained model is used as initialization). Although model averaging technically requires two hyper-parameters– averaging frequency and starting iteration, through empirical analysis, we show that setting the frequency to 1 and setting the start iteration close to 0 works well on multiple datasets and architectures, making our proposal hyperparameter-free in practice.
21
+
22
+ 2. Computationally efficient:SWAD requires computing validation performance more frequently than is typically done $2 \mathrm { x } \mathrm { - } 6 \mathrm { x }$ on the DomainBed datasets), which is needed because it needs to find the start and end iteration between which model averaging is done. This increases compute requirements. This segment is selected based on the validation performance computed using the model being trained. Our proposal to instead use the SMA model to perform early stopping and inference, side-steps this need and does not require frequent validation performance check. We show that the root cause for this difference is that the model being trained has unstable performance on OOD data, while the SMA model has a more stable OOD performance (see Figure 1 and Table 2). Thus this observation results in our hyperparameter-free and more efficient model averaging strategy.
23
+
24
+ 3. EoA: Taking advantage of our efficient model averaging protocol (section 2.2), we find that an ensemble of moving average models (EoA) outperforms a traditional ensemble of unaveraged models (Table 4). We also show ablation analysis that the rank correlation between in-domain validation performance and out-domain test performance is better for the ensemble of average models (Table 3).
25
+
26
+ 4. Theoretical explanation: To explain why both model averaging and ensembling improve OOD performance under a unified theoretical framework, we adapt the well known Bias-Variance decomposition to the domain generalization setting, and argue that the expected OOD loss for individual models comprises of both the bias and the variance term, while the expected OOD loss for ensembles and averaged models comprises mainly of the bias term only, and is thus strictly lower (section 3.2). Our explanation is in contrast with SWAD, which uses flat minima to explain the improved OOD generalization, which applies to model averaging, but is less straight forward for explaining the boost by ensembles.
27
+
28
+ 5. Benchmarking: For benchmarking, we experiment with three different pre-trained models as initializations for DG training, with increasing pre-training dataset size and model size. In these experiments we find that EoA provides a larger gain over the corresponding ERM baseline with increasing dataset and model size. These gains range from $4 \% - 6 \%$ (Table 4). Notice that this claim is different from existing work [20], which states that the baseline ERM performance improves with larger pre-training data and model size.
29
+
30
+ # 2 Model Averaging
31
+
32
+ # 2.1 Terminology
33
+
34
+ Online Model: For a given supervised learning objective function, let $f _ { \theta } ( . )$ denote the deep network being optimized using gradient based optimizer, where $\theta$ denotes the parameters of this model. We refer to $f _ { \theta }$ as the online model, or unaveraged model. The output of $f _ { \theta } ( . )$ is a vector of $K$ logits corresponding to the $K$ classes in the supervised task.
35
+
36
+ Moving Average (MA) Model: While the online model is being trained, we maintain a moving average of the online model’s parameters. This process is sometime referred to as iterate averaging in existing literature. The deep network whose parameters are set to be this moving average is referred to as the moving average model, or more specifically simple moving average (SMA) model because of its use in our work. We denote the parameters of this model by $\hat { \theta }$ .
37
+
38
+ # 2.2 Model Averaging Protocol
39
+
40
+ We use a simple moving average (SMA) of the online model. Instead of calculating the moving average starting from initialization (as done in Polyak-Ruppert averaging), we instead start after a certain number of iterations $t _ { 0 }$ during training (tail averaging), and maintain the moving average until the end of training. As we discuss in the next section, $t _ { 0 }$ is chosen to be close, but not equal to the initialization when a pre-trained model is used as initialization. At any iteration $t$ , we denote:
41
+
42
+ $$
43
+ \begin{array} { r } { \hat { \theta } _ { t } = \left\{ \begin{array} { l l } { \theta _ { t } , } & { \mathrm { i f ~ } t \leq t _ { 0 } } \\ { \frac { t - t _ { 0 } } { t - t _ { 0 } + 1 } \cdot \hat { \theta } _ { t - 1 } + \frac { 1 } { t - t _ { 0 } + 1 } \cdot \theta _ { t } , } & { \mathrm { o t h e r w i s e } } \end{array} \right. } \end{array}
44
+ $$
45
+
46
+ where $\theta _ { t }$ is the online model’s state at iteration $t$ . Note that effectively, $\begin{array} { r } { \widehat { \theta } _ { t } : = \frac { 1 } { t - t _ { 0 } + 1 } \cdot \sum _ { t ^ { \prime } = t _ { 0 } } ^ { t } \theta _ { t ^ { \prime } } } \end{array}$ Further, at iteration $t$ , if we need to calculate validation performance, we use $\widehat { \theta } _ { t }$ to do so, and not $\theta _ { t }$ . As we show in the next section, the benefit of doing so is that the rank correlation between in-domain validation accuracy and out-domain test accuracy is significantly better when predictions are made using $\widehat { \theta } _ { t }$ . This makes model selection more reliable for domain generalization. Finally, for a given run, model selection selects $\widehat { \theta } _ { t ^ { * } }$ for making test set predictions, such that $\widehat { \theta } _ { t ^ { * } }$ achieves the best validation performance. We discuss some theoretical perspectives on why model averaging can help domain generalization in section 5.1.
47
+
48
+ # 2.3 Ablation Analysis
49
+
50
+ Here we perform four ablation studies: 1) impact of the start iteration $t _ { 0 }$ used in our SMA protocol in Eq. 1; 2) the frequency of model averaging; 3) instability reduction of SMA model compared to the online mode along the optimization trajectory on out-domain data; 4) correlation between in-domain and out-domain accuracy across independently trained models.
51
+
52
+ Due to space limitation, we show experiments for 1,2 and 4 in Appendix section C. In summary, we find that: 1) starting averaging close to initialization results in improved out-domain performance (Figure 5 in Appendix) when the parameters are initialized used a pre-trained model; 2) the frequency of SMA does not have a significant impact on performance, unless sampling is done at too large intervals (Figure 6 in Appendix); 4) the rank correlation is poor between validation and test accuracy of independently trained models (Figure 8 in Appendix). An implication of this is that it is difficult to discover the best model (for out-domain performance) from a pool of independently trained models, based only on their in-domain validation performance (echoing the findings of [10]).
53
+
54
+ Table 1: Spearman correlation (closer to 1 is better) between within-run in-domain validation accuracy and out-domain test accuracy on multiple datasets. Model averaging improves rank correlation for both individual models (left) and ensemble of averages (right).
55
+ Table 2: Individual Models
56
+
57
+ <table><tr><td>TerraIncognita</td><td>w/o avg</td><td>w/avg</td></tr><tr><td>L100</td><td>0.21± 0.07</td><td>0.90 士 0.05</td></tr><tr><td>L38</td><td>0.12 ± 0.13</td><td>0.83 ± 0.05</td></tr><tr><td>L43</td><td>0.30 ± 0.06</td><td>0.67 士 0.18</td></tr><tr><td>L46</td><td>0.03 ± 0.11</td><td>0.52 士 0.14</td></tr></table>
58
+
59
+ Table 3: Ensembles
60
+
61
+ <table><tr><td>TerraIncognita</td><td>w/o avg</td><td>w/ avg</td></tr><tr><td>L100</td><td>0.48</td><td>1</td></tr><tr><td>L38</td><td>0.17</td><td>0.95</td></tr><tr><td>L43</td><td>0.59</td><td>0.38</td></tr><tr><td>L46</td><td>0.08</td><td>0.61</td></tr></table>
62
+
63
+ # 2.3.1 Instability Reduction: Rank Correlation
64
+
65
+ We study the reliability of model selection for domain generalization when using online models vs moving average models, using rank correlation (see Appendix C.4 for definition). To do so, we train models on a dataset, both with and without model averaging, and compute Spearman correlation between the in-domain validation accuracy and out-domain test accuracy sampled at regular intervals during the training process. Since there are multiple runs where a given domain acts as the test domain, we calculate the mean and standard error of these values over these runs.
66
+
67
+ The rank correlations are shown in Table 2 (and Table 8 in Appendix) for the PACS, VLCS, OfficeHome, TerraIncognita and DomainNet datasets. We find that in majority of the cases, using model averaging results in a significantly better rank correlation compared to using the online model. These experiments therefore suggest that the reliability of model selection is significantly higher within a run when using model averaging.
68
+
69
+ # 3 Ensemble of Averages (EoA)
70
+
71
+ [18] propose a rigorous framework for evaluation in the domain generalization setting which accounts for randomness due to seed and hyper-parameter values, and recommend reporting the average test accuracy over all the runs computed using a model selection criteria. However, in practice, it is desirable to have a single predictor that has a high accuracy. An ensemble combines predictions from multiple models, and is a well known approach for achieving this goal [11] by exploiting function diversity [14]. However, as we show, even ensembles suffer from instability in the domain generalization setting. Building on the observations of the previous section, we investigate the behavior of ensemble of moving average models and find that it mitigates this issue. We begin by describing the EoA protocol below.
72
+
73
+ EoA Protocol: We perform experiments with ensemble of multiple independently trained models (i.e., with different hyper-parameters and seeds). When each of these models are moving average models from their corresponding runs, we refer to this ensemble in short as the ensemble of averages $( E o A )$ . Identical to how we make predictions for traditional ensembles (specifically the bagging method [6]), the class $\hat { y }$ predicted by an EoA for an input $\mathbf { x }$ is given by the formula:
74
+
75
+ $$
76
+ \hat { y } = \arg \operatorname* { m a x } _ { k } { S o f t m a x ( \frac { 1 } { E } \sum _ { i = 1 } ^ { E } f ( \mathbf { x } ; \hat { \boldsymbol { \theta } } _ { i } ) ) _ { k } }
77
+ $$
78
+
79
+ where $E$ is the total number of models in the ensemble, ${ \hat { \theta } } _ { i }$ denotes the parameters of the $i ^ { t h }$ moving average model, and the sub-script $( . ) _ { k }$ denotes the $k ^ { t h }$ element of the vector argument. Finally, the state ${ \hat { \theta } } _ { i }$ of the $i ^ { t h }$ moving average model used in the ensemble is selected from its corresponding run using its in-domain validation set performance (described in section 2.2). We now investigate the behavior of EoA compared with ensembles of online models on domain generalization tasks.
80
+
81
+ # 3.1 Analysis
82
+
83
+ Qualitative visualization: For the purpose of contrasting the behavior of traditional ensembles vs ensemble of averages, we begin by qualitatively studying the stability of out-domain performance of these two ensembling techniques during the training process. To do so, we use the TerraIncognita dataset, and fix one of its domains as the test domain while using the others as training/validation data. We then train 6 different models independently for 5, 000 iterations with different seeds, hyper-parameters and training-validation splits identical to the [18] protocol. We also maintain moving average models corresponding to each of these 6 models. At every 300 iterations, we form an ensemble of the 6 online models from their corresponding runs and compute the out-domain test accuracy. Since, each run has a different training-validation split, we calculate the mean validation accuracy of each of these online models at that iteration. We follow an identical procedure for the moving average models and plot these performances in Figure 2. We find that the ensemble of averages has a better stability on out-domain test set compared to the ensemble of online models.
84
+
85
+ ![](images/f67f9c7d348c1a1dda558b9e32195dea840d53c35f6561dd7697be037f7ff934.jpg)
86
+ Figure 2: Ensemble of moving averages (EoA) (right) has better out-domain test performance stability compared with ensemble of online models (left), w.r.t. in-domain validation accuracy. Details: The plots are for the TerraIncognita dataset with domain L38 used as the test domain, and others as training/validation domain, and ResNet-50. Each ensemble has 6 different models from independent runs with different random seeds, hyper-parameters, and training/validation split.
87
+
88
+ For clarity, note that this procedure for calculating test accuracy at regular intervals is different from what we proposed earlier for EoA for practical purposes. This experiment is only meant to highlight the fact that making predictions on out-domain data using an ensemble of online models suffers from instability along the optimization trajectory, while an ensemble of averages mitigates this issue. For plots on other domains of TerraIncognita, see Figure 10 in the Appendix.
89
+
90
+ Rank correlation: We now measure the rank correlation between in-domain validation accuracy and out-domain test accuracy for a quantitative evaluation. The details of the metric and motivations behind this experiment are same as those described in section 2.3.1. Here we use the same experimental setup described in the qualitative analysis above. But in addition, we also conduct experiments on VLCS, OfficeHome and DomainNet datasets. The results are shown in Table 3 (and Table 9 in Appendix). We find that in majority of the cases, using EoA results in a significantly better rank correlation compared to using the online model ensemble. These results show more concretely the fact that predictions by an ensemble of online models on out-domain data suffers from instability along the optimization trajectory, and EoA mitigates this problem.
91
+
92
+ # 3.2 Why does Ensembling and Model Averaging Improve Performance?
93
+
94
+ We explain the performance boost achieved by ensemble of averages (see next section) by adapting the Bias-Variance decomposition [17] to the domain generalization setting. For classification tasks with one-hot labels, the Bias-Variance decomposition is given as [49],
95
+
96
+ $$
97
+ \begin{array} { r } { \mathbb { E } _ { \mathbf { x } , y } \mathbb { E } _ { \mathcal { T } } [ C E ( y , f ( \mathbf { x } ; \mathcal { T } ) ) ] = \underbrace { \mathbb { E } _ { \mathbf { x } , y } [ C E ( y , \bar { f } ( \mathbf { x } ) ) ] } _ { \mathrm { B i a s } ^ { 2 } } + \underbrace { \mathbb { E } _ { \mathbf { x } , \mathcal { T } } [ K L ( \bar { f } ( \mathbf { x } ) , f ( \mathbf { x } ; \mathcal { T } ) ) ] } _ { \mathrm { V a r i a n c e } } } \end{array}
98
+ $$
99
+
100
+ where $C E$ denotes the cross entropy loss, $K L$ denotes KL divergence, $\mathcal { T } = \{ ( \mathbf { x } _ { i } ^ { i n } , y _ { i } ^ { i n } ) \} _ { i = 1 } ^ { N }$ are $N$ IID samples drawn from the in-domain training distribution $\mathbb { P } ^ { i n }$ , $f ( \mathbf { x } ; \mathcal { T } )$ denotes the prediction of the model $f$ on sample $\mathbf { x }$ such that the model is trained on the dataset $\tau$ , and $\bar { f } ( \mathbf { x } ) = \bar { \mathbb { E } } _ { \mathcal { T } } [ f ( \mathbf { x } ; \mathcal { T } ) ]$ . Finally $( \mathbf { x } , y ) \sim \mathbb { P } ^ { o u t }$ where $\mathbb { P } ^ { o u t }$ is the out-domain distribution. Notice how $\tau$ and $\left( \mathbf { x } , y \right)$ come from different distributions. For instance, in PACS dataset, $\mathbb { P } ^ { i n }$ could be the union of art, cartoon and photo domains, and $\mathbb { P } ^ { o u t }$ could be the sketch domain.
101
+
102
+ The L.H.S. of the above equation is the expected cross entropy loss on the out-domain distribution achieved by individual models, i.e., when we train an individual model on a particular instance of the training dataset $\tau$ , the expected out-domain test loss is denoted by L.H.S. Importantly, the Bias term on the R.H.S. denotes the expected cross entropy loss on the out-domain distribution achieved by the function $\bar { f } ( . )$ , which is essentially an ensemble. Finally, the variance term captures how much the prediction of individual models differs in expectation from the ensemble prediction, which makes this term strictly greater than zero.
103
+
104
+ ![](images/c3e24164b8bbb34a0d4175f6f26836828e9af6fa006ffdb31ea8f59c46459f1e.jpg)
105
+ Figure 3: Left: Effect of ensemble size (number of models in an ensemble) on out-domain performance (mean and standard error) for models with and without moving average (MA) parameters for ResNet-50 pre-trained on ImageNet. Right: Using the performance of ensemble of size 1 (shown in the left plot) as reference, right plot shows the percentage point improvement for ensembles of size $> 1$ . The plots show that i) ensemble of averages (solid lines in left plot) are consistently better than ensemble of models without averaging (dashed lines in left plot); ii) ensemble of averages consistently improves performance over averaged models (ensemble of size 1 in right plot).
106
+
107
+ Therefore, the above decomposition tells us that the expected test domain error of an ensemble is strictly less than that of an individual model. This interpretation directly explains why a traditional ensemble of unaveraged models can be expected to perform better than individual unaveraged models. However, it is still not clear why EoA performs better that a traditional ensemble in practice. To establish this connection, we note that in practice, we typically train a small number of independent models to form a traditional ensemble due to computational constraints. Thus such ensembles do not behave identically to the expected ensemble $\bar { f } ( . )$ described above. Model averaging on the other hand has been shown to approximate an ensemble [23]. To see this, consider without any loss of generality that the ensemble contains models with parameters $\{ \theta _ { 1 } , \theta _ { 2 } \dots \theta _ { T } \}$ , and denote $\begin{array} { r } { \widehat { \theta } _ { T } : = \frac { 1 } { T } \cdot \sum _ { t = 1 } ^ { T } \widehat { \theta _ { t } } } \end{array}$ Then note that the second order Taylor’s expansion around $\hat { \theta } _ { T }$ of each model’s $k ^ { t h }$ dimension’s prediction is given by,
108
+
109
+ $$
110
+ \frac { 1 } { T } \cdot \sum _ { t = 1 } ^ { T } f ( \theta _ { t } ) _ { k } \approx f ( \hat { \theta } _ { T } ) _ { k } + \frac { 1 } { T } \cdot \sum _ { t = 1 } ^ { T } ( \hat { \theta } _ { T } - \theta _ { t } ) ^ { T } \frac { \partial f ( \hat { \theta } _ { T } ) _ { k } } { \partial \hat { \theta } _ { T } } + 0 . 5 ( \hat { \theta } _ { T } - \theta _ { t } ) ^ { T } \frac { \partial ^ { 2 } f ( \hat { \theta } _ { T } ) _ { k } } { \partial \hat { \theta } _ { T } ^ { 2 } } ( \hat { \theta } _ { T } - \theta _ { t } )
111
+ $$
112
+
113
+ Notice that $f ( . )$ is the model output and therefore the first and second order terms are the derivatives of the model output and not the loss gradient and Hessian. The first order term is zero due to ference of o $\begin{array} { r } { \widehat { \theta } _ { T } : = \frac { 1 } { T } \cdot \sum _ { t = 1 } ^ { T } \theta _ { t } } \end{array}$ . A crucial dif-d to [23] is that they average model states that lie near different loss minima, while we perform tail averaging. Therefore, the term $( \widehat { \theta } _ { T } - \theta _ { t } )$ may not behave similar to that in their case. To shed light on its behavior, we plot the histogram of the second order term and the moving average model’s logit $f ( { \widehat { \theta } } _ { T } ) _ { k }$ in Eq. 3 for the first dimension $k = 1$ ) for test domain data in figure 4 (details and additional experiments provided in Appendix D). The histogram shows that the second order term
114
+
115
+ ![](images/446c1ed4e5625131a494e336b7c6d008f845399c22dc881a8a97aec187fc286a.jpg)
116
+ Figure 4: The scale of terms– moving average model’s logit and the second order term in Eq. 3. The latter concentrates around 0, suggesting our model averaging protocol approximates ensembles.
117
+
118
+ concentrates near zeros while the logit values span a wider range, which implies that under the second order approximation, the model averaging protocol used in our work behaves like an ensemble. Finally, to study the impact of ensemble size on out-domain performance, we plot the test domain accuracy as a function of ensemble size in figure 3. The plots show that i. EoA outperforms traditional ensembles for all ensemble sizes (left); and ii. ensembles of larger size typically have better
119
+
120
+ Table 4: Performance benchmarking on 5 datasets of the DomainBed benchmark using two different pre-trained models. SWAD and MIRO are the previous SOTA. See Table 10 in Appendix for comparison with more methods. Note that ensembles do not have confidence interval because an ensemble uses all the models to make a prediction. Gray background shows our proposal. Our runs implies we ran experiments, but we did not propose it. Experiments use the training-domain validation protocol from [18].
121
+
122
+ <table><tr><td>Algorithm</td><td>PACS</td><td>VLCS</td><td>OfficeHome</td><td>TerraIncognita</td><td>DomainNet</td><td>Avg.</td></tr><tr><td colspan="7">ResNet-50 (25MParameters,Pre-trained on ImageNet)</td></tr><tr><td>ERM (our runs) Ensemble (our runs)</td><td>84.4± 0.8 87.6</td><td>77.1 ± 0.5 78.5</td><td>66.6±0.2 70.8</td><td>48.3±0.2 49.2</td><td>43.6± 0.1 47.7</td><td>64.0 66.8</td></tr><tr><td>ERM[18]</td><td>85.7 ± 0.5</td><td>77.4 ± 0.3</td><td>67.5 ± 0.5 70.6 ± 0.3</td><td>47.2 ± 0.4 50.0 ± 0.4</td><td>41.2 ± 0.2 46.5 ± 0.2</td><td>63.8</td></tr><tr><td>SWAD [8] MIRO [9]</td><td>88.1 ± 0.4 85.4± 0.4</td><td>79.1 ± 0.4 79.0± 0.</td><td>70.5 ± 0.4</td><td>50.4 ± 1.1</td><td>44.3 ± 0.2</td><td>66.9 65.9</td></tr><tr><td>SMA (ours) EoA (ours)</td><td>87.5 ± 0.2 88.6</td><td>78.2 ± 0.2 79.1 72.5</td><td>70.6 ± 0.1</td><td>50.3 ± 0.5 52.3</td><td>46 ± 0.1 47.4</td><td>66.5 68.0</td></tr><tr><td colspan="7">ResNeXt-5032x4d [48] (25MParameters,Pre-trained1B Images)</td></tr><tr><td>ERM (our runs)</td><td>88.9± 0.3</td><td>79.0± 0.1</td><td>70.9± 0.5</td><td>51.4 ± 1.2</td><td>48.1±0.2</td><td>67.7</td></tr><tr><td>Ensemble (our runs)</td><td>91.2</td><td>80.3</td><td>77.8</td><td>53.5</td><td>52.8</td><td>71.1</td></tr><tr><td>SMA (ours) EoA (ours)</td><td>92.7 ± 0.3 93.2</td><td>79.7 ± 0.3 80.4</td><td>78.6 ± 0.1 80.2</td><td>53.3 ± 0.1 55.2</td><td>53.5 ± 0.1 54.6</td><td>71.6</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td> 72.7</td></tr><tr><td></td><td colspan="4">RegNetY-16GF[40] (81MParameters,Pre-trained on 3.6B Images)</td><td></td><td></td></tr><tr><td>ERM (our runs)</td><td>92 ± 0.4</td><td>78.6± 0.6</td><td>73.8± 0.5</td><td>55.6± 0.9</td><td>53.1± 0.2</td><td>70.6</td></tr><tr><td>Ensemble (our runs)</td><td>95.1</td><td>80.6</td><td>80.5</td><td>59.5</td><td>57.8</td><td>74.7</td></tr><tr><td>ERM[9]</td><td>89.6 ± 0.4</td><td>78.6 ± 0.3</td><td>71.9 ± 0.6</td><td>51.4 ± 1.8</td><td>48.5 ± 0.6</td><td>68.0</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>SWAD [9]</td><td>94.7 ± 0.2</td><td>79.7 ± 0.2</td><td>80.0± 0.1</td><td>57.9 ± 0.7</td><td>53.6± 0.6</td><td>73.2</td></tr><tr><td>MIRO [9]</td><td>97.4 ± 0.2</td><td>79.9 ± 0.6</td><td>80.4± 0.2</td><td>58.9 ±1.3</td><td>53.8 ± 0.1</td><td>74.1</td></tr><tr><td>SMA (ours)</td><td>95.5 ± 0.0</td><td>80.7 ± 0.1</td><td>82.0± 0.0</td><td>59.7 ± 0.0</td><td>60.0± 0.0</td><td>75.6</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>EoA (ours)</td><td>95.8</td><td>81.1</td><td>83.9</td><td>61.1</td><td>60.9</td><td>76.6</td></tr></table>
123
+
124
+ out-domain performance. See a discussion on functional diversity of ensembles vs model averaging in Appendix E.
125
+
126
+ # 4 Empirical Results
127
+
128
+ # 4.1 DomainBed Benchmarking
129
+
130
+ We now benchmark our model averaging protocol (SMA) and ensemble of averages against online models (ERM, without MA) and ensemble of online models (ensembles). Note that all these models are trained using the ERM objective as before. We evaluate on PACS [27], VLCS [13], OfficeHome [45], TerraIncognita [3] and DomainNet [35] datasets in DomainBed. The training-evaluation protocols are the same as described in section 2.3 for moving average and online models, and in section 3 for ensembles. Full details can be found in section B in the Appendix.
131
+
132
+ Comparison with existing results using ResNet-50 pre-trained on ImageNet: Here we compare existing methods with our runs. All methods use ResNet-50 (25M parameters) [19] pre-trained on ImageNet as initialization. Comparing ERM [18] and ERM (our runs), we find that they perform similarly, especially considering we have used a smaller hyper-parameter space (further discussion in Appendix E). A comparison between SWAD and SMA shows that SWAD is slightly better (by $0 . 4 \%$ on average). However, recall that our protocol retains the advantage of not tuning any hyperparameters while SWAD has 3 additional ones that they tune separately in addition to the optimization hyper-parameters. Interestingly, traditional ensembles and SMA achieve similar performance $( 6 6 . 8 \%$ and $6 6 . 5 \%$ respectively). Finally, EoA outperforms all the existing results: ERM by $4 \%$ and SWAD (previous SOTA) by $1 . 1 \%$ . Importantly, note that while all non-ensemble models report the average test accuracy of multiple models following the protocol of [18], EoA test accuracy is achieved by a single predictor that combines the output of multiple models.
133
+
134
+ Experiments with larger pre-training datasets and larger models: In addition to ResNet-50 pre-trained on ImageNet, we now also experiment with ResNeXt-50 32x4d (25M parameters), that is pre-trained using semi-weakly supervised objective on Instagram 1B images and ImageNet labeled data [48], and RegNetY-16GF (81M parameters) pre-trained using Instagram 3.6B images. Note that both ResNet-50 and ResNeXt-50 32x4d have similar number of parameters, while RegNetY-16GF has more than $3 \mathbf { x }$ the number of parameters. On the other hand, also notice that the three architectures are respectively pre-trained on an increasing size of datasets. The rationale behind this choice is that recent trends in deep learning has shown that models pre-trained on larger datasets and architectures achieve better downstream transfer performance [12, 32, 20]. Therefore, we expect the latter models to improve the ERM baseline, and our goal is to investigate the out-domain performance gain by model averaging and EoA relative to the corresponding ERM baseline with increasing pre-training dataset size and model size.
135
+
136
+ The experimental results are shown in Table 4. To investigate models with the same size, but one pre-trained on a larger dataset, we compare the results of ResNet-50 and ResNeXt-50 32x4d. On average across all five datasets, the gain of SMA over ERM (our runs) is $2 . 5 \%$ for ResNet-50 and $3 . 9 \%$ for $\mathrm { R e s N e X t - } 5 0 \ 3 2 \mathrm { x } 4 \mathrm { d } .$ . The gain of EoA over ERM is larger: $4 \%$ vs $5 \%$ respectively. This suggests that pre-training the model on a larger dataset increases the gain of model averaging and EoA over the corresponding ERM baseline, while the ERM performance itself improves.
137
+
138
+ Next, to investigate the impact of both larger model size and larger pre-training dataset, we compare the results of $\mathrm { R e s N e X t - } 5 0 \ 3 2 \mathrm { x } 4 \mathrm { d }$ and RegNetY-16GF. On average across all five datasets, the gain of SMA over ERM (our runs) is $3 . 9 \%$ for ResNeXt-50 32x4d and $5 \%$ for RegNetY-16GF. The gain of EoA over ERM is again larger: $5 \%$ vs $6 \%$ respectively. This suggests that increasing both model size and pre-training dataset size allow model averaging and EoA to provide larger out-domain gains over the corresponding ERM baseline. Notice that these claims are different from existing work [20], which states that the baseline ERM performance improves with larger pre-training data and model size.
139
+
140
+ # 4.2 In-domain Performance Improvement using Model Averaging
141
+
142
+ We study the in-domain test accuracy on PACS and OfficeHome datasets using ImageNet pretrained ResNet-50 with and without our SMA protocol. In this experiment, we combine all the domains of PACS and split it into training/- validation/test splits (0.8/0.1/0.1). We run 10
143
+
144
+ Table 5: SMA outperforms ERM without model averaging in the IID setting.
145
+
146
+ <table><tr><td rowspan=1 colspan=1>Algorithm</td><td rowspan=1 colspan=1>PACS</td><td rowspan=1 colspan=1>OfficeHome</td></tr><tr><td rowspan=1 colspan=1>ERM (no averaging)</td><td rowspan=1 colspan=1>94.39 ± 0.46</td><td rowspan=1 colspan=1>77.09± 0.57</td></tr><tr><td rowspan=1 colspan=1>SMA (ours)</td><td rowspan=1 colspan=1>96.77 ± 0.20</td><td rowspan=1 colspan=1>83.56± 0.21</td></tr></table>
147
+
148
+ different runs with different seeds and randomly chosen splits for each dataset. The best model for each run is chosen using the validation set. The remaining optimization details are identical to those used in the previous section. The test accuracy mean and standard error using these best models are shown in Table 5. As expected, SMA outperforms models without averaging.
149
+
150
+ # 5 Related Work
151
+
152
+ # 5.1 Model Averaging
153
+
154
+ A theoretical perspective: In our model averaging protocol, we compute a simple moving average of the model parameters starting early during training. This is known as tail-averaging [24], which is slightly different from Polyak-Ruppert averaging [36] in that the latter starts averaging from the very beginning of training. In the context of least square regression in the IID setting, [24] theoretically study the behavior of tail averaging and show that the excess risk of the moving average model is upper bounded by a bias and a variance term. This bias term depends on the initialization state of the parameter, but interestingly, it decays exponentially with $t _ { 0 }$ , where $t _ { 0 }$ is the iteration at which model averaging is started. The variance term on the other hand depends on the covariance of the noise inherent in the data w.r.t. the optimal parameter, and is shown to decay at a faster rate when using model averaging, as opposed to a slower rate without averaging. This motivated them to propose tail-averaging.
155
+
156
+ Model averaging has also been shown to have a regularization effect [34] similar to that of Tikhonov regularization [42]. This regularization has been classically used in ill-posed optimization problems (typically least squared regression), which are under-specified. This property provides an interesting connection between model averaging and the under-specification problem discussed in [10], where the authors perform large scale experiments showing that the performance of multiple over-parameterized deep models, trained independently with different hyper-parameters and seeds, have a high variance on out-domain data, even though their in-domain performances are very close together. Based on this connection, a simple intuition why one can expect model averaging to help in domain generalization is its Tikhonov regularization effect. However, this intuition requires a more thorough investigation.
157
+
158
+ SWAD [8]: SWAD propose flat minima as a means for improving domain generalization. Following the intuition of stochastic weight averaging (SWA, [23]), they use model averaging to find flat minima. However, their proposal is different from sampling model states at regular intervals and towards the end of training (as done in SWA). SWAD selects contiguous model states along the optimization path for averaging, based on their validation loss. This is done to prevent including an under-performing state (determined using the in-domain validation set) in the moving average model. SWAD however adds additional hyper-parameters of its own: the validation loss threshold below which the the model states are selected, and patience parameters (number of iterations that determine the start and end of the averaging process). Note that this also requires computing validation loss more frequently during training. In this context, we show that instead of finding the start and end period for model averaging meticulously, we can simply start model averaging early during training and continue till the end. This difference arises from the fact that SWAD uses the online network to calculate validation performance while we use the SMA model in our protocol. This is explained further in section 2.2. The benefit our observations provide over SWAD is that they allow us to take advantage of model averaging without the additional hyper-parameters and compute required by SWAD.
159
+
160
+ # 5.2 Domain Generalization
161
+
162
+ Existing methods aimed at domain generalization can be broadly categorized into techniques that perform domain alignment, regularization, data augmentation, and meta-learning. Domain alignment is perhaps the most intuitive direction, in which methods aim to learn latent representations which have similar distributions across different domains [41, 30, 39, 37]. There are different variants of this idea, such as minimizing some divergence metric between the latent representation of different domains (E.g. DANN [16]), or less strictly, minimizing the difference between the latent statistics of different domains (E.g. DICA [33], CORAL [41]). In the meta learning category, source domains are typically split into 2 subsets to be used as the training and test domains in episodes to simulate the domain generalization setting [28, 29]. Data augmentation is also a popular tool used for improving domain generalization. It ranges from introducing various types of augmentations to simulate unseen test domain conditions (E.g. style transfer [50, 52]) to self-supervised learning involving matching the representations of an image with different augmentations (E.g. [1, 7]). Finally, different ways of regularizing models (implicit and explicit) have also been developed with the goal of encouraging domain-invariant feature learning [38, 47, 46]. For instance, invariant risk minimization [2] propose a regularization such that the classifier is optimal in all the environments. Representation SelfChallenging [21] propose to suppress the dominant features that get activated on the training data, which forces the network to use other features that correlate with labels. Risk extrapolation [26] propose a regularization that minimizes the variance between domain-wise loss, in the hope that it is representative of the variance including unseen test domains. See [51] for a survey on DG methods.
163
+
164
+ Our investigation in this work is complementary to all these domain generalization methods. Additionally, one of our main focus is to also study and improve performance instability on out-domain data during training, which results in more reliable model selection. This aspect has not received much attention.
165
+
166
+ # 6 Conclusion
167
+
168
+ We investigated a hyperparameter-free and efficient protocol for model averaging in the ERM framework, and showed that it provides a significant boost to out-domain performance compared to un-averaged models. Building on this observation, we showed that an ensemble of moving average models performs better compared to an ensemble of un-averaged models. Importantly, we showed that in both cases, model averaging significantly improves the rank correlation between in-domain validation accuracy and out-domain test accuracy, which is crucial for reliable model selection using in-domain validation data. We experimented with three pre-trained models with increasing pre-training dataset and model size, and found that EoA provides a proportionally larger gain compared to the corresponding ERM baseline, and lies in the range of $4 \% - 6 \%$ . Finally, we explain the performance boost of EoA by adapting the Bias-Variance trade-off perspective to the domain generalization setting. Further discussions along with limitations of our work are provided in Appendix E.
169
+
170
+ References
171
+ [1] Isabela Albuquerque, Nikhil Naik, Junnan Li, Nitish Keskar, and Richard Socher. Improving out-of-distribution generalization via multi-task self-supervised pretraining. arXiv preprint arXiv:2003.13525, 2020.
172
+ [2] Martin Arjovsky, Léon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. arXiv preprint arXiv:1907.02893, 2019.
173
+ [3] Sara Beery, Grant Van Horn, and Pietro Perona. Recognition in terra incognita. In Proceedings of the European conference on computer vision (ECCV), pages 456–473, 2018.
174
+ [4] Shai Ben-David, John Blitzer, Koby Crammer, and Fernando Pereira. Analysis of representations for domain adaptation. Advances in neural information processing systems, 19, 2006.
175
+ [5] Gilles Blanchard, Gyemin Lee, and Clayton Scott. Generalizing from several related classification tasks to a new unlabeled sample. Advances in neural information processing systems, 24:2178–2186, 2011.
176
+ [6] Leo Breiman. Bagging predictors. Machine learning, 24(2):123–140, 1996.
177
+ [7] Silvia Bucci, Antonio D’Innocente, Yujun Liao, Fabio Maria Carlucci, Barbara Caputo, and Tatiana Tommasi. Self-supervised learning across domains. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2021.
178
+ [8] Junbum Cha, Sanghyuk Chun, Kyungjae Lee, Han-Cheol Cho, Seunghyun Park, Yunsung Lee, and Sungrae Park. Swad: Domain generalization by seeking flat minima. arXiv preprint arXiv:2102.08604, 2021.
179
+ [9] Junbum Cha, Kyungjae Lee, Sungrae Park, and Sanghyuk Chun. Domain generalization by mutual-information regularization with pre-trained models. arXiv preprint arXiv:2203.10789, 2022.
180
+ [10] Alexander D’Amour, Katherine Heller, Dan Moldovan, Ben Adlam, Babak Alipanahi, Alex Beutel, Christina Chen, Jonathan Deaton, Jacob Eisenstein, Matthew D Hoffman, et al. Underspecification presents challenges for credibility in modern machine learning. arXiv preprint arXiv:2011.03395, 2020.
181
+ [11] Thomas G Dietterich. Ensemble methods in machine learning. In International workshop on multiple classifier systems, pages 1–15. Springer, 2000.
182
+ [12] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
183
+ [13] Chen Fang, Ye Xu, and Daniel N Rockmore. Unbiased metric learning: On the utilization of multiple datasets and web images for softening bias. In Proceedings of the IEEE International Conference on Computer Vision, pages 1657–1664, 2013.
184
+ [14] Stanislav Fort, Huiyi Hu, and Balaji Lakshminarayanan. Deep ensembles: A loss landscape perspective. arXiv preprint arXiv:1912.02757, 2019.
185
+ [15] Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In international conference on machine learning, pages 1050–1059. PMLR, 2016.
186
+ [16] Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The journal of machine learning research, 17(1):2096–2030, 2016.
187
+ [17] Stuart Geman, Elie Bienenstock, and René Doursat. Neural networks and the bias/variance dilemma. Neural computation, 4(1):1–58, 1992.
188
+
189
+ [18] Ishaan Gulrajani and David Lopez-Paz. In search of lost domain generalization. arXiv preprint arXiv:2007.01434, 2020.
190
+
191
+ [19] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770–778, 2016.
192
+
193
+ [20] Dan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath, Frank Wang, Evan Dorundo, Rahul Desai, Tyler Zhu, Samyak Parajuli, Mike Guo, et al. The many faces of robustness: A critical analysis of out-of-distribution generalization. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 8340–8349, 2021.
194
+
195
+ [21] Zeyi Huang, Haohan Wang, Eric P Xing, and Dong Huang. Self-challenging improves crossdomain generalization. In Computer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part II 16, pages 124–140. Springer, 2020.
196
+
197
+ [22] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International conference on machine learning, pages 448–456. PMLR, 2015.
198
+
199
+ [23] Pavel Izmailov, Dmitrii Podoprikhin, Timur Garipov, Dmitry Vetrov, and Andrew Gordon Wilson. Averaging weights leads to wider optima and better generalization. arXiv preprint arXiv:1803.05407, 2018.
200
+
201
+ [24] Prateek Jain, Sham Kakade, Rahul Kidambi, Praneeth Netrapalli, and Aaron Sidford. Parallelizing stochastic gradient descent for least squares regression: mini-batching, averaging, and model misspecification. Journal of Machine Learning Research, 18, 2018.
202
+
203
+ [25] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
204
+
205
+ [26] David Krueger, Ethan Caballero, Joern-Henrik Jacobsen, Amy Zhang, Jonathan Binas, Dinghuai Zhang, Remi Le Priol, and Aaron Courville. Out-of-distribution generalization via risk extrapolation (rex). In International Conference on Machine Learning, pages 5815–5826. PMLR, 2021.
206
+
207
+ [27] Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. Deeper, broader and artier domain generalization. In Proceedings of the IEEE international conference on computer vision, pages 5542–5550, 2017.
208
+
209
+ [28] Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. Learning to generalize: Meta-learning for domain generalization. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
210
+
211
+ [29] Da Li, Jianshu Zhang, Yongxin Yang, Cong Liu, Yi-Zhe Song, and Timothy M Hospedales. Episodic training for domain generalization. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 1446–1455, 2019.
212
+
213
+ [30] Haoliang Li, Sinno Jialin Pan, Shiqi Wang, and Alex C Kot. Domain generalization with adversarial feature learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 5400–5409, 2018.
214
+
215
+ [31] Ya Li, Xinmei Tian, Mingming Gong, Yajing Liu, Tongliang Liu, Kun Zhang, and Dacheng Tao. Deep domain generalization via conditional invariant adversarial networks. In Proceedings of the European Conference on Computer Vision (ECCV), pages 624–639, 2018.
216
+
217
+ [32] Dhruv Mahajan, Ross Girshick, Vignesh Ramanathan, Kaiming He, Manohar Paluri, Yixuan Li, Ashwin Bharambe, and Laurens Van Der Maaten. Exploring the limits of weakly supervised pretraining. In Proceedings of the European conference on computer vision (ECCV), pages 181–196, 2018.
218
+
219
+ [33] Krikamol Muandet, David Balduzzi, and Bernhard Schölkopf. Domain generalization via invariant feature representation. In International Conference on Machine Learning, pages 10–18. PMLR, 2013.
220
+
221
+ [34] Gergely Neu and Lorenzo Rosasco. Iterate averaging as regularization for stochastic gradient descent. In Conference On Learning Theory, pages 3222–3242. PMLR, 2018.
222
+ [35] Xingchao Peng, Qinxun Bai, Xide Xia, Zijun Huang, Kate Saenko, and Bo Wang. Moment matching for multi-source domain adaptation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 1406–1415, 2019.
223
+ [36] Boris T Polyak and Anatoli B Juditsky. Acceleration of stochastic approximation by averaging. SIAM journal on control and optimization, 30(4):838–855, 1992.
224
+ [37] Alexandre Rame, Corentin Dancette, and Matthieu Cord. Fishr: Invariant gradient variances for out-of-distribution generalization. arXiv preprint arXiv:2109.02934, 2021.
225
+ [38] Shiori Sagawa, Pang Wei Koh, Tatsunori B Hashimoto, and Percy Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. arXiv preprint arXiv:1911.08731, 2019.
226
+ [39] Yuge Shi, Jeffrey Seely, Philip HS Torr, N Siddharth, Awni Hannun, Nicolas Usunier, and Gabriel Synnaeve. Gradient matching for domain generalization. arXiv preprint arXiv:2104.09937, 2021.
227
+ [40] Mannat Singh, Laura Gustafson, Aaron Adcock, Vinicius de Freitas Reis, Bugra Gedik, Raj Prateek Kosaraju, Dhruv Mahajan, Ross Girshick, Piotr Dollár, and Laurens van der Maaten. Revisiting weakly supervised pre-training of visual perception models. arXiv preprint arXiv:2201.08371, 2022.
228
+ [41] Baochen Sun and Kate Saenko. Deep coral: Correlation alignment for deep domain adaptation. In European conference on computer vision, pages 443–450. Springer, 2016.
229
+ [42] Andrey Nikolayevich Tikhonov. On the stability of inverse problems. In Dokl. Akad. Nauk SSSR, volume 39, pages 195–198, 1943.
230
+ [43] Vladimir Vapnik and Vlamimir Vapnik. Statistical learning theory wiley. New York, 1(624):2, 1998.
231
+ [44] Ramakrishna Vedantam, David Lopez-Paz, and David J Schwab. An empirical investigation of domain generalization with empirical risk minimizers. Advances in Neural Information Processing Systems, 34, 2021.
232
+ [45] Hemanth Venkateswara, Jose Eusebio, Shayok Chakraborty, and Sethuraman Panchanathan. Deep hashing network for unsupervised domain adaptation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5018–5027, 2017.
233
+ [46] Yufei Wang, Haoliang Li, and Alex C Kot. Heterogeneous domain generalization via domain mixup. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 3622–3626. IEEE, 2020.
234
+ [47] Minghao Xu, Jian Zhang, Bingbing Ni, Teng Li, Chengjie Wang, Qi Tian, and Wenjun Zhang. Adversarial domain adaptation with domain mixup. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 6502–6509, 2020.
235
+ [48] I Zeki Yalniz, Hervé Jégou, Kan Chen, Manohar Paluri, and Dhruv Mahajan. Billion-scale semi-supervised learning for image classification. arXiv preprint arXiv:1905.00546, 2019.
236
+ [49] Zitong Yang, Yaodong Yu, Chong You, Jacob Steinhardt, and Yi Ma. Rethinking bias-variance trade-off for generalization of neural networks. In International Conference on Machine Learning, pages 10767–10777. PMLR, 2020.
237
+ [50] Xiangyu Yue, Yang Zhang, Sicheng Zhao, Alberto Sangiovanni-Vincentelli, Kurt Keutzer, and Boqing Gong. Domain randomization and pyramid consistency: Simulation-to-real generalization without accessing target domain data. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 2100–2110, 2019.
238
+ [51] Kaiyang Zhou, Ziwei Liu, Yu Qiao, Tao Xiang, and Chen Change Loy. Domain generalization: A survey. arXiv preprint arXiv:2103.02503, 2021.
239
+
240
+ [52] Kaiyang Zhou, Chen Change Loy, and Ziwei Liu. Semi-supervised domain generalization with stochastic stylematch. arXiv preprint arXiv:2106.00592, 2021.
241
+
242
+ # Checklist
243
+
244
+ 1. For all authors...
245
+
246
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
247
+ (b) Did you describe the limitations of your work? [Yes] In Appendix E, we have discussed various aspects including the limitations of our and existing methods in addressing domain generalization, functional diversity of ensembles vs model averaging strategy, and more.
248
+ (c) Did you discuss any potential negative societal impacts of your work? [Yes] See Appendix A.
249
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
250
+
251
+ 2. If you are including theoretical results...
252
+
253
+ (a) Did you state the full set of assumptions of all theoretical results? [Yes] See section 3.2. (b) Did you include complete proofs of all theoretical results? [N/A]
254
+
255
+ 3. If you ran experiments...
256
+
257
+ (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes]
258
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
259
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
260
+ (d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes]
261
+
262
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
263
+
264
+ (a) If your work uses existing assets, did you cite the creators? [Yes]
265
+ (b) Did you mention the license of the assets? [No]
266
+ (c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
267
+ (d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
268
+ (e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
269
+
270
+ 5. If you used crowdsourcing or conducted research with human subjects...
271
+
272
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
273
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
274
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]